Re: How to get output of command called by os.system()?

2009-10-30 Thread Chris Rebert
On Fri, Oct 30, 2009 at 11:09 PM, Peng Yu wrote: > I need to integrate shell program with python. I'm wondering if there > is a way get the output of the shell program called by os.system(). You'd probably do better to use the `subprocess` module instead: http://docs.python.org/library/subprocess

How to get output of command called by os.system()?

2009-10-30 Thread Peng Yu
I need to integrate shell program with python. I'm wondering if there is a way get the output of the shell program called by os.system(). Thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: How can module determine its own path?

2009-10-30 Thread Gabriel Genellina
En Fri, 30 Oct 2009 20:40:59 -0300, Stef Mientki escribió: 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 ex

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

2009-10-30 Thread Gabriel Genellina
En Fri, 30 Oct 2009 14:50:34 -0300, Sean DiZazzo escribió: On Oct 29, 10:17 pm, Chris Rebert wrote: On Thu, Oct 29, 2009 at 9:53 PM, Peng Yu 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 >

Re: How can module determine its own path?

2009-10-30 Thread Dave Angel
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__ doesn't exists. cheers,

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

2009-10-30 Thread Dave Angel
Sean DiZazzo wrote: On Oct 29, 10:17 pm, Chris Rebert wrote: On Thu, Oct 29, 2009 at 9:53 PM, Peng Yu 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

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

2009-10-30 Thread Alf P. Steinbach
* alex23: "Alf P. Steinbach" wrote: And no, I didn't do any research on that. If it mattered more (e.g. appearing as statement in the text) I'd have done that. The nice thing about Usenet is that people rush in to correct things. ;-) http://xkcd.com/386/> Unfortunately, the idiocy people say

Re: self.__dict__ tricks

2009-10-30 Thread Steven D'Aprano
On Fri, 30 Oct 2009 11:16:29 -0500, Tim Johnson wrote: > On 2009-10-30, Steven D'Aprano > 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 t

Re: How can module determine its own path?

2009-10-30 Thread Steven D'Aprano
On Fri, 30 Oct 2009 20:08:28 -0500, Robert Kern wrote: > Stef Mientki wrote: ... >> but how do I configure a "properly initialized namespace dict" (other >> than my current namespace) ? > > filename = '...' > ns = dict( > __file__=filename, > __name__='whatever_you_need_it_to_be', __bu

Re: How can module determine its own path?

2009-10-30 Thread Steven D'Aprano
On Sat, 31 Oct 2009 00:40:59 +0100, 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 launc

Re: list comprehension problem

2009-10-30 Thread alex23
Terry Reedy wrote: > alex23 wrote: > > You're completely wrong. Immutability has nothing to do with identity, > > which is what 'is' is testing for: > > What immutability has to do with identity is that 'two' immutable > objects with the same value *may* actually be the same object, > *depending o

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

2009-10-30 Thread alex23
"Alf P. Steinbach" wrote: > And no, I didn't do any research on that. If it mattered more (e.g. appearing > as > statement in the text) I'd have done that. The nice thing about Usenet is that > people rush in to correct things. ;-) http://xkcd.com/386/> Unfortunately, the idiocy people say on th

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 "", line 1, in ImportError: DLL load failed: %1 is not a valid Win32 application. I have a

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 m

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: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Richard Heathfield
In , Alf P. Steinbach wrote: > 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. Still, I'm fairly sure that there > ac

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__ d

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 stunt

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 -- http://mail.p

Re: Python 2.6 Global Variables

2009-10-30 Thread Aahz
In article <888b5e8f-1be5-4040-bc7a-45c2e1695...@d9g2000prh.googlegroups.com>, AK Eric 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 ># asdfasd

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

Re: Web development with Python 3.1

2009-10-30 Thread erob
On Oct 30, 7:01 pm, erob wrote: > On Oct 28, 5:16 am, "Diez B. Roggisch" 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 temp

