[pythonvis] How I set up my computer for Python development on Windows

  • From: "Richard Dinger" <rrdinger@xxxxxxxxxx>
  • To: <pythonvis@xxxxxxxxxxxxx>
  • Date: Sun, 18 May 2014 13:51:00 -0700

I am sending this out in response to Al's request for more information on how 
to set up your system environment for Python  software development on Windows.  
This is my layered approach for small or large projects.

The minimum set up used for any project:
1 I start Windows Explorer and I create a new development directory for the 
project.  Here I will call the development directory project.  Put a shortcut 
to the directory on your desktop if you like.

2 Then I copy the shell.bat file into that directory and start it running.  The 
shell.bat batch file looks like the following (Note lines beginning with rem 
are comments and may be omitted):

rem begin shell.bat
rem replace c:\python27 with where you installed python
set path=%path%;c:\python27

rem change prompt to just the drive letter (optional):
prompt $N$G

rem start a command shell that inherits the new settings
cmd.exe
rem end shell.bat

If you added the Python interpreter location to the PATH environment variable 
through the control panel, you do not need the set path statement in the above 
shell.bat file.

3 Start your text editor, write the initial version of your program and save it.

4 Switch focus to the shell and enter the program file name to run it.  If an 
error exists read the error message and switch focus back to your editor to 
make corrections and save them.  Switch focus back to the shell and try again.  
Repeat until working.  I think EdSharp will streamline some of this iterative 
work.

5 Start the interpreter in Project by entering 'python' in the shell, which 
starts the interpreter with all your files local so they can be imported or 
read.


For more elaborate projects
1 Add the following directories to Project as needed:
A) Archive directory of module revisions
- copies of key files prior to making a substantial change
B) Unit Test directory
- holds testing modules if applicable
C) Other Testing directories as needed

2 Add the following files to Project directory as needed
A) about.txt - design notes and ideas
B) action.txt - action items e. g. stuff to do
C) test.txt - dump file of script output for debugging
D) grep utility - multi file string search utility 
- EdSharp may include this if not make a python version

3 Other resources
A) Python interpreter running for quick tests or help with syntax
B) Google running for a quick questions
- python.org and stack exchange are good resources
- always include python in your search string
C) Python library reference running
- good place for library information

Other related posts:

  • » [pythonvis] How I set up my computer for Python development on Windows - Richard Dinger