
python3 工具
python3 工具函数
学无止境慢慢来
每天进步一点点,活成自己羡慕的模样。
keep coding!!!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python3 joinPath().py
"""模块:python3 joinPath().py功能:python3 路径拼接。"""import osdef joinPath(fileUrl, urisInFileUrl): """ 根据文件路径,拼接出该文件内相对路径 uri 的绝对路径。 文件内 相对路径 uri 是相对于 文件路径的。 :param fileUrl: 文件路径,如:h...原创 2020-04-14 14:32:26 · 3821 阅读 · 0 评论 -
python3 getPath_extension.py
"""时间:2019/11/6内容:文件路径、文件名、文件扩展名。模块名:pathFileName_extension.py"""def getPathName(pathFile): """ 功能:获取文件名及其路径。 :param pathFile: 文件及其路径。类似:I:\\Gaoshengjie\\龙哥任务\\读shp\\31-CS\\31-CS.s...原创 2019-10-24 09:58:49 · 712 阅读 · 0 评论 -
python3 scrapCesium.py
"""2019.6.18日,更新。"""from urllib import requestimport osimport urllibdef get_abs_paths(directory, totalPathFiles=[]): """ 此函数旨在获取directory目录下,所有文件的绝对路径, 并放在totalPathFiles里。 dir...原创 2018-12-24 17:29:47 · 741 阅读 · 0 评论 -
scrapCesium-supermap.py
from urllib import requestimport osimport urllibdef get_abs_paths(directory, totalPathFiles=[]): ''' 此函数旨在获取directory目录下,所有文件的绝对路径, 并放在totalPathFiles里。 directory,目标目录。 '''...原创 2019-04-15 17:05:50 · 173 阅读 · 0 评论 -
python3查看自身默认编码的方法
import sysprint(sys.stdout.encoding)# UTF-8转载 2019-04-07 17:52:52 · 2694 阅读 · 0 评论 -
3dtiles getFloorsNodes9.py
"""代码前提: 此模块用于,获取指定目录下的所有scenetree.json文件,并生成分层数据,最后一级子目录下,只有一个scenetree.json文件。启动代码:1.python getFloorsNodes9.py1.获取BIM模型的sceneTree.json文件的每一分层的所有节点名及其子节点id,并写到文件(sceneTree.jso...原创 2019-04-05 22:12:58 · 713 阅读 · 0 评论 -
handleJSONFile_单引号替换成双引号.py
'''此模块用于实现,把json文件的单引号替换成双引号。'''with open("floorsNames.json", "r", encoding="utf-8") as f: floorsNames = f.read()print(floorsNames)floorsNames = floorsNames.replace("'", "\"")print(floorsNam...原创 2019-03-04 21:00:42 · 646 阅读 · 0 评论 -
python3 os_shutil_makedirs.py
import osdef makedirs(path): """ 此函数用于,创建目录。 可以创建多级目录。 :param path: 要创建的目录。 :return: """ # 判断路径是否存在 if not os.path.exists(path): # 如果不存在则创建目录 os.mak...转载 2018-12-24 16:46:03 · 424 阅读 · 0 评论 -
python3 getDirpaths_filepathsOfDir.py
import osdef getPathFilesInDirectory(directory, pathFiles=[]): """ 此函数用于,获取directory目录下,所有文件的绝对路径, 并存放在pathFiles里。 directory下可以同时有目录和文件。 如果在调用此函数时,未对pathFiles传参, 则pathFile...原创 2018-12-24 16:37:23 · 1328 阅读 · 0 评论