Re: Are *.pyd's universal?

2009-10-30 Thread Carl Banks
On Oct 30, 8:43 am, Dave Angel 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 a .dll exte

Re: datetime question

2009-10-30 Thread Ben Finney
Victor Subervi 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 calendar, use the ‘calendar

Re: Web development with Python 3.1

2009-10-30 Thread erob
On Oct 28, 5:16 am, "Diez B. Roggisch" 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: Python library "support" propaganda lists?

2009-10-30 Thread Ben Finney
Ulrich Eckhardt 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, a Usenet group

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

2009-10-30 Thread Gabriel Genellina
En Fri, 30 Oct 2009 13:40:14 -0300, zooko escribió: On Oct 20, 9:50 pm, "Gabriel Genellina" 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 posts and web pages and blog entries de

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 I

Re: __eq__() inconvenience when subclassing set

2009-10-30 Thread Jess Austin
On Oct 29, 10:41 pm, "Gabriel Genellina" 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   > (although they share

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 > se

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 HTM

Re: datetime question

2009-10-30 Thread Rami Chowdhury
On Fri, 30 Oct 2009 13:03:32 -0700, Victor Subervi 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, Victor Off the top of my h

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" 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 file .

Re: How can module determine its own path?

2009-10-30 Thread kj
In <7e456639-9dbb-41ba-ae36-042a034fa...@y32g2000prd.googlegroups.com> AK Eric 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 inspect.getsourc

Re: Python library "support" propaganda lists?

2009-10-30 Thread Aahz
In article , Robert Kern 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 to help >you. No acrimony. No enemies. All benefit. This is why it i

Re: Strange behavior related to value / reference

2009-10-30 Thread Aahz
In article <626f24e5-4d8e-416c-b3ed-dc56a88dc...@s21g2000prm.googlegroups.com>, Lambda 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 Eskimos emigrate t

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

2009-10-30 Thread Mensanator
On Oct 30, 2:07 pm, "Alf P. Steinbach" 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 fil

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: Aaaargh! "global name 'eggz' is not defined"

2009-10-30 Thread Fabio Zadrozny
On Thu, Oct 29, 2009 at 6:48 PM, kj 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 execution reaches

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 Kern 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. I

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: Feedback wanted on programming introduction (Python in Windows)

2009-10-30 Thread Richard Heathfield
In , Dann Corbit wrote: > In article , > r...@see.sig.invalid says... >> >> In , Dann >> Corbit wrote: >> >> >> > >> > You can read PDF with the ghostscript stuff or the free Adobe >> > stuff. >> >> Agreed. But why should you have to? > > As opposed to...? Something you can grep. -- Ri

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 so

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: Python library "support" propaganda lists?

2009-10-30 Thread Aaron Watters
On Oct 30, 12:51 pm, Robert Kern 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 > means > peop

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: 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 (bett

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 so

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 prog

Re: import problem in tkinter

2009-10-30 Thread Peter Otten
Dave Angel wrote: > 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 th

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

2009-10-30 Thread Dann Corbit
In article , r...@see.sig.invalid says... > > In , Dann > Corbit wrote: > > > > > > You can read PDF with the ghostscript stuff or the free Adobe stuff. > > Agreed. But why should you have to? As opposed to...? PDF and PS are no more or less proprietary than any other format. And Ghostscr

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: How to avoid certain directories when using os.walk?

2009-10-30 Thread Sean DiZazzo
On Oct 29, 10:17 pm, Chris Rebert wrote: > On Thu, Oct 29, 2009 at 9:53 PM, Peng Yu 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? Otherwis

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

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: 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

Re: transpose array

2009-10-30 Thread Aahz
In article , Rhodri James 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 significant size. -- Aahz (a...@pythoncraft.com) <*> http://w

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: Sqlite3. Substitution of names in query.

2009-10-30 Thread Matteo
On Oct 30, 7:27 am, "Diez B. Roggisch" 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 cases, but the

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 th

Re: Sqlite3. Substitution of names in query.

2009-10-30 Thread Matteo
On Oct 30, 7:10 am, Lacrima wrote: > 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 = c

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 ha

Re: Python 2.6 Global Variables

2009-10-30 Thread Stephen Hansen
On Fri, Oct 30, 2009 at 9:01 AM, AK Eric 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 it's important to

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

2009-10-30 Thread zooko
On Oct 20, 9:50 pm, "Gabriel Genellina" 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 posts and web pages and blog entries decrying this practice over the last several years, but

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 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 get through in a time

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. -- http://mail.python.org/mailman/listinfo/python-l

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"

Re: self.__dict__ tricks

2009-10-30 Thread Tim Johnson
On 2009-10-30, Steven D'Aprano 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 dictionaries. The 'grunt' work is d

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 spec

Re: Are *.pyd's universal?

2009-10-30 Thread Dave Angel
Carl Banks wrote: On Oct 29, 9:10 pm, Lawrence D'Oliveiro wrote: In message , Christian Heimes wrote: Lawrence D'Oliveiro schrieb: In message , Christian Heimes wrote: On Linux and several other Unices the suffix is .so and not .pyd. Why is that? Or conve

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 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 P

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 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 u

Tutorial Forum

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

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

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 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 will have to make m

Re: Python 2.6 Global Variables

2009-10-30 Thread Dave Angel
Gabriel Genellina wrote: En Fri, 30 Oct 2009 00:29:27 -0300, Steven D'Aprano escribió: On Thu, 29 Oct 2009 10:31:03 -0700, AK Eric wrote: 2/ in Python, "global" really means "module-level" - there's nothing like a "true" global namespace. It isn't a neat trick anymore once you realize the

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 > http://www.cricketschirping.com/weblog/2005/1

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 d

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 %} {{ entry.title }} {{ entry.body }} {% 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

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 the

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 Whi

Re: Problem embedding Python.

2009-10-30 Thread Dave Angel
Dave Angel wrote: Brandon Keown wrote: On Oct 27, 7:48 pm, "Gabriel Genellina" wrote: Now that you've solved your problem, revise your conclusion. A file without a path *is* searched in the current working directory - but that directory may not be the one you think it is. -- Gabriel Gene

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

2009-10-30 Thread Lie Ryan
Aahz wrote: In article , Robert Kern 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 unimpressed with the way it doesn't work with "import *". If only IDLE's Intell

Re: Web development with Python 3.1

2009-10-30 Thread Dotan Cohen
>> Look at this "templating code": >> {% for entry in blog_entries %} >>    {{ entry.title }} >>    {{ entry.body }} >> {% 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 g

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

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 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 of 3.1.1? I'd

Re: Python library "support" propaganda lists?

2009-10-30 Thread Frank Millman
"Aaron Watters" 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 problem. > > Followi

Re: Python library "support" propaganda lists?

2009-10-30 Thread Frank Millman
"Aaron Watters" 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 problem. > > Followi

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 wrote: > * bartc: > >> You say elsewhere that you're not specifically teaching Python, but the >> text is full of technical

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, inc

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 http://www.cricketschirping.com/weblog/2005/12/11/force-dire

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=?", ('Jo

Re: What IDE has good git and python support?

2009-10-30 Thread Ben Finney
Bruno Desthuilliers 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 module to support Git in ‘vc’. It will t

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',))

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

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: Are *.pyd's universal?

2009-10-30 Thread Carl Banks
On Oct 29, 9:10 pm, Lawrence D'Oliveiro wrote: > In message , Christian > > Heimes wrote: > > Lawrence D'Oliveiro schrieb: > > >> In message , > >> Christian Heimes wrote: > > >>> On Linux and several other Unices the suffix is .so and not .pyd. > > >> Why is that? Or conversely, why isn't it .dll

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

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

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.

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

  1   2   >