Re: [Tutor] Rock, Paper, Scissors

2006-08-10 Thread John Fouhy
Hi Chris, On 11/08/06, Christopher Spears <[EMAIL PROTECTED]> wrote: >def plays(self): >self.choice = raw_input("Pick (R)ock, (P)aper, or > (S)cissors! ") >if self.choice == 'r': >self.choice = 'rocks' >elif self.choic

[Tutor] Rock, Paper, Scissors

2006-08-10 Thread Christopher Spears
Here is my Rock,Paper,Scissors script: #!/usr/bin/python import random random.seed() class Human: def __init__(self): self.points = 0 self.choice = " " def plays(self): self.choice = raw_input("Pick (R)ock, (P)aper,

Re: [Tutor] i18n Encoding/Decoding issues

2006-08-10 Thread Danny Yoo
On Thu, 10 Aug 2006, anil maran wrote: > how do u find out original encoding Read: http://www.joelonsoftware.com/articles/Unicode.html In short: there's no good, reliable way to guess the encoding. But there should be no need to guess: a proper document will have the encoding explici

Re: [Tutor] i18n Encoding/Decoding issues

2006-08-10 Thread anil maran
how do u find out original encodingthanksMichael Lange <[EMAIL PROTECTED]> wrote: Hi Jorge,On Thu, 10 Aug 2006 13:32:10 +0100"Jorge De Castro" <[EMAIL PROTECTED]> wrote:(...)> > Using unicode(body, 'latin-1').encode('utf-8') doesn't work either. Besides, > am I the only one to feel that if I want t

Re: [Tutor] wx.Notebook query in wxpython

2006-08-10 Thread John Fouhy
On 11/08/06, Amresh Kulkarni <[EMAIL PROTECTED]> wrote: > I am developing a GUI which has a notebook with multiple tabs. The tabs are > formed by adding pages to the notebook. > I have a check menu to select/deselect the tabs(pages) i want. On checking > on an item it will must show the respective

Re: [Tutor] i18n Encoding/Decoding issues

2006-08-10 Thread Michael Lange
Hi Jorge, On Thu, 10 Aug 2006 13:32:10 +0100 "Jorge De Castro" <[EMAIL PROTECTED]> wrote: (...) > > Using unicode(body, 'latin-1').encode('utf-8') doesn't work either. Besides, > am I the only one to feel that if I want to encode something in UTF-8 it > doesn't feel intuitive to have to conve

Re: [Tutor] python import problem

2006-08-10 Thread Alan Gauld
>> The other way would be to add each folder to >> your PYTHONPATH >It works for me now: >import sys >import os.path >sys.path.append(os.path.join(sys.path[0] ,"translate")) That isn't using PYTHONPATH its updaing sys.path which is slightly different.. This way you need to do that for every pro

[Tutor] wx.Notebook query in wxpython

2006-08-10 Thread Amresh Kulkarni
Hi all,I am developing a GUI which has a notebook with multiple tabs. The tabs are formed by adding pages to the notebook.I have a check menu to select/deselect the tabs(pages) i want. On checking on an item it will must show the respective tab and unchecking should hide it. Simple as it may sound,

Re: [Tutor] [tutor] ipconfig

2006-08-10 Thread andrew clarke
On Thu, Aug 10, 2006 at 04:47:43PM +0300, [EMAIL PROTECTED] wrote: > is there in python an independent from the system way to obtain the IP >>> import socket >>> hostname = socket.gethostname() >>> ip = socket.gethostbyname(hostname) >>> print ip 192.168.1.10 _

Re: [Tutor] [tutor] ipconfig

2006-08-10 Thread Jason Massey
I found this on an artima forum:http://www.artima.com/forums/flat.jsp?forum=181&thread=113874 This worked on my machine (win xp):socket.getaddrinfo(socket.gethostname(), None)[0][4][0]On 8/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:hello list is there in python an independent from the syst

[Tutor] [tutor] ipconfig

2006-08-10 Thread emilia12
hello list is there in python an independent from the system way to obtain the IP i am playng around import sys import os ipconfname={'nt':'ipconfig', 'posix':'ifconfig'} ipstr = os.popen(ipconfname[os.name] ).read() #print ipstr but i found out that answer depends on os.name ... in this case

[Tutor] i18n Encoding/Decoding issues

2006-08-10 Thread Jorge De Castro
Hi all, It seems I can't get rid of my continuous issues i18n with Python :( I've been through: http://docs.python.org/lib/module-email.Header.html and http://www.reportlab.com/i18n/python_unicode_tutorial.html to no avail. Basically, I'm receiving and processing mail that comes with content (fr