Last week I decided to take a look a Python since it's been around quite awhile and I've never used it. I have found it to have a simple install (with a little caveat around getting the registry keys properly configured in order to be able to download helpful modules). The language itself is one that a programmer can quickly pick up the basics too, although it has advanced features that will take awhile to master (at least that is so for me). I am a self learned Java/ant hacker and I find I like the scripting ability of Python. However, what makes it really fun and quick to come up to speed on is having a solid IDE to develop the scripts with. That is where Pycharm comes in. With it's debugging, auto type, auto format and other features, it makes coming up to speed with Python a much simpler task. Below is how I got started....
Download Python
Download Python: https://www.python.org/download/- by default, installs to c:\Python## where ## is version number, ex Python34
- installer updates/add HKEY_LOCAL_MACHINE\SOFTWARE\PYTHON registry entry
Adding HKEY_CURRENT_USER Registry entry
Some Python module installers look in the HKEY_CURRENT_USER registry entry for the Python settings so need to get the info there- http://choorucode.com/2012/04/28/python-version-not-found-in-registry-error/
- open regedit
- navigate to Computer->HKEY_LOCAL_MACHINE->SOFTWARE->Python
- right click 3.4 -> Export
- save as .reg file on your system, ex. c:\Users\yourname\python3.4.reg
- edit .reg file and change all HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER
- open cmd box as administrator
- cd to where .reg file was saved
- install using regedit command
- c:> regedit python3.4.reg
- keys should be successfully added to registry
- verify using regedit that Computer->HKEY_CURRENT_USER->SOFTWARE->Python exists
- c:> regedit python3.4.reg
Installing Python modules
Module install can be done using pip or by double clicking the module if it is an installer.Modules/Packages
libxml
XML processing library combining libxml2 and libxslt libraries and providing a safe and convenient access to the libraries using the ElementTree API.- need to install manually on windows....dont try installing using PyCharm->Settings since it requires building it which you cant do (ok you might be able to, but it wont be easy)
- get the libxml installer
- there are 2 versions: win32 and win-amd64 and both need to be installed for lxml.etree to work
- page with lots of modules: http://www.lfd.uci.edu/~gohlke/pythonlibs/(search for lxml on the page)
- 3.3.5 win32 version: lxml-3.3.5.win32-py3.4.exe
- 3.3.5 amd64 version: lxml-3.3.5.win-amd64-py3.4.exe
- page with lots of modules: http://www.lfd.uci.edu/~gohlke/pythonlibs/(search for lxml on the page)
- there are 2 versions: win32 and win-amd64 and both need to be installed for lxml.etree to work
PyCharm IDE
PyCharm is a Python IDE put out by JetBrains- download from: http://www.jetbrains.com/pycharm/download/
- start PyCharm
- File -> Settings -> Project Interpreter
- click on the +
- in search bar, type PyGitHub
- click Install Package
No comments:
Post a Comment