14
votes

I've been learning Python, and I keep running into the $ character in online documentation. Usually it goes something like this:

$ python ez_setup.py (Yeah, I've been trying to install setup tools)

I'm fairly certain that this command isn't for the python IDE or console, but I've tried windows cmd and it doesn't work. Any help?

4

4 Answers

20
votes

As of now, Python does not implement $ in its syntax. So, it has nothing to do with Python.

Instead, what you are seeing is the terminal prompt of a Unix-based system (Mac, Linux, etc.)

11
votes

When you open up command prompt in Windows, you'll see something like:

C:\Users\Michael0x2a\Blah> 

The $ symbol is the equivalent in Linux-based systems.

Whenever you see the $ sign, simply ignore it and type in the rest of the line without modification.

5
votes

The $ is the command prompt. It is used to signify that python ez_setup.py should be run on a command line and not on a python/perl/ruby shell

You might also see % python ez_setup.py, which also means the same thing

3
votes

As the two previous answers told, $ is the beginning of commandline prompt waiting for your input in Unix/Linux -systems. In Windows the similar example notation would be like

C:\> python ez_setup.py

So you don't have to write the dollar sign. Just imagine the beginnings of Windows CMD or Powershell prompt in the beginning of line :)

You can read more discussion about the history of dollar sign from Superuser.