itools 0.15.5 released

2007-06-01 Thread J. David Ibáñez
itools is a Python library, it groups a number of packages into a single meta-package for easier development and deployment: itools.catalogitools.i18n itools.vfs itools.cmsitools.ical itools.web itools.csvitools.pdf

Re: c[:]()

2007-06-01 Thread Erik Max Francis
Warren Stringer wrote: `c[:]()` is unambiguous because: def c(): print 'yo' c() # works, but c[:]() # causes: Traceback (most recent call last)... c[:]() # causes: TypeError: unsubscriptable object There are many `c()` to be found in the wild and

Re: c[:]()

2007-06-01 Thread Erik Max Francis
Warren Stringer wrote: As mentioned a while back, I'm now predisposed towards using `do(c)()` because square brackets are hard with cell phones. The one mitigating factor for more general use, outside of cell phones, is speed. The speed at which you can type code is almost _never_ a valid

Re: Python memory handling

2007-06-01 Thread Leo Kislov
On May 31, 8:06 am, [EMAIL PROTECTED] wrote: Hello, I will try later with python 2.5 under linux, but as far as I can see, it's the same problem under my windows python 2.5 After reading this document :http://evanjones.ca/memoryallocator/python-memory.pdf I think it's because list or

Re: pack() and the division of vertical space

2007-06-01 Thread Eric Brunel
On Thu, 31 May 2007 19:45:04 +0200, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am trying to figure out how to stack two widgets in a frame vertically so that they both expand horizontally and during vertical expansion, the top one sticks to the top of the frame and the bottom one consumes

Re: strange PyLint configuration

2007-06-01 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Bjoern Schliessmann wrote: [ripped out of context :-)] Has this been updated recently? I could've sworn I had read that stuff like has_key was old. Yes, `has_key()` is old, it's spelled ``in`` these days. :-) if mapping.has_key(ham): pass # - if ham in mapping: pass

Python in University

2007-06-01 Thread [EMAIL PROTECTED]
Hi all, My name is Tennessee Leeuwenburg. I am the Editor-In-Chief of The Python Papers (archive.pythonpapers.org). We're currently looking for contributions to our next issue. We'd love to hear from anyone who is interested in being involved. I'm also trying to track down anyone who may be

[OT] HTML Form/Page and Navigation with multiple buttons

2007-06-01 Thread Bruno Desthuilliers
mosscliffe a écrit : Excellent - thanks for all your help. I now have a form created by a python script executing an HTML page, s/executing/generating/, I think... still-totally-ot doing everything I need, except for Session Data (probably use hidden fields ?? future research) HTTP is a

Re: Embed text document in excel application using python

2007-06-01 Thread Tim Golden
[EMAIL PROTECTED] wrote: Hi, How to embed object in excel using python? Is it me, or is this a popular question at the moment? Have a look at this post from yesterday: http://tinyurl.com/37egtt (Doesn't exactly answer, but at least points the way) TJG --

Re: Is PEP-8 a Code or More of a Guideline?

2007-06-01 Thread Hendrik van Rooyen
Tim Roberts [EMAIL PROTECTED] wrote: Carl Banks [EMAIL PROTECTED] wrote: Identifiers should just allow spaces. first element.get item(selected value) This is not a joke. I don't mean Python should necessarily do this (though it could be done without any ambiguity or backward

Re: speeding things up with C++

2007-06-01 Thread bullockbefriending bard
Are you sure you want an STL container? Since the primary operator here is Python, the extra benefits from the STL container over plain C arrays isn't as evident. Pyrex is a good way to write the interface between your C++ code and the Python code - it handles the refcounting and

Re: execute a function after each source code line ?

2007-06-01 Thread Steve Howell
--- stef [EMAIL PROTECTED] wrote: doing a simulation of another language (JAL), I translate the other language into Python code, then I execute this converted Python code. [...] (btw the whole program is running as an graphical (wxPython) application) I worked on an open source project that

Re: Thread-safety of dict

2007-06-01 Thread Duncan Booth
Adam Olsen [EMAIL PROTECTED] wrote: So there you have it: if you're using a dict with custom classes (or anything other than str) across multiple threads, and without locking it, it's possible (though presumably extremely rare) for a lookup to fail even through the key was there the entire

Re: Python memory handling

2007-06-01 Thread Andrew MacIntyre
[EMAIL PROTECTED] wrote: Using the same file with cElementTree took me 217 Mb, with no unreachable object. For me it's not a good behavior, it's not a good way to let the system swap this unused memory instead of freeing it. I think it's a really good idea to have a memory pool for

RE: c[:]()

2007-06-01 Thread Warren Stringer
Warren Stringer wrote: `c[:]()` is unambiguous because: def c(): print 'yo' c() # works, but c[:]() # causes: Traceback (most recent call last)... c[:]() # causes: TypeError: unsubscriptable object There are many `c()` to be found in the

Re: subexpressions

2007-06-01 Thread Peter Otten
Sergey Dorofeev wrote: Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sergey Dorofeev wrote: Please help, is there way to use sub-expressions in lambda? For example, if I want to calculate sin(x^2)+cos(x^2) I must code: lambda x: sin(x*x)+cos(x*x) How to make x*x to

Delete a file from a CGI

2007-06-01 Thread Matias Surdi
HI! I want to delete a file from a CGI, but I always get a Permission denied error. I've tryed this after creating the file (from a normal script): os.chmod(.lock,stat.S_IMODE(stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG)) os.chown(.lock,pwd.getpwnam(nobody)[2],pwd.getpwnam(nobody)[3]) but the

subexpressions

2007-06-01 Thread Sergey Dorofeev
Hello all! Please help, is there way to use sub-expressions in lambda? For example, if I want to calculate sin(x^2)+cos(x^2) I must code: lambda x: sin(x*x)+cos(x*x) How to make x*x to be evaluated once? -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread-safety of dict

2007-06-01 Thread Martin v. Löwis
So there you have it: if you're using a dict with custom classes (or anything other than str) across multiple threads, and without locking it, it's possible (though presumably extremely rare) for a lookup to fail even through the key was there the entire time. That could be fixed by adding a

Re: HTML Form/Page and Navigation with multiple buttons

2007-06-01 Thread Bruno Desthuilliers
Steve Holden a écrit : mosscliffe wrote: (snip) Why is a link better than a button ? Beats me why you got that advice. Buttons are perfectly adequate for that purpose. Call me a purist if you want, but I don't think forms and buttons are perfectly adequate for normal navigation, which

Re: interesting take on python OO

2007-06-01 Thread Bruno Desthuilliers
7stud a écrit : http://www.evolt.org/article/OO_programming_the_Python_way/18/449/ - The last article gives you the absolute basics of using Python. This time, we'll do the OO side of Python. Yes, Python: a true object- oriented language with classes, inheritance and all. Ok, my OO

Re: subexpressions

2007-06-01 Thread Sergey Dorofeev
Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Please help, is there way to use sub-expressions in lambda? For example, if I want to calculate sin(x^2)+cos(x^2) I must code: lambda x: sin(x*x)+cos(x*x) How to make x*x to be evaluated once? (lambda x: [sin(x2) +

Re: generating a tree-like structure

2007-06-01 Thread A.T.Hofkamp
On 2007-05-31, Thorsten Kampe [EMAIL PROTECTED] wrote: * (31 May 2007 12:15:48 -0700) On May 31, 12:44 pm, Thorsten Kampe [EMAIL PROTECTED] wrote: This is a fairly general question: is there some kind of module or framework that allows building a tree like structure from certain kind of

Re: interesting take on python OO

2007-06-01 Thread A.T.Hofkamp
On 2007-06-01, Bruno Desthuilliers [EMAIL PROTECTED] wrote: FWIW, I still don't get why people insist on believing that C++ and Java have anything to do with OO !-) (and yes, it's friday...) Good marketing. Albert -- http://mail.python.org/mailman/listinfo/python-list

Re: execute a function after each source code line ?

2007-06-01 Thread Steve Howell
--- Diez B. Roggisch [EMAIL PROTECTED] wrote: Are there any other (simple) ways of achieving this ? (btw the whole program is running as an graphical (wxPython) application) use the python trace facilities. http://docs.python.org/lib/module-trace.html I'm not sure how much that

Re: How to clean a module?

2007-06-01 Thread Diez B. Roggisch
ai wrote: Yes, you are right. But from this problem, could I infer that the statement del xxx doesn't release the memory which xxx used? It just removes the name xxx from the current scope - which will result in a reference counter decrease. If that was the last reference, the object will be

Re: subexpressions

2007-06-01 Thread A.T.Hofkamp
On 2007-06-01, Sergey Dorofeev [EMAIL PROTECTED] wrote: Hello all! Please help, is there way to use sub-expressions in lambda? For example, if I want to calculate sin(x^2)+cos(x^2) I must code: lambda x: sin(x*x)+cos(x*x) How to make x*x to be evaluated once? lambda x: (lambda y: sin(y) +

execute a function after each source code line ?

2007-06-01 Thread stef
hello, doing a simulation of another language (JAL), I translate the other language into Python code, then I execute this converted Python code. Now I need todo some checks and give visual feedback to the user, each time a line of code is executed. One way of realizing this, is to add a

Re: execute a function after each source code line ?

2007-06-01 Thread stef
Steve Howell wrote: --- stef [EMAIL PROTECTED] wrote: doing a simulation of another language (JAL), I translate the other language into Python code, then I execute this converted Python code. [...] (btw the whole program is running as an graphical (wxPython) application) I

Re: subexpressions

2007-06-01 Thread Sergey Dorofeev
Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sergey Dorofeev wrote: Please help, is there way to use sub-expressions in lambda? For example, if I want to calculate sin(x^2)+cos(x^2) I must code: lambda x: sin(x*x)+cos(x*x) How to make x*x to be evaluated once?

Re: execute a function after each source code line ?

2007-06-01 Thread stef
Diez B. Roggisch wrote: stef wrote: hello, doing a simulation of another language (JAL), I translate the other language into Python code, then I execute this converted Python code. Now I need todo some checks and give visual feedback to the user, each time a line of code is executed.

Re: subexpressions

2007-06-01 Thread Peter Otten
Sergey Dorofeev wrote: Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Please help, is there way to use sub-expressions in lambda? For example, if I want to calculate sin(x^2)+cos(x^2) I must code: lambda x: sin(x*x)+cos(x*x) How to make x*x to be evaluated once?

Re: file reading by record separator (not line by line)

2007-06-01 Thread Tijs
Steve Howell wrote: I think itertools.groupby() is usually the key batteries-included component in elegant solutions to this problem, but I wonder if the Python community couldn't help a lot of newbies (or insufficiently caffeinated non-newbies) by any of the following: Well, I'm not

Re: Easy make money!

2007-06-01 Thread GPcapital
On Apr 22, 1:06 am, John Nagle [EMAIL PROTECTED] wrote: Dustan wrote: On Apr 21, 3:45 pm,GPcapital[EMAIL PROTECTED] wrote: Lately I've been surfing trought some web pages and got this one www.gpcapitalgroup.com. It looks quite interesting, it may be a great chance to invest.

RE: c[:]()

2007-06-01 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Warren Stringer wrote: I like your use case. Am I correct in assuming that `y = x[:]; y()` is NOT to be found in working code? If that is the case, then nothing gets broken. It would be instructive to have a use case where enabling c[:]() would break existing code.

Re: calling Postgresql stored procedure (written in plpython)

2007-06-01 Thread Alchemist
Thanks for your help. My stored procedure is written in pythonpl. I noticed that SELECT queries are executed correctly (results are returned to my script) whereas UPDATE queries are not being performed as the data is not updated. I am using a database user with read/write access to the

Re: file reading by record separator (not line by line)

2007-06-01 Thread Steve Howell
--- Tijs [EMAIL PROTECTED] wrote: Yes, or a single one that takes a wide range of construction possibilities, like strings, lambdas or regexes in various keyword parameters. BlockReader(f, start='') BlockReader(f, start=re.compile('|'), end='---') BlockReader(f, start=lambda x:

Re: subexpressions

2007-06-01 Thread Peter Otten
Sergey Dorofeev wrote: Please help, is there way to use sub-expressions in lambda? For example, if I want to calculate sin(x^2)+cos(x^2) I must code: lambda x: sin(x*x)+cos(x*x) How to make x*x to be evaluated once? (lambda x: [sin(x2) + cos(x2) for x2 in [x*x]][0])(.5) == sin(.5*.5) +

Re: file reading by record separator (not line by line)

2007-06-01 Thread Steve Howell
--- Tijs [EMAIL PROTECTED] wrote: Steve Howell wrote: [...] but I wonder if the Python community couldn't help a lot of newbies (or insufficiently caffeinated non-newbies) by any of the following: Well, I'm not a newbie, and I always make sure to be thoroughly caffeinated before

Re: subexpressions

2007-06-01 Thread Steve Howell
--- A.T.Hofkamp [EMAIL PROTECTED] wrote: lambda x: (lambda y: sin(y) + cos(y))(x*x) Elegant. I find the use of y confusing there (thinking about the unit circle), so I'd amend it to this: lambda x: (lambda x2: sin(x2) + cos(x2))(x*x) But I like the overall idea.

Re: subexpressions

2007-06-01 Thread Sergey Dorofeev
Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What syntax would you suggest for a lambda enhanced to cover your use case? I suppose you will end up with roughly the same number of characters, all crammed in one line -- or broken into lines at a random position as it

Re: execute a function after each source code line ?

2007-06-01 Thread Diez B. Roggisch
stef wrote: hello, doing a simulation of another language (JAL), I translate the other language into Python code, then I execute this converted Python code. Now I need todo some checks and give visual feedback to the user, each time a line of code is executed. One way of realizing

Re: c[:]()

2007-06-01 Thread Douglas Woodrow
On Thu, 31 May 2007 18:42:05, Warren Stringer [EMAIL PROTECTED] wrote They were copied from working code. Copied *badly*? Yes. Running python via: Windows - start - run - python doesn't allow cut and paste Hi Warren, Actually you can copy and paste from a Windows cmd/command shell:

Re: subexpressions

2007-06-01 Thread Steve Holden
Sergey Dorofeev wrote: Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Please help, is there way to use sub-expressions in lambda? For example, if I want to calculate sin(x^2)+cos(x^2) I must code: lambda x: sin(x*x)+cos(x*x) How to make x*x to be evaluated once?

Re: Roundup, smtplib, TLS and MS Exchange

2007-06-01 Thread Tijs
carlistixx wrote: [EMAIL PROTECTED] tracker]$ roundup-server -p 8081 roundup=/home/foobar/roundup/tracker Roundup server started on :8081 send: 'STARTTLS\r\n' reply: '503 5.5.2 Send hello first\r\n' reply: retcode (503); Msg: 5.5.2 Send hello first I think this must be an issue with

Re: speeding things up with C++

2007-06-01 Thread Max M
bullockbefriending bard skrev: good point. while i bow to the genius of the folks who invented template metaprogramming, the compiler error messages tend to be profoundly depressing :). one way or the other, pyrex is something i need to learn since i'm now completely enamoured with python and

Re: subexpressions

2007-06-01 Thread Tijs
Steve Howell wrote: FWIW there's the possibility that even without a subexpression syntax, some Python implementations would detect the duplication of x*x and optimize that for you. It would have to know that x*x had no side effects, which I think is a safe assumption even in a dynamic

Re: Adding tuples to a dictionary

2007-06-01 Thread Nick Craig-Wood
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Let me comment on what happens in you're code: The place where you create new objects is keys = [str(x) for x in range(20)] # here you create 20 strings which will be reused ( by reference ) and my_dict[key] = (key, key) # here you

Re: Python memory handling

2007-06-01 Thread Nick Craig-Wood
Andrew MacIntyre [EMAIL PROTECTED] wrote: You should also appreciate something about PyMalloc: it only handles allocation requests of 256 bytes or smaller, and this limitation is part of PyMalloc's design. If most of your allocations are 256 bytes, you're at the mercy of the platform

cStringIO change in 2.4 vs 2.5. Regression?

2007-06-01 Thread Markus Schöpflin
Hello, I just stumbled accross a difference between cStringIO in Python 2.4 and 2.5. You can no longer feed arrays to cStringIO. Python 2.4: ---%--- ActivePython 2.4.3 Build 12 (ActiveState Software Inc.) based on Python 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 bit (Intel)] on win32

Re: execute a function after each source code line ?

2007-06-01 Thread Steve Howell
--- stef [EMAIL PROTECTED] wrote: the language I want to simulate (JAL), is very Pascal like, and therefor can be easily converted into equivalent Python code. One more idea. If you haven't already, maybe you can post something to the PyPy community to effect of this: ''' I have a

Re: generating a tree-like structure

2007-06-01 Thread Steve Howell
--- A.T.Hofkamp [EMAIL PROTECTED] wrote: I would probably generate a DOT file to get a 2D visualization. DOT is part of Graphviz (graphviz.org), and there are quite a few graphviz front-ends available in Python to make DOT generation easier (pydot, yapgvb, and probably a few others).

Re: c[:]()

2007-06-01 Thread Douglas Woodrow
On Fri, 1 Jun 2007 07:23:16, Steve Holden [EMAIL PROTECTED] wrote Actually you can copy and paste from a Windows cmd/command shell: right-click the title-bar of the window, select Edit from the pop-up menu, then Mark from the sub-menu to copy whatever you want to select into the Windows

Re: Python 2.5.1 broken os.stat module

2007-06-01 Thread Joe Salmeri
Martin v. Löwis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I created a file and specifically set the created date, last accessed date and last write date to 01/02/2003 12:34:56 How did you do that? I used a touch utility to set the dates but let's try it a different

RE: c[:]()

2007-06-01 Thread Warren Stringer
Warren Stringer wrote: As mentioned a while back, I'm now predisposed towards using `do(c)()` because square brackets are hard with cell phones. The one mitigating factor for more general use, outside of cell phones, is speed. The speed at which you can type code is almost _never_ a

Re: file reading by record separator (not line by line)

2007-06-01 Thread Tijs
Steve Howell wrote: from blockread import BlockReader b = BlockReader(f, boundary='') for block in b: # whatever Yep, I like this idea. You might have a few variations: Yes, or a single one that takes a wide range of construction possibilities, like strings, lambdas or

Re: subexpressions

2007-06-01 Thread Bruno Desthuilliers
Steve Holden a écrit : (snip) Stop thinking of three lines as extensive coding and your problem disappears immediately. Lol ! +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: subexpressions

2007-06-01 Thread Paul Boddie
On 1 Jun, 12:55, Steve Howell [EMAIL PROTECTED] wrote: FWIW there's the possibility that even without a subexpression syntax, some Python implementations would detect the duplication of x*x and optimize that for you. It would have to know that x*x had no side effects, which I think is a

Re: subexpressions

2007-06-01 Thread Diez B. Roggisch
Steve Howell wrote: --- Sergey Dorofeev [EMAIL PROTECTED] wrote: What syntax would you suggest for a lambda enhanced to cover your use case? I suppose you will end up with roughly the same number of characters, all crammed in one line -- or broken into lines at a random position as it

Re: Delete a file from a CGI

2007-06-01 Thread Gerardo Herzig
When you execute a cgi, the program runs under the apache user (ussualy www or wwwrun or so), so THAT user needs permissions for deleting the file. Other approach could be suid'ing the cgi program. Gerardo HI! I want to delete a file from a CGI, but I always get a Permission denied error.

Re: getmtime differs between Py2.5 and Py2.4

2007-06-01 Thread Neil Hodgson
Joe Salmeri: I can see that you guys have already spent alot of time investigating this but surely the results should match what Windows Explorer says or what the dir command returns??? One problem I have seen is that Windows Explorer and its File Properties sheet sometimes cache time

Re: file reading by record separator (not line by line)

2007-06-01 Thread Tijs
Steve Howell wrote: Do you have any free time on your hands? Nope. I think Python is a programmer's language, not a whack-something-together script language for text processing (although it is used that way). Any decent programmer has no need of this construct, since the time to lookup how

Re: c[:]()

2007-06-01 Thread Duncan Booth
Steve Holden [EMAIL PROTECTED] wrote: Actually you can copy and paste from a Windows cmd/command shell: right-click the title-bar of the window, select Edit from the pop-up menu, then Mark from the sub-menu to copy whatever you want to select into the Windows clipboard. HTH, Better

Re: c[:]()

2007-06-01 Thread Duncan Booth
Grant Edwards [EMAIL PROTECTED] wrote: [Please quit saying a container if you mean lists and tuples. A container is way too general. There most probably _are_ containers for which c() does not fail.] One example of such a container is any folderish content in Zope: subscripting gets you the

logging module: log file with datetime

2007-06-01 Thread Álvaro Nieto
Hi I have this logging config file; [loggers] keys=cdmto [handlers] keys=cdmtoHandler [formatters] keys=mtoFormatter [logger_cdmto] level=DEBUG handlers=cdmtoHandler qualname=cdmto propagate=0 [handler_cdmtoHandler]

Re: execute a function after each source code line ?

2007-06-01 Thread Steve Howell
--- stef [EMAIL PROTECTED] wrote: Steve, that's exactly what I've in mind. The screen shots, looks really good, and I'll definitely will take a deeper look into your code. Cool, good luck. Feel free to contact me privately if you have questions about the implementation. There's also a

Re: HTML Form/Page and Navigation with multiple buttons

2007-06-01 Thread Steve Holden
Bruno Desthuilliers wrote: Steve Holden a écrit : mosscliffe wrote: (snip) Why is a link better than a button ? Beats me why you got that advice. Buttons are perfectly adequate for that purpose. Call me a purist if you want, but I don't think forms and buttons are perfectly adequate

RE: c[:]()

2007-06-01 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Warren Stringer wrote: Warren Stringer wrote: As mentioned a while back, I'm now predisposed towards using `do(c)()` because square brackets are hard with cell phones. The one mitigating factor for more general use, outside of cell phones, is speed. The speed at

Re: subexpressions

2007-06-01 Thread Steve Holden
Sergey Dorofeev wrote: Peter Otten [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sergey Dorofeev wrote: Please help, is there way to use sub-expressions in lambda? For example, if I want to calculate sin(x^2)+cos(x^2) I must code: lambda x: sin(x*x)+cos(x*x) How to make x*x to

Re: subexpressions

2007-06-01 Thread Steve Howell
--- Sergey Dorofeev [EMAIL PROTECTED] wrote: What syntax would you suggest for a lambda enhanced to cover your use case? I suppose you will end up with roughly the same number of characters, all crammed in one line -- or broken into lines at a random position as it happens with

Re: Delete a file from a CGI

2007-06-01 Thread Steve Holden
Matias Surdi wrote: HI! I want to delete a file from a CGI, but I always get a Permission denied error. I've tryed this after creating the file (from a normal script): os.chmod(.lock,stat.S_IMODE(stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG))

Re: c[:]()

2007-06-01 Thread Steve Holden
Douglas Woodrow wrote: On Thu, 31 May 2007 18:42:05, Warren Stringer [EMAIL PROTECTED] wrote They were copied from working code. Copied *badly*? Yes. Running python via: Windows - start - run - python doesn't allow cut and paste Hi Warren, Actually you can copy and paste from a Windows

Re: subexpressions

2007-06-01 Thread Steve Howell
--- Tijs [EMAIL PROTECTED] wrote: Steve Howell wrote: FWIW there's the possibility that even without a subexpression syntax, some Python implementations would detect the duplication of x*x and optimize that for you. It would have to know that x*x had no side effects, which I think

RE: c[:]()

2007-06-01 Thread Carsten Haese
On Fri, 2007-06-01 at 02:19 -0700, Warren Stringer wrote: There is code that you type which persists and code that you type from a command line. Two completely different idioms. A credo inside the cell phone game industry is that you lose half your audience with each menu keystroke. That's how

RE: c[:]()

2007-06-01 Thread Carsten Haese
On Fri, 2007-06-01 at 08:39 -0400, Carsten Haese wrote: On Fri, 2007-06-01 at 02:19 -0700, Warren Stringer wrote: There is code that you type which persists and code that you type from a command line. Two completely different idioms. A credo inside the cell phone game industry is that you

Re: subexpressions

2007-06-01 Thread Diez B. Roggisch
Ok, I stand corrected. Duplicate subexpressions are pretty easy to avoid in Python, so though an optimization would not be impossible here (checking for immutability of builtins, etc., which still assumes the idea that multiplication is more expensive than checking for immutability even

unknown host

2007-06-01 Thread abcd
I have a linux machine (ip = 10.10.10.8), which can ping other machines on the same subnet...such as 10.10.10.1 10.10.10.2 10.10.10.5 10.10.10.6 10.10.10.254 If I use socket.gethostbyaddr(ip) I get back results when ip is 10.10.10.1 and 10.10.10.254 but for the other IP addresses (10.10.10.5,

Re: ImageMagick Issue

2007-06-01 Thread Facundo Batista
Sick Monkey escribió: I ran into another slight problem. And I attempted to fix it, but have not been able to do so yet. If a filename does not contain a space, then this method works like a charm. But if there is a space then the code throws a nasty error. Ok, the issue is that

Re: unknown host

2007-06-01 Thread Michael Bentley
On Jun 1, 2007, at 8:09 AM, abcd wrote: I have a linux machine (ip = 10.10.10.8), which can ping other machines on the same subnet...such as 10.10.10.1 10.10.10.2 10.10.10.5 10.10.10.6 10.10.10.254 If I use socket.gethostbyaddr(ip) I get back results when ip is 10.10.10.1 and

Re: logging module: log file with datetime

2007-06-01 Thread Vinay Sajip
On 1 Jun, 13:00, Álvaro Nieto [EMAIL PROTECTED] wrote: How could I define a log file with datetime in his name?. Now the name for log file is './Logs/cdmto.log' and I'd like it would be './ Logs/cdmto_20070601.log', for example. You can't do this just in the configuration -

Re: pack() and the division of vertical space

2007-06-01 Thread [EMAIL PROTECTED]
On Jun 1, 3:13 am, Eric Brunel [EMAIL PROTECTED] wrote: On Thu, 31 May 2007 19:45:04 +0200, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am trying to figure out how to stack two widgets in a frame vertically so that they both expand horizontally and during vertical expansion, the top

Re: Delete a file from a CGI

2007-06-01 Thread Matias Surdi
Thanks for your reply. This is the code that creates the file: lock_file = open(.lock,w) lock_file.write(test) lock_file.close() #Change permissions so that CGI can write lock file os.chmod(.lock,stat.S_IMODE(stat.S_IRWXU | stat.S_IRWXO | stat.S_IRWXG)) This script was run as root. Now, the

Re: c[:]()

2007-06-01 Thread Sion Arrowsmith
Warren Stringer [EMAIL PROTECTED] wrote: #-- class do(list): def __call__(self,*args,**kwargs): return [f(*args,**kwargs) for f in self] def a(): print 'a called' def b(): print 'b called' c = do() c = [a,b] do(c[:])() do(c)()

Re: unknown host

2007-06-01 Thread Sion Arrowsmith
abcd [EMAIL PROTECTED] wrote: I have a linux machine (ip = 10.10.10.8), which can ping other machines on the same subnet...such as [ ... ] If I use socket.gethostbyaddr(ip) I get back results when ip is 10.10.10.1 and 10.10.10.254 but for the other IP addresses (10.10.10.5, .6, etc) I get back

Re: c[:]()

2007-06-01 Thread Grant Edwards
On 2007-06-01, Carsten Haese [EMAIL PROTECTED] wrote: On Fri, 2007-06-01 at 02:19 -0700, Warren Stringer wrote: There is code that you type which persists and code that you type from a command line. Two completely different idioms. A credo inside the cell phone game industry is that you lose

Re: c[:]()

2007-06-01 Thread Grant Edwards
On 2007-06-01, Warren Stringer [EMAIL PROTECTED] wrote: I like your use case. Am I correct in assuming that `y = x[:]; y()` is NOT to be found in working code? No, you may not assume that. If that is the case, then nothing gets broken. It would be instructive to have a use case where

Cookie: Not understanding again

2007-06-01 Thread mosscliffe
I have the following code, which I thought would create a cookie, if one did not exist and on the html form being sent to the server, it would be availabe for interrogation, when the script is run a second time. It seems to me there is something basic missing in that I should need to tell the

Re: calling Postgresql stored procedure (written in plpython)

2007-06-01 Thread Nikita the Spider
In article [EMAIL PROTECTED], Alchemist [EMAIL PROTECTED] wrote: Thanks for your help. My stored procedure is written in pythonpl. I noticed that SELECT queries are executed correctly (results are returned to my script) whereas UPDATE queries are not being performed as the data is not

Re: Cookie: Not understanding again

2007-06-01 Thread mosscliffe
On 1 Jun, 15:49, mosscliffe [EMAIL PROTECTED] wrote: I have the following code, which I thought would create a cookie, if one did not exist and on the html form being sent to the server, it would be availabe for interrogation, when the script is run a second time. It seems to me there is

What is equivalent of *this = that in python?

2007-06-01 Thread Emin.shopper Martinian.shopper
Dear Experts, How do I reassign self to another object? For example, I want something like class foo: def Update(self,other): # make this object the same as other or make this object a copy of other self = other # This won't work. What I really want is *this = other in C++

MySQLdb insert fails on one table

2007-06-01 Thread Sells, Fred
I have this table mysql describe valid_individuals; +---+--+--+-+-+---+ | Field | Type | Null | Key | Default | Extra | +---+--+--+-+-+---+ | fname | varchar(30) | YES | | NULL| | | lname | varchar(30)

Re: What is equivalent of *this = that in python?

2007-06-01 Thread Carsten Haese
On Fri, 2007-06-01 at 11:30 -0400, Emin.shopper Martinian.shopper wrote: Dear Experts, How do I reassign self to another object? For example, I want something like class foo: def Update(self,other): # make this object the same as other or make this object a copy of other

Re: c[:]()

2007-06-01 Thread dackz
This discussion has gone in more circles than Earth has gone 'round the Sun, but it seems you should consider the following: 1) Sequences and functions serve fundamentally different purposes in Python. One is for containing objects, the other is for executing an action. (And yes, I'm aware that

Re: What is equivalent of *this = that in python?

2007-06-01 Thread Emin.shopper Martinian.shopper
I have a distributed application using xmlrpc and I'd like for a local object to sync itself to match a remote version of the object. I realize that I can copy all the attributes from the remote object to the local object, but that seems like an ugly solution. There must be a better way...

Re: Using PIL to find separator pages

2007-06-01 Thread Larry Bates
Steve Holden wrote: Larry Bates wrote: I have a project that I wanted to solicit some advice on from this group. I have millions of pages of scanned documents with each page in and individual .JPG file. When the documents were scanned the people that did the scanning put a colored (hot

Re: MySQLdb insert fails on one table

2007-06-01 Thread Carsten Haese
On Fri, 2007-06-01 at 11:48 -0400, Sells, Fred wrote: INSERT INTO valid_individuals (fname,lname,alias,email) VALUES (%s,%s,%s,%s) [['', '', 'z', 'aa']] this function works fine for several other tables, but on this one I get no errors and there is nothing in the table. If I

Re: cStringIO change in 2.4 vs 2.5. Regression?

2007-06-01 Thread Terry Reedy
Markus Schöpflin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Hello, | | I just stumbled accross a difference between cStringIO in Python 2.4 | and 2.5. You can no longer feed arrays to cStringIO. [snip] | Has this change been done on purpose or is it a regression? I doubt that

Re: Python 2.5.1 broken os.stat module

2007-06-01 Thread Terry Reedy
Joe Salmeri [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | I hope I have provided enough information for you to reproduce the bug so | that a solution can be found. If, when discussion is concluded here, you still think there is a bug, file a report on SF. Make a concise summary

Re: How to clean a module?

2007-06-01 Thread ai
thx On Jun 1, 6:50 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: ai wrote: Yes, you are right. But from this problem, could I infer that the statement del xxx doesn't release the memory which xxx used? It just removes the name xxx from the current scope - which will result in a

Re: Using PIL to find separator pages

2007-06-01 Thread Steve Holden
Larry Bates wrote: Steve Holden wrote: Larry Bates wrote: I have a project that I wanted to solicit some advice on from this group. I have millions of pages of scanned documents with each page in and individual .JPG file. When the documents were scanned the people that did the scanning put

  1   2   >