![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python 学习
A_wangc
这个作者很懒,什么都没留下…
展开
-
python list与string转换
1、字符型list转换为string dat = ['1','2','3','4','5'] str1 = ''.join(dat) 2、整数型list转换为string dat = [1,2,3,4,5] str_list = map(str,dat) #方法1 str_list = [ str(i) for i in dat] #方法2 str1 = ''.join(str_list ) 3、ASCII的list转化为string dat = [50, 48, 50, 48, 49, 50, 49,原创 2020-12-18 14:24:47 · 2428 阅读 · 0 评论 -
使用Notepad++ 编写python 使用相对路径去打开文件出现 FileNotFoundError: [Errno 2] No such file or directory:
1、使用的Notepad++编写的,使用cmd /k D:\Python37\python.exe “$(FULL_CURRENT_PATH)” & PAUSE & EXIT运行 2、最开始遇到这个问题,使用绝对路径解决了,但是越想越觉得不甘心,开始在网上查 3、查到可以使用 os.path.abspath(’.’) + ‘filename’ 去打开文件。 4、出现如下结果No...原创 2019-09-22 16:16:43 · 1874 阅读 · 0 评论