Windows7中双击py文件运行程序
2016-01-28 10:31
459 查看
最近看了一本python方面的教材,洋洋洒洒写了好几页,也没将要点讲到,我现将在Window7下,双击py文件运行程序的方法总结如下:
注意:别忘了在py文件中的最后加入input(“Enter the any press to exit” )这行代码。这种方法仅仅限于在Windows系统下使用,方便查看自己的运行结果。
双击该文件后,出现界面如下:
方法
将该文件的Properties设置为如下:注意:别忘了在py文件中的最后加入input(“Enter the any press to exit” )这行代码。这种方法仅仅限于在Windows系统下使用,方便查看自己的运行结果。
举例
比如,我写了如下代码:# Instructions # Demonstraction programmer - created functions def instructions(): """Display game instructions""" print( """ Welcome to the greatest intellectual challenge of all time: Tic-Tac-Toe. This will be a showdown between your human brain and my sillicon processor. You will make you move known by entering a number, 0-8. The number will correspond to the board position as illustrated: 0 | 1 | 2 --------- 3 | 4 | 5 --------- 6 | 7 | 8 Prepare your self, human. The ultimate battle is about to begin.\n""" ) # main print("Here are the instructions to the Tic-Tac-Toe:") instructions() input("\n\nPress the enter key to exit.")
双击该文件后,出现界面如下:
相关文章推荐
- Python动态类型的学习---引用的理解
- Python3写爬虫(四)多线程实现数据爬取
- 垃圾邮件过滤器 python简单实现
- 下载并遍历 names.txt 文件,输出长度最长的回文人名。
- install and upgrade scrapy
- Scrapy的架构介绍
- Centos6 编译安装Python
- 使用Python生成Excel格式的图片
- 让Python文件也可以当bat文件运行
- [Python]推算数独
- Python中zip()函数用法举例
- Python中map()函数浅析
- Python将excel导入到mysql中
- Python在CAM软件Genesis2000中的应用
- 使用Shiboken为C++和Qt库创建Python绑定
- FREEBASIC 编译可被python调用的dll函数示例
- Python 七步捉虫法