Python编写自己或其他文件

时间:2015-07-13 11:23:22

标签: python python-3.x

我知道这听起来很一般,没有我想要的任何来源或方式。

我希望我的代码能够逐字写入/添加行,例如: new Handler().postDelayed(new Runnable() { @Override public void run() { // your operations (open popup?) } }, **your_delay_time**); 进入python文件。

我希望能够通过powershell编辑我的py文件。

1 个答案:

答案 0 :(得分:1)

with open('whatever.py', 'w') as py_file:
  py_file.write("print('hello world!')")
相关问题