Re: [Tutor] Python and Tkinter Programming by Grayson--New Version?

2010-11-28 Thread wesley chun
On Sun, Nov 28, 2010 at 7:18 PM, Terry Carroll wrote: > On Thu, 25 Nov 2010, Alan Gauld wrote: >> "Yves Dextraze" wrote >>> Sent from my iPod >> >> There is no mention on Amazon of any new editions and they usually >> announce several months in advance... >> >> A pity a new Tkinter book using Tix

Re: [Tutor] Python and Tkinter Programming by Grayson--New Version?

2010-11-28 Thread Terry Carroll
On Thu, 25 Nov 2010, Alan Gauld wrote: "Yves Dextraze" wrote Sent from my iPod There is no mention on Amazon of any new editions and they usually announce several months in advance... A pity a new Tkinter book using Tix and ttk instead of PMW would be a really useful resource! Odd -- Y

Re: [Tutor] temporarily modifying sys.path

2010-11-28 Thread Tim Johnson
* Alan Gauld [101128 15:17]: > > "Tim Johnson" wrote > >>> Just curious, but could the imp module help you? imp.find_module > >> I'll be darned. I never even heard of that module, but I just >> did an import and looked at the docs. I *will* give that a try. > > I think its new in Python v3...

Re: [Tutor] Temperature Scales

2010-11-28 Thread Corey Richardson
On 11/28/2010 8:33 PM, Andre Jeyarajan wrote: Write two functions that will convert temperatures back and forth from the Celsius and Fahrenheit temperature scales (using raw_input) def C_F(x): y = (x-32)*(5.0/9) print y def F_C(x): y = (x*9.0/5)+32 print y I have created th

Re: [Tutor] Pyserial and invalid handle

2010-11-28 Thread Walter Prins
Also note this link: http://ur.ly/vVU9 It confirms that PySerial 2.4 works fine on Windows 7 64 bit. (I've also just downloaded and checked that installing pyserial 2.4 replaces the existing pyserial and it does on my Python installation.) Walter ___ T

Re: [Tutor] Pyserial and invalid handle

2010-11-28 Thread Walter Prins
John, On 28 November 2010 15:55, John Smith wrote: > Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] > on win32 > Type "copyright", "credits" or "license()" for more information. > > >>> import serial > >>> ser = serial.Serial('com1', timeout = 5) > >>> x = ser.read() >

[Tutor] Temperature Scales

2010-11-28 Thread Andre Jeyarajan
 Write two functions that will convert temperatures back and forth from the Celsius and Fahrenheit temperature scales (using raw_input) def C_F(x):     y = (x-32)*(5.0/9)     print y def F_C(x):     y = (x*9.0/5)+32     print y I have created the two functions but I don’t know what to do from he

Re: [Tutor] REport Card Question

2010-11-28 Thread Wayne Werner
On Sun, Nov 28, 2010 at 6:50 PM, Andre Jeyarajan wrote: > Write a code that will take an input from a user (numerical grade) and > convert their numerical grade into a letter grade that is accompanied by a > “smart” statement. > > def grade_score(grade): > > if grade >=95 and grade <= 100: >

[Tutor] REport Card Question

2010-11-28 Thread Andre Jeyarajan
Write a code that will take an input from a user (numerical grade) and convert their numerical grade into a letter grade that is accompanied by a “smart” statement. def grade_score(grade):     if grade >=95 and grade <= 100:          print 'A+, Excellent'      elif grade >=85 and grade < 95:    

Re: [Tutor] temporarily modifying sys.path

2010-11-28 Thread Alan Gauld
"Tim Johnson" wrote Just curious, but could the imp module help you? imp.find_module I'll be darned. I never even heard of that module, but I just did an import and looked at the docs. I *will* give that a try. I think its new in Python v3... Compare my recent post about reload() - now

Re: [Tutor] temporarily modifying sys.path

2010-11-28 Thread Tim Johnson
* Evert Rol [101128 07:56]: > > I need a function that will import a module (using __import__) from > > only one specific location on my filesystem. Name collisions are > > possible. To avoid this I could *temporarily* modify sys.path for > > the operation so that it contains only the path that I

Re: [Tutor] Pyserial and invalid handle

2010-11-28 Thread John Smith
On 11/28/2010 10:57 AM, Emile van Sebille wrote: On 11/28/2010 7:55 AM John Smith said... Can anybody tell me why the handle below is invalid? I'm running Win7. TIA, John Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32 Type "copyright", "credits" or "licens

Re: [Tutor] A regular expression problem

2010-11-28 Thread Steven D'Aprano
Josep M. Fontana wrote: I'm trying to use regular expressions to extract strings that match certain patterns in a collection of texts. Basically these texts are edited versions of medieval manuscripts that use certain symbols to mark information that is useful for filologists. I'm interested in

Re: [Tutor] A regular expression problem

2010-11-28 Thread Evert Rol
> Here's what I do. This was just a first attempt to get strings > starting with a non alpha-numeric symbol. If this had worked, I would > have continued to build the regular expression to get words with non > alpha-numeric symbols in the middle and in the end. Alas, even this > first attempt did

Re: [Tutor] Pyserial and invalid handle

2010-11-28 Thread Emile van Sebille
On 11/28/2010 7:55 AM John Smith said... Can anybody tell me why the handle below is invalid? I'm running Win7. TIA, John Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import serial >>>

Re: [Tutor] temporarily modifying sys.path

2010-11-28 Thread Evert Rol
> I need a function that will import a module (using __import__) from > only one specific location on my filesystem. Name collisions are > possible. To avoid this I could *temporarily* modify sys.path for > the operation so that it contains only the path that I want > to work from. Just curious, b

[Tutor] temporarily modifying sys.path

2010-11-28 Thread Tim Johnson
I need a function that will import a module (using __import__) from only one specific location on my filesystem. Name collisions are possible. To avoid this I could *temporarily* modify sys.path for the operation so that it contains only the path that I want to work from. console example: >>> sys_

[Tutor] A regular expression problem

2010-11-28 Thread Josep M. Fontana
I'm trying to use regular expressions to extract strings that match certain patterns in a collection of texts. Basically these texts are edited versions of medieval manuscripts that use certain symbols to mark information that is useful for filologists. I'm interested in isolating words that have

[Tutor] Pyserial and invalid handle

2010-11-28 Thread John Smith
Can anybody tell me why the handle below is invalid? I'm running Win7. TIA, John Python 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import serial >>> ser = serial.Serial('com1', timeout = 5)

Re: [Tutor] string case manipulation in python 3.x

2010-11-28 Thread Steven D'Aprano
Rance Hall wrote: I need to do some case manipulation that I don't see in the documented string functions. I want to make sure that user input meets a certain capitalization scheme, for example, if user input is a name, then the first letter of each word in the name is upper case, and the rest a

Re: [Tutor] Is Python useful for emulating?

2010-11-28 Thread Stefan Behnel
Mauricio Alejandro, 28.11.2010 03:59: I never created any emulator before, and i'm learning C++. Let's say i try to write an emulator for... SNES. Would Python be fast enough? Also, any useful advice you can give me? Things i should know about before i start coding? If you want to write somet

Re: [Tutor] Is Python useful for emulating?

2010-11-28 Thread Luke Paireepinart
It probably won't be fast enough. I wrote an NES emu in python and I ran into a lot of performance issues. If you're new to emu scene, start with David winters' doc and write a chip-8 emu. I will help you learn the structure and process of writing an emulator. Then reimplememt it in c afterward