Re: [Tutor] (no subject)

2005-05-25 Thread jfouhy
Quoting John Carmona <[EMAIL PROTECTED]>: > The next step is to use the built-in functin ord() in order to convert > each character to an ASCII integer. I have had a look at the ord() function > but it says that it only take one argument i.e. ord('a'). How could I > execute to convert each charact

[Tutor] (no subject)

2005-05-25 Thread John Carmona
With the help of Pujo Aji I have written this little script that print every single ASCII code>> S = [chr(x) for x in range (0,256)] for x in S: print x, The next step is to use the built-in functin ord() in order to convert each character to an ASCII integer. I have had a look at the ord()

[Tutor] Copy selected text of entry widget

2005-05-25 Thread Khrystyna Mandziy
Hi, all! How can be implemented copieng to clipboard of entry widget? This dosn't works self.selection = self.entry.get(SEL_FIRST, SEL_LAST) get takes only 1 arg. reg. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python won't play .wav file

2005-05-25 Thread Lee Harr
>>Strangely... I do not believe the wave module is meant to actually >>_play_ a wav file. It looks to me like it is only intended to read and >>parse the file for meta information. >> >>You could try passing the name of the file to another program >>via os.system, or you could use pygame. > >Ok

Re: [Tutor] Python Date picker

2005-05-25 Thread Lee Harr
>>>What I need to do is validate a date field (better if it's already done) >>>and >>>I want to know if anyone knows about a code to do that (a made code, >>>don't >>>mean you to do my work). I was hoping to find a calendar combo box as in >>>Visual Basic DropDown Calendar >>> >>> >>For which GUI s

Re: [Tutor] Am I making this harder than it needs to be?

