1 Windows 下 Python 打印 "Hello Python World!"

操作系统:Windows 10

Python版本:3.6.5

文本编辑器:geany 1.33

具体步骤:

1.安装Python

    win10下安装Python

2.安装Geany 

    geany官网下载windows的releases。然后点击安装

3.编写第一个程序


1 Windows 下 Python 打印
新建一个python文件


1 Windows 下 Python 打印
点击保存/另存为,或者Ctrl+s,即可保存新建文件并同时重命名


1 Windows 下 Python 打印
编写第一个程序


1 Windows 下 Python 打印
编辑编译即可在geany的编译器中查看编译结果
1 Windows 下 Python 打印
或者点击F5/执行,即可cmd执行python来跑python文件


遇到的问题:

1.最开始,输入代码之后,执行文件。一直执行失败。且没有任何提示信息。 后面各种百度和实操之后终于找到了解决办法。

解决办法:


1 Windows 下 Python 打印
点击执行,选择“设置生成命令”
1 Windows 下 Python 打印
修改Compile 和Execute

1.找到python的安装目录。我的是:C:\Program Files (x86)\Python36-32\python

2.目前找到的有四种方式。不知道是geany有bug还是咋的。我轮番试了好几遍。一会行一会不行的。但是这几种方式中一定有适合你的

    这四种方式中,双引号必须是英文状态下的,然后 "%f" 和前面的内容中间有一个空格。

(1)精确至python目录,且Compile和Execute是一样的

      Compile 中:"C:\Program Files (x86)\Python36-32\python" "%f"

      Execute中:"C:\Program Files (x86)\Python36-32\python" "%f"

(2)精确至python执行文件,即python.exe,且Compile和Execute是一样的

     Compile 中:"C:\Program Files (x86)\Python36-32\python.exe" "%f"

     Execute中:"C:\Program Files (x86)\Python36-32\python.exe" "%f"

(3)精确至python目录。但Compile和Execute不一样,Compile中磁盘名是大写C, Execute中磁盘名是小写c

    Compile 中:"C:\Program Files (x86)\Python36-32\python" "%f"

    Execute中:"c:\Program Files (x86)\Python36-32\python" "%f"

(4)精确至python执行文件,即python.exe。但Compile和Execute不一样,Compile中磁盘名是大写C, Execute中磁盘名是小写c

    Compile 中:"C:\Program Files (x86)\Python36-32\python.exe" "%f"

    Execute中:"c:\Program Files (x86)\Python36-32\python.exe" "%f"

3.设置完成后,再次执行,则成功了。

你可能感兴趣的:(1 Windows 下 Python 打印 "Hello Python World!")