Help with Python™
Help with Python™
Hi i just downloaded python and i have allready got some of the basic very easy language actually can some just tell me how i can debug and run the script?
Thanx
Thanx
"A computer is considered a user
A series of computers is considered a network
The worlds computers are considered a PLayGround"
~88EighT88~
A series of computers is considered a network
The worlds computers are considered a PLayGround"
~88EighT88~
as far as debugging goes the only option I'm aware of is running the script through a console such (cmd.exe or command.com), then when any errors occur they are printed out in the console and do not disappear when the script terminates. If you're sticking to simple things you can use www.codepad.org to run your code and display the output (it doesn't support anything involving sockets and you cant use file I/O) which is really good for practising as you can do it anywhere, its quick and even has syntax highlighting. I think its using Python 2.6.4 (as its the standard on debian) which has slight differences to 3
p.s these colours are done with a python script :P
p.s these colours are done with a python script :P
Ok so i tried that Cmd.exe thing and its giving errors then i try Python Command line and its gives a syntax error no description just "There is a syntax error" any suggestions?
any specific Cmds i should be running other than open ("dir") (python comline) run dir (cmd)?
any extension i should be adding?
any specific Cmds i should be running other than open ("dir") (python comline) run dir (cmd)?
any extension i should be adding?
"A computer is considered a user
A series of computers is considered a network
The worlds computers are considered a PLayGround"
~88EighT88~
A series of computers is considered a network
The worlds computers are considered a PLayGround"
~88EighT88~
I would send you it but I'd much rather see you make your own, it's a good way to lean (plus it makes the posts ~40 times larger so I probably shouldn't promote this too much).
you can just do
python "Z:\my files\my folder\my script.py"
in the command line to save you the 'cd' hastle, and the syntax errors you just have to figure out yourself (might take a bit of time) which you simply do by reading through the code and checking things, it could be something like you have = instead of == or too much going on on a single line.
you can just do
python "Z:\my files\my folder\my script.py"
in the command line to save you the 'cd' hastle, and the syntax errors you just have to figure out yourself (might take a bit of time) which you simply do by reading through the code and checking things, it could be something like you have = instead of == or too much going on on a single line.
Can you please tell me how to do this Paradx?PaRaDoX wrote:Also, make sure you installed python correctly (changed certain environment variables / options, etc.)
the cmd command isnt running it...
"A computer is considered a user
A series of computers is considered a network
The worlds computers are considered a PLayGround"
~88EighT88~
A series of computers is considered a network
The worlds computers are considered a PLayGround"
~88EighT88~
- PaRaDoX
- Posts: 708
- Joined: Fri Aug 22, 2008 5:52 am
- Location: In your fridge, waiting to pop out and scare you.
Depends what error you're getting. If its a syntax error, make sure you followed the instructions on the python site. Can't remember the exact thing it tells you to do, but I remember that it had something to do with the window where you change environment variables, this kinda thing that eliminated the need to go to the python directory, it made all the commands global.88EighT88 wrote:Can you please tell me how to do this Paradx?PaRaDoX wrote:Also, make sure you installed python correctly (changed certain environment variables / options, etc.)
the cmd command isnt running it...

~You are a glitch in my reasoning.
you can add the python directory to the PATH variable so it searches that directory for executables, here's a link about adding to the PATH:
http://www.computerhope.com/issues/ch000549.htm
once that's done you can simply do this to start a python session (assuming the python executable is called python which is probably is):or if you just want to open an interactive session to play with:
try not to mess up your path by replacing all the paths with a single new one (your PATH should be a semicolon separated list of paths and not just a single path)
http://www.computerhope.com/issues/ch000549.htm
once that's done you can simply do this to start a python session (assuming the python executable is called python which is probably is):
Code: Select all
python "my file.py"
Code: Select all
python
- PaRaDoX
- Posts: 708
- Joined: Fri Aug 22, 2008 5:52 am
- Location: In your fridge, waiting to pop out and scare you.
CodeX wrote:you can add the python directory to the PATH variable so it searches that directory for executables, here's a link about adding to the PATH:
http://www.computerhope.com/issues/ch000549.htm
once that's done you can simply do this to start a python session (assuming the python executable is called python which is probably is):or if you just want to open an interactive session to play with:Code: Select all
python "my file.py"
try not to mess up your path by replacing all the paths with a single new one (your PATH should be a semicolon separated list of paths and not just a single path)Code: Select all
python
YEA! that was it

Thanks, that was bugging me for a while >.>

~You are a glitch in my reasoning.