Python Question

Discuss how to write good code, break bad code, your current pet projects, or the best way to approach novel problems

Python Question

Post by R_I_P1337 on Tue Jul 01, 2008 1:11 pm
([msg=6251]see Python Question[/msg])

Ive been writing a crappy game in python recently and im wonderin whether anyones knows how to actually run the program when your finished with it? Can anyone tell me how?
R_I_P1337
New User
New User
 
Posts: 17
Joined: Thu Jun 19, 2008 2:21 pm
Blog: View Blog (0)


Re: Python Question

Post by nathandelane on Tue Jul 01, 2008 1:42 pm
([msg=6255]see Re: Python Question[/msg])

Are you writing it on Linux or Windows?

If you're writing it on Linux, then the first line of your entry script should be
Code: Select all
#!/usr/bin/python


And then it should have the extension .py. On Windows if you installed Python using the automated installer, then just double-click the presumable .py extension named entry script.
Me, Nathandelane, Highly influential to Hackerdom, Premature Optimization=http://c2.com/cgi/wiki?PrematureOptimization
User avatar
nathandelane
Poster
Poster
 
Posts: 204
Joined: Thu Jun 26, 2008 11:26 am
Location: Utah
Blog: View Blog (0)


Re: Python Question

Post by slashdox on Tue Jul 01, 2008 3:00 pm
([msg=6269]see Re: Python Question[/msg])

Yup, that's basically it.

On some Windows systems without Python installed, its only going to open the script, not interpret it.
slashdox
New User
New User
 
Posts: 24
Joined: Thu Jun 26, 2008 10:31 pm
Location: Toronto
Blog: View Blog (0)


Re: Python Question

Post by thedotmaster on Sat Jul 05, 2008 6:45 pm
([msg=6653]see Re: Python Question[/msg])

I always load my python scripts from console (I run linux). I have them in a folder on my desktop so all I need to do is type:
Code: Select all
cd Desktop/python
python script.py


I prefer not to double-click em on windows because it closes as soon as it terminates the script, hence you can't read any debug messages.
Hope that helps, thedotmaster
Image
User avatar
thedotmaster
Contributor
Contributor
 
Posts: 984
Joined: Sun May 04, 2008 4:39 pm
Location: North West UK
Blog: View Blog (1)


Re: Python Question

Post by R_I_P1337 on Tue Jul 22, 2008 12:13 pm
([msg=7997]see Re: Python Question[/msg])

Thanks for your help really appreciated :D
R_I_P1337
New User
New User
 
Posts: 17
Joined: Thu Jun 19, 2008 2:21 pm
Blog: View Blog (0)


Re: Python Question

Post by thedotmaster on Sun Jul 27, 2008 6:13 pm
([msg=8462]see Re: Python Question[/msg])

R_I_P1337 wrote:Thanks for your help really appreciated :D

No problem. :)
Image
User avatar
thedotmaster
Contributor
Contributor
 
Posts: 984
Joined: Sun May 04, 2008 4:39 pm
Location: North West UK
Blog: View Blog (1)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests