2018年7月30日 星期一

Python as a beginner

[auto import module]
windows 10:
1. 右键单击我的电脑,然后单击属性
2. 单击高级选项卡,然后单击环境变量
3. 在系统变量下,单击新建
4. 将 PYTHONSTARTUP 添加到变量名中。
5. 将 Python 文件的路径添加到变量值,然后单击确定


centos 7:
?
[ref] http://desktop.arcgis.com/zh-cn/arcmap/10.3/analyze/executing-tools/modifying-settings.htm



[tools setup]
anaconda https://www.anaconda.com/download/
cmder http://cmder.net/ (full version prefered)
visual studio code https://code.visualstudio.com/

[useful functions]
import os, glob
if elif else
for i in range(0,10)
list=[]
list.insert(0, 'python')
os.rename(source, destination)

[compile to exe file]
CMD >> pip install pyinstaller
CMD >> cd 'the folder of your python source file (test.py)'
CMD >> pyintaller -F -c test.py
PS. -F, –onefile 打包成一个exe文件。
  -D, –onedir 创建一个目录,包含exe文件,但会依赖很多文件(默认选项)。
  -c, –console, –nowindowed 使用控制台,无界面(默认)
  -w, –windowed, –noconsole 使用窗口,无控制台


2018年6月29日 星期五