Re: Queue cleanup

2010-08-31 Thread Paul Rubin
Lawrence D'Oliveiro writes: > And yet Java code, for example, doesn’t have a reputation for greater > reliability compared to, say code written in Ada or C++, or even C. What is > the Java runtime written in? C. Why not use Java, if there is no speed > penalty in doing so? The Java runtime (su

Re: Performance: sets vs dicts.

2010-08-31 Thread Paul Rubin
Terry Reedy writes: > Does anyone seriously think that an implementation should be rejected > as an implementation if it intellegently did seq[n] lookups in > log2(n)/31 time units for all n (as humans would do), instead of > stupidly taking 1 time unit for all n < 2**31 and rejecting all larger >

Re: Installing Python as Scripting Language in IIS

2010-08-31 Thread Michel Claveau - MVP
Re ! More details: C:\Python26\Lib\site-packages\win32comext\axscript\Demos\client\ie\demo.htm @+ -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python as Scripting Language in IIS

2010-08-31 Thread Michel Claveau - MVP
Hi! You must register Python as ActiveScripting's language. See : C:\Python26\Lib\site-packages\win32comext\axscript @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Dumb Stupid Question About List and String

2010-08-31 Thread Xavier Ho
On 1 September 2010 12:00, Alban Nona wrote: > @Xavier: ShaDoW, WorldPositionPoint (which is the same thing as > WordPointCloud passe) :) > Aha! That's what I was missing. Cheers, Xav -- http://mail.python.org/mailman/listinfo/python-list

Re: Source code for itertools

2010-08-31 Thread Tim Roberts
vsoler wrote: >On 31 ago, 04:42, Paul Rubin wrote: >> vsoler writes: >> > I was expecting an itertools.py file, but I don't see it in your list. >> >> ./python3.1-3.1.2+20100829/Modules/itertoolsmodule.c >> >> looks promising.  Lots of stdlib modules are written in C for speed or >> access to s

Re: triangle python user's group?

2010-08-31 Thread Tim Arnold
"Albert Hopkins" wrote in message news:mailman.219.1283200967.29448.python-l...@python.org... > On Mon, 2010-08-30 at 12:38 -0700, Tim Arnold wrote: >> Hi, >> Is there a python users group in the Research Triangle Park area >> (North Carolina, USA)? > > Google "triangle python user's group" > t

Fwd: Dumb Stupid Question About List and String

2010-08-31 Thread Alban Nona
In fact, the First list (wich contain "Elm001, Elm002, Elm003) will be generated automatically from files that I have in a directory, that's why I cant write the same code for Elm002, 003, etc... Because Ill not know how many Elm there will be. 2010/8/31 MRAB > On 01/09/2010 03:00, Alban Nona w

Re: [Pickle]dirty problem 3 lines

2010-08-31 Thread MRAB
On 01/09/2010 03:33, bussiere bussiere wrote: i know it's dirty, i know i should use json but i want to know, it's quiet late here : import pickle dump = """b'\x80\x03]q\x00(K\x00K\x01e.'""" print(pickle.loads(dump)) how can i get back my object from this string ? the string is : b'\x80\x03]q\x

[Pickle]dirty problem 3 lines

2010-08-31 Thread bussiere bussiere
i know it's dirty, i know i should use json but i want to know, it's quiet late here : import pickle dump = """b'\x80\x03]q\x00(K\x00K\x01e.'""" print(pickle.loads(dump)) how can i get back my object from this string ? the string is : b'\x80\x03]q\x00(K\x00K\x01e.' and i'am using python3 help wil

Re: Dumb Stupid Question About List and String

2010-08-31 Thread MRAB
On 01/09/2010 03:00, Alban Nona wrote: @MRAB, thank you, but what if there are like 40 entries like 'Elem00x' ? is there a way to do it automaticaly ? If you can do it for 'Elem001', I'm sure you could write some code to produce a list of 'Elem001', 'Elem002', etc, and check whether any are sub

Re: Dumb Stupid Question About List and String

2010-08-31 Thread Alban Nona
@MRAB, thank you, but what if there are like 40 entries like 'Elem00x' ? is there a way to do it automaticaly ? @Xavier: ShaDoW, WorldPositionPoint (which is the same thing as WordPointCloud passe) :) Anyway, thank you ! 2010/8/31 Xavier Ho > On 1 September 2010 07:57, Alban Nona wrote: > >>

Re: Structured programming with optionParser

2010-08-31 Thread NickC
On Mon, 30 Aug 2010 21:19:08 -0700, Michele Simionato wrote: > Perhaps, I should give an example of using plac. > > For more (including managing options, which I have not shown here) you > should check the full documentation of plac. I have just uploaded > release 0.7.2, which is required for th

comp.lang.python

2010-08-31 Thread roshini begum
www.127760.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Optimising literals away

2010-08-31 Thread Cameron Simpson
On 31Aug2010 23:38, MRAB wrote: | On 31/08/2010 23:11, Cameron Simpson wrote: | >On 31Aug2010 22:53, MRAB wrote: | >| There's still the possibility of some optimisation. If the resulting | >| set is never stored anywhere (bound to a name, for example) then it | >| could be created once. When the

Re: Queue cleanup

2010-08-31 Thread Lawrence D'Oliveiro
In message <7xmxs4uzjl@ruckus.brouhaha.com>, Paul Rubin wrote: > Gregory Ewing writes: > >> I'd be disappointed if CPython ditched refcounting and >> then became unsuitable for real-time games as a result. > > Refcounting is susceptable to the same pauses for reasons already > discussed. Do

Re: Queue cleanup

2010-08-31 Thread Lawrence D'Oliveiro
In message <7x39tz42fd@ruckus.brouhaha.com>, Paul Rubin wrote: > Dennis Lee Bieber writes: > >> Heap marking, OTOH, tends to run at indeterminate times, which could >> have an impact if one needs predictable response timings > > Reference counting has the same problem. If you drop the last

ride tab editor 2.03 has been released

2010-08-31 Thread eric_dex...@msn.com
ride tab editor 2.03 has been released. ride tab editor features customizable instruments and an editable tool menu (alpha help would be nice). also included are some scripts showing how you can use the output files in csound. The 2 series is an expansion of ride guitar tab editor that managed

Re: msg.attach multiple attachments and passing vars to html

2010-08-31 Thread Chris Rebert
On Tue, Aug 31, 2010 at 5:44 PM, MRAB wrote: > On 01/09/2010 00:24, aurfal...@gmail.com wrote: >> Also, is it somehow possible to pas python vars to html? >> >> My goal to to have an email that says something like; >> >> Welcome to ACME. >> A few LINKS to get you started. >> Your user name is USR

Re: Queue cleanup

2010-08-31 Thread Lawrence D'Oliveiro
In message <7xtymbzixt@ruckus.brouhaha.com>, Paul Rubin wrote: > It's pretty well established by now that GC doesn't have any significant > speed penalty compared with manual allocation. It does consume more > memory, which is acceptable a lot of the time. It certainly leads to > more reliab

Re: msg.attach multiple attachments and passing vars to html

2010-08-31 Thread MRAB
On 01/09/2010 00:24, aurfal...@gmail.com wrote: Hi, Few questions as I've been at this for dayz. Can I do multiple attachments in order via msg.attach as so; part1 = MIMEText(html, 'html') msg.attach(part1) part2 = MIMEText(text, 'plain') msg.attach(part2) part3 = MIMEText(html, 'html') msg.at

Re: Saving (unusual) linux filenames

2010-08-31 Thread Nobody
On Tue, 31 Aug 2010 18:49:33 +, Grant Edwards wrote: >> How many filenames contain control characters? > > How many filenames contain ","? Not many, Unless you only ever deal with "Unix folk", it's not /that/ uncommon to encounter filenames which are essentially complete sentences, punctuat

Re: Saving (unusual) linux filenames

2010-08-31 Thread Alan Meyer
On 8/31/2010 2:33 PM, Nobody wrote: ... FWIW, my usual solution is URL-encoding (i.e. replacing any "awkward" character by a "%" followed by two hex digits representing the byte's value). It has the advantage that you can extend the set of bytes which need encoding as needed without having to ch

Re: Python libs on Windows ME

2010-08-31 Thread Alexander Kapps
hexusne...@gmail.com wrote: On Aug 31, 2:04 pm, Thomas Jollans wrote: On Tuesday 31 August 2010, it occurred to hexusne...@gmail.com to exclaim: I'm not guessing that this is a problem on Windows 98, but on Windows ME modules in /Lib don't seem to load. Examples include site.py and os.py whi

Re: Stackless Python and EVE Online

2010-08-31 Thread Terry Reedy
On 8/31/2010 11:10 AM, Benjamin Kaplan wrote: On Tuesday, August 31, 2010, Roman Sokolyuk wrote: Hi, I am new to Python and I wanted to understand something... The EVE Online Client is build using Stackless Python So when I install the client on my machine, how doe sit get run if I do not hav

msg.attach multiple attachments and passing vars to html

2010-08-31 Thread aurfalien
Hi, Few questions as I've been at this for dayz. Can I do multiple attachments in order via msg.attach as so; part1 = MIMEText(html, 'html') msg.attach(part1) part2 = MIMEText(text, 'plain') msg.attach(part2) part3 = MIMEText(html, 'html') msg.attach(part3) I desire to attach part1, part2 and

Re: Performance: sets vs dicts.

2010-08-31 Thread Terry Reedy
On 8/31/2010 10:09 AM, Aahz wrote: In article, Jerry Hill wrote: On Mon, Aug 30, 2010 at 7:42 PM, Aahz wrote: Possibly; IMO, people should not need to run timeit to determine basic algorithmic speed for standard Python datatypes. http://wiki.python.org/moin/TimeComplexity takes a stab at i

Ed Lambda: Functional programming meetup in Edinburgh

2010-08-31 Thread Ollie Saunders
Hi guys, I'm running a meetup for functional programming in Edinburgh. The first one will be on the 13th of September at Malone's Irish Bar (14 Forrest Road) and will continue every 2nd monday of each month. For the first meetup I think we'll just be having a chat and getting to know each other bu

Re: Optimising literals away

2010-08-31 Thread MRAB
On 31/08/2010 23:11, Cameron Simpson wrote: On 31Aug2010 22:53, MRAB wrote: [...] |>>>def m(arg): |>>>if arg& set([1,2,3]): |> |>set() is a function call, not a literal. When m is called, who knows |>what 'set' will be bound to? In Py3, at least, you could write {1,2,3}, |>which is much faster

Re: Dumb Stupid Question About List and String

2010-08-31 Thread Xavier Ho
On 1 September 2010 07:57, Alban Nona wrote: > listPass = ["DIF","SPC", "RFL", "SSS", "REFR", "ALB", "AMB", "NRM", "MVE", > "DPF", "SDW", "MAT", "WPP"] > Out of curiosity, could you briefly mention what "SDW" and "WPP" passes are? I've worked out the rest, and these two are riddling my brain. (

Re: Dumb Stupid Question About List and String

2010-08-31 Thread MRAB
On 31/08/2010 22:57, Alban Nona wrote: Just Another Question on this one, Im trying to create that kind of thing in code now: #GENERE ET INCREMENT LE NOM DES ELEMENTS val = 0 list = ["0", "1", "2", "3"] listEl = [] for n in list: val = val + 1 next = "00" +str(val) elem

Re: Optimising literals away

2010-08-31 Thread Cameron Simpson
On 31Aug2010 22:53, MRAB wrote: [...] | >>>def m(arg): | >>>if arg& set([1,2,3]): | > | >set() is a function call, not a literal. When m is called, who knows | >what 'set' will be bound to? In Py3, at least, you could write {1,2,3}, | >which is much faster as it avoids creating and deleting a list

Re: Python libs on Windows ME

2010-08-31 Thread hexusne...@gmail.com
On Aug 31, 2:04 pm, Thomas Jollans wrote: > On Tuesday 31 August 2010, it occurred to hexusne...@gmail.com to exclaim: > > > I'm not guessing that this is a problem on Windows 98, but on Windows > > ME modules in /Lib don't seem to load.  Examples include site.py and > > os.py which are both locat

Re: Dumb Stupid Question About List and String

2010-08-31 Thread Alban Nona
Just Another Question on this one, Im trying to create that kind of thing in code now: #GENERE ET INCREMENT LE NOM DES ELEMENTS val = 0 list = ["0", "1", "2", "3"] listEl = [] for n in list: val = val + 1 next = "00" +str(val) elem = "ELM"+next listEl.append(elem) #I

Re: Optimising literals away

2010-08-31 Thread MRAB
On 31/08/2010 21:18, Terry Reedy wrote: On 8/31/2010 12:33 PM, Aleksey wrote: On Aug 30, 10:38 pm, Tobias Weber wrote: Hi, whenever I type an "object literal" I'm unsure what optimisation will do to it. Optimizations are generally implentation dependent. CPython currently creates numbers, str

Re: Stackless Python and EVE Online

2010-08-31 Thread Benjamin Kaplan
On Tue, Aug 31, 2010 at 5:45 PM, Krister Svanlund wrote: > On Tue, Aug 31, 2010 at 5:10 PM, Benjamin Kaplan > wrote: >> On Tuesday, August 31, 2010, Roman Sokolyuk wrote: >>> Hi, >>> >>> I am new to Python and I wanted to understand something... >>> The EVE Online Client is build using Stackless

Re: Stackless Python and EVE Online

2010-08-31 Thread Krister Svanlund
On Tue, Aug 31, 2010 at 5:10 PM, Benjamin Kaplan wrote: > On Tuesday, August 31, 2010, Roman Sokolyuk wrote: >> Hi, >> >> I am new to Python and I wanted to understand something... >> The EVE Online Client is build using Stackless Python >> So when I install the client on my machine, how doe sit

Re: Saving (unusual) linux filenames

2010-08-31 Thread AmFreak
Thanks for all the nice answers! The normal thing to do is to escape the delimiter when it appears in data. There are lots of plenty of escaping standards to choose from, and some of them (e.g. the one used for URLs) are already present in various bits of Python's standard library. The CSV mo

Re: Saving (unusual) linux filenames

2010-08-31 Thread Stefan Schwarzer
Hi Grant, On 2010-08-31 20:49, Grant Edwards wrote: > How many filenames contain ","? CVS repository files end with ,v . However, just let's agree that nobody uses CVS anymore. :-) > Not many, but the OP wants his > program to be bulletproof. Can't fault him for that. What about using the csv

Re: Python libs on Windows ME

2010-08-31 Thread Alexander Kapps
Thomas Jollans wrote: I would use another os like Linux or Windows 2000, but this particular computer can't even seem to handle even the most minimal graphical Linux distributions. Really? I'm sure you can get Linux on there somehow. It might not be trivial, but it should definitely be possib

Re: Find closest matching string based on collection of strings in list/dict/set

2010-08-31 Thread Shashwat Anand
On Wed, Sep 1, 2010 at 2:31 AM, Joel Goldstick < joel.goldst...@columbuswebmakers.com> wrote: > pyt...@bdurham.com wrote: > >> I'm parsing a simple, domain specific scripting language that has >> commands like the following: *page, *title, *text, *footer, etc. >> There are about 100 of these '*' c

Re: Find closest matching string based on collection of strings in list/dict/set

2010-08-31 Thread Arnaud Delobelle
Joel Goldstick writes: > pyt...@bdurham.com wrote: >> I'm parsing a simple, domain specific scripting language that has >> commands like the following: *page, *title, *text, *footer, etc. >> There are about 100 of these '*' commands. When we see a command >> that we don't recognize, I would like

Re: Functions continuing to ru after returning something?

2010-08-31 Thread Stefan Schwarzer
Hi, On 2010-08-31 02:05, Bradley Hintze wrote: > I may be having a brain fart, but is it at all possible to have a > function first return a value then continue its calculation. Like this > simple example: > > my_var = 5 > def my_function(): > return my_var > my_var +=1 > > This obviousl

Re: Python libs on Windows ME

2010-08-31 Thread Thomas Jollans
On Tuesday 31 August 2010, it occurred to hexusne...@gmail.com to exclaim: > I'm not guessing that this is a problem on Windows 98, but on Windows > ME modules in /Lib don't seem to load. Examples include site.py and > os.py which are both located in the top level Lib directory. The same > thing

Re: Find closest matching string based on collection of strings in list/dict/set

2010-08-31 Thread Joel Goldstick
pyt...@bdurham.com wrote: I'm parsing a simple, domain specific scripting language that has commands like the following: *page, *title, *text, *footer, etc. There are about 100 of these '*' commands. When we see a command that we don't recognize, I would like to find the closest match possible (f

Re: Dumb Stupid Question About List and String

2010-08-31 Thread Alban Nona
Well, I have a lot to learn :) Thank you very much both of you ! it seems to work now :p 2010/8/31 MRAB > On 31/08/2010 20:20, Alban Nona wrote: > >> Ok, here a solution: >> >> myFirstList = ["FN067_098_MEN", "FN067_098_JIN", "FN067_098_BG"] >> >> mySecondList = >> >> ["FN067_098_MEN_Hair_PUZ_v

Re: Helper app for intranet site

2010-08-31 Thread kevinlcarlson
On Aug 30, 4:13 pm, Lawrence D'Oliveiro wrote: > In message > <61894f54-90ff-4e0e-9c81-860b6e9cd...@p12g2000prn.googlegroups.com>, > > > > kevinlcarlson wrote: > > On Aug 29, 8:46 pm, Lawrence D'Oliveiro > > wrote: > > >> In message > >> <45e0772c-24a8-4cbb-a4fc-74a1b6c25...@n19g2000prf.googlegro

Re: Installing Python as Scripting Language in IIS

2010-08-31 Thread hexusne...@gmail.com
On Aug 30, 6:55 pm, naugiedoggie wrote: > Hello, > > Windows 2003, 64-bit, standard edition server with IIS 6.0.  I > followed the MS instruction sheets on setting up CGI application with > Python as scripting engine.  I'm just getting 404 for the test script, > whereas an html file in the same vi

Python libs on Windows ME

2010-08-31 Thread hexusne...@gmail.com
I'm not guessing that this is a problem on Windows 98, but on Windows ME modules in /Lib don't seem to load. Examples include site.py and os.py which are both located in the top level Lib directory. The same thing happens with Python 2.3, 2.4, and 2.5. I can't get IDLE to load and the Python int

Re: Optimising literals away

2010-08-31 Thread Terry Reedy
On 8/31/2010 12:33 PM, Aleksey wrote: On Aug 30, 10:38 pm, Tobias Weber wrote: Hi, whenever I type an "object literal" I'm unsure what optimisation will do to it. Optimizations are generally implentation dependent. CPython currently creates numbers, strings, and tuple literals just once. Mut

Re: How to convert (unicode) text to image?

2010-08-31 Thread Terry Reedy
On 8/31/2010 12:47 AM, ru...@yahoo.com wrote: I have participated in 71 doc improvement issues on the tracker. Most of those I either initiated or provided suggestions. How many have you helped with? Certainly not 71. But there is, for example, http://bugs.python.org/issue1397474 Please note

Re: Find closest matching string based on collection of strings in list/dict/set

2010-08-31 Thread Shashwat Anand
On Tue, Aug 31, 2010 at 9:12 PM, wrote: > I'm parsing a simple, domain specific scripting language that has commands > like the following: *page, *title, *text, *footer, etc. There are about 100 > of these '*' commands. When we see a command that we don't recognize, I > would like to find the clo

Re: Dumb Stupid Question About List and String

2010-08-31 Thread Shashwat Anand
On Wed, Sep 1, 2010 at 12:27 AM, Alban Nona wrote: > Hi all, > > Im stuck on this problem: > I have a function which return me a list of string (basically the result > looks like: ["FN067_098_MEN", FN067_098_JIN", FN067_098_BG"] > In other hand, I have another list full of that kind of entries: >

Re: Dumb Stupid Question About List and String

2010-08-31 Thread MRAB
On 31/08/2010 20:20, Alban Nona wrote: Ok, here a solution: myFirstList = ["FN067_098_MEN", "FN067_098_JIN", "FN067_098_BG"] mySecondList = ["FN067_098_MEN_Hair_PUZ_v001.0001.exr","FN067_098_JIN_Hair_SPC_v001.0001.exr","FN067_098_MEN_Jin_MVE_v001.0001.exr","FR043_010_GEN_NRM_v001.0001.exr"] fo

Re: Optimising literals away

2010-08-31 Thread Stefan Behnel
John Nagle, 31.08.2010 21:03: On 8/30/2010 8:38 AM, Tobias Weber wrote: whenever I type an "object literal" I'm unsure what optimisation will do to it. CPython is a "naive interpreter". It has almost no optimization. It doesn't even really comprehend "constants". This is an implementation prob

Re: Dumb Stupid Question About List and String

2010-08-31 Thread Chris Rebert
On Tue, Aug 31, 2010 at 12:20 PM, Alban Nona wrote: > Ok, here a solution: > for n in myFirstList: > var = str(n) n is already a string, so the previous line doesn't do anything useful. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Dumb Stupid Question About List and String

2010-08-31 Thread MRAB
On 31/08/2010 19:57, Alban Nona wrote: Hi all, Im stuck on this problem: I have a function which return me a list of string (basically the result looks like: ["FN067_098_MEN", FN067_098_JIN", FN067_098_BG"] In other hand, I have another list full of that kind of entries: ["FN067_098_MEN_Hair_PUZ

Re: Dumb Stupid Question About List and String

2010-08-31 Thread Alban Nona
Ok, here a solution: myFirstList = ["FN067_098_MEN", "FN067_098_JIN", "FN067_098_BG"] mySecondList = ["FN067_098_MEN_Hair_PUZ_v001.0001.exr","FN067_098_JIN_Hair_SPC_v001.0001.exr","FN067_098_MEN_Jin_MVE_v001.0001.exr","FR043_010_GEN_NRM_v001.0001.exr"] for n in myFirstList: var = str(n)

Re: Saving (unusual) linux filenames

2010-08-31 Thread Arnaud Delobelle
amfr...@web.de writes: > Hi, > > i have a script that reads and writes linux paths in a file. I save > the path (as unicode) with 2 other variables. I save them seperated by > "," and the "packets" by newlines. So my file looks like this: > path1, var1A, var1B > path2, var2A, var2B > path3, var3A

Re: Optimising literals away

2010-08-31 Thread John Nagle
On 8/30/2010 8:38 AM, Tobias Weber wrote: Hi, whenever I type an "object literal" I'm unsure what optimisation will do to it. CPython is a "naive interpreter". It has almost no optimization. It doesn't even really comprehend "constants". This is an implementation problem, not a language pro

Dumb Stupid Question About List and String

2010-08-31 Thread Alban Nona
Hi all, Im stuck on this problem: I have a function which return me a list of string (basically the result looks like: ["FN067_098_MEN", FN067_098_JIN", FN067_098_BG"] In other hand, I have another list full of that kind of entries: ["FN067_098_MEN_Hair_PUZ_v001.0001.exr","FN067_098_JIN_Hair_SPC_v

Re: Saving (unusual) linux filenames

2010-08-31 Thread MRAB
On 31/08/2010 19:33, Nobody wrote: On Tue, 31 Aug 2010 18:13:44 +0100, MRAB wrote: this works for "normal" paths but as soon as i have a path that does include a "," it breaks. The problem now is that (afaik) linux allows every char (aside from "/" and null) to be used in filenames. The only so

Re: Saving (unusual) linux filenames

2010-08-31 Thread Grant Edwards
On 2010-08-31, MRAB wrote: > On 31/08/2010 17:58, Grant Edwards wrote: >> On 2010-08-31, MRAB wrote: >>> On 31/08/2010 15:49, amfr...@web.de wrote: Hi, i have a script that reads and writes linux paths in a file. I save the path (as unicode) with 2 other variables. I save them

Re: sendmail error

2010-08-31 Thread Thomas Jollans
On Tuesday 31 August 2010, it occurred to sandric ionut to exclaim: > This is the only message that I will send to this list regarding my > question: > > 1. I have copied and paste my code from Eclipe PyDev and I have used web > interface for yahoo email to send the email. I will try never to use

Re: Saving (unusual) linux filenames

2010-08-31 Thread Nobody
On Tue, 31 Aug 2010 18:13:44 +0100, MRAB wrote: this works for "normal" paths but as soon as i have a path that does include a "," it breaks. The problem now is that (afaik) linux allows every char (aside from "/" and null) to be used in filenames. The only solution i can think

Re: Saving (unusual) linux filenames

2010-08-31 Thread Albert Hopkins
On Tue, 2010-08-31 at 16:49 +0200, amfr...@web.de wrote: > i have a script that reads and writes linux paths in a file. I save > the > path (as unicode) with 2 other variables. I save them seperated by "," > and > the "packets" by newlines. So my file looks like this: > path1, var1A, var1B > pa

Re: Fw: sendmail error

2010-08-31 Thread Alexander Kapps
Chris Withers wrote: Alexander Kapps wrote: Instead you want something like: except smtplib.SMTPException, msg print "eroare: " + msg Err, that's still concatenating a string and an exception object. OUCH! What a stupid error. Thanks for correction. :-) What *would* work is: except s

Re: sendmail error

2010-08-31 Thread Chris Withers
Thomas Jollans wrote: I struggle to imagine what one might do to a piece of code to garble it this badly. You viewed the text/plain part of his message, the text/html part showed the code almost correctly, complete with pasted-from-IDE colour formatting ;-) Chris -- Simplistix - Content Man

Re: Fw: sendmail error

2010-08-31 Thread Chris Withers
Alexander Kapps wrote: Instead you want something like: except smtplib.SMTPException, msg print "eroare: " + msg Err, that's still concatenating a string and an exception object. What *would* work is: except smtplib.SMTPException, msg print "eroare: " + str(msg) ...not that it's pa

Re: sendmail error

2010-08-31 Thread sandric ionut
This is the only message that I will send to this list regarding my question: 1. I have copied and paste my code from Eclipe PyDev and I have used web interface for yahoo email to send the email. I don't know why the message arrived like that. I consider that the message from Dave was rude and

Re: Saving (unusual) linux filenames

2010-08-31 Thread MRAB
On 31/08/2010 17:58, Grant Edwards wrote: On 2010-08-31, MRAB wrote: On 31/08/2010 15:49, amfr...@web.de wrote: Hi, i have a script that reads and writes linux paths in a file. I save the path (as unicode) with 2 other variables. I save them seperated by "," and the "packets" by newlines. So

Re: Saving (unusual) linux filenames

2010-08-31 Thread Grant Edwards
On 2010-08-31, MRAB wrote: > On 31/08/2010 15:49, amfr...@web.de wrote: >> Hi, >> >> i have a script that reads and writes linux paths in a file. I save the >> path (as unicode) with 2 other variables. I save them seperated by "," >> and the "packets" by newlines. So my file looks like this: >> pa

Re: Saving (unusual) linux filenames

2010-08-31 Thread Jeremy Sanders
amfr...@web.de wrote: > i have a script that reads and writes linux paths in a file. I save the > path (as unicode) with 2 other variables. I save them seperated by "," and > the "packets" by newlines. So my file looks like this: > path1, var1A, var1B > path2, var2A, var2B > path3, var3A, var3B I

Re: Optimising literals away

2010-08-31 Thread Aleksey
On Aug 30, 10:38 pm, Tobias Weber wrote: > Hi, > whenever I type an "object literal" I'm unsure what optimisation will do > to it. > > def m(arg): >   if arg & set([1,2,3]): >     return 4 > > Is the set created every time the method is called? What about a > frozenset? Or tuple vs list? After how

Re: Saving (unusual) linux filenames

2010-08-31 Thread MRAB
On 31/08/2010 15:49, amfr...@web.de wrote: Hi, i have a script that reads and writes linux paths in a file. I save the path (as unicode) with 2 other variables. I save them seperated by "," and the "packets" by newlines. So my file looks like this: path1, var1A, var1B path2, var2A, var2B path3,

Find closest matching string based on collection of strings in list/dict/set

2010-08-31 Thread python
I'm parsing a simple, domain specific scripting language that has commands like the following: *page, *title, *text, *footer, etc. There are about 100 of these '*' commands. When we see a command that we don't recognize, I would like to find the closest match possible (from a list of all legal comm

Re: PyGeo

2010-08-31 Thread Robert Kern
On 8/31/10 7:21 AM, Giacomo Boffi wrote: L writes: also the PyGeo readme text mentions Numerical python (I think it means Numeric, but I also have NumPy installed) afaict, Numerical python is numpy --- if you look at pygeo home page, the reference to Numerical python is a link to numpy home

Re: Saving (unusual) linux filenames

2010-08-31 Thread Grant Edwards
On 2010-08-31, amfr...@web.de wrote: > Hi, > > i have a script that reads and writes linux paths in a file. I save the > path (as unicode) with 2 other variables. I save them seperated by "," and > the "packets" by newlines. So my file looks like this: > path1, var1A, var1B > path2, var2A, var

Re: Stackless Python and EVE Online

2010-08-31 Thread Benjamin Kaplan
On Tuesday, August 31, 2010, Roman Sokolyuk wrote: > Hi, > > I am new to Python and I wanted to understand something... > The EVE Online Client is build using Stackless Python > So when I install the client on my machine, how doe sit get run if I do not > have Python installed? > We call it "free

Saving (unusual) linux filenames

2010-08-31 Thread AmFreak
Hi, i have a script that reads and writes linux paths in a file. I save the path (as unicode) with 2 other variables. I save them seperated by "," and the "packets" by newlines. So my file looks like this: path1, var1A, var1B path2, var2A, var2B path3, var3A, var3B this works for "norm

Re: Stackless Python and EVE Online

2010-08-31 Thread Thomas Jollans
On Tuesday 31 August 2010, it occurred to Roman Sokolyuk to exclaim: > Hi, > > I am new to Python and I wanted to understand something... > > The EVE Online Client is build using Stackless Python > > So when I install the client on my machine, how doe sit get run if I do not > have Python instal

Stackless Python and EVE Online

2010-08-31 Thread Roman Sokolyuk
Hi, I am new to Python and I wanted to understand something... The EVE Online Client is build using Stackless Python So when I install the client on my machine, how doe sit get run if I do not have Python installed? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance: sets vs dicts.

2010-08-31 Thread Jerry Hill
On Tue, Aug 31, 2010 at 10:09 AM, Aahz wrote: > I suggest that we should agree on these guarantees and document them in > the core. I can't get to the online python-dev archives from work (stupid filter!) so I can't give you a link to the archives, but the original thread that resulted in the cre

Re: Performance: sets vs dicts.

2010-08-31 Thread Ian
On 31/08/2010 15:09, Aahz wrote: I suggest that we should agree on these guarantees and document them in the core. I suspect that documenting them will be the easy part ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance: sets vs dicts.

2010-08-31 Thread Stefan Behnel
Jerry Hill, 31.08.2010 14:24: On Mon, Aug 30, 2010 at 7:42 PM, Aahz wrote: Possibly; IMO, people should not need to run timeit to determine basic algorithmic speed for standard Python datatypes. http://wiki.python.org/moin/TimeComplexity takes a stab at it. IIRC, last time this came up, there

Re: Performance: sets vs dicts.

2010-08-31 Thread Aahz
In article , Jerry Hill wrote: >On Mon, Aug 30, 2010 at 7:42 PM, Aahz wrote: >> >> Possibly; IMO, people should not need to run timeit to determine basic >> algorithmic speed for standard Python datatypes. > >http://wiki.python.org/moin/TimeComplexity takes a stab at it. IIRC, >last time this c

Re: sendmail error

2010-08-31 Thread Thomas Jollans
On Tuesday 31 August 2010, it occurred to sandric ionut to exclaim: > Hello: > > I have a script for sending email from python (it is attached bellow). When > I am launching the script I get the error: > TypeError: cannot concatenate 'str' and 'type' objects if I use > sys.argv[1], but if I input

Re: Fw: sendmail error

2010-08-31 Thread Alexander Kapps
sandric ionut wrote: Three things: When quoting code, do it exactly, and without wordwrap in your mail program. There are so many typos in that code sample that it's useless, presumably because you didn't use copy/paste The code was COPY and PASTE -> presume wrong When quoting an

Fw: sendmail error

2010-08-31 Thread sandric ionut
- Forwarded Message From: sandric ionut To: Dave Angel Sent: Tue, August 31, 2010 3:56:40 PM Subject: Re: sendmail error From: Dave Angel To: sandric ionut Cc: Python List Sent: Tue, August 31, 2010 2:49:29 PM Subject: Re: sendmail error T

Re: PyGeo

2010-08-31 Thread Giacomo Boffi
L writes: > also the PyGeo readme text mentions Numerical python (I think it > means Numeric, but I also have NumPy installed) afaict, Numerical python is numpy --- if you look at pygeo home page, the reference to Numerical python is a link to numpy home page on the contrary, there is no "impor

Re: Performance: sets vs dicts.

2010-08-31 Thread Jerry Hill
On Mon, Aug 30, 2010 at 7:42 PM, Aahz wrote: > Possibly; IMO, people should not need to run timeit to determine basic > algorithmic speed for standard Python datatypes. http://wiki.python.org/moin/TimeComplexity takes a stab at it. IIRC, last time this came up, there was some resistance to makin

Re: sendmail error

2010-08-31 Thread Dave Angel
sandric ionut wrote: Hello: I have a script for sending email from python (it is attached bellow). When I am launching the script I get the error: TypeError: cannot concatenate 'str' and 'type' objects if I use sys.argv[1], but if I input from the begging an email address like "em...@email.com

Re: Can't find elements using ElementTree find method

2010-08-31 Thread Brendan Simon (eTRIX)
I can't use getroot() when using fromstring() -- as fromstring() returns an Element, not an ElementTree object. Yes, my root is the 'components' element, but find() seems to insist on searching for sub-elements. Ideally, I would like root.find('components') or root.find('./components') to find t

Re: PyGeo

2010-08-31 Thread Thomas Jollans
On Tuesday 31 August 2010, it occurred to L to exclaim: > Traceback (most recent call last): >File > "/usr/lib/python2.6/dist-packages/pygeo/examples/real/dandelinspheres2.py", > line 2, in > from pygeo.base.abstract_elements_real import _Sphere, _Point >File "/usr/lib/python2.6/dist-

Re: Can't find elements using ElementTree find method

2010-08-31 Thread Stefan Behnel
Brendan Simon (eTRIX), 31.08.2010 10:49: I am trying to use ElementTree (with Python 2.7) and can't seem to find elements at the top level. The find() and findall() methods seem to find elements within the top level, but not if it the elements are at the top level. How do I find top level ele

Re: Can't find elements using ElementTree find method

2010-08-31 Thread Nitin Pawar
Try using getroot() I think your root is components so its searching in root On Tue, Aug 31, 2010 at 2:19 PM, Brendan Simon (eTRIX) < brendan.si...@etrix.com.au> wrote: > I am trying to use Ele

Can't find elements using ElementTree find method

2010-08-31 Thread Brendan Simon (eTRIX)
I am trying to use ElementTree (with Python 2.7) and can't seem to find elements at the top level. The find() and findall() methods seem to find elements within the top level, but not if it the elements are at the top level. How do I find top level elements ?? Here is my code. import xml.et

Re: Functions continuing to ru after returning something?

2010-08-31 Thread Paul Rubin
Bradley Hintze writes: > my_var = 5 > def my_function(): > return my_var > my_var +=1 def my_function(): temp = my_var my_var += 1 return temp -- http://mail.python.org/mailman/listinfo/python-list

sendmail error

2010-08-31 Thread sandric ionut
Hello: I have a script for sending email from python (it is attached bellow). When I am launching the script I get the error: TypeError: cannot concatenate 'str' and 'type' objects if I use sys.argv[1], but if I input from the begging an email address like "em...@email.com", the script is w

Re: Functions continuing to ru after returning something?

2010-08-31 Thread Bruno Desthuilliers
Peter Otten a écrit : n = 1 def f(): ... global n ... try: ... return n ... finally: ... n += 1 ... The same without a global: def f(_n=[0]): try: return _n[0] finally: _n[0] += 1 But yeps, using a generator would be better. -- ht

  1   2   >