[英]How to create a new text document from scratch and save it as .py file using cmd?
Without considering an option to open a notepad first and saving it with the extension ".py" , how to create a new ".py" file in a corresponding directory using cmd ? 在不考虑先打开记事本并使用扩展名“ .py”保存的选项的情况下,如何使用cmd在相应目录中创建新的“ .py”文件?
Note : As a beginner python learner I request you to kindly ignore if this was a silly question ... 注意:作为一个Python初学者,我请您忽略这是否是一个愚蠢的问题...
on windows: C:\\Users\\username\\Desktop> echo "the script" > hello_world.py 在Windows上:C:\\ Users \\ username \\ Desktop> echo“ the script”> hello_world.py
Note: replace the username with your actual user account. 注意:用您的实际用户帐户替换用户名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.