Re: self.__dict__ tricks

2009-10-30 Thread Steven D'Aprano
On Fri, 30 Oct 2009 15:55:04 +1100, Ben Finney wrote: Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Thu, 29 Oct 2009 21:16:37 -0500, Tim Johnson wrote: class formLoader(): Idiomatic Python is to use CamelCase for classes. Or rather: Instead of camelCase names,

Re: How to run a repeating timer every n minutes?

2009-10-30 Thread Frank Millman
Diez B. Roggisch wrote: mk wrote: I'm newbie at threading, so I'm actually asking: should not method like stop() be surrounded with acquire() and release() of some threading.lock? I mean, is this safe to update running thread's data from the main thread without lock? stop() is part of

Re: Modify dict/set during iteration?

2009-10-30 Thread Steven D'Aprano
On Thu, 29 Oct 2009 21:14:22 -0700, metal wrote: Maybe my real goal is the following: def miter(iterable): for x in tuple(iterable): if x in iterable: yield x I don't think that does what you think it does. For some iterables it doesn't do

spring effect in Python

2009-10-30 Thread pochis40
I'm trying to write in Python something similar to this: (Java) http://java.sun.com/applets/jdk/1.4/demo/applets/GraphLayout/example1.html or these: (Proce55ing) http://www.cricketschirping.com/processing/ExportAtlas/ or

Re: ImportError: No module named _md5 - Please help

2009-10-30 Thread wadi wadi
Thanks Robert for defending me :) On 10/29/09, Robert Kern robert.k...@gmail.com wrote: On 2009-10-29 11:28 AM, Sean DiZazzo wrote: On Oct 29, 8:49 am, wadi wadiwadie...@gmail.com wrote: I can't alter the import statement as the error log is pointing to one of the installed python files

Re: ftpilb.FTP.stor...() freeze mystery

2009-10-30 Thread Anthra Norell
Gabriel Genellina wrote: En Thu, 29 Oct 2009 13:18:30 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: Gabriel Genellina wrote: En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: Gabriel Genellina wrote: En Tue, 27 Oct 2009 07:53:36 -0300, Anthra

Re: If a class Child inherits from Parent, how to implement Child.some_method if Parent.some_method() returns Parent instance ?

2009-10-30 Thread Bruno Desthuilliers
metal a écrit : The actual situation is I'm coding with a immuable set-like datatype XSet which supports XSet(['al']) XSet(['ah'] = XSet(['ax'] I assume it was '==', not '=' if I declare ax is consists of al and ah That means I can't explian it very well 'cause my english... Now I try to

Re: If a class Child inherits from Parent, how to implement Child.some_method if Parent.some_method() returns Parent instance ?

2009-10-30 Thread Bruno Desthuilliers
metal a écrit : Consider the following: (snip) class Parent: def some_method(self): return Parent(...) class Child: pass Child().some_method() returns a Parent instance. It actually raises an AttributeError. You forgot to make Child inherit from Parent.

Re: Aaaargh! global name 'eggz' is not defined

2009-10-30 Thread Bruno Desthuilliers
Robert Kern a écrit : On 2009-10-29 16:52 PM, Aahz wrote: (snip) Coincidentally, I tried PyFlakes yesterday and was unimpressed with the way it doesn't work with import *. I consider import * the first error to be fixed, so it doesn't bother me much. :-) +1 QOTW --

Re: If a class Child inherits from Parent, how to implement Child.some_method if Parent.some_method() returns Parent instance ?

2009-10-30 Thread metal
On 10月30日, 上午8时03分, metal metal...@gmail.com wrote: The actual situation is I'm coding with a immuable set-like datatype XSet which supports XSet(['al']) XSet(['ah'] = XSet(['ax'] if I declare ax is consists of al and ah A typo, XSet(['al']) | XSet(['ah'] = XSet(['ax'] --

Re: '11' + '1' is '111'?

2009-10-30 Thread Ben Finney
metal metal...@gmail.com writes: '11' + '1' == '111' is well known. but it suprises me '11'+'1' IS '111'. Don't be surprised. Rather, don't depend on implementation-dependent behaviour, such as whether two objects that compare equal will or will not have the same identity. That behaviour is

Re: list comprehension problem

2009-10-30 Thread Ben Finney
(Please preserve attribution lines when you quote someone, so we can keep track of who said what in the developing discussion.) Nick Stinemates n...@stinemates.org writes: Some objects are singletons, ie there's only ever one of them. The most common singleton is None. In virtually every

Re: self.__dict__ tricks

2009-10-30 Thread Ben Finney
Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Thu, 29 Oct 2009 21:16:37 -0500, Tim Johnson wrote: class formLoader(): Idiomatic Python is to use CamelCase for classes. Or rather: Instead of camelCase names, idiomatic Python is to use TitleCase names. -- \ “We are

import problem in tkinter

2009-10-30 Thread Jebegnana das
import _tkinter # If this fails your Python may not be configured for Tk I'm using python3 in linux. In windows tkinter is working fine but in mandriva linux spring 2009 it fails to import. Can you please tell me step-by-step on how to fix this issue? In python3.1 home page the description is not

Re: If a class Child inherits from Parent, how to implement Child.some_method if Parent.some_method() returns Parent instance ?

2009-10-30 Thread metal
On 10月30日, 下午4时44分, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: metal a écrit : The actual situation is I'm coding with a immuable set-like datatype XSet which supports XSet(['al']) XSet(['ah'] = XSet(['ax'] I assume it was '==', not '=' if I declare ax is

Re: If a class Child inherits from Parent, how to implement Child.some_method if Parent.some_method() returns Parent instance ?

2009-10-30 Thread Bruno Desthuilliers
metal a écrit : On 10月30日, 下午4时44分, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: metal a écrit : (snip) def methods(cls): return [k for k, v in cls.__dict__.items() if callable(v)] All callables are not functions or methods... The inspect module might

Re: Python 2.6 Global Variables

2009-10-30 Thread Bruno Desthuilliers
AK Eric a écrit : 2/ in Python, global really means module-level - there's nothing like a true global namespace. Isn't that __main__? Nope import __main__ __main__.foo = asdfasdf print foo # asdfasdf Not advocating, but it does serve the purpose. This won't make 'foo' available to

Re: Python 2.6 Global Variables

2009-10-30 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : AK Eric a écrit : 2/ in Python, global really means module-level - there's nothing like a true global namespace. Isn't that __main__? Nope import __main__ __main__.foo = asdfasdf print foo # asdfasdf Not advocating, but it does serve the purpose. This

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread bartc
Alf P. Steinbach al...@start.no wrote in message news:hcdlsp$9a...@news.eternal-september.org... * bartc: Alf P. Steinbach al...@start.no wrote in message news:hc8pn3$dd...@news.eternal-september.org... [Cross-posted comp.programming and comp.lang.python] You use the highly

Re: Are *.pyd's universal?

2009-10-30 Thread Carl Banks
On Oct 29, 9:10 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message mailman.2297.1256863331.2807.python-l...@python.org, Christian Heimes wrote: Lawrence D'Oliveiro schrieb: In message mailman.2268.1256841007.2807.python-l...@python.org, Christian Heimes wrote:

Re: What IDE has good git and python support?

2009-10-30 Thread Bruno Desthuilliers
Aweks a écrit : what do you use? bash + emacs -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Bruno Desthuilliers
Alf P. Steinbach a écrit : (snip) Microsoft's own Windows Explorer, the main GUI shell for Windows, which presumably was made by the best programmers available Mouarf !!! +1 JOFY (= Joke Of The Year) -- http://mail.python.org/mailman/listinfo/python-list

Sqlite3. Substitution of names in query.

2009-10-30 Thread Lacrima
Hello! I use sqlite3 module for my sqlite database. I am trying to substitute table name in sql query. import sqlite3 con = sqlite3.connect('mydb') cur = con.execute(select * from table where name='Joe') That's ok cur = con.execute(select * from table where name=?, ('Joe',)) That's ok too

Re: What IDE has good git and python support?

2009-10-30 Thread Ben Finney
Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid writes: Aweks a écrit : what do you use? bash + emacs Yes, Bash and the toolkit provided by the GNU operating system are an excellent integrated development environment (IDE). Emacs has a ‘vc’ mode, and Git provides an Emacs

