Discuss / Python / 求赐教

求赐教

Topic source

井圜哈

#1 Created at ... [Delete] [Delete and Lock User]

刚入门遇到这个问题,求赐教 Microsoft Windows [版本 10.0.17134.523] (c) 2018 Microsoft Corporation。保留所有权利。

C:\Users\Lenovo>python hello.py python: can't open file 'hello.py': [Errno 2] No such file or directory

C:\Users\Lenovo>dir 驱动器 C 中的卷是 Windows 卷的序列号是 60A7-8471

C:\Users\Lenovo 的目录

2018/12/15 22:51 <DIR> . 2018/12/15 22:51 <DIR> .. 2018/12/15 11:45 <DIR> 3D Objects 2018/12/15 11:45 <DIR> Contacts 2019/01/18 14:25 <DIR> Desktop 2019/01/15 23:41 <DIR> Documents 2018/12/23 09:53 <DIR> Downloads 2018/12/15 11:45 <DIR> Favorites 2018/12/15 22:51 1,277,424 flashplayerpp_install_cn.exe 2018/12/15 11:45 <DIR> Links 2018/12/15 11:45 <DIR> Music 2018/09/06 11:14 <DIR> OneDrive 2019/01/15 09:33 <DIR> Pictures 2018/12/15 11:45 <DIR> Saved Games 2018/12/15 11:45 <DIR> Searches 2018/12/15 11:45 <DIR> Videos 1 个文件 1,277,424 字节 15 个目录 19,375,927,296 可用字节

C:\Users\Lenovo>cd C:\work

C:\work>dir 驱动器 C 中的卷是 Windows 卷的序列号是 60A7-8471

C:\work 的目录

2019/01/18 14:38 <DIR> . 2019/01/18 14:38 <DIR> .. 2019/01/18 14:38 17 hello.py.txt 1 个文件 17 字节 2 个目录 19,375,431,680 可用字节

C:\work>more hello.py 无法访问 C:\work\hello.py 文件

廖雪峰

#2 Created at ... [Delete] [Delete and Lock User]

2019/01/18 14:38 17 hello.py.txt

你的文件名真的是hello.py吗?

hello.py 你的后缀怎么是txt呢

求教 windows 10 不能直接改后缀成 .py 要怎么办

跌梦重生

#5 Created at ... [Delete] [Delete and Lock User]

你要在“查看”里面将文件扩展名勾选上。这样就可以改后缀了。

请问大家为什么这个里面会有一个“more+文件名”?


  • 1

Reply