2005-05-25 Thread Kent Johnson
Ron Phillips wrote: > short version: I need a way to get max and min E and N out of > [(E0,N0),(E1,N1)...(En,Nn)] without reordering the list not sure if your coordinates are strings like 'E0' or if that is a placeholder for an int. If they are ints you can use minE = min(e for e,n in coordLis

Re: [Tutor] Am I making this harder than it needs to be?

2005-05-25 Thread Ron Phillips
Oh, thanks! That didn't exactly do the trick, because I had data like [(1, 22),(2,11)], but from your code I came up with:       def getBB(self):    Es=[]    Ns=[]    for i in range(len(self)):    Es.append((self[i].E))    Ns.append((self[i].N))    self.boundingBo

Re: [Tutor] Covert numbers to hex fails

2005-05-25 Thread Tom Tucker
Alan, Thanks! Your response was helpful. I was trying to pass a number variable to the hex object. The output associated with this would be referenced in the hexoutput variable. I guess this is as simple as hexoutput = "%X" % (value) Thanks again for the help, Tom On 5/25/05, Alan G <[E

Re: [Tutor] Python won't play .wav file

2005-05-25 Thread Joseph Quigley
Hi, I'm replying to you both... At 03:16 PM 5/24/2005, you wrote: >Strangely... I do not believe the wave module is meant to actually >_play_ a wav file. It looks to me like it is only intended to read and >parse the file for meta information. > >You could try passing the name of the file to anoth

Re: [Tutor] Am I making this harder than it needs to be?

2005-05-25 Thread Pujo Aji
try this code: L = [(1,11),(2,22)] print max(L) print min(L) I don't know if that what you want. good luck pujo On 5/25/05, Ron Phillips <[EMAIL PROTECTED]> wrote: > > short version: I need a way to get max and min E and N out of > [(E0,N0),(E1,N1)...(En,Nn)] without reordering th

[Tutor] Am I making this harder than it needs to be?

2005-05-25 Thread Ron Phillips
short version: I  need a way to get max and min E and N out of [(E0,N0),(E1,N1)...(En,Nn)] without reordering the list   long version:   I would like a list of geographic coordinates (Easting, Northing) to maintain a "bounding box" [(minEasting,minNorthing),(maxEasting,maxNorthing)] attribute.  

Re: [Tutor] Exceptions and its error messages

2005-05-25 Thread Kent Johnson
Jonas Melian wrote: > I use i.e. with OSError exception the next error messages: > err_o.strerror, err_o.filename > > :: > try: > (os.listdir(x)) > except OSError, err_o: > print "Error! %s: %r" % (err_o.strerror, err_o.filename) > :: > > But how knowing all error messages from some modul

[Tutor] brief description of URL's

2005-05-25 Thread Lloyd Kvam
A sample URL http://www.mysite.com/path-to/file?arg1=stuff&arg2=morestuff http: scheme of URL (specifies protocol or processing) //www.mysite.comis the host. the name of the computer That host computer could be offering many services, web sites, email, time, etc. Each service is given

Re: [Tutor] Data base in XML

2005-05-25 Thread Jonas Melian
Kent Johnson wrote: >>I'm going to build a little data base in XML, with information about >>localization for each country. > > Why XML? You could use pickle or CSV or a real database... > I have choosed XML because it's designed as a universal data exchange format. _

Re: [Tutor] Exceptions and its error messages

2005-05-25 Thread Jonas Melian
Kent Johnson wrote: > Jonas Melian wrote: >> How to know all the exceptions that there are? (i.e. OSError, ImportError) > > Some library modules define their own exceptions such as socket.error so > the above is not a complete > list of exceptions defined in the standard distribution, just the one

Re: [Tutor] Data base in XML

2005-05-25 Thread Kent Johnson
Jonas Melian wrote: > Hi all, > > I'm going to build a little data base in XML, with information about > localization for each country. Why XML? You could use pickle or CSV or a real database... > Then, I'm in dude of using xml.sax (built in python) or elementtree. > Which do you recommend to me

Re: [Tutor] Exceptions and its error messages

2005-05-25 Thread Kent Johnson
Jonas Melian wrote: > How to know all the exceptions that there are? (i.e. OSError, ImportError) The built-in exceptions are documented here: http://docs.python.org/lib/module-exceptions.html Some library modules define their own exceptions such as socket.error so the above is not a complete li

Re: [Tutor] Exceptions and its error messages

2005-05-25 Thread jfouhy
Quoting Jonas Melian <[EMAIL PROTECTED]>: > How to know all the exceptions that there are? (i.e. OSError, > ImportError) Check the Python library reference (on python.org); section 2.4: Built-in exceptions. Of course, you can subclass Exception to build your own! -- John. _

[Tutor] Data base in XML

2005-05-25 Thread Jonas Melian
Hi all, I'm going to build a little data base in XML, with information about localization for each country. Then, I'm in dude of using xml.sax (built in python) or elementtree. Which do you recommend to me? And is it necessary build a DTD or Schema file? Thanks in advance!

[Tutor] Exceptions and its error messages

2005-05-25 Thread Jonas Melian
Hi, How to know all the exceptions that there are? (i.e. OSError, ImportError) And all error messages of each exception? (i.e. err_o.strerror, err_o.filename) Thanks in advance! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/list

Re: [Tutor] xml

2005-05-25 Thread Roel Schroeven
D. Hartley wrote: > And just in case anyone *isnt* working on the riddles: > > anyone have a pointer to a *SIMPLE* intro to xml as used in python? I > looked in the library and there are about 11 xml-related modules. > > Perhaps something 'remote'. ;) The 'remote' is the key indeed.

Re: [Tutor] Covert numbers to hex fails

2005-05-25 Thread Alan G
> Good evening! I am trying to pass a number variable and have it > converted to hex. Any recommendations on how to achieve this? You appear to have answered your own question below. What exactly is the problem? FAILS -- >>> value = 1234567890 >>> hexoutput = hex('%d' % (value)) WOR

Re: [Tutor] xml

2005-05-25 Thread Alan G
Hi Denise, Sounds like you need a tutor on the basics of the web rather than one on the Python aspects. It seems you are not familiar with the web terminology and therefore can't understand the explanations in the Python docs. I'll try to help with a few specifics here but you probably need to go