Re: Sqlite3. Substitution of names in query.

2009-10-30 Thread Diez B. Roggisch
Lacrima schrieb: Hello! I use sqlite3 module for my sqlite database. I am trying to substitute table name in sql query. import sqlite3 con = sqlite3.connect('mydb') cur = con.execute(select * from table where name='Joe') That's ok cur = con.execute(select * from table where name=?,

Re: spring effect in Python

2009-10-30 Thread Lie Ryan
pochis40 wrote: I'm trying to write in Python something similar to this: (Java) http://java.sun.com/applets/jdk/1.4/demo/applets/GraphLayout/example1.html or these: (Proce55ing) http://www.cricketschirping.com/processing/ExportAtlas/ or

Python library support propaganda lists?

2009-10-30 Thread Aaron Watters
Let me vent my annoyance. In the last couple months on a few occasions I've tried various Python libraries (and I'm not going to name names) and run into some problem. Following the documented procedure I eventually post the problem to the support list trying to politely explain everything,

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Xavier Ho
Alf, I kindly urge you to re-read bartc's comments. He does have a good point and you seem to be avoiding direct answers. On Fri, Oct 30, 2009 at 1:17 PM, Alf P. Steinbach al...@start.no wrote: * bartc: You say elsewhere that you're not specifically teaching Python, but the text is full of

Re: Python library support propaganda lists?

2009-10-30 Thread Frank Millman
Aaron Watters aaron.watt...@gmail.com wrote in message news:69f74b6c-e996-4e5c-a9f2-b5173e33a...@d21g2000yqn.googlegroups.com... Let me vent my annoyance. In the last couple months on a few occasions I've tried various Python libraries (and I'm not going to name names) and run into some

Re: Python library support propaganda lists?

2009-10-30 Thread Frank Millman
Aaron Watters aaron.watt...@gmail.com wrote in message news:69f74b6c-e996-4e5c-a9f2-b5173e33a...@d21g2000yqn.googlegroups.com... Let me vent my annoyance. In the last couple months on a few occasions I've tried various Python libraries (and I'm not going to name names) and run into some

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Xavier Ho
On Fri, Oct 30, 2009 at 1:48 PM, Alf P. Steinbach al...@start.no wrote: Does that mean that 'print' is still subject to change as of 3.1.1? Funny that. They removed reduce() when Python moved from 2.6.x to 3.0. They even removed __cmp__(). Makes me a sad panda. Is print() subject to change as

Re: Python library support propaganda lists?

2009-10-30 Thread Frank Millman
Aaron Watters wrote: Following the documented procedure I eventually post the problem to the support list trying to politely explain everything, including the admission that it may all be my stupidity causing the problem. Then I'm told automatically that my post will be moderated. Then

Re: Web development with Python 3.1

2009-10-30 Thread Dotan Cohen
Look at this templating code: {% for entry in blog_entries %}    h2{{ entry.title }}/h2    p{{ entry.body }}/p {% endfor %} What's the problem ? Simple, clear and obvious. It is clear and obvious. But it has the template engine duplicating a function that Python has built in. My goal is

Re: Aaaargh! global name 'eggz' is not defined

2009-10-30 Thread Lie Ryan
Aahz wrote: In article mailman.2279.1256851983.2807.python-l...@python.org, Robert Kern robert.k...@gmail.com wrote: I like using pyflakes. It catches most of these kinds of typo errors, but is much faster than pylint or pychecker. Coincidentally, I tried PyFlakes yesterday and was

Re: Problem embedding Python.

2009-10-30 Thread Dave Angel
Dave Angel wrote: div class=moz-text-flowed style=font-family: -moz-fixedBrandon Keown wrote: On Oct 27, 7:48 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: snip Now that you've solved your problem, revise your conclusion. A file without a path *is* searched in the current working

Re: Python library support propaganda lists?

2009-10-30 Thread Ulrich Eckhardt
Aaron Watters wrote: In the last couple months on a few occasions I've tried various Python libraries (and I'm not going to name names) and run into some problem. Following the documented procedure [...] Documented where? [...] I eventually post the problem to the support list Which

