如何用python IDLE编写一个程序

时间:2024-10-13 09:24:08

1、双击打开IDLE,如果没找到,可以在开始菜单中找。

如何用python IDLE编写一个程序
如何用python IDLE编写一个程序

2、在这里可以直接输入代码,例如1+2

如何用python IDLE编写一个程序

3、点击左上角的file-new file,新建一个文件。

如何用python IDLE编写一个程序

4、此时会出现一个名字叫untitle的文件,就是在这里输入代码。

如何用python IDLE编写一个程序

5、输入一段代码,例如:print("hello world")

如何用python IDLE编写一个程序

6、选择file-save,选择一个路径将其保存,这里选择桌面。

如何用python IDLE编写一个程序
如何用python IDLE编写一个程序

7、此时桌面上就会多一个名字叫hello,后缀为py的文件。

如何用python IDLE编写一个程序
© 手抄报圈