跳至内容
菜单
此问题已终结
5427 查看

I got an error : OSError: [Errno 2] No such file or directory: '/Users/Downloads'

What is wrong in this code?


 import random, os
a = random.randint(1, 9999)
name = 'filename' + str(a * 7) + '.txt'
print '>>', a
ROOT = os.path.abspath(os.sep)
filepath = os.path.join(ROOT, name)
os.chdir(filepath)
file = open(filepath, 'w')

形象
丢弃
相关帖文 回复 查看 活动
0
9月 17
3727
1
1月 23
6485
1
3月 21
19032
1
3月 15
4422
6
9月 22
67466