Skip to content

Instantly share code, notes, and snippets.

@nrrb
Last active August 29, 2015 14:06
Show Gist options
  • Save nrrb/7ef728df019c02ff50d4 to your computer and use it in GitHub Desktop.
Save nrrb/7ef728df019c02ff50d4 to your computer and use it in GitHub Desktop.
Python Development Environment in Windows 8

Python dev environment setup on Windows

http://docs.python-guide.org/en/latest/starting/install/win/

Install Python 2.7

  1. Start Windows PowerShell as Administrator
  2. Run Set-ExecutionPolicy Unrestricted
  3. Set path with [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
  4. Close Admin PowerShell

Download these to a folder:

https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py https://raw.github.com/pypa/pip/master/contrib/get-pip.py

  1. Open normal user mode PowerShell
  2. Change directory to the folder containing the above scripts
  3. Run python .\ez_setup.py
  4. Run python .\get-pip.py

To install packages, for instance ipython, run pip install ipython.

Get compiled Python packages for Windows here (lxml for example)

PowerShell Extensions

PowerShell Community Extensions

How to do less/head/tail/sed in PowerShell

  • Use gc log.txt | select -first 10 for head
  • Use gc log.txt | select -last 10 for tail
  • Use gc log.txt | more for less
  • Use gc log.txt | %{ $_ -replace '\d+', '($0)' } for sed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment