Re: [Tutor] sys.getfilesystemencoding()

2012-12-20 Thread eryksun
On Thu, Dec 20, 2012 at 1:01 PM, Albert-Jan Roskam wrote: > >> You shouldn't encode a string argument you've declared as c_wchar_p >> (i.e. wintypes.LPCWSTR, i.e. type 'Z'). > > Ok, yes, that was plain stupid of me. On Windows, CPython 3.3 presents a twist. sizeof(c_wchar) is 2, but sys.maxunicod

[Tutor] playing mp3 files

2012-12-20 Thread Kirk Bailey
the robotradio program is coming along. It plays. it dances. it sings. IT selects random libraries and random broadcast files. and it restarts itself with consummate ease. Aka, NOW wtf?!? Jim is exchanging letters with me on this, but does not yet have a solution. Here's the code of the hour:

Re: [Tutor] invalid literal for int error in Game loop

2012-12-20 Thread Prasad, Ramit
Ciaran Mooney wrote: > Sent: Thursday, December 20, 2012 3:35 PM > To: d...@davea.name > Cc: tutor@python.org > Subject: Re: [Tutor] invalid literal for int error in Game loop > > Thanks for the feedback. > > Steve, If I set the FPS to a default of say 30, the game seems to run at this > default

Re: [Tutor] invalid literal for int error in Game loop

2012-12-20 Thread Dave Angel
On 12/20/2012 04:34 PM, Ciaran Mooney wrote: > Thanks for the feedback. > > Steve, If I set the FPS to a default of say 30, the game seems to run at this > default FPS=30 regardless of the key pressed in the function. > > Dave, If I remove the the default value at the start of the function and a

Re: [Tutor] invalid literal for int error in Game loop

2012-12-20 Thread Ciaran Mooney
Thanks for the feedback. Steve, If I set the FPS to a default of say 30, the game seems to run at this default FPS=30 regardless of the key pressed in the function. Dave, If I remove the the default value at the start of the function and add it to elif in the loop I get the following error: T

Re: [Tutor] how to control putty window

2012-12-20 Thread Prasad, Ramit
Ufuk Eskici wrote: > Hello, > > I run this command and opens putty: > > import os > import subprocess > command = '"c:\Program Files\Putty\putty.exe" -ssh ufukeskici@10.10.10.10 -pw > test > subprocess.Popen(command) > > But then I want to input new commands to this Putty new window. How can I

Re: [Tutor] invalid literal for int error in Game loop

2012-12-20 Thread Dave Angel
On 12/20/2012 03:51 PM, Steven D'Aprano wrote: > On 21/12/12 07:40, Ciaran Mooney wrote: > >> def difficultyLevel(): >> FPS = '' > > Here you set the variable FPS to the empty string. > >> if event.type == KEYDOWN: >> if event.key == ord('b'): >> FPS = 30

Re: [Tutor] invalid literal for int error in Game loop

2012-12-20 Thread Steven D'Aprano
On 21/12/12 07:40, Ciaran Mooney wrote: def difficultyLevel(): FPS = '' Here you set the variable FPS to the empty string. if event.type == KEYDOWN: if event.key == ord('b'): FPS = 30 elif event.key == ord('m'): FPS =

[Tutor] invalid literal for int error in Game loop

2012-12-20 Thread Ciaran Mooney
HI All, Was hoping someone could help me with a problem I am having programming a game using pygame. I am trying to return a variable with a integer value defined by user input from a function. Basically the idea is to allow the player to select the level of difficulty by selecting from a cho

Re: [Tutor] sys.getfilesystemencoding()

2012-12-20 Thread Albert-Jan Roskam
> On Wed, Dec 19, 2012 at 5:43 AM, Albert-Jan Roskam > wrote: >> >> So MBCS is just a collective noun for whatever happens to be the >> installed/available codepage of the host computer (at least with >> CP_ACP)? > > To be clear, the "mbcs" encoding in Python uses CP_ACP. MBCS means > multibyt

Re: [Tutor] how to control putty window

2012-12-20 Thread Alan Gauld
On 20/12/12 14:25, Ufuk Eskici wrote: Hello, I run this command and opens putty: import os import subprocess command = '"c:\Program Files\Putty\putty.exe" -ssh ufukeskici@10.10.10.10 -pw test subprocess.Popen(command) But then I want to input new commands to thi

[Tutor] playing mp3 files

2012-12-20 Thread Kirk Bailey
Ok, I found something that works reliably: http://www.mailsend-online.com/blog/play-mp3-files-with-python-on-windows.html Here is the code as modified for my uses (beware text wrap!): -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #!c:\Python25\pythonw.exe # Copyright (c) 2011 b

Re: [Tutor] how to control putty window

2012-12-20 Thread Dave Angel
On 12/20/2012 09:25 AM, Ufuk Eskici wrote: > > I run this command and opens putty: > > import os > import subprocess > command = '"c:\Program Files\Putty\putty.exe" -ssh > ufukeskici@10.10.10.10-pw test > subprocess.Popen(command) > > You really should use cut and paste when trying to tell us what

Re: [Tutor] how to control putty window

2012-12-20 Thread David Rock
* Ufuk Eskici [2012-12-20 16:25]: > Hello, > > I run this command and opens putty: > > import os > import subprocess > command = '"c:\Program Files\Putty\putty.exe" -ssh > ufukeskici@10.10.10.10-pw test > subprocess.Popen(command) > > But then I want to input new commands to this Putty new wind

[Tutor] how to control putty window

2012-12-20 Thread Ufuk Eskici
Hello, I run this command and opens putty: import os import subprocess command = '"c:\Program Files\Putty\putty.exe" -ssh ufukeskici@10.10.10.10-pw test subprocess.Popen(command) But then I want to input new commands to this Putty new window. How can I do it? Thanks. Ufuk __