From: kevin hayes
To: [email protected]
Sent: Friday, November 02, 2007 2:08 AM
Subject: Re: [pygame] Help with the 3rd Lecture, first tutorial
I am thoroughly confused at this point. I guess I need to change the path.
Kevin,
When sending you information I can understand that you could have gotten
confused since everything from setting the system path and such was thrown at
you.
You had said, and was reminded about the path you had loaded Python25 from,
and that was from the Python25 folder where it would normally be installed on
the windows C drive. That is where it will fall apart. Yes, you had to change
the path for running example programs for the path has to be where the example
program is...
You have to look at the program location and where all the data for the
program is residing. If the data folder is a child, sub-directory of the
example folder then you are OK as long as, I repeat, "AS LONG AS" you load the
python25.exe at that directory point. Or you either go to the example directory
by using the batch files I gave you or going to the command prompt and typing
C: and hitting enter, then cd python25 and hitting enter then cd examples and
hitting enter or
The third way is to go to windows explorer and go to the examples folder
and click on the Chimp.py game and if it runs it will run the chimp example or
it may ask what you want to run it with. For if it asks you then go to the
browse option and click on it. For by doing this it will allow you to select
which program you wish to run. First it will ask you to enter the path to the
program and that is what you enter. For the program to run any .py module is
the very path you first went to and that is c:\Python25\ and you enter that
path plus the Python25 program and once you have entered
c:\Python25\Python25.exe and hit enter or go to OK and click on it your program
will run from Windows Explorer each time you double click on a .py file.
Now that you have set Windows Explorer to run any .py game or program you
write all you have to do is go to the folder in which a .py module/file is
located. Once you click on it it will load Python25.exe and the file and run.
You will not have to go to a DOS prompt unless you want to when doing this.
The Open Command Here is only if you want to run from the DOS shell for it will
take you to the folder you are hovering over inside Explorer, thus bypassing
going to the DOS prompt icon, clicking on it, and navigating the long way over
to that folder.
NOW:
NOTE:
You had asked if the path needed to be changed and that depends on where
you are residing. For where you run Python25.exe, is where the OS.PATH connects
to. If you are in the Python25 folder that is what is loaded into OS>PATH at
the time of loading Python25.exe
Now, you have many options, but you also have to look at the .py module you
have and what it also demands. The Chimp.py file has join("data/file") and this
is appended to the OS.PATH.
So, you now have to locate where the data folder is. So, since the data
folder is in the examples folder you either move to that folder, where Chimp.py
is, and then click on Chimp.py from Explorer or at the DOS prompt move to that
folder and type Python25 Chimp.Py and then hit enter.
Your Chimp will run as long as the data folder is a child of the examples
folder.
If not, then you must change the Chimp.py program where it has the
join(data/) reference. You must add the complete location of where you are at
to get it running. So if Chimp.py is loaded and does not run you then modify
the join( to reflect from where you were which was c:\Python25\ and add to the
join statement everywhere it is located the addition of example/ to it, or
join("example/data/filename.ext) what ever was inside the parens and expand
it...
FINAL OPTIONS:
1) Go to the examples folder when at the DOS prompt then type Python25
Chimp.py.
2) Or use Windows Explorer and click on Chimp.py inside the examples
folder. Setup up Explorer so it runs Python25.exe upon the click.
3) Or from Windows download the Open Command Here, set it up, then hover
over the examples folder, then click on the file/context menu option for Open
Command
Here and repeat step 1 if you want to be in DOS to run/test your games.
You have many choices and the best one is option 2. Option 2 is to run
immediately the game you wish to test/run. For that is the path of least
resistance! For you stay within Windows and not even touch DOS unless of course
you want to be in DOS.
"May The Force Be With You!"
Bruce