Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 09-09-2004, 12:37 PM   #1 (permalink)
Intensegutwound
Registered User
 
Join Date: Sep 2004
Posts: 3
Intensegutwound is on a distinguished road
Setting the path for python scripting

I'm running windows 98 on my university server, and I've already downloaded python. I read a tutorial and it said:

"Setting the path

You will need to cause the directory containing the file named python.exe to be listed in your system environment variable named path.

Do you know how to set the path?

If you already know how to set the path, go ahead and do it. If you don't already know how, you may need to get some help."

If someone could post a link to a site that would instruct me how to do this, or give me a pointer as to what I should do it would be much appreciated.

Thanks for your time

The link is to the tutorial site is
http://www.****baldwin.com/python/Pyth0016.htm
I've looked on google, but nothings coming up, and the readme is incomprehensible to me at this point
Intensegutwound is offline   Reply With Quote
Old 09-09-2004, 12:51 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,475
sde is on a distinguished road
let's assume your python path is c:\python

open your windows command prompt ( or MS Dos Prompt ), type this:
Code:
set PATH=%PATH%;c:\python
that should do the trick.
__________________
Mike
sde is offline   Reply With Quote
Old 09-09-2004, 12:59 PM   #3 (permalink)
Intensegutwound
Registered User
 
Join Date: Sep 2004
Posts: 3
Intensegutwound is on a distinguished road
SyntaxError: invalid syntax
>>> set path=%path%;c:\python23
File "<stdin>", line 1
set path=%path%;c:\python23
^
SyntaxError: invalid syntax
>>>

^my input, and the output

I got the python 23 from the address bar for the folder that contains everything python I downloaded. Did I input the wrong address?

Or did I misinterpret the instructions, as in should I have replaced "path" with c:python23 for instance?

Thanks again

Also, i saw somewhere that I had to create a folder for holding my scripts. Is this the case, or will the most recent download of python already have one of these folders? Should this be the folder that I set as my path?

I just downloaded crimson editor, does this simplify the problem, or just confuse the issue, if so, just ignore last comment.
Intensegutwound is offline   Reply With Quote
Old 09-09-2004, 03:07 PM   #4 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,151
Belisarius is on a distinguished road
I think he meant to set the environmental variable PATH in a Windows prompt, not through Python.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 09-09-2004, 03:21 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,475
sde is on a distinguished road
yes, i meant Start -> Programs -> MSDos

or

Start->run
type cmd then press enter.

a black windows command line will come up. then follow the instructions in my first post.
__________________
Mike
sde is offline   Reply With Quote
Old 09-10-2004, 04:36 AM   #6 (permalink)
Intensegutwound
Registered User
 
Join Date: Sep 2004
Posts: 3
Intensegutwound is on a distinguished road
Thanks for your time, no error message came up (the prompt just returned . So I assume it worked. To run any scripts I create do I simply write it in any suitable text editor, and then open it with a python interpreter. Or can I actually open said scripts from the interactive python prompt.

Or are the interpreter, and the interactive python prompt the same thing?

thanks
Intensegutwound is offline   Reply With Quote
Old 09-10-2004, 06:04 AM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,475
sde is on a distinguished road
i'm not sure with python cause i haven't coded with it.

if you want to make sure the path thing worked, in the same command line type
Code:
echo %PATH%
you should see the python path at the end of the string.

this is just a windows feature. it makes it so you can execute the python inturpreter from any directory, .. rather than navigating to the c:\python23 directory to execute the inturpretor.
__________________
Mike
sde is offline   Reply With Quote
Old 11-23-2004, 06:32 AM   #8 (permalink)
MealMan401
Registered User
 
MealMan401's Avatar
 
Join Date: Apr 2004
Posts: 10
MealMan401 is on a distinguished road
Smile

Ya, you can run script from the interactive thingy (mostly this is ment to test short snippets of code cause its akward to fix typos when using it)

But mainly people pick an editor that they really like (I go for one that has python syntax support 'out of the box'), type their code in it, save it as a .py file and run the python interpreter with that file

something like this (i haven done this for a while so i dont know the exact command line for it but here goes....)

file name is foo.py

so
type in command line prompt: python foo.py

try that and see how it goes!
MealMan401 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 09:42 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting