[Tutor] PinYin support on Entry widgets

2005-08-21 Thread Jorge Louis De Castro
Hello,   Is it possible to have the Entry widgets behave like everything else on Windows when you change the language settings? When I change my settings from English to Chinese all Wins' textboxes and forms allow inserting of chinese characters. It does not work like that with Tkinter widg

[Tutor] Sorting by numbers

2005-08-21 Thread Jonas Melian
From an input as this: Standard timing 0: 85 Hz, 640x480 Standard timing 1: 85 Hz, 800x600 Standard timing 2: 85 Hz, 1024x768 Standard timing 3: 85 Hz, 1280x1024 Standard timing 4: 70 Hz, 1600x1200 Standard timing 5: 60 Hz, 1920x1440 I want to get columns 3 and 5 for sort them from mayor mo mino

Re: [Tutor] Sorting by numbers

2005-08-21 Thread Jonas Melian
Solution: modes.sort(key=lambda item: int(item[1].split('x')[0])) # 2.4 modes.sort(lambda x, y: cmp(int(x[1].split('x')[0]), int(y[1].split('x')[0]))) #2.3.5 Jonas Melian wrote: > From an input as this: > >Standard timing 0: 85 Hz, 640x480 >Standard timing 1: 85 Hz, 800x600 >Standard timing 2: 8

Re: [Tutor] PinYin support on Entry widgets

2005-08-21 Thread Jorge Louis de Castro
Ignore this one, works as expected (coffee needed, you see). j. >From: "Jorge Louis De Castro" <[EMAIL PROTECTED]> >Reply-To: Jorge Louis De Castro <[EMAIL PROTECTED]> >To: >Subject: [Tutor] PinYin support on Entry widgets >Date: Sun, 21 Aug 2005 10:43:14 +0100 > >Hello, > >Is it possible to ha

Re: [Tutor] Sorting by numbers

2005-08-21 Thread Jonas Melian
:( I get >>> modes [['85', '640x480'], ['85', '800x600'], ['85', '1024x768'], ['85', '1280x1024'], ['70', '1600x1200'], ['60', '1920x1440']] please help! >Solution: >modes.sort(key=lambda item: int(item[1].split('x')[0])) # 2.4 >modes.sort(lambda x, y: cmp(int(x[1].split('x')[0]), >int(y[1].spl

Re: [Tutor] Sorting by numbers

2005-08-21 Thread Kent Johnson
Jonas Melian wrote: > :( I get > >>> modes > [['85', '640x480'], ['85', '800x600'], ['85', '1024x768'], ['85', > '1280x1024'], ['70', '1600x1200'], ['60', '1920x1440']] > please help! > > >>Solution: >>modes.sort(key=lambda item: int(item[1].split('x')[0])) # 2.4 >>modes.sort(lambda x, y: cmp(i

Re: [Tutor] Confused about embedding python in Html

2005-08-21 Thread Alan G
Hi Tony, > I want to use embedded python in an html page. I assume you mean you want to embed python code in amongst your HTML and have it executed at the server in the same way as ASP? There is a system available called PSP - Python Server Pages which allows this but be aware that because of Py

Re: [Tutor] Searching Sorted Lists

2005-08-21 Thread R. Alan Monroe
> [EMAIL PROTECTED] wrote: >> Hi, Can someone tell me if there is a bulit in Binary search function for >> python lists ? >> >> I am currently building lists and sorting them with a comparison function. >> The only list search function I know is List.Index(X), which is pretty >> inefficient I reck

[Tutor] no rsplit

2005-08-21 Thread Jonas Melian
v = "64x43x12" -> '64x43', '12' How split it by the las 'x'? In 2.4 it could be used rsplit("x",1) but i've 2.3.5 Is there another way of splitting a string from the end? ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinf

Re: [Tutor] no rsplit

2005-08-21 Thread Kent Johnson
Write your own? >>> def rsplitx1(s): ... try: ... i = s.rindex('x') ... return s[:i], s[i+1:] ... except ValueError: ... return s ... >>> rsplitx1('64x43x12') ('64x43', '12') >>> rsplitx1('64x43x') ('64x43', '') >>> rsplitx1('64') '64' Kent Jonas Melian wrote: > v = "64

Re: [Tutor] no rsplit

2005-08-21 Thread Orri Ganel
Jonas Melian wrote: >v = "64x43x12" -> '64x43', '12' > >How split it by the las 'x'? > >In 2.4 it could be used rsplit("x",1) > >but i've 2.3.5 > >Is there another way of splitting a string from the end? >___ >Tutor maillist - [EMAIL PROTECTED] >http:

[Tutor] how to make a script do two things at once.

2005-08-21 Thread nephish
Hey there, i have a simple question about getting a script to do two things at once. like this. for i in range(100): print i time.sleep(.2) if i == 15: os.system('python /home/me/ipupdate.py') print 'done' when i run this, it stops at 15 and runs the script called out

[Tutor] Network Tutorials

2005-08-21 Thread John Walton
Hello, everyone. I just began school, and they already assigned us science fair. Since I'm in 8th grade, I get to do demonstrations for our projects. > I'm probably going to demonstrate Python's networking> capabilities by writing a simple instant messenger program. I only have a few problems:

Re: [Tutor] Network Tutorials

2005-08-21 Thread Danny Yoo
On Sun, 21 Aug 2005, John Walton wrote: > Hello, everyone. I just began school, and they already assigned us > science fair. Since I'm in 8th grade, I get to do demonstrations for > our projects. > > I'm probably going to demonstrate Python's networking capabilities by > writing a simple insta

Re: [Tutor] how to make a script do two things at once.

2005-08-21 Thread Danny Yoo
On Sun, 21 Aug 2005, nephish wrote: > i have a simple question about getting a script to do > two things at once. Hi Shawn, It sounds like you may want to try threading. Here you go: http://www.python.org/doc/lib/module-threading.html Aahz has written a tutorial about Threads here:

Re: [Tutor] how to make a script do two things at once.

2005-08-21 Thread Kent Johnson
nephish wrote: > Hey there, > i have a simple question about getting a script to do > two things at once. > like this. > > > for i in range(100): > print i > time.sleep(.2) > if i == 15: > os.system('python /home/me/ipupdate.py') > > print 'done' > > when i run this,

Re: [Tutor] how to make a script do two things at once.

2005-08-21 Thread nephish
Kent Johnson wrote: >nephish wrote: > > >>Hey there, >>i have a simple question about getting a script to do >>two things at once. >>like this. >> >> >>for i in range(100): >>print i >>time.sleep(.2) >>if i == 15: >>os.system('python /home/me/ipupdate.py') >> >>print '

Re: [Tutor] how to make a script do two things at once.

2005-08-21 Thread I-McTaggart, Peter
You might also try the following from the os module. (taken from the Python manuals.) This may be easier than getting your head around threads. - spawnl( mode, path, ...) spawnle( mode, path, ..., env) spawnlp( mode, file, ...) spawnlpe( mode, file, ..., env) s

[Tutor] Network Programming Information and terminology

2005-08-21 Thread John Walton
Hello. It's me again. Thanks for all the help with the Python Networking Resources, but does anyone know what I'll need to know to write a paper on Network Programming and Python. Like terminology and all that. Maybe I'll have a section on socketets, TCP, Clients (half of the stuff I don't even

Re: [Tutor] Network Programming Information and terminology

2005-08-21 Thread Byron
Hi John, Here is a link that you might find useful: *http://compnetworking.about.com/od/basicnetworkingconcepts/* --- Listed below are two very basic Python IM programs. You'll need to run the server first -- let it run in the background. Once this is running, start the second program, which

[Tutor] Importing serial module

2005-08-21 Thread Hans Dushanthakumar
Hi Folks Another newbie here :) Heres a couple of questions: 1) I downloaded the python serial port module (pyserial-2.2.win32.exe) from http://sourceforge.net/project/showfiles.php?group_id=46487 And installed it on my Win XP PC. However, when I try to import the module, I get the foll: err

Re: [Tutor] Importing serial module

2005-08-21 Thread Danny Yoo
On Mon, 22 Aug 2005, Hans Dushanthakumar wrote: > 1) I downloaded the python serial port module (pyserial-2.2.win32.exe) > from http://sourceforge.net/project/showfiles.php?group_id=46487 > And installed it on my Win XP PC. >However, when I try to import the module, I get the foll: error > >