【发布时间】:2018-08-28 15:13:14
【问题描述】:
我正在尝试在 Python 2.6.6 中创建一个文件。它在 Python 2.7 中工作
fp = open('command_file.txt', 'w')
fp.write(device1 + '#' + intstatus + '\n' + device1 + '#\n')
当我在 Python 2.6.6 中运行时,没有创建 command_file.txt。
知道怎么解决吗?
【问题讨论】:
-
该文件几乎可以肯定正在创建 - 但也许它是在与您正在查找的位置不同的目录中创建的?
-
我登录到 root ...我没有看到文件...
-
我试过 10:57:03 # find . -name command_file.txt...看不到文件..
标签: python python-2.7 file