尝试interneting和检查python3文档,但我似乎无法修复以下 - 我可能只是缺少一个国旗或东西!python3创建/打开文件区分大小写Mac
我想创建和编辑本地目录中的文件。使用区分大小写的文件名的Python:但我有以下行为:
~$ python3
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> f = open("file.txt", "w")
>>> f.write("hello\n")
6
>>> f.close()
>>> del f
>>> f = open("File.txt", "w")
>>> f.write("BYE\n")
4
>>> f.close()
>>> del f
>>> quit()
~$ ls
Applications Downloads Movies Public
Cloud File.txt Music intel
Desktop Jagex Documents Library
Documents Library Pictures
~$ cat File.txt
BYE
~$ cat file.txt
cat: file.txt: No such file or directory
有谁知道在哪里我的文件“file.txt” [用“你好\ N”]文件已走了吗?
谢谢!
Edit1:我使用的是OSX Sierra 10.12.1。
是否使用OS X? –
啊是的 - 对不起,我想补充一点。是的“OSX Sierra 10.12.1”是准确的:) –