Re: unicode question

2006-02-25 Thread Tim Roberts
Edward Loper [EMAIL PROTECTED] wrote: I would like to convert an 8-bit string (i.e., a str) into unicode, treating chars \x00-\x7f as ascii, and converting any chars \x80-xff into a backslashed escape sequences. I.e., I want something like this: decode_with_backslashreplace('abc \xff\xe8

Re: Exception not raised

2006-02-25 Thread Michele Petrazzo
Diez B. Roggisch wrote: This code are inside a method into class that have no try/except. And called from a method inside a wx.Frame derivate. The other strange thing is that if I try the same code just before the caller to that method, it raise an exception: So maybe the C-layer of wx

Multiple threaded download streams?

2006-02-25 Thread gjzusenet
Hello. Though Python supports threading, I think it is limited to python code - as soon as you issue a command that uses an external (C?) module, all of your python threads hang until this command returns. Is that true? I'm using urllib2 to download many files, and I have a double problem: 1.

Re: How to send an email with non-ascii characters in Python

2006-02-25 Thread Sybren Stuvel
Lad enlightened us with: Body='Rídících Márinka a Školák Kája Marík'.decode('utf8').encode('windows-1250')# I use the text written in my editor with utf-8 coding, so first I decode and then encode to windows-1250 Why would you do that? What's the advantage of windows-1250? Sybren -- The

Import in a separate thread

2006-02-25 Thread cyberco
I want to import a long list of modules in a separate thread to speed things up. How can I make the modules imported in that separate thread accessible outside the method? === import os # import rest in a separate thread def importRest(): import audio import

Re: Import in a separate thread

2006-02-25 Thread Paul Rubin
cyberco [EMAIL PROTECTED] writes: I want to import a long list of modules in a separate thread to speed things up. How can I make the modules imported in that separate thread accessible outside the method? It won't speed things up unless the main thread is waiting for user input during those

Re: Import in a separate thread

2006-02-25 Thread Peter Hansen
cyberco wrote: I want to import a long list of modules in a separate thread to speed things up. How can I make the modules imported in that separate thread accessible outside the method? Sounds like premature optimization. Speed things up? What things? How long is it taking now to load the

Re: python-list/python-dev quoting style

2006-02-25 Thread Grant Edwards
On 2006-02-25, Michael Hoffman [EMAIL PROTECTED] wrote: And who is me, anyway? It's hard to believe that you don't understand who me is in a conversation between two people, Since when is a Usenet news group a conversation between two people? one of whom is identified as Aahz and is

Re: Multiple threaded download streams?

2006-02-25 Thread Grant Edwards
On 2006-02-25, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Though Python supports threading, I think it is limited to python code - as soon as you issue a command that uses an external (C?) module, all of your python threads hang until this command returns. Is that true? No. Not unless the C

Re: Multiple threaded download streams?

2006-02-25 Thread Diez B. Roggisch
Use a separate thread for downloading. Or the twisted select-reactor. No threads needed. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: graph display(please help)

2006-02-25 Thread Mladen Adamovic
questions? wrote: I heard from my friend who used to program in JAVA, it is really easy to do graph display in JAVA. Thanks for any suggestions!!! Jython -- Mladen Adamovic home page: http://home.blic.net/adamm -- http://mail.python.org/mailman/listinfo/python-list

Re: Import in a separate thread

2006-02-25 Thread Paul Rubin
Peter Hansen [EMAIL PROTECTED] writes: Sounds like premature optimization. Speed things up? What things? How long is it taking now to load the modules you are loading? Even the wxPython demo takes only a few seconds to load on a decent machine, and that's loading a *heck* of a lot of stuff.

Re: Using ElementTree to tidy up an XML string to my liking

2006-02-25 Thread Richard Townsend
On Fri, 24 Feb 2006 18:21:59 +0100, Magnus Lycka wrote: Concerning element names, it's your coice of course, but I agree more and more with Guido and PEP008 that camelCase is ugly. (Not that ALLCAPS is better...) I can see in PEP008 where it says Capitalized_Words_With_Underscores is ugly,

Problem with Property

2006-02-25 Thread none
I'm trying to implement a simple repeateable property mechansism so I don't have to write accessors for every single instance variable I have. classMyObject: def __init__ (self): self.initialize() def initialize(self): self._value=None def

Re: Best python module for Oracle, but portable to other RDBMSes

2006-02-25 Thread dananrg
Thanks Olivier and Jonathan. Do either of you, or anyone else, know of a good open source data modeling / ER-diagram / CASE tools? I'd like to be able to build relatively simple schemas in one open source tool and be able to create a database on different platforms as needed (e.g. MySQL,

Re: Module written in C does not repond to Ctrl-C interruption.

2006-02-25 Thread Daniel Dittmar
Bo Peng wrote: Daniel Dittmar wrote: You could set up your own signal handler when entering the C extension. This should abort the extension (tricky) and call the Python signal handler. This can be done under linux using things in signal.h but I am not sure whether or not there is a

Re: PyUNO with different Python

2006-02-25 Thread M�ta-MCI
h... I can run OK hello_world.py. But only with Python-core-2.3 Python 2.4 don't run (conflict-version, or windows error). And, it's not possible to install extensions (like PyWin) to Python-core-2.3 (this destroy the same extensions in my normal Python 2.4) I had let down these aspects

Re: [Python-de] PyUNO with different Python

2006-02-25 Thread M�ta-MCI
Bonjour ! J'ai des problèmes/besoins similaires. Mais, désolé, je ne parle pas allemand... @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

A bit off topic, but good web hosting for PostgreSQL/Python?

2006-02-25 Thread dananrg
Seems like most web hosting providers support MySQL, but not PostgreSQL. I need a web hosting account that supports PostgreSQL for a particular personal project I'm working on (as well as Python, natch), since PostGIS runs only on PostgreSQL. PostGIS is a nice open source spatial database

Re: python-list/python-dev quoting style

2006-02-25 Thread Michael Hoffman
[Aahz] And who is me, anyway? [me] It's hard to believe that you don't understand who me is in a conversation between two people, [Grant Edwards] Since when is a Usenet news group a conversation between two people? Now there are three. At that time only two people had participated in this

Re: Problem with Property

2006-02-25 Thread André Malo
* none wrote: classMyObject: [...] As you can see, the _getProperty() method gets called properly when I do 'o.value' but 'o.value = 123' does not seem to use the property stucture. I can't figure out why 'o.value=123' does not call _setProperty() Any ideas? property only works as

Is Python a Zen language?

2006-02-25 Thread John Coleman
Greetings, I have a rough classification of languages into 2 classes: Zen languages and tool languages. A tool language is a language that is, well, a *tool* for programming a computer. C is the prototypical tool language. Most languages in the Algol family are tool languages. Visual Basic and

Re: Multiple threaded download streams?

2006-02-25 Thread Peter Hansen
Diez B. Roggisch wrote: Use a separate thread for downloading. Or the twisted select-reactor. No threads needed. Although depending on what the GUI is like, and what platform is involved, one might still want at least a second thread for the reactor itself. -Peter --

Re: Problem with Property

2006-02-25 Thread Steve Holden
none @bag.python.org wrote: I'm trying to implement a simple repeateable property mechansism so I don't have to write accessors for every single instance variable I have. Please don't do that. The Python way is to use direct access to instance variables unless there's a good reason not to.

Re: Problem with Property

2006-02-25 Thread none
André Malo wrote: * none wrote: classMyObject: [...] As you can see, the _getProperty() method gets called properly when I do 'o.value' but 'o.value = 123' does not seem to use the property stucture. I can't figure out why 'o.value=123' does not call _setProperty() Any ideas?

Re: Problem with Property

2006-02-25 Thread none
André Malo wrote: * none wrote: classMyObject: [...] As you can see, the _getProperty() method gets called properly when I do 'o.value' but 'o.value = 123' does not seem to use the property stucture. I can't figure out why 'o.value=123' does not call _setProperty() Any ideas?

Re: Problem with Property

2006-02-25 Thread Felipe Almeida Lessa
Em Sáb, 2006-02-25 às 09:14 -0500, Steve Holden escreveu: It seems particularly odd to want to put getters and setters behind property access. What does the extra layer buy you? I can only think of some kind of debugging. Maybe? regards Steve Cya, Felipe. -- Quem excele em empregar a

Re: Problem with Property

2006-02-25 Thread Peter Hansen
none @bag.python.org wrote: I'm trying to implement a simple repeateable property mechansism so I don't have to write accessors for every single instance variable I have. ... Any ideas? Yes, don't write accessors for every single instance variable you have. In some languages that might be

Re: Is Python a Zen language?

2006-02-25 Thread Ron Stephens
Actually, Python has the distinction of being both a great tool language *and* a great Zen language. That's what makes Python so cool ;-))) Ron Stephens Python411 www.awaretek.com/python/index.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with Property

2006-02-25 Thread none
Steve Holden wrote: none @bag.python.org wrote: It seems particularly odd to want to put getters and setters behind property access. What does the extra layer buy you? The purpose is that there is more to the accessors then I posted. The setters do some 'mark dirty' bookeeping whenever the

Re: Pure python implementation of string-like class

2006-02-25 Thread and-google
Akihiro KAYAMA wrote: As the character set is wider than UTF-16(U+10), I can't use Python's native unicode string class. Have you tried using Python compiled in Wide Unicode mode (--enable-unicode=ucs4)? You get native UTF-32/UCS-4 strings then, which should be enough for most purposes. --

Re: Is Python a Zen language?

2006-02-25 Thread Alex Martelli
Mu. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a Zen language?

2006-02-25 Thread John Coleman
Ron Stephens wrote: Actually, Python has the distinction of being both a great tool language *and* a great Zen language. That's what makes Python so cool ;-))) Ron Stephens Python411 www.awaretek.com/python/index.html This would explain why the question is so hard to answer. It is a

Re: python-list/python-dev quoting style

2006-02-25 Thread Steve Holden
Some lurker calling himself me wrote: [Aahz] And who is me, anyway? [me] It's hard to believe that you don't understand who me is in a conversation between two people, [Grant Edwards] Since when is a Usenet news group a conversation between two people? Now there are three. At

Re: Pure python implementation of string-like class

2006-02-25 Thread Steve Holden
Akihiro KAYAMA wrote: Hi all. I would like to ask how I can implement string-like class using tuple or list. Does anyone know about some example codes of pure python implementation of string-like class? Because I am trying to use Python for a text processing which is composed of a large

Re: Import in a separate thread

2006-02-25 Thread cyberco
Well, it is for the python implementation for Nokia Series 60 phones, and loading lots of modules in such constrained environments can certainly slow things down. The splashscreen idea is what I want to do, but that requires the loading to continue in a background thread. --

Re: Multiple threaded download streams?

2006-02-25 Thread Bryan Olson
Diez B. Roggisch wrote: Use a separate thread for downloading. Or the twisted select-reactor. No threads needed. He's using urllib2, which does not use Twisted's select-reactor. Fortunately urllib2 downloads run fine in their own threads; no rewrite-all-the-code-as-Twisted-state-machines

Re: Is Python a Zen language?

2006-02-25 Thread [EMAIL PROTECTED]
GEB perhaps? -- http://mail.python.org/mailman/listinfo/python-list

Re: python-list/python-dev quoting style

2006-02-25 Thread Grant Edwards
On 2006-02-25, Steve Holden [EMAIL PROTECTED] wrote: [Aahz] And who is me, anyway? [me] It's hard to believe that you don't understand who me is in a conversation between two people, [Grant Edwards] Since when is a Usenet news group a conversation between two people? Now there are

Re: unicode question

2006-02-25 Thread Kent Johnson
Edward Loper wrote: I would like to convert an 8-bit string (i.e., a str) into unicode, treating chars \x00-\x7f as ascii, and converting any chars \x80-xff into a backslashed escape sequences. I.e., I want something like this: decode_with_backslashreplace('abc \xff\xe8 def') u'abc

Re: Import in a separate thread

2006-02-25 Thread Kent Johnson
cyberco wrote: I want to import a long list of modules in a separate thread to speed things up. How can I make the modules imported in that separate thread accessible outside the method? === import os # import rest in a separate thread def importRest():

Re: Multiple threaded download streams?

2006-02-25 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hello. Though Python supports threading, I think it is limited to python code - as soon as you issue a command that uses an external (C?) module, all of your python threads hang until this command returns. Is that true? I'm using urllib2 to download many files, and I

Re: Is Python a Zen language?

2006-02-25 Thread Max Erickson
Given that python code is often described in terms of being 'pythonic' or not, and that pythonic is a term that is apparently well agreed upon yet seemingly impossible to define for someone who does not already understand the word, python is probably a zen language. max --

Re: Is Python a Zen language?

2006-02-25 Thread Kent Johnson
John Coleman wrote: Greetings, I have a rough classification of languages into 2 classes: Zen languages and tool languages. A tool language is a language that is, well, a *tool* for programming a computer. C is the prototypical tool language. Most languages in the Algol family are tool

Can optparse do dependencies?

2006-02-25 Thread Bob
I'd like to setup command line switches that are dependent on other switches, similar to what rpm does listed below. From the grammar below we see that the query-options are dependent on the query switch, {-q|--query}. Can optparse do this or do I have to code my own thing? Thanks. QUERYING AND

Re: Pure python implementation of string-like class

2006-02-25 Thread Akihiro KAYAMA
Hi bearophile. In article [EMAIL PROTECTED], [EMAIL PROTECTED] writes: bearophileHUGS Maybe you can create your class using an array of 'L' with the array bearophileHUGS standard module. Thanks for your suggestion. I'm currently using an usual list as a internal representation. According to my

Re: Pure python implementation of string-like class

2006-02-25 Thread Akihiro KAYAMA
Hi And. In article [EMAIL PROTECTED], [EMAIL PROTECTED] writes: and-google Akihiro KAYAMA wrote: and-google As the character set is wider than UTF-16(U+10), I can't use and-google Python's native unicode string class. and-google and-google Have you tried using Python compiled in Wide

Re: Is Python a Zen language?

2006-02-25 Thread Twig
What is zen? Is it something eatible (I'm hungry now)? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a Zen language?

2006-02-25 Thread Twig
Kent Johnson wrote: Expanding on what Alex said :-) *snip* Python is an excellent tool language, it is very pragmatic and powerful *snip* Kent It's a good axe, Muddy waters said about his guitar when asked by some heavy-mega guitar hero. Python is practical tool for practical

Re: Is Python a Zen language?

2006-02-25 Thread Terry Reedy
John Coleman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] an interesting statement and question. ... So (assuming my classification makes sense) which is Python? The emphasis on simplicity and the beginner-friendly nature of it seems to put it in the tool category. On the other

Re: Is Python a Zen language?

2006-02-25 Thread Luis M. González
I don't know if python is Zend. It's quite minimalistic and it flows very well, so I guess it is a... Feng-shui language? -- http://mail.python.org/mailman/listinfo/python-list

Re: A bit off topic, but good web hosting for PostgreSQL/Python?

2006-02-25 Thread Francisco Reyes
[EMAIL PROTECTED] writes: Seems like most web hosting providers support MySQL, but not PostgreSQL. There are actually many. Two that I personally have experience with: http://hub.org http://bizintegrators.com They both support PostgreSQL. Not sure on their python support, but I believe they

Re: Pure python implementation of string-like class

2006-02-25 Thread Ross Ridge
Steve Holden wrote: Wider than UTF-16 doesn't make sense. It makes perfect sense. Ross Ridge -- http://mail.python.org/mailman/listinfo/python-list

Grabbing a object from the current code block using a callable statement?

2006-02-25 Thread ChaosKCW
Hi Is it possible to grab get an object returned from a string and a callable ? e.g I pass in a key value pair: def somemethod(adict = {'new name for object': 'code to reutrn obejct'}): object = . for key, value in adict.items(): if callable(value): somedict[key] =

Re: Is Python a Zen language?

2006-02-25 Thread Bryan Olson
John Coleman wrote: I have a rough classification of languages into 2 classes: Zen languages and tool languages. A tool language is a language that is, well, a *tool* for programming a computer. C is the prototypical tool language. Most languages in the Algol family are tool languages.

Re: python-list/python-dev quoting style

2006-02-25 Thread Michael Hoffman
Grant Edwards wrote: On 2006-02-25, Steve Holden [EMAIL PROTECTED] wrote: [me] It's hard to believe that you don't understand who me is in a conversation between two people, [me] Is there really confusion about who me is? I find that mystifying. [Grant Edwards] And now none of us have any way

Re: PyGTK + Glade = weird problem

2006-02-25 Thread sapo
Finally solved this stuff, the problem wasnt with glade, the problem was that i was using the destroy event in glade, i just changed the destroy to delete-event and it worked like a charm. thanx :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Path (graph) shower utility

2006-02-25 Thread Jorgen Grahn
On Wed, 22 Feb 2006 11:31:15 +0100, Durumdara [EMAIL PROTECTED] wrote: Hi ! I need to create a program that read eml file headers, analyze the You mean email. Took me some time to figure out. receive tags and create a path database. I finished

Re: Path (graph) shower utility

2006-02-25 Thread bearophileHUGS
Thank you Jorgen, now I understand the question, and the answer isn't difficult :-) Graphviz is good enough for this purpose. but IIRC there are Python bindings for it as well. Durumdara can use an email module to extract data, then a graph library to create the graph, and then save the result

Re: Is Python a Zen language?

2006-02-25 Thread Jorgen Grahn
On Sat, 25 Feb 2006 18:31:33 GMT, Bryan Olson [EMAIL PROTECTED] wrote: ... I think that's a horrible classification. Every language is both. I agree; it's horrible as a classification. But it's interesting concepts. One might use them to discuss the design of various languages, and how the

Re: Is Python a Zen language?

2006-02-25 Thread John Coleman
Bryan Olson wrote: John Coleman wrote: I have a rough classification of languages into 2 classes: Zen languages and tool languages. A tool language is a language that is, well, a *tool* for programming a computer. C is the prototypical tool language. Most languages in the Algol family

Re: spaces at ends of filenames or directory names on Win32

2006-02-25 Thread drobinow
For example... tell windows to move a file named ' XXX ' (one space before and one space after the filename). Windows will complain that file 'XXX' does not exist. It's correct of course, 'XXX' does not exist, but ' XXX ' does indeed exist. Can anyone rescue me from this madness :( - Please

Re: remote module importing (urlimport)

2006-02-25 Thread EP
ajones wrote: What plans do you have for security in this? I would think that in order to trust this over the network you would at least need a certificate identifying the server as well as some method of verifying package contents. Either way, cool stuff. I think this is an interesting

Editable lists in pygtk - Editing wrong cell

2006-02-25 Thread sapo
Hi all, i m trying to make an editable list with a toggle button, it shows up and i can edit the list.. but its editing the wrong cell! If i click on the toggle button on the first cell it sets FALSE on the last cell of that row, if i change the text of the last cell if changes another cell

Re: Can optparse do dependencies?

2006-02-25 Thread Raymond Hettinger
[Bob] I'd like to setup command line switches that are dependent on other switches, similar to what rpm does listed below. From the grammar below we see that the query-options are dependent on the query switch, {-q|--query}. Can optparse do this or do I have to code my own thing? Thanks.

Re: Optimize flag question

2006-02-25 Thread Raymond Hettinger
[Olivier Langlois] So my question is: what are the 'optimizations' that the Python interpreter is doing when you specify the optimize flag and is there anything I should be cautious about when using it? Currently, -O provides no optimizations other than eliminating assertions. Raymond --

Re: Pure python implementation of string-like class

2006-02-25 Thread Ross Ridge
Steve Holden wrote: Wider than UTF-16 doesn't make sense. Ross Ridge wrote It makes perfect sense. Alan Kennedy wrote: UTF-16 is a Unicode Transcription Format, meaning that it is a mechanism for representing all unicode code points, even the ones with ordinals greater than 0x, using

Re: Grabbing a object from the current code block using a callable statement?

2006-02-25 Thread Larry Bates
ChaosKCW wrote: Hi Is it possible to grab get an object returned from a string and a callable ? e.g I pass in a key value pair: def somemethod(adict = {'new name for object': 'code to reutrn obejct'}): object = . for key, value in adict.items(): if

Re: Is Python a Zen language?

2006-02-25 Thread Kay Schluehr
John Coleman wrote: Ron Stephens wrote: Actually, Python has the distinction of being both a great tool language *and* a great Zen language. That's what makes Python so cool ;-))) Ron Stephens Python411 www.awaretek.com/python/index.html This would explain why the question is so

Re: Concantenation and string slicing

2006-02-25 Thread Larry Bates
Dennis Lee Bieber wrote: On Thu, 23 Feb 2006 18:06:46 -0600, Larry Bates [EMAIL PROTECTED] declaimed the following in comp.lang.python: Better was is: message = raw_input(Enter a message: ) print message[::-1] I sometimes get the feeling a lot of responses to newbies, lately,

Re: Optimize flag question

2006-02-25 Thread Steve Holden
[copied to python-list] Olivier Langlois wrote: Hi Steve! Could you outline the code that needs to be in to make the program work, so we can assess the errors for ourselves? There is nothing unfixable. There are some instances where the code is checking a function return value

Re: spaces at ends of filenames or directory names on Win32

2006-02-25 Thread Larry Bates
Jeffrey Schwab wrote: Larry Bates wrote: IMHO leading and/or trailing spaces in filenames is asking for incompatibilities with cross-platform file access. With what platforms specifically? Much like using single-quote in filenames which are perfectly legal in DOS/Windows, but Linux

Re: spaces at ends of filenames or directory names on Win32

2006-02-25 Thread Larry Bates
Steven D'Aprano wrote: On Thu, 23 Feb 2006 17:49:31 -0600, Larry Bates wrote: Steven D'Aprano wrote: On Thu, 23 Feb 2006 14:30:22 -0600, Larry Bates wrote: How about not naming files with leading and trailing spaces on the Mac? Seems like a bad habit that needs breaking ;-). Why is it a

Re: Is Python a Zen language?

2006-02-25 Thread none
John Coleman wrote: Bryan Olson wrote: John Coleman wrote: I have a rough classification of languages into 2 classes: Zen languages and tool languages. A tool language is a language that is, well, a *tool* for programming a computer. C is the prototypical tool language. Most languages in

looking for a simpe plotting module

2006-02-25 Thread MARK LEEDS
i'm pretty much a python beginner so can anyone recommend a plooting package in python ( simple foating numbers that makes lines or dots with a yaxis and an an xaxis.i don't need fancy drawings ) that is a built in module in python ? i am using python 2.4 in linux if that matters. thanks.

Re: Is Python a Zen language?

2006-02-25 Thread Paul Rubin
Kay Schluehr [EMAIL PROTECTED] writes: I have at times the impression that many people who talk about Zen philosophy confuse it with some home brewn mixture of platonism with its transgressive move towards the true reality, a stoic hedonism of contemplation and the taoistic being-in-doing. Zen

Re: looking for a simpe plotting module

2006-02-25 Thread Henrique Ferreiro
matplotlib is an excellent library which uses the syntax of matlab plots. http://matplotlib.sourceforge.net O Sáb, 25-02-2006 ás 15:01 -0800, MARK LEEDS escribiu: i'm pretty much a python beginner so can anyone recommend a plooting package in python ( simple foating numbers that makes lines

Re: How to send an email with non-ascii characters in Python

2006-02-25 Thread Gabriel B.
2006/2/25, Sybren Stuvel [EMAIL PROTECTED]: Lad enlightened us with: Body='Rídících Márinka a Školák Kája Marík'.decode('utf8').encode('windows-1250')# I use the text written in my editor with utf-8 coding, so first I decode and then encode to windows-1250 what does a string became when

Modify the local scope inside a function

2006-02-25 Thread Sandra-24
Is there a way in python to add the items of a dictionary to the local function scope? i.e. var_foo = dict['var_foo']. I don't know how many items are in this dictionary, or what they are until runtime. exec statements are difficult for debuggers to deal with, so as a workaround I built my code

Re: Can optparse do dependencies?

2006-02-25 Thread Giovanni Bajo
Raymond Hettinger wrote: I'd like to setup command line switches that are dependent on other switches, similar to what rpm does listed below. From the grammar below we see that the query-options are dependent on the query switch, {-q|--query}. Can optparse do this or do I have to code my own

Re: Pure python implementation of string-like class

2006-02-25 Thread Xavier Morel
Akihiro KAYAMA wrote: Sorry for my terrible English. I am living in Japan, and we have a large number of characters called Kanji. UTF-16(U+...U+10) is enough for practical use in this country also, but for academic purpose, I need a large codespace over 20-bits. I wish I could use

Re: Pure python implementation of string-like class

2006-02-25 Thread Xavier Morel
Ross Ridge wrote: Steve Holden wrote: Wider than UTF-16 doesn't make sense. It makes perfect sense. Ross Ridge Not if you're still within Unicode / Universal Character Set code space. While UCS-4 technically goes beyond any

Re: groupwise send mail

2006-02-25 Thread Max M
[EMAIL PROTECTED] wrote: Can someone give me an idea as to why this is not working? The Recipients.Add line doesnt cause an error, but my recipients arent being used. The email never gets sent because there is no recipeients. Thanks, Eric import win32com.client gwApp =

Re: spaces at ends of filenames or directory names on Win32

2006-02-25 Thread Jeffrey Schwab
Larry Bates wrote: Jeffrey Schwab wrote: Larry Bates wrote: IMHO leading and/or trailing spaces in filenames is asking for incompatibilities with cross-platform file access. With what platforms specifically? Much like using single-quote in filenames which are perfectly legal in

xslt queries in xml to SQL queries

2006-02-25 Thread Ian Roddis
Hello, I want to embed SQL type queries within an XML data record. The XML looks something like this: DISPLAYPAGE FIELD NAME=SERVER TYPE=DROPDOWN OPTION1OPTION OPTION2OPTION OPTION3OPTION /FIELD /DISPLAYPAGE I want to populate

Re: Pure python implementation of string-like class

2006-02-25 Thread Ross Ridge
Xavier Morel wrote: Not if you're still within Unicode / Universal Character Set code space. Akihiro Kayama in his original post made it clear that he wanted to use a character set larger than entire Unicode code space. Ross Ridge --

ImportError in Unpickle

2006-02-25 Thread [EMAIL PROTECTED]
Hi, I have a python script that pickles and unpickles a give object. It works without any problems on windows (the data was pickled on windows first). But when I try to run the script on Linux, I get the following error: mydbinfo = pickle.Unpickler(f).load() File

Re: Optimize flag question

2006-02-25 Thread bonono
Steve Holden wrote: Some other functions rely on the AssertionError exception to indicate to the user that something went wrong instead of using a user defined exception. The real problem here is that you appear to be using AssertionError in an inappropriate way. If some caller passes

How to Mount/Unmount Drives on Windows?

2006-02-25 Thread dpickles
Hello, I am creating a simple application that will reside in the Windows system tray. The purpose of the program is to mount or unmount external hard drives or flash memory devices, and to set their default states (ie mounted or unmounted) at startup. I do not know how to mount or unmount

Pythonic exceptionalism (was: A C-like if statement)

2006-02-25 Thread Cameron Laird
In article [EMAIL PROTECTED], Steven D'Aprano [EMAIL PROTECTED] wrote: On Thu, 23 Feb 2006 12:04:38 -0700, Bob Greschke wrote: try: i = a.find(3) print It's here: , i except NotFound: print No 3's here Nuts. I guess you're right. It wouldn't be proper. Things are added or

Re: How to Mount/Unmount Drives on Windows?

2006-02-25 Thread shearichard
This looks like it might help you ... http://support.microsoft.com/?kbid=311272 ... although the blurb does say DevCon is not redistributable. It is provided for use as a debugging and development tool. There is an article about it at ... http://tinyurl.com/4kb8m regards richard. --

Re: Temporary Variable

2006-02-25 Thread Steven D'Aprano
On Fri, 24 Feb 2006 14:08:22 -0800, darthbob88 wrote: Reply to all: I realize that naming a variable spam is not entirely kosherized. It was originally named secret, but I renamed it in a fit of whimsy. The language is named after Monty Python's Flying Circus, is it not? Remember the Spam

Re: Temporary Variable

2006-02-25 Thread Terry Hancock
On 24 Feb 2006 14:08:22 -0800 [EMAIL PROTECTED] wrote: Reply to all: I realize that naming a variable spam is not entirely kosherized. In fact this is untrue: It is an official rule straight from the BDFL himself that example programs should contain words like spam, ham, eggs from the spam

Re: Optimize flag question

2006-02-25 Thread Steven D'Aprano
On Sat, 25 Feb 2006 17:56:42 -0800, bonono wrote: Steve Holden wrote: Some other functions rely on the AssertionError exception to indicate to the user that something went wrong instead of using a user defined exception. The real problem here is that you appear to be using

Re: Is Python a Zen language?

2006-02-25 Thread Steven D'Aprano
On Sat, 25 Feb 2006 06:09:16 -0800, John Coleman wrote: Greetings, I have a rough classification of languages into 2 classes: Zen languages and tool languages. A tool language is a language that is, well, a *tool* for programming a computer. C is the prototypical tool language. Most

Re: How to send an email with non-ascii characters in Python

2006-02-25 Thread Kent Johnson
Gabriel B. wrote: what does a string became when it's decoded? I mean, it must be encoded in something, right? Unicode, for encodings like latin-1 or utf-8. A few special cases like str.decode('string_escape') yield byte strings again. Kent --

Re: Modify the local scope inside a function

2006-02-25 Thread Crutcher
Here you go. Unfortunate that you can't modify locals() easily, but there are other options. def foo(d): for k in d: exec '%s = %s' % (k, repr(d[k])) print a + b foo({'a':1, 'b':2}) -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a Zen language?

2006-02-25 Thread The Eternal Squire
Kay Schluehr wrote: John Coleman wrote: Ron Stephens wrote: Actually, Python has the distinction of being both a great tool language *and* a great Zen language. That's what makes Python so cool ;-))) Ron Stephens Python411 www.awaretek.com/python/index.html This would

Looking a device up in the Running Object Table

2006-02-25 Thread Lunchtimemama
I'm looking to disable Windows autoplay for a particular device. There's a registry key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\CancelAutoplay\CLSID) that will turn off autoplay for listed devices, but one must provide the device's CLSID as it

Re: Modify the local scope inside a function

2006-02-25 Thread Jason Mobarak
Sandra-24 wrote: Is there a way in python to add the items of a dictionary to the local function scope? i.e. var_foo = dict['var_foo']. I don't know how many items are in this dictionary, or what they are until runtime. Why do you want to do this? Exec and eval should -not- be used for this

  1   2   >