Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I broke my BSD box, and I need to survive a few days in unknown Windows territory. I got the Python interpreter running in a terminal by typing python. I ran notepad with the prompt as well, but I am totally lost after that.

How can I do this?

$ mkdir Test
$ echo "print 'hello'" >
$ python

I would greatly appreciate if someone explained in terms of unix tools how I can get just python and a text-editor running? (I'm missing an environment variable; found C:\Python26\python.exe but haven't yet gotten the env var correct).

share|improve this question

migrated from Jul 22 '11 at 15:12

This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems.

I am just looking someone to explain me what this thing is. I do not want spend any time to it, I want some quick way to get unix -style tools working. I am not sure which is the best option. Perhaps some virtualized unix or something like that? I am happy if I get python working because I can handle most stuff with it but I am interested to know how you other folks handle things like this when you MUST just use the shxt? – user3672 Jul 20 '11 at 22:19
Nevermind. Add any specific question to your question and I'll update my answer. My solution is to add GnuWin32, vim, ie. decent tools to the environment. – Vitor Py Jul 20 '11 at 22:21
up vote 2 down vote accepted

Your example mkdir Test; echo "print 'hello'" >; python is actually valid in Windows Command Prompt, provided that you have set the Environment Variable as suggested here. You can also set Variables temporarily or list all your current Variables using the set keyword, enter set /? in command prompt for more. (to set it permanantly use the setx utility, download from here).

To list where something is in the path (which work-alike, if you don't use cygwin), use the script I posted here.

For a start, do yourself a favor and download Cygwin plus Cygwin Ports and add the cygwin /bin directory to the Path.

share|improve this answer
It apparently creates some sort of virtual directory structure. How can I find the C:\Python26\ there? Where does it place the original structure? – user3672 Jul 20 '11 at 23:23
@hhh: are you speaking about cygwin?, let's say you installed it as C:\cygwin, the cygwin directory is like /, there is a /cygdrive folder under which the whole file-system is mounted (you got the loop?...). so to access C:\Python26\ you do cd /cygdrive/c/Python26 in cygwin's shell. also take a look at the chere package. – Philomath Jul 20 '11 at 23:37

Since you already installed the interpreter try on the prompt:

echo %PATH%

Is python on the PATH? If not, right click on My Computer, then Properties, then Advanced, then Environmental Variables and add it.

Python should comes with IDLE. Can't you find it on the start menu? IDLE has a text editor. You could also download vim or wherever suits your taste.

Also I'd suggest you to download GnuWin32 and add it to the path. This way you get a more familiar environment and less crude tools than wherever comes with Windows.

share|improve this answer
how can I find the location of the python installed to this box? Is there something like locate/whereis? – user3672 Jul 20 '11 at 22:54
@hhh Nothing similar to locate as far as I know. Python usually installs itself on the C:` root as C:\Python{version}` (like C:\Python26). Just take a look C:\ using the My Computer icon. Or you can right click on Python icon in the start menu, look at Properties and see where the shortcut points to. – Vitor Py Jul 20 '11 at 23:00
I found python in C:\Python26\python.exe but I cannot find the executable (the file to add to the env var). – user3672 Jul 20 '11 at 23:01
@hhh Add just C:\Python26 to the %PATH%. You must close the prompt and open another one before changes to %PATH% take effect. – Vitor Py Jul 20 '11 at 23:03
here I pasted a which work-alike in Windows CMD. HTH. – Philomath Jul 21 '11 at 0:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .