Re: [Tutor] gui further explained
On Tue, Jun 9, 2009 at 10:31 PM, Essah Mitges e_mit...@hotmail.com wrote: i don't know if its what i am searching that is wrong but what i am trying to do is link my game i made in pygame to my pygame menu the menu has 4 button classes on it one foe instruction one to quit one for high scores and one to start the game the 3 other buttons work all but the one to start the game this is basicly the menu i want people to see first the main menu So why don't you put your menu in your game? Consider the following: # Lamegame.py - probably the lamest game ever! print Welcome to Lame Game! raw_input(Please type something and press enter: ) print You win! So there's a game. Now let's add a menu: # lamegameimproved.py - the lamest game, now with a menu! import sys print Welcome to Lame Game! print \nMenu:\n print (Q)uit print (P)lay choice = raw_input(Your Choice? (P or Q): ) if choice.lower() == 'q': sys.exit(0) elif choice.lower() == 'p': # add original code here See? Quite simple. Even with pygame it shouldn't be a whole lot more complex than that. And that's really the most simple example I could think of and it's really not very good. For instance you could put the original code into a game function and then call it if the choice was P. HTH, Wayne ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] gui further explained
does anyone know how to make a parallel or serial interface with respective software, i would prefer parallel because it is easy to utilise ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] gui further explained
Jacob Mansfield wrote: does anyone know how to make a parallel or serial interface with respective software, i would prefer parallel because it is easy to utilise Both the serial and the parallel interface seem to be covered by pyserial http://pyserial.wiki.sourceforge.net and http://pyserial.wiki.sourceforge.net/pyParallel . With these libraries you can program the ports from Python. Albert ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] gui further explained
What I am trying to do is start my pygame game from my pygame menuI do not think I am using the right code to do this I am trying to use the subprocess module to open a child window with the game inside of it but python doesn't like thatThe second thing that i'd like to know how I could list the content of a text file inside a pygame window(this is a different file)Traceback (most recent call last): File C:\Users\John Doe\Desktop\D-Day\back.py, line 47, in main() File C:\Users\John Doe\Desktop\D-Day\back.py, line 37, in main elif sbut.clicked(k.pos): File C:\Users\John Doe\Desktop\D-day\but.py, line 200, in clickedsubprocess.Popen([D-Day, Destruction.py]) File C:\Python26\lib\subprocess.py, line 595, in __init__errread, errwrite) File C:\Python26\lib\subprocess.py, line 804, in _execute_child startupinfo)WindowsError: [Error 2] The system cannot find the file specified _ Attention all humans. We are your photos. Free us. http://go.microsoft.com/?linkid=9666046 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] gui further explained (The error in unreadable form)
Essah Mitges wrote: What I am trying to do is start my pygame game from my pygame menuI do not think I am using the right code to do this I am trying to use the subprocess module to open a child window with the game inside of it but python doesn't like thatThe second thing that i'd like to know how I could list the content of a text file inside a pygame window(this is a different file)Traceback (most recent call last): File C:\Users\John Doe\Desktop\D-Day\back.py, line 47, in main() File C:\Users\John Doe\Desktop\D-Day\back.py, line 37, in mainelif sbut.clicked(k.pos): File C:\Users\John Doe\Desktop\D-day\but.py, line 200, in clickedsubprocess.Popen([D-Day, Destruction.py]) File C:\Python26\lib\subprocess.py, line 595, in __init__errread, errwrite) File C:\Python26\lib\subprocess.py, line 804, in _execute_childstartupinfo)WindowsError: [Error 2] The system cannot find the file specified _ Attention all humans. We are your photos. Free us. http://go.microsoft.com/?linkid=9666046 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Powered by Gentoo GNU/Linux http://linuxcrazy.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] gui further explained
On Tue, Jun 9, 2009 at 6:49 PM, Essah Mitges e_mit...@hotmail.com wrote: What I am trying to do is start my pygame game from my pygame menuI do not think I am using the right code to do this I am trying to use the subprocess module to open a child window with the game inside of it but python doesn't like thatThe second thing that i'd like to know how I could list the content of a text file inside a pygame window(this is a different file)Traceback (most recent call last): File C:\Users\John Doe\Desktop\D-Day\back.py, line 47, in main() File C:\Users\John Doe\Desktop\D-Day\back.py, line 37, in mainelif sbut.clicked(k.pos): File C:\Users\John Doe\Desktop\D-day\but.py, line 200, in clicked subprocess.Popen([D-Day, Destruction.py]) File C:\Python26\lib\subprocess.py, line 595, in __init__errread, errwrite) File C:\Python26\lib\subprocess.py, line 804, in _execute_child startupinfo)WindowsError: [Error 2] The system cannot find the file specified As far as I can tell, since your error formatting was lost, is that Popen can't find the the file. The other problem is that what you're thinking of really makes no sense. Pygame doesn't need (and shouldn't) run a program inside the window. You should have all of your game processes available to the main program and when you want to start the game it should just be a part of it - not a subprocess. HTH, Wayne ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] gui further explained (The error in unreadable form)
ok I follows like 3 ppl instructions for making readable errors I'lll manually type it out lolTraceback (most recent call last): File C:\Users\John Doe\Desktop\D-Day\back.py, line 47, in main() File C:\Users\John Doe\Desktop\D-Day\back.py, line 37, in main elif sbut.clicked(k.pos): File C:\Users\John Doe\Desktop\D-Day\back.py, line 200, in clicked subprocess.Popen([D-Day, Destruction.py]) File C:\Python26\lib\subprocess.py, line 595, in ___init___ errread, errwrite) File C:\Python26\lib\subprocess.py, line 804, in _execute_child startupinfo)WindowsError: [Error 2} The system cannot find the file specified Date: Tue, 9 Jun 2009 20:07:15 -0400 From: da...@abbottdavid.com To: e_mit...@hotmail.com CC: tutor@python.org Subject: Re: [Tutor] gui further explained (The error in unreadable form) Essah Mitges wrote: What I am trying to do is start my pygame game from my pygame menuI do not think I am using the right code to do this I am trying to use the subprocess module to open a child window with the game inside of it but python doesn't like thatThe second thing that i'd like to know how I could list the content of a text file inside a pygame window(this is a different file)Traceback (most recent call last): File C:\Users\John Doe\Desktop\D-Day\back.py, line 47, in main() File C:\Users\John Doe\Desktop\D-Day\back.py, line 37, in main elif sbut.clicked(k.pos): File C:\Users\John Doe\Desktop\D-day\but.py, line 200, in clicked subprocess.Popen([D-Day, Destruction.py]) File C:\Python26\lib\subprocess.py, line 595, in __init__ errread, errwrite) File C:\Python26\lib\subprocess.py, line 804, in _execute_child startupinfo)WindowsError: [Error 2] The system cannot find the file specified _ Attention all humans. We are your photos. Free us. http://go.microsoft.com/?linkid=9666046 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor -- Powered by Gentoo GNU/Linux http://linuxcrazy.com _ Attention all humans. We are your photos. Free us. http://go.microsoft.com/?linkid=9666046 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] gui further explained
i don't know if its what i am searching that is wrong but what i am trying to do is link my game i made in pygame to my pygame menu the menu has 4 button classes on it one foe instruction one to quit one for high scores and one to start the game the 3 other buttons work all but the one to start the game this is basicly the menu i want people to see first the main menu From: sri...@gmail.com Date: Tue, 9 Jun 2009 21:48:28 -0500 Subject: Re: [Tutor] gui further explained To: e_mit...@hotmail.com CC: tutor@python.org On Tue, Jun 9, 2009 at 7:18 PM, Essah Mitges e_mit...@hotmail.com wrote: lol i was trying to open it while keeping my menu open to have it in a different window So you have a pygame window that is just a menu? and when you select this option it will try to run another python script? Your description of your desired goal isn't terribly clear, and hence it's difficult to offer good advice. When you say menu and different window that could mean a host of things. If you say I have a pygame window that consists of a menu; here is my code link to some pastebin. I'm having problems when I select some option - I want it to specific action, i.e. open a toplevel window (with titlebar, etc.), display some pixels on the screen, etc., but some unexpected behavior. The interesting this is that often when I take the time to write out a detailed question I find that the answer is right there in front of me. I've probably almost posted about 10-15 questions in the past 6 months and then just by virtue of taking the time to really look over my code I find the solution to my problem. HTH, Wayne _ Attention all humans. We are your photos. Free us. http://go.microsoft.com/?linkid=9666046___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor