摘要: cv2.line(image, start_point, end_point, color, thickness) ``` # Python program to explain cv2.line() method # importing cv2 import cv2 image = cv2.imr 阅读全文
posted @ 2023-07-03 10:22 xiaoxuxli 阅读(5) 评论(0) 推荐(0) 编辑
摘要: ``` #string with integers sepated by spaces string1="1 2 3 4 5 6 7 8" print("Actual String containing integers: ",string1) print("Type of string: ",ty 阅读全文
posted @ 2023-07-03 10:21 xiaoxuxli 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 四连通和八连通域 `label, num = measure.label(mask_img, neighbors=8, background=0, return_num=True)` 参考: [1] https://blog.csdn.net/weixin_39976081/article/deta 阅读全文
posted @ 2023-06-05 13:03 xiaoxuxli 阅读(15) 评论(0) 推荐(0) 编辑
摘要: ### 字符拼接 ``` #!/bin/bash name="Shell" url="http://c.biancheng.net/shell/" str1=$name$url #中间不能有空格 str2="$name $url" #如果被双引号包围,那么中间可以有空格 str3=$name": " 阅读全文
posted @ 2023-06-02 07:40 xiaoxuxli 阅读(7) 评论(0) 推荐(0) 编辑
摘要: def logging1(): """ logging 1 test :return: """ logging.info('this is logging 1') def logging2(): """ logging 1 test :return: """ logging.info('this i 阅读全文
posted @ 2023-05-09 13:02 xiaoxuxli 阅读(25) 评论(0) 推荐(0) 编辑
摘要: os.mkdir() <-> Path.mkdir() os.makedirs() <-> Path.mkdir() os.path.exists() <-> Path.exists() os.listdir() <-> Path.iterdir() os.path.isdir() <-> Path 阅读全文
posted @ 2023-05-09 11:11 xiaoxuxli 阅读(68) 评论(0) 推荐(0) 编辑
摘要: Do a str.replace('; ', ', ') and then a str.split(', ') or import re re.split('; |, ', string_to_split) >>> a='Beautiful, is; better*than\nugly' >>> i 阅读全文
posted @ 2023-05-09 11:11 xiaoxuxli 阅读(10) 评论(0) 推荐(0) 编辑
摘要: The primary difference between the two is that list.sort() will sort the list in-place, mutating its indexes and returning None, whereas sorted() will 阅读全文
posted @ 2023-05-09 11:11 xiaoxuxli 阅读(13) 评论(0) 推荐(0) 编辑
摘要: from pathlib import Path # pathlib for easy path handling import pydicom # pydicom to handle dicom files import matplotlib.pyplot as plt import numpy 阅读全文
posted @ 2023-05-03 13:23 xiaoxuxli 阅读(35) 评论(0) 推荐(0) 编辑
摘要: which python -> /home/xx/anaconda3/bin/python pip 版本号 python3 –m pip –-version -> pip 21.2.4 from /home/xx/anaconda3/lib/python3.9/site-packages/pip ( 阅读全文
posted @ 2023-05-03 11:38 xiaoxuxli 阅读(79) 评论(0) 推荐(0) 编辑