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')
OSErrorが表示されます。 OSError:[Errno 2]このようなファイルまたはディレクトリはありません: '/ Users/Downloads'ダウンロードディレクトリ(python、odoo)にtxtファイルを入れる方法
スクリプトの出力全体を表示できますか? – aydow