Re: PID lockfile

2009-03-30 Thread JanC
Aahz wrote: Okay. But is that something that needs to be accommodated with, specifically, PID file handling? Why would a PID file ever need to be on NFS storage instead of local? That's the question. You'll probably get some complaints from people running diskless machines, eventually, some

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread Scott David Daniels
mark.sea...@gmail.com wrote: On Mar 29, 9:52 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Mar 29, 2009 at 9:18 PM, mark.sea...@gmail.com wrote: ... ... Also, you shouldn't use `class_ ` as the name of the first argument to __new__(). Use `cls` instead since that's the conventional name

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread Chris Rebert
2009/3/29 Scott David Daniels scott.dani...@acm.org: mark.sea...@gmail.com wrote: On Mar 29, 9:52 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Mar 29, 2009 at 9:18 PM,  mark.sea...@gmail.com wrote: ... ... Also, you shouldn't use `class_ ` as the name of the first argument to

suid/sudo in python

2009-03-30 Thread rustom
Im trying to write a program that has su permissions for some file system tasks and is non-su elsewhere. This is typically done in C with suid root owned code. What is the python paradigm for this kind of thing? (if at all) -- http://mail.python.org/mailman/listinfo/python-list

Re: suid/sudo in python

2009-03-30 Thread Ben Finney
rustom rustompm...@gmail.com writes: Im trying to write a program that has su permissions for some file system tasks and is non-su elsewhere. On Unix, ‘su’ is a program for switching to a different user; it's not the name of a particular user. I presume you mean “ … that has root permissions

SQL Query shows error in program while it function correctly in psql interface

2009-03-30 Thread bijoy
Hi, Following SQL assaignment is not working in Program. intable_bookname=SELECT book_name FROM table_book WHERE book_name='name'; where as this works perfectly fine with psql interface Pls help me on this Thanks a lot in advance Bijoy -- http://mail.python.org/mailman/listinfo/python-list

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 29, 11:16 pm, Chris Rebert c...@rebertia.com wrote: 2009/3/29 Scott David Daniels scott.dani...@acm.org: mark.sea...@gmail.com wrote: On Mar 29, 9:52 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Mar 29, 2009 at 9:18 PM,  mark.sea...@gmail.com wrote: ... ... Also, you

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Eric Brunel
Alan G Isaac wrote: [snip] PS If you were also offering an answer to the second question, I missed it altogether, but although it is perhaps slightly less obvious than with a StringVar, I would ask the same basic question of an IntVar: why does it not behave more like an int? E.g., why is

Re: i have to change default tab length in pydev

2009-03-30 Thread Dave Angel
Most such problems are caused by mixing tabs and spaces in the same file. Pick one style and be consistent, and you'll be in good shape. My approach is to always expand tabs. My tab key simply gets me to a convenient column, there never are any tabs in my source files. (I don't use either

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Hendrik van Rooyen
Steven D'Aprano st...@rource.com.au wrote: Oh noes!!! Python will be just like nearly every other language!!! Including Python. There are already at least thirteen implementations (forks) of Python (although some of these are defunct or unmaintained): CPython Jython IronPython Python for

Can't get a simple TCP program to work

2009-03-30 Thread Zach
The following *extremely* simple script complains that Socket is not connected when I try to call recv. Could anyone provide some quick guidance? http://pastebin.com/m64317b32 -- http://mail.python.org/mailman/listinfo/python-list

Improve module performance by reducing disk reads

2009-03-30 Thread kian tern
Hi all, I'm writing in Python for about 2 weeks (moved from Perl) I've ported one of my modules which is a parser for a binary format (see link bellow for the format specs) http://etidweb.tamu.edu/cdrom0/image/stdf/spec.pdf In the first version of the parser I was reading exactly the amount of

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Eric Brunel
Alan G Isaac wrote: I'm a complete newbie to GUI. I have a couple questions about tkinter. 1. Where is the list of changes in Python 3's tkinter? I'll let someone else answer this as I don't use Python 3 myself. I guess there are not many. 2. What exactly is the role of the root

Re: dict view to list

2009-03-30 Thread Tim Hoffman
Hi Aaron I personally don't understand how somedict.values().to_list() is actually preferable to list(somedict.keys()) In the standard python idiom I am constructing a new object (which I can control the type of) using a standard language mechanism (and I can substitute list with set or for that

database connection error - postgresql

2009-03-30 Thread bijoy
Hi, *code:* (only the class definiton and Database connection part) import pg __metaclass__=type class addbook: conn=pg.connect('secondbooks.db') curs=conn.cursor() *error:* conn=pg.connect(secondbooks.db) pg.InternalError: FATAL: database secondbooks.db does not exist

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Paul Rubin
Hendrik van Rooyen m...@microcorp.co.za writes: Its kind of sad to see unladen swallow, which is just a promise, on the list, while Shedskin, which isn't, is ignored. Does this say something about big corporations vs the small man? I think the programs on the list were supposed to

Re: SQL Query shows error in program while it function correctly in psql interface

2009-03-30 Thread bijoy
Hi, I have figured this out. Pls excuse me. thanks a lot Bijoy On Mon, Mar 30, 2009 at 12:41 PM, bijoy bijoy.fra...@gmail.com wrote: Hi, Following SQL assaignment is not working in Program. intable_bookname=SELECT book_name FROM table_book WHERE book_name='name'; where as this works

Re: Ordered Sets

2009-03-30 Thread Nick Craig-Wood
Aahz a...@pythoncraft.com wrote: I find the trick of using a Python list to store the doubly-linked list difficult to understand (as opposed to the usual mechanism of a node class). I understand why it was done (time and space efficiency), but I also still feel emotionally that it's somewhat

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread Hrvoje Niksic
mark.sea...@gmail.com writes: So I want a class ShadowRegister, which just has a value that I can do get/set bit sel and slice ops. I got that working with __init__. It was subclass from object. Then I wanted a RegisterClass that was a subclass of ShadowRegister, which would read a hardware

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread Jan Decaluwe
mark.sea...@gmail.com wrote: Python 2.5.3 for business reasons. So I want a class ShadowRegister, which just has a value that I can do get/set bit sel and slice ops. I got that working with __init__. It was subclass from object. Then I wanted a RegisterClass that was a subclass of

Re. suid/sudo in python

2009-03-30 Thread Rustom Mody
Ben Finney wrote The key thing to realise is that, having relinquished privilege, the same process can't get it back again as easily. So if you need to do some tasks as a privileged user, do those *very* early and then drop the privileges for the rest of the life of the process. Taking

Re: smtplib problem with newly rebuilt Debian/lenny system

2009-03-30 Thread BJ Swope
try s=smtplib.SMTP('127.0.0.1') instead. I'm guessing that it's trying to bind to the IPv6 or some other non IPv4 localhost instance. On Wed, Mar 18, 2009 at 11:25 AM, cassiope f...@u.washington.edu wrote: A hard drive failure forced me to rebuild my main system. Just a few things haven't

Caught out by daylight saving :-(

2009-03-30 Thread CinnamonDonkey
Hi All, I had the following bit of code which was working fine until we went into Daylight saving this weekend, now the result is an hour out. timeString = 20090330 15:45:23 timeFormat = '%Y-%m-%d %H:%M:%S' modificationTime = datetime.datetime.utcfromtimestamp( time.mktime

Re: Caught out by daylight saving :-(

2009-03-30 Thread Chris
On Mar 30, 1:47 pm, CinnamonDonkey cinnamondon...@googlemail.com wrote: Hi All, I had the following bit of code which was working fine until we went into Daylight saving this weekend, now the result is an hour out.     timeString = 20090330 15:45:23     timeFormat = '%Y-%m-%d %H:%M:%S

Re: Caught out by daylight saving :-(

2009-03-30 Thread andrew cooke
All, I had the following bit of code which was working fine until we went into Daylight saving this weekend, now the result is an hour out. timeString = 20090330 15:45:23 timeFormat = '%Y-%m-%d %H:%M:%S' modificationTime = datetime.datetime.utcfromtimestamp( time.mktime

Re: Re. suid/sudo in python

2009-03-30 Thread Rustom Mody
On Mon, Mar 30, 2009 at 5:17 PM, andrew cooke and...@acooke.org wrote: Rustom Mody wrote: Ben Finney wrote The key thing to realise is that, having relinquished privilege, the same process can't get it back again as easily. So if you need to do some tasks as a privileged user, do those *very*

Accessing shell output from HTTP

2009-03-30 Thread Brendon Wickham
Hi there, I would like users of my web application to be able to download a backup file of a database (using* *MySQL's *mysqldump* command). My strategy is to use *zipfile* to create a zip file object (with the * mysqldump* output as the contents of the zipped file) and then use * sys.stdout* to

Re: PyFits for Windows?

2009-03-30 Thread W. eWatson
W. eWatson wrote: It looks like PyFits downloads are for Linux. Isn't there anything available for Win (xp)? I'm now on the scipy mail list. Things look hopeful, according to the first respondent, to meet my criteria mentioned in another sub-thread to this one: I'm hoping the use of this

Re: Re. suid/sudo in python

2009-03-30 Thread andrew cooke
Rustom Mody wrote: Ben Finney wrote The key thing to realise is that, having relinquished privilege, the same process can't get it back again as easily. So if you need to do some tasks as a privileged user, do those *very* early and then drop the privileges for the rest of the life of the

CPython and C++ object GC

2009-03-30 Thread csaba . balazs
Hello Everybody, I would like to use a C++ gui library with the following (simplified) interface in Python. #include stdio.h class Gui; class GuiObject { public: GuiObject(Gui *Gui) {printf(creating GuiObject(gui: %X)\n, Gui);} ~GuiObject() {printf(deleting GuiObject\n);}

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Alan G Isaac
On 3/30/2009 3:37 AM Eric Brunel apparently wrote: The object traditionally called root is in fact an instance of the tcl interpreter that will get the commands generated by the Tkinter module. Due to tk architecture, creating this interpreter will also create a window, which is inteneded to be

Re: how to optimize zipimport

2009-03-30 Thread Coonay
On Mar 26, 1:38 pm, John Machin sjmac...@lexicon.net wrote: On Mar 26, 2:06 pm, Coonay fla...@gmail.com wrote: see,the zipimort takes nearly 0.5 second D 03-25 07:53PM 21.374 Loading __main__ I 03-25 07:53PM 21.455 zipimporter('/base/data/home/apps/coonay/1.332322118600950324/

Re: Caught out by daylight saving :-(

2009-03-30 Thread CinnamonDonkey
until we went into Daylight saving this weekend, now the result is an hour out.     timeString = 20090330 15:45:23     timeFormat = '%Y-%m-%d %H:%M:%S'     modificationTime = datetime.datetime.utcfromtimestamp( time.mktime ( time.strptime( timeString, timeFormat

Re: Programming Python 4th Edition?

2009-03-30 Thread Esmail
Nick Craig-Wood wrote: I read Programming Python as an experienced programmer and like you I enjoyed the encyclopedic nature of it. So if it appeals to you I'd say go for it! The fact that it doesn't use the latest version of python isn't a problem - python doesn't change very quickly and

Re: Re. suid/sudo in python

2009-03-30 Thread Rustom Mody
The outline of what I do (in C) is: 1. Write the CGI program in C, put setuid(0), setgid(0) statements in that file and then perform any other actions (including calling other scripts) 2. Set the S bit of the executable of the CGI binary compiled from the C file (chmod +S xxx.cgi) The C code runs

Re: Caught out by daylight saving :-(

2009-03-30 Thread Dave Angel
until we went into Daylight saving this weekend, now the result is an hour out. timeString = 20090330 15:45:23 timeFormat = '%Y-%m-%d %H:%M:%S' modificationTime = datetime.datetime.utcfromtimestamp( time.mktime ( time.strptime( timeString, timeFormat ) ) ) minutesToAdvance

Re: Caught out by daylight saving :-(

2009-03-30 Thread CinnamonDonkey
...@gmail.com wrote: On Mar 30, 1:47 pm, CinnamonDonkey cinnamondon...@googlemail.com wrote: Hi All, I had the following bit of code which was working fine until we went into Daylight saving this weekend, now the result is an hour out.     timeString = 20090330 15:45:23

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Alan G Isaac
On 3/30/2009 3:37 AM Eric Brunel apparently wrote: The string representation of Tkinter objects seems to be a design principle in this module: it'll always evaluate to the representation this object has at tcl level. Since a XxxVar is represented by an actual variable at tcl level, its string

running pyhton IDLE on windows vista

2009-03-30 Thread ryan
Hi guys , I am facing problems running python25 on vista . i was able to successfully install it but when i try to run it then, its throws errors saying Firewall issues .. I tried disabling the firewall but no go.. Thanks in advance!! -- http://mail.python.org/mailman/listinfo/python-list

Re: database connection error - postgresql

2009-03-30 Thread bijoy
hi, I figured out these too. Pls excuse me Thanks Bijoy On Mon, Mar 30, 2009 at 1:30 PM, bijoy bijoy.fra...@gmail.com wrote: Hi, *code:* (only the class definiton and Database connection part) import pg __metaclass__=type class addbook: conn=pg.connect('secondbooks.db')

Re: Caught out by daylight saving :-(

2009-03-30 Thread CinnamonDonkey
.     timeString = 20090330 15:45:23     timeFormat = '%Y-%m-%d %H:%M:%S'     modificationTime = datetime.datetime.utcfromtimestamp( time.mktime ( time.strptime( timeString, timeFormat ) ) )     minutesToAdvance = datetime.timedelta( minutes=5 )     modificationTime = modificationTime

Re: Read Garmin XML (TCX) files in Python...

2009-03-30 Thread cmalmqui
Elementtree solved the problem! I am very impressed with the speed you get from the cElementTree library. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Wing IDE Backup configuration settings?

2009-03-30 Thread Raúl Gómez C .
Find the .wingide folder in your home and tar it, at least in linux... On Sat, Mar 28, 2009 at 12:26 PM, John Doe j...@usenetlove.invalid wrote: Anyone know how to back up the configuration settings like font sizes and colors in the Wing IDE? Thanks. --

Re: Improve module performance by reducing disk reads

2009-03-30 Thread Dave Angel
Since the email contains no code, I can only assume you're using the bult-in open() call, and file.read(). If you didn't specify a bufsize, a system default is used. I seriously doubt if 0 is the default. Since it's already buffered, additional buffering by you might have little effect, or

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread srepmub
Its kind of sad to see unladen swallow, which is just a promise, on the list, whileShedskin, which isn't, is ignored. Does this say something about big corporations vs the small man? I think the programs on the list were supposed to actually implement Python and extensions of

Thoughts on language-level configuration support?

2009-03-30 Thread jfager
I've written a short post on including support for configuration down at the language level, including a small preliminary half-functional example of what this might look like in Python, available at http://jasonfager.com/?p=440. The basic idea is that a language could offer syntactic support for

Re: Re. suid/sudo in python

2009-03-30 Thread bieffe62
On Mar 30, 1:16 pm, Rustom Mody rustompm...@gmail.com wrote: Ben Finney wrote The key thing to realise is that, having relinquished privilege, the same process can't get it back again as easily. So if you need to do some tasks as a privileged user, do those *very* early and then drop the

Re: database connection error - postgresql

2009-03-30 Thread D'Arcy J.M. Cain
On Mon, 30 Mar 2009 13:30:18 +0530 bijoy bijoy.fra...@gmail.com wrote: conn=pg.connect(secondbooks.db) pg.InternalError: FATAL: database secondbooks.db does not exist In fact i have a database

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 2:30 am, Jan Decaluwe j...@jandecaluwe.com wrote: mark.sea...@gmail.com wrote: Python 2.5.3 for business reasons. So I want a class ShadowRegister, which just has a value that I can do get/set bit sel and slice ops.  I got that working with __init__.  It was subclass from

Re: Caught out by daylight saving :-(

2009-03-30 Thread Dave Angel
is an hour out. timeString =20090330 15:45:23 timeFormat =%Y-%m-%d %H:%M:%S' modificationTime =atetime.datetime.utcfromtimestamp( time.mktime ( time.strptime( timeString, timeFormat ) ) ) minutesToAdvance =atetime.timedelta( minutes=5 ) modificationTime

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
It needs to read HW reg and adjust ChipRegister value, or ShadowRegister and change the HW value (order was reversed). I will look at MyHDL again though to see if there is some reason it can print class subclassed from intbv, or if it even has a class subclassed from intbv, without casting as a

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Michele Simionato
On Mar 30, 3:31 pm, srepmub mark.duf...@gmail.com wrote: for the record, the input for Shedskin is pure Python, so there is no added syntax or optional type declaration system. that said, I can understand it not being on some list for not being production-ready. thanks, mark dufour. But

Re: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread Eric Brunel
Alan G Isaac wrote: [snip] On 3/30/2009 3:37 AM Eric Brunel apparently wrote: The Tk instance is registered in a hidden variable in the Tkinter module. When you don't specify a master, it'll use the latest created Tk instance one by default. BTW, the latest should be the only one: it is quite

Deleteing empty directories

2009-03-30 Thread CinnamonDonkey
Hi All, I've been scratching my head all afternoon trying to work out the best/ quickest way is to delete empty directories within a tree (Windows). I've looked at os.walk() but it seems to traverse the directory tree in the wrong order (is it possible to reverse the order?) It seems the only

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Steven D'Aprano
On Mon, 30 Mar 2009 09:46:40 +0200, Hendrik van Rooyen wrote: Its kind of sad to see unladen swallow, which is just a promise, on the list, while Shedskin, which isn't, is ignored. Does this say something about big corporations vs the small man? No, what it says is that I had just read a

Re: complaints about no replies last week

2009-03-30 Thread pruebauno
On Mar 28, 11:07 am, Aaron Brady castiro...@gmail.com wrote: Hi, A week ago, I posted a question and an idea about Python's garbage collector.  I got a few replies.  Some days later, I posted a mock-up implementation of it, and got *NO* replies.  Does this mean: a) It works b) It doesn't

Re: Deleteing empty directories

2009-03-30 Thread Tim Golden
CinnamonDonkey wrote: Hi All, I've been scratching my head all afternoon trying to work out the best/ quickest way is to delete empty directories within a tree (Windows). I've looked at os.walk() but it seems to traverse the directory tree in the wrong order (is it possible to reverse the

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Tim Golden
Steven D'Aprano wrote: On Mon, 30 Mar 2009 09:46:40 +0200, Hendrik van Rooyen wrote: Its kind of sad to see unladen swallow, which is just a promise, on the list, while Shedskin, which isn't, is ignored. Does this say something about big corporations vs the small man? No, what it says is

urllib2, proxies, and pac files on OS X

2009-03-30 Thread Mani Ghasemlou
Hi all, urllib2 correctly detects proxies as configured in my preferences pane on OS X 10.5: Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type help, copyright, credits or license for more information. import urllib2

create a log level for python logging module

2009-03-30 Thread dj
I am trying to create a log level called userinfo for the python logging. I read the source code and tried to register the level to the logging namespace with the following source: from logging import Logger # create the custom log level

Re: Deleteing empty directories

2009-03-30 Thread andrew cooke
CinnamonDonkey wrote: Hi All, I've been scratching my head all afternoon trying to work out the best/ quickest way is to delete empty directories within a tree (Windows). I've looked at os.walk() but it seems to traverse the directory tree in the wrong order (is it possible to reverse the

Re: Unit testing frameworks

2009-03-30 Thread Alexander Draeger
Hi, I'm work on a testing framework for Python. Until now I have implemented the main features of PyUnit and JUnit 4.x. I like the annotation syntax of JUnit 4.x and it's theory concept is great therefore you can imagine how my framework will be. I plan a lot of additionally features which are

Re: Deleteing empty directories

2009-03-30 Thread CinnamonDonkey
My understanding was that rmtree removes a whole tree not just the empty directories? eg. root - file1 - file2 - dir1 - dir2 - file3 - dir3 I would expect; dir1 and dir3 to be deleted and nothing else touched. My attempt came up with: import os import shutil def isDirEmpty( path ):

Re: Deleteing empty directories

2009-03-30 Thread CinnamonDonkey
Revised: root + Dir1 + Dir2 + Dir3 + NotEmptyDir File1 File2 Result: Root + NotEmptyDir File1 File2 --- import os import shutil def isDirEmpty( path ): if not os.path.isdir( path ): return False contents = os.listdir( path )

Re: Thoughts on language-level configuration support?

2009-03-30 Thread Steven D'Aprano
On Mon, 30 Mar 2009 06:40:00 -0700, jfager wrote: I've written a short post on including support for configuration down at the language level, including a small preliminary half-functional example of what this might look like in Python, available at http://jasonfager.com/?p=440. The basic

Re: smtplib problem with newly rebuilt Debian/lenny system

2009-03-30 Thread cassiope
On Mar 27, 11:29 am, a...@pythoncraft.com (Aahz) wrote: [posted e-mailed, please respond to newsgroup] In article d37a66e9-55c2-437c-b613-009a62f71...@d2g2000pra.googlegroups.com, cassiope  f...@u.washington.edu wrote: In attempting to diagnose the cause, I tried directly executing the

recursive outline numbering for object trees

2009-03-30 Thread Alia Khouri
Hi, Here my problem description: Given the following class: class Node(object): def __init__(self, name, children=[], parent=None): self.name = name self.level = '' self.children = children self.parent = parent def __repr__(self): name =

Pyowa Meeting this week

2009-03-30 Thread Mike Driscoll
Hi, This is just a reminder that we have a Pyowa meeting this week. It will be held at Durham Center in Ames, IA on the ISU campus from 7-9 p.m. Directions are on the website (www.pyowa.org). Topics include the following: 1) What PyCon attendees thought of PyCon (likes, dislikes, etc) 2) Code

Re: Deleteing empty directories

2009-03-30 Thread Steven D'Aprano
On Mon, 30 Mar 2009 08:14:55 -0700, CinnamonDonkey wrote: My understanding was that rmtree removes a whole tree not just the empty directories? So it seems: os.mkdir('die-die-die') os.mkdir('die-die-die/stuff') shutil.rmtree('die-die-die') I think what

Re: Pyowa Meeting this week

2009-03-30 Thread Mike Driscoll
On Mar 30, 10:33 am, Mike Driscoll kyoso...@gmail.com wrote: Hi, This is just a reminder that we have a Pyowa meeting this week. It will be held at Durham Center in Ames, IA on the ISU campus from 7-9 p.m. Directions are on the website (www.pyowa.org). Topics include the following: 1) What

distutils, No module named numpy.distutils.fcompiler.conv_template

2009-03-30 Thread Luis Alberto Zarrabeitia Gomez
I'm trying to compile the wrappers for ANN (Approximate Nearest Neighbor) from http://scipy.org/scipy/scikits/wiki/AnnWrapper, either the main one (scikits) or the attachment in the main page. However, the command python setup.py build produces the exception: ImportError: No module named

Re: complaints about no replies last week

2009-03-30 Thread Steven D'Aprano
On Mon, 30 Mar 2009 07:50:49 -0700, pruebauno wrote: I myself asked about how to write a library to efficiently do union and intersection of sets containing time intervals some time ago on this list and got little to no answers. It is a tricky problem. With all the confidence of somebody who

Re: Thoughts on language-level configuration support?

2009-03-30 Thread jfager
On Mar 30, 11:17 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Mon, 30 Mar 2009 06:40:00 -0700, jfager wrote: I've written a short post on including support for configuration down at the language level, including a small preliminary half-functional example of what this

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
Here again is example: from ctypes import * class REG_INFO(Structure): _fields_ = [ ('address', c_ubyte), ('message', c_char * 256), ('size', c_ubyte) ] class myclass(object): # # def __new__(class_, init_val, size, reg_info): def __init__(self,

Problems with code

2009-03-30 Thread Zach Goscha
Hi, I am trying to call an unbound method (Map.Background) but getting the following error: TypeError: unbound method background() must be called with Map instance as first argument (got nothing instead) Here is some of the code(not completed) Thanks in Advance - Zach Code: class

Re: Upgrade Python on a Mac

2009-03-30 Thread 7stud
On Mar 3, 4:01 am, Graham Dumpleton graham.dumple...@gmail.com wrote: On Mar 3, 8:53 am, Rey Bango reyba...@gmail.com wrote: Hi, I'd like to upgrade the installed version of Python that came standard on OS X (Leopard) with either 2.6.1 or 3.0.1. Before I stick my foot in it, I just

Re: recursive outline numbering for object trees

2009-03-30 Thread Gabriel Genellina
Alia Khouri alia_khouri at yahoo.com writes: Given the following class: class Node(object): def __init__(self, name, children=[], parent=None): self.name = name self.level = '' self.children = children self.parent = parent def __repr__(self):

Re: Problems with code

2009-03-30 Thread Chris Rebert
2009/3/30 Zach Goscha zta...@gmail.com: Hi, I am trying to call an unbound method (Map.Background) but getting the following error:  TypeError: unbound method background() must be called with Map instance as first argument (got nothing instead) Here is some of the code(not completed)

Re: modifying a list element from a function

2009-03-30 Thread TP
Adrian Dziubek wrote: Could you explain your high level goal for this? It looks like a very wicked way of doing things. Have You tried to read the list methods' documentation? Maybe there you find something you need (like list.index)? Hello, I have a disambiguation function that modifies a

RE: tkinter questions: behavior of StringVar, etc

2009-03-30 Thread John Posner
Eric Brunel said: The Tk instance is registered in a hidden variable in the Tkinter module. When you don't specify a master, it'll use the latest created Tk instance one by default. BTW, the latest should be the only one: it is quite unsafe to create several Tk instances in the

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread MRAB
mark.sea...@gmail.com wrote: Here again is example: from ctypes import * class REG_INFO(Structure): _fields_ = [ ('address', c_ubyte), ('message', c_char * 256), ('size', c_ubyte) ] class myclass(object): # # def __new__(class_, init_val, size,

Re: Problems with code

2009-03-30 Thread Albert Hopkins
On Mon, 2009-03-30 at 11:05 -0500, Zach Goscha wrote: Hi, I am trying to call an unbound method (Map.Background) but getting the following error: TypeError: unbound method background() must be called with Map instance as first argument (got nothing instead) Here is some of the

Re: Ordered Sets

2009-03-30 Thread pataphor
On Mon, 30 Mar 2009 03:30:04 -0500 Nick Craig-Wood n...@craig-wood.com wrote: class Node(object): ... __slots__ = [prev, next, this] ... def __init__(self, prev, next, this): ... self.prev = prev ... self.next = next ... self.this = this [...] So the Node

Re: Re. suid/sudo in python

2009-03-30 Thread rustom
On Mar 30, 6:47 pm, bieff...@gmail.com wrote: On Mar 30, 1:16 pm, Rustom Mody rustompm...@gmail.com wrote: Ben Finney wrote The key thing to realise is that, having relinquished privilege, the same process can't get it back again as easily. So if you need to do some tasks as a

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread Scott David Daniels
mark.sea...@gmail.com wrote: ... It seems like there's no way to do what I'm trying. I am confined to Python 2.5.3 for business reasons. So I want a class ShadowRegister, which just has a value that I can do get/set bit sel and slice ops. I got that working with __init__. It was subclass

Re: Re. suid/sudo in python

2009-03-30 Thread Martin P. Hellwig
Rustom Mody wrote: cut I don't think this is necessary a python problem but a generic, SUID scripts considered dangerous, problem. The essence of your program is that you only want information, that is great! Since that makes it all a bit simpler. How about writing a cronjob that outputs

Re: running pyhton IDLE on windows vista

2009-03-30 Thread Scott David Daniels
ryan wrote: I am facing problems running python25 on vista . i was able to successfully install it but when i try to run it then, its throws errors saying Firewall issues .. I tried disabling the firewall but no go.. Yes, we believe you. Read smart questions

Re: email from windows

2009-03-30 Thread Suraj Barkale
prakash jp prakash.stack at gmail.com writes: Hi all,   In windows environment, how to send email from one gmail address to another gmail (or another mail) addrress     Gmail requires SSL smtp support which is missing in Python stdlib. However, you can look at this example

Syntax disagreement between IDLE and pydev?

2009-03-30 Thread Jim Garrison
IDLE (3.1a1) accepts a,*b = re.split(str,pattern) and does the right thing ('a' gets the first result and 'b' gets the rest). pydev configured to use the exact same Python 3.1a1 runtime doesn't like this syntax (in my source, column 23 is the asterisk): Encountered * at line 32,

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread David Bolen
mark.sea...@gmail.com writes: class myclass(object): # # def __new__(class_, init_val, size, reg_info): def __init__(self, init_val, size, reg_info): # self = object.__new__(class_) self.reg_info = reg_info print self.reg_info.message self.val =

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 9:40 am, Scott David Daniels scott.dani...@acm.org wrote: mark.sea...@gmail.com wrote: ... It seems like there's no way to do what I'm trying.  I am confined to Python 2.5.3 for business reasons. So I want a class ShadowRegister, which just has a value that I can do get/set

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 10:53 am, David Bolen db3l@gmail.com wrote: mark.sea...@gmail.com writes: class myclass(object): #     # def __new__(class_, init_val, size, reg_info):     def __init__(self, init_val, size, reg_info):         # self = object.__new__(class_)         self.reg_info =

Re: please include python26_d.lib in the installer

2009-03-30 Thread Johan Compen
On Sat, Mar 28, 2009 at 1:17 AM, Mark Hammond skippy.hamm...@gmail.com wrote: Please note: I want to build my own code in Debug mode for debugging. I don't want to build or use the debug version of Python. I also can't Python does this on purpose so you don't accidentally mix different

Re: Syntax disagreement between IDLE and pydev?

2009-03-30 Thread Mike Driscoll
On Mar 30, 12:40 pm, Jim Garrison j...@acm.org wrote: IDLE (3.1a1) accepts         a,*b = re.split(str,pattern) and does the right thing ('a' gets the first result and 'b' gets the rest). pydev configured to use the exact same Python 3.1a1 runtime doesn't like this syntax (in my source,

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
If I cast it long then it prints fine, but I was hoping there would be a slicker way (to accomplish this in the class itself). print 'bird val = 0x%016X' % long(bird) -- http://mail.python.org/mailman/listinfo/python-list

Re: Syntax disagreement between IDLE and pydev?

2009-03-30 Thread Jim Garrison
Jim Garrison wrote: IDLE (3.1a1) accepts a,*b = re.split(str,pattern) and does the right thing ('a' gets the first result and 'b' gets the rest). pydev configured to use the exact same Python 3.1a1 runtime doesn't like this syntax (in my source, column 23 is the asterisk): Encountered *

Re: Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread Dave Angel
After taking out the class myclass stuff, the code worked for me in Python 2.6.1, through the cat line. Could you please tell us what version of Python you're running this on? import sys print Python version: , sys.version yielded (on my machine) Python version: 2.6.1 (r261:67517, Dec 4

Re: please include python26_d.lib in the installer

2009-03-30 Thread Christian Heimes
Johan Compen wrote: If Python doesn't include the _d.lib file, then why does the header file reference it? I would prefer manual control over which lib file to use. (And I don't want to disable _DEBUG for other reasons). Could the header file be changed so it alwas uses the release lib? In

Re: global name 'self' is not defined - noob trying to learn

2009-03-30 Thread mark . seagoe
On Mar 30, 11:53 am, Dave Angel da...@ieee.org wrote: After taking out the class  myclass stuff, the code worked for me in Python 2.6.1, through the cat line.  Could you please tell us what version of Python you're running this on? import sys print Python version: , sys.version yielded (on

Re: Syntax disagreement between IDLE and pydev?

2009-03-30 Thread Benjamin Kaplan
On Mon, Mar 30, 2009 at 2:23 PM, Jim Garrison j...@acm.org wrote: Jim Garrison wrote: IDLE (3.1a1) accepts a,*b = re.split(str,pattern) and does the right thing ('a' gets the first result and 'b' gets the rest). pydev configured to use the exact same Python 3.1a1 runtime doesn't

  1   2   3   4   5   >