Publishing new release on PyPI: How?

2009-10-30 Thread Michael Ströder
HI! Well, maybe I'm completely blind but I can't find a way to add a new release to PyPI index for python-ldap, not just a new file to an existing release version. I'm the project owner and I did it several times in the past. But I simply can't find the button where to add another release. Was

Re: Web development with Python 3.1

2009-10-30 Thread Bruno Desthuilliers
Dotan Cohen a écrit : Look at this templating code: {% for entry in blog_entries %} h2{{ entry.title }}/h2 p{{ entry.body }}/p {% endfor %} What's the problem ? Simple, clear and obvious. It is clear and obvious. But it has the template engine duplicating a function that Python has

Re: Modify dict/set during iteration?

2009-10-30 Thread Dave Angel
metal wrote: Steven D'Aprano wrote: On Thu, 29 Oct 2009 19:02:01 -0700, metal wrote: I used this quickndirty way, any good idea to solve this problem? It's not a problem that wants solving, it's a feature that wants paying attention to. As a general rule, you shouldn't modify

Re: spring effect in Python

2009-10-30 Thread Riccardo Lemmi
pochis40 wrote: I'm trying to write in Python something similar to this: (Java) http://java.sun.com/applets/jdk/1.4/demo/applets/GraphLayout/example1.html or these: (Proce55ing) http://www.cricketschirping.com/processing/ExportAtlas/ or

Re: Python 2.6 Global Variables

2009-10-30 Thread Dave Angel
Gabriel Genellina wrote: div class=moz-text-flowed style=font-family: -moz-fixedEn Fri, 30 Oct 2009 00:29:27 -0300, Steven D'Aprano st...@remove-this-cybersource.com.au escribió: On Thu, 29 Oct 2009 10:31:03 -0700, AK Eric wrote: 2/ in Python, global really means module-level - there's

Re: How to avoid certain directories when using os.walk?

2009-10-30 Thread Dave Angel
Chris Rebert wrote: On Thu, Oct 29, 2009 at 9:53 PM, Peng Yu pengyu...@gmail.com wrote: I don't see a way to avoid walking over directories of certain names with os.walk. For example, I don't want os.walk return files whose path include '/backup/'. Is there a way to do so? Otherwise, maybe I

Re: import problem in tkinter

2009-10-30 Thread Dave Angel
Jebegnana das wrote: import _tkinter # If this fails your Python may not be configured for Tk I'm using python3 in linux. In windows tkinter is working fine but in mandriva linux spring 2009 it fails to import. Can you please tell me step-by-step on how to fix this issue? In python3.1 home page

Tutorial Forum

2009-10-30 Thread TheTutorialSpot Webmaster
Come check out http://www.thetutorialspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: self.__dict__ tricks

2009-10-30 Thread MRAB
Steven D'Aprano wrote: On Fri, 30 Oct 2009 15:55:04 +1100, Ben Finney wrote: Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Thu, 29 Oct 2009 21:16:37 -0500, Tim Johnson wrote: class formLoader(): Idiomatic Python is to use CamelCase for classes. Or rather: Instead of

Re: self.__dict__ tricks

2009-10-30 Thread Tim Golden
MRAB wrote: Steven D'Aprano wrote: On Fri, 30 Oct 2009 15:55:04 +1100, Ben Finney wrote: Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Thu, 29 Oct 2009 21:16:37 -0500, Tim Johnson wrote: class formLoader(): Idiomatic Python is to use CamelCase for classes. Or rather:

Re: Are *.pyd's universal?

2009-10-30 Thread Dave Angel
Carl Banks wrote: On Oct 29, 9:10 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message mailman.2297.1256863331.2807.python-l...@python.org, Christian Heimes wrote: Lawrence D'Oliveiro schrieb: In message

Re: Python 2.6 Global Variables

2009-10-30 Thread AK Eric
It isn't a neat trick anymore once you realize the name '__main__' isn't special. Replace __main__ with foo, or config, or whatever, and you get the same results. Ok, there is a catch: a file with that name must exist, at least an empty one... True. I do feel a bit less special now

Re: self.__dict__ tricks

2009-10-30 Thread Tim Johnson
On 2009-10-30, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: Could you explain what problem you are trying to solve? class formLoader(): Hi Steve In a nutshell: The 'problem' is to parse a form in such a way that tags which are to be modified are represented as

Re: Python library support propaganda lists?

2009-10-30 Thread Robert Kern
On 2009-10-30 07:30 AM, Aaron Watters wrote: Let me vent my annoyance. In the last couple months on a few occasions I've tried various Python libraries (and I'm not going to name names) and run into some problem. Following the documented procedure I eventually post the problem to the support

How to keep permission bits when including package data in distutils

2009-10-30 Thread Olli Wang
Hi, I want to include some binary package data into my distribution and I define these binary in MANIFEST.in. However, all binary lose the `x` permissions so they can't be executed in my program. Is there any way to remedy this situation? Thanks. --

Re: Python library support propaganda lists?

2009-10-30 Thread Aaron Watters
[note: if this shows up twice, it's because my internet connection flaked out] On Oct 30, 12:23 pm, Robert Kern robert.k...@gmail.com wrote: You almost certainly ran into technical misconfiguration or lazy moderators. It's suspicious, however, when other posts which seem to be from new posters

Re: Python 2.6 Global Variables

2009-10-30 Thread Stephen Hansen
On Fri, Oct 30, 2009 at 9:01 AM, AK Eric warp...@sbcglobal.net wrote: Should we start talking about how you can add stuff to __builtin__ and then it really is exposed to everything? (right, unless I'm missing some other Python idiom?) Again, *not advocating* in standard practice, but I think

Re: Python library support propaganda lists?

2009-10-30 Thread Robert Kern
On 2009-10-30 11:31 AM, Aaron Watters wrote: I know this may be due to simple laziness and negligence, but in that case they should turn moderation off. That's the funny thing about mailing list problems. If a misconfiguration means people can't post to your, you don't hear from the people

Re: Python2.6 + win32com crashes with unicode bug

2009-10-30 Thread GerritM
Terry Reedy schreef: GerritM wrote: I have automated image generation with Python, win32com and Visio5.0. This works well upto Python2.5 but fails with Python 2.6. Short term solution is to return to 2.5 :-(. I have reproduced the bug below with a minimum of Python lines. Below the problem

Re: Sqlite3. Substitution of names in query.

2009-10-30 Thread Matteo
On Oct 30, 7:27 am, Diez B. Roggisch de...@nospam.web.de wrote: [snip] Or even better, by not doing it at all - because usually, your datamodel is tied to your program, so the need for this kind of dynamicity shouldn't arise in the first place. Die Perhaps that is true in the majority of

How can module determine its own path?

2009-10-30 Thread kj
How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) TIA! kynn -- http://mail.python.org/mailman/listinfo/python-list

Re: transpose array

2009-10-30 Thread Aahz
In article mailman.2137.1256686009.2807.python-l...@python.org, Rhodri James rho...@wildebst.demon.co.uk wrote: Surely more Pythonic would be: for t in zip(xVec, yVec, zVec): print f, , .join(t) Except that you *really* want itertools.izip() if these vectors are likely to be any

Re: How can module determine its own path?

2009-10-30 Thread Robert Kern
On 2009-10-30 12:19 PM, kj wrote: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible

Socket MUD client script

2009-10-30 Thread Zamnedix
I'm having trouble with this script I'm writing. I want it to connect to a MUD, which it does fine, but afterwards it displays the greeting and login prompt, and when I type in username the loop to receive and then send seems to stop. Here's my code: #!/usr/bin/python import socket import sys a

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
* bartc: python.org seems to be the main site. Google python download and that is the first hit. Their windows download seems to be 13MB against the 32MB of activestate, and the IDE provided seems more advanced that the 'console window' you have in your tutorial. I'm just asking why your

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
* Alf P. Steinbach: * bartc: python.org seems to be the main site. Google python download and that is the first hit. Their windows download seems to be 13MB against the 32MB of activestate, and the IDE provided seems more advanced that the 'console window' you have in your tutorial. I'm

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Dann Corbit
In article xfwdnvpdb-3mkhtxnz2dnuvz8nvi4...@bt.com, r...@see.sig.invalid says... In mpg.255246264331509a989...@news.eternal-september.org, Dann Corbit wrote: snip You can read PDF with the ghostscript stuff or the free Adobe stuff. Agreed. But why should you have to? As opposed

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
* bartc: Python has a lot of baggage which is OK if that's what's going to be used, but otherwise is unnecessary confusion: where to put the program code (typed in live or in a file, or some combination); whether to call the file .py or .pyw; the difference between console and graphical

Re: Socket MUD client script

2009-10-30 Thread MRAB
Zamnedix wrote: I'm having trouble with this script I'm writing. I want it to connect to a MUD, which it does fine, but afterwards it displays the greeting and login prompt, and when I type in username the loop to receive and then send seems to stop. Here's my code: #!/usr/bin/python import

Re: Web development with Python 3.1

2009-10-30 Thread Terry Reedy
Dotan Cohen wrote: It is clear and obvious. But it has the template engine duplicating a function that Python has built in. ... Then use Mako - it uses plain Python to manage the presentation logic. And if you go for Mako, then you might as well switch to Pylons. Great framework too

Re: How can module determine its own path?

2009-10-30 Thread AK Eric
How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ Also: import inspect print inspect.getsourcefile(lambda:None) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python library support propaganda lists?

2009-10-30 Thread Aaron Watters
On Oct 30, 12:51 pm, Robert Kern robert.k...@gmail.com wrote: On 2009-10-30 11:31 AM, Aaron Watters wrote: I know this may be due to simple laziness and negligence, but in that case they should turn moderation off. That's the funny thing about mailing list problems. If a misconfiguration

Firebird DBs use Kinterbasdb or sqlalchemy?

2009-10-30 Thread Jorge
Hi, to access firebird data bases which shall I use kinterbasdb or sqlalchemy. Yes I'm a newbie. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket MUD client script

2009-10-30 Thread Terry Reedy
Zamnedix wrote: I'm having trouble with this script I'm writing. I want it to connect to a MUD, which it does fine, but afterwards it displays the greeting and login prompt, and when I type in username the loop to receive and then send seems to stop. Here's my code: #!/usr/bin/python import

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Richard Heathfield
In mpg.2554d283970cde989...@news.eternal-september.org, Dann Corbit wrote: In article xfwdnvpdb-3mkhtxnz2dnuvz8nvi4...@bt.com, r...@see.sig.invalid says... In mpg.255246264331509a989...@news.eternal-september.org, Dann Corbit wrote: snip You can read PDF with the ghostscript stuff

Re: Firebird DBs use Kinterbasdb or sqlalchemy?

2009-10-30 Thread Christian Heimes
Jorge wrote: Hi, to access firebird data bases which shall I use kinterbasdb or sqlalchemy. You have to use kinterbasdb. SQLAlchemy is not a DBA but an ORM. Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python library support propaganda lists?

2009-10-30 Thread Robert Kern
On 2009-10-30 14:37 PM, Aaron Watters wrote: On Oct 30, 12:51 pm, Robert Kernrobert.k...@gmail.com wrote: On 2009-10-30 11:31 AM, Aaron Watters wrote: I know this may be due to simple laziness and negligence, but in that case they should turn moderation off. That's the funny thing about

Re: Aaaargh! global name 'eggz' is not defined

2009-10-30 Thread Fabio Zadrozny
On Thu, Oct 29, 2009 at 6:48 PM, kj no.em...@please.post wrote: How can one check that a Python script is lexically correct? As my Python apps grow in complexity and execution, I'm finding it more often the situation in which a program dies after a lengthy (i.e. expensive) run because the

datetime question

2009-10-30 Thread Victor Subervi
Hi; I have this code: today = datetime.date.today() day = today.day mo = today.month yr = today.year Works great. What I need to calculate is the length of days in the given month. How do I do that? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Mensanator
On Oct 30, 2:07 pm, Alf P. Steinbach al...@start.no wrote: * bartc: Python has a lot of baggage which is OK if that's what's going to be used, but otherwise is unnecessary confusion: where to put the program code (typed in live or in a file, or some combination); whether to call the

Re: Strange behavior related to value / reference

2009-10-30 Thread Aahz
In article 626f24e5-4d8e-416c-b3ed-dc56a88dc...@s21g2000prm.googlegroups.com, Lambda stephenh...@gmail.com wrote: def matrix_power(m, n): result = m[:] print result is m Use copy.deepcopy() -- Aahz (a...@pythoncraft.com) * http://www.pythoncraft.com/ You could make

Re: Python library support propaganda lists?

2009-10-30 Thread Aahz
In article mailman.2343.1256932944.2807.python-l...@python.org, Robert Kern robert.k...@gmail.com wrote: You know, if you hadn't leapt to paranoid conclusions in the first place, you could have named the lists that you were having problems with right here, and probably other people would be able

Re: How can module determine its own path?

2009-10-30 Thread kj
In 7e456639-9dbb-41ba-ae36-042a034fa...@y32g2000prd.googlegroups.com AK Eric warp...@sbcglobal.net writes: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ Also: import inspect print

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Alf P. Steinbach
* Mensanator: On Oct 30, 2:07 pm, Alf P. Steinbach al...@start.no wrote: * bartc: Python has a lot of baggage which is OK if that's what's going to be used, but otherwise is unnecessary confusion: where to put the program code (typed in live or in a file, or some combination); whether to

Re: datetime question

2009-10-30 Thread Rami Chowdhury
On Fri, 30 Oct 2009 13:03:32 -0700, Victor Subervi victorsube...@gmail.com wrote: Hi; I have this code: today = datetime.date.today() day = today.day mo = today.month yr = today.year Works great. What I need to calculate is the length of days in the given month. How do I do that? TIA,

Re: Web development with Python 3.1

2009-10-30 Thread Dotan Cohen
It is clear and obvious. But it has the template engine duplicating a function that Python has built in. My goal is to learn reusable Python (reusable for non-web projects). My goal is not to find the quickest way to a website. Please correct me if I'm wrong, but you did learn HTML, CSS and

Re: Web development with Python 3.1

2009-10-30 Thread Dotan Cohen
I took a look a both yesterday. They are both generic text templating systems that seem to pretty much do the same thing. I suspect you will prefer Mako since it avoids duplicating Python's comtrol structures. But I think it worthwhile to look at both anyway since doing so will help to

Re: __eq__() inconvenience when subclassing set

2009-10-30 Thread Jess Austin
On Oct 29, 10:41 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: We know the last test fails because the == logic fails to recognize mySet   (on the right side) as a more specialized object than frozenset (on the   left side), because set and frozenset don't have a common base type  

Re: Web development with Python 3.1

2009-10-30 Thread Robert Kern
On 2009-10-30 15:55 PM, Dotan Cohen wrote: It is clear and obvious. But it has the template engine duplicating a function that Python has built in. My goal is to learn reusable Python (reusable for non-web projects). My goal is not to find the quickest way to a website. Please correct me if

Re: Unicode again ... default codec ...

2009-10-30 Thread Gabriel Genellina
En Fri, 30 Oct 2009 13:40:14 -0300, zooko zoo...@gmail.com escribió: On Oct 20, 9:50 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: DON'T do that. Really. Changing the default encoding is a horrible, horrible hack and causes a lot of problems. I'm not convinced. I've read all of the

Re: Python library support propaganda lists?

2009-10-30 Thread Ben Finney
Ulrich Eckhardt eckha...@satorlaser.com writes: Aaron Watters wrote: I don't know why this happens, but if people are using their support forums And now it's a forum, not a mailinglist, and more than one of them? I'm not impressed by the attempt to hijack the word “forum”. A mailing list,

Re: Web development with Python 3.1

2009-10-30 Thread erob
On Oct 28, 5:16 am, Diez B. Roggisch de...@nospam.web.de wrote: Dotan Cohen schrieb: While I know that to be true in the general sense, from what I've looked at Django and other frameworks it seems that the web frameworks push the coder to use templates, not letting him near the HTML.

Re: datetime question

2009-10-30 Thread Ben Finney
Victor Subervi victorsube...@gmail.com writes: What I need to calculate is the length of days in the given month. How do I do that? The ‘datetime’ module focusses on individual date+time values (and the periods between them, with the ‘timedelta’ type). For querying the properties of the

Re: Are *.pyd's universal?

2009-10-30 Thread Carl Banks
On Oct 30, 8:43 am, Dave Angel da...@ieee.org wrote: And I'm guessing that CPython searches down sys.path, and when it finds the module, gives a full path to LoadLibrary(), in which case the DLL search path is moot. It's not Python that's the issue. The issue is that if you have a module with

Re: Web development with Python 3.1

2009-10-30 Thread erob
On Oct 30, 7:01 pm, erob robillard.etie...@gmail.com wrote: On Oct 28, 5:16 am, Diez B. Roggisch de...@nospam.web.de wrote: Dotan Cohen schrieb: While I know that to be true in the general sense, from what I've looked at Django and other frameworks it seems that the web frameworks

Re: Publishing new release on PyPI: How?

2009-10-30 Thread Martin v. Löwis
Well, maybe I'm completely blind but I can't find a way to add a new release to PyPI index for python-ldap, not just a new file to an existing release version. I recommend to run python setup.py register, rather than using the HTML UI. I'm the project owner and I did it several times in the

Re: Python 2.6 Global Variables

2009-10-30 Thread Aahz
In article 888b5e8f-1be5-4040-bc7a-45c2e1695...@d9g2000prh.googlegroups.com, AK Eric warp...@sbcglobal.net wrote: 2/ in Python, global really means module-level - there's nothing like a true global namespace. Isn't that __main__? import __main__ __main__.foo = asdfasdf print foo # asdfasdf

Re: How can module determine its own path?

2009-10-30 Thread Stef Mientki
Robert Kern wrote: On 2009-10-30 12:19 PM, kj wrote: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ but for modules launched with execfile, __file__ doesn't exists. cheers, Stef --

Re: OT: DARPA red balloon challenge

2009-10-30 Thread Albert Hopkins
On Thu, 2009-10-29 at 20:27 -0700, Adam N wrote: [...] On December 5, DARPA will raise 10 red weather balloons somewhere in the US. The first person to get the location of all 10 balloons and submit them will be given $40k. Hasn't the U.S. had enough weather balloon-related publicity stunts?

Re: How can module determine its own path?

2009-10-30 Thread Robert Kern
On 2009-10-30 18:40 PM, Stef Mientki wrote: Robert Kern wrote: On 2009-10-30 12:19 PM, kj wrote: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ but for modules launched with execfile, __file__

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Richard Heathfield
In hcfj10$1o...@news.eternal-september.org, Alf P. Steinbach wrote: snip I'm very very happy that most comments about perceived defects in the text and in my responses here, have only disagreements over terminology. I had expected a slew of errors being pointed out, since I'm new to Python.

Re: How can module determine its own path?

2009-10-30 Thread Stef Mientki
Robert Kern wrote: On 2009-10-30 18:40 PM, Stef Mientki wrote: Robert Kern wrote: On 2009-10-30 12:19 PM, kj wrote: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ but for modules launched with

Re: How can module determine its own path?

2009-10-30 Thread Robert Kern
Stef Mientki wrote: Robert Kern wrote: On 2009-10-30 18:40 PM, Stef Mientki wrote: Robert Kern wrote: On 2009-10-30 12:19 PM, kj wrote: How can a module determine the path of the file that defines it? (Note that this is, in the general case, different from sys.argv[0].) __file__ but for

Problems with cx_Oracle and Oracle 11.1 on Windows

2009-10-30 Thread ron.re...@gmail.com
Hi, I am trying to use cx_Oracle and SQLAlchemy with Oracle 11gR1 (11.1) on Windows Vista 64 bit. When I import cx_Oracle, I get this error: import cx_Oracle Traceback (most recent call last): File stdin, line 1, in module ImportError: DLL load failed: %1 is not a valid Win32 application. I

  1   2   >