Re: Thoughts on language-level configuration support?

2009-03-30 Thread David Stanek
On Mon, Mar 30, 2009 at 9:40 AM, 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: Re. suid/sudo in python

2009-03-30 Thread rustom
On Mar 30, 9:41 pm, "Martin P. Hellwig" wrote: > Rustom Mody wrote: > > 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 the require information into a > file and then write a separa

Re: Speech activated scripting/macroing for Windows

2009-03-30 Thread John Doe
This might be a better link. http://code.google.com/p/dragonfly/ After getting it to work, at first, it seems excellent for continuous command recognition (with speech activated scripting) in Windows. Yes! -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on language-level configuration support?

2009-03-30 Thread jfager
On Mar 30, 9:31 pm, "Rhodri James" wrote: > On Mon, 30 Mar 2009 16:59:12 +0100, jfager wrote: > > It's the configuration problem.  Right now you would use something > > like ConfigParser or optparse to populate some configuration object, > > which you would then pass around and extract values fro

Re: Unix programmers and Idle

2009-03-30 Thread Niklas Norrthon
On 31 Mar, 01:16, Dale Amon wrote: > I wonder if someone could point me at documentation > on how to debug some of the standard Unix type things > in Idle. I cannot seem to figure out how to set my > argument line for the program I am debugging in an Idle > window. for example: > >         vlmdeck

Stripping non-numbers from a file parse without nested lists?

2009-03-30 Thread daku9999
There has got to be a better way of doing this: I'm reading in a file that has a lot of garbage, but eventually has something that looks similar to: (some lines of garbage) dip/dir. (some more lines of garbage) 55/158 (some more lines of garbage) 33/156 etc. and I'm stripping out the 55/158 value

Creating huge data in very less time.

2009-03-30 Thread venutaurus...@gmail.com
Hello all, I've a requirement where I need to create around 1000 files under a given folder with each file size of around 1GB. The constraints here are each file should have random data and no two files should be unique even if I run the same script multiple times. Moreover the filename

Cyclic GC rules for subtyped objects with tp_dictoffset

2009-03-30 Thread BChess
Hi, I'm writing a new PyTypeObject that is base type, supports cyclic GC, and has a tp_dictoffset. If my type is sub-typed by a python class, what exactly are the rules for how I'm supposed to treat my PyDict object with regards to cyclic GC? Do I still visit it in my traverse () function if I'm

Re: unpack the source tarball on Windows

2009-03-30 Thread alex23
On Mar 31, 2:25 pm, Mensanator wrote: > Thanks, I'll try that next time (when the Winzip 45 day > trial expires). Better still, grab the freec 7-Zip: http://www.7-zip.org/ Supported formats: * Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR * Unpacking only: ARJ, CAB, CHM, CPIO, DEB,

Re: An inheritance question: getting the name of the "one up" class

2009-03-30 Thread alex23
On Mar 31, 1:13 pm, "Nick" wrote: > I want to add a "pedigree" function to Animal so that I can have: > > >>> h = Human() > >>> h.pedigree() > > human < primate < mammal < animal class Animal(object): @classmethod def pedigree(cls): return [c.__name__ for c in cls.mro() if c is no

Re: unpack the source tarball on Windows

2009-03-30 Thread Mensanator
On Mar 30, 8:49�pm, "drobi...@gmail.com" wrote: > On Mar 30, 7:10�pm, Mensanator wrote: > > > I'm looking for the Turtle Graphics Demos (apparently not included in > > the Windows install). > > > So I downloaded the bzipped source tarball. > > > I've got Cygwin installed and assume it has the nee

Re: An inheritance question: getting the name of the "one up" class

2009-03-30 Thread Gabriel Genellina
En Tue, 31 Mar 2009 00:13:44 -0300, Nick escribió: I've got a collection of classes describing animals, part of which looks like: class Animal(object): def __init__(self): self.pet = False self.edible = False self.legs = 0 self.sound = None self.

win32com python AttributeError!

2009-03-30 Thread Michael
Hi Python-list - Has anyone figured this out from Rebecca: Hi, I am having trouble with win32com for python. I get the following error when I try to issue any command after using Dispatch. >>> xl=win32com.client.Dispatch("Excel.Application") >>> xl.Visible=0 Traceback (most recent call last):

Operational Error. --HELP

2009-03-30 Thread bijoy franco
Hi, Following is the in-function cursor object. Code:import pgdb __metaclass__=type class addbook: conn=pgdb.connect(dsn='localhost:secondbooks',user='postgres',password='postgres1') curs=conn.cursor() def addBook(self): *infunction_curs=self.curs** *

Operational Error. --HELP

2009-03-30 Thread bijoy franco
Hi, Following is the in-function cursor object. Code:import pgdb __metaclass__=type class addbook: conn=pgdb.connect(dsn='localhost:secondbooks',user='postgres',password='postgres1') curs=conn.cursor() def addBook(self): *infunction_curs=self.curs** *

An inheritance question: getting the name of the "one up" class

2009-03-30 Thread Nick
I've got a collection of classes describing animals, part of which looks like: class Animal(object): def __init__(self): self.pet = False self.edible = False self.legs = 0 self.sound = None self.name = self.__class__.__name__.lower() class Mammal(Animal):

Re: Unix programmers and Idle

2009-03-30 Thread Dale Amon
On Mon, Mar 30, 2009 at 09:47:24PM -0500, Dave Angel wrote: > See http://docs.python.org/library/idle.html and search for command line > > According to that page (for Python 2.6.1), you can set those parameters > on the command line that starts IDLE itself. > > I haven't tried it yet, as I'm u

Re: Ordered Sets

2009-03-30 Thread Alex_Gaynor
On Mar 30, 12:27 pm, pataphor wrote: > On Mon, 30 Mar 2009 03:30:04 -0500 > > Nick Craig-Wood wrote: > > >>> class Node(object): > > ...     __slots__ = ["prev", "next", "this"] > > ...     def __init__(self, prev, next, this): > > ...         self.prev = prev > > ...         self.next = next > >

postfix type declaration

2009-03-30 Thread Armin
http://www.python.org/dev/peps/pep-3117/ Found it uber-funny! enjoy! It would have been cool if they actually accepted this! -- Armin Moradi -- http://mail.python.org/mailman/listinfo/python-list

Re: Unix programmers and Idle

2009-03-30 Thread Gabriel Genellina
En Mon, 30 Mar 2009 23:47:24 -0300, Dave Angel escribió: See http://docs.python.org/library/idle.html and search for command line According to that page (for Python 2.6.1), you can set those parameters on the command line that starts IDLE itself. Well, that's not terribly useful, I'

Re: Relative Imports, why the hell is it so hard?

2009-03-30 Thread Gabriel Genellina
En Mon, 30 Mar 2009 21:15:59 -0300, Aahz escribió: In article , Gabriel Genellina wrote: I'd recommend the oposite - use relative (intra-package) imports when possible. Explicit is better than implicit - and starting with 2.7 -when "absolute" import semantics will be enabled by default- you'

Re: Unix programmers and Idle

2009-03-30 Thread Dave Angel
See http://docs.python.org/library/idle.html and search for command line According to that page (for Python 2.6.1), you can set those parameters on the command line that starts IDLE itself. I haven't tried it yet, as I'm using Komodo. Dale Amon wrote: On Mon, Mar 30, 2009 at 08:11:10PM -0

Call to PyEval_EvalCodeEx crashes in PyFrame_New with abort

2009-03-30 Thread grbgooglefan
I've emabedded Python(2.6) in my C++ application and using on Solaris 5.10. When the application calls Py_Eval, it causes an abort & application core dumps. But this is at random times & no pattern for this. Crash is as below: Can you please help to know, what can cause this abort in PyFrame_New?

usb mass storage device detection

2009-03-30 Thread prakash jp
Hi all, I am interested in detecting usb mass storage devices, r there any scripts in python to do so. Thanks in advance. Regards Prakash -- http://mail.python.org/mailman/listinfo/python-list

Re: Unix programmers and Idle

2009-03-30 Thread MRAB
Gabriel Genellina wrote: En Mon, 30 Mar 2009 22:21:12 -0300, Dale Amon escribió: vlmdeckcheck.py --strict --debug file.dat There must be a way to tell it what the command line args are for the test run but I can't find it so far. The line above represent what I want to emulate within id

Re: Unix programmers and Idle

2009-03-30 Thread Gabriel Genellina
En Mon, 30 Mar 2009 22:21:12 -0300, Dale Amon escribió: vlmdeckcheck.py --strict --debug file.dat There must be a way to tell it what the command line args are for the test run but I can't find it so far. The line above represent what I want to emulate within idle. If you run idle, s

Strange pexpect behaviour: just duplicates stdin

2009-03-30 Thread Nikolaus Rath
Hello, I have a strange problem with pexpect: $ cat test.py #!/usr/bin/python import pexpect child = pexpect.spawn("./test.pl") while True: try: line = raw_input() except EOFError: break child.sendline(line) print child.readline().rstrip("\r\n") child.close()

Re: unpack the source tarball on Windows

2009-03-30 Thread drobi...@gmail.com
On Mar 30, 7:10 pm, Mensanator wrote: > I'm looking for the Turtle Graphics Demos (apparently not included in > the Windows install). > > So I downloaded the bzipped source tarball. > > I've got Cygwin installed and assume it has the needed utilities. > > What would I type at the Cygwin prompt to

Re: unpack the source tarball on Windows

2009-03-30 Thread Mensanator
On Mar 30, 6:34 pm, "Gabriel Genellina" wrote: > En Mon, 30 Mar 2009 20:10:28 -0300, Mensanator   > escribió: > > > I'm looking for the Turtle Graphics Demos (apparently not included in > > the Windows install). > > > So I downloaded the bzipped source tarball. > > > I've got Cygwin installed and

Re: recursive outline numbering for object trees

2009-03-30 Thread Alia K
"Gabriel Genellina" wrote: > You should thank Aaron Brady who wrote the original function. I just   > smoothed some edges and glued it with your own code. Ah, Aaron Brady is castironpi... Well, thank you both then. (-: AK -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on language-level configuration support?

2009-03-30 Thread Rhodri James
On Mon, 30 Mar 2009 16:59:12 +0100, jfager wrote: It's the configuration problem. Right now you would use something like ConfigParser or optparse to populate some configuration object, which you would then pass around and extract values from. This would provide two advantages over these appro

Re: Unix programmers and Idle

2009-03-30 Thread Dale Amon
On Mon, Mar 30, 2009 at 08:11:10PM -0500, Dave Angel wrote: > I don't know what Idle has to do with it. sys.args contains the command > line arguments used to start a script. > > Dale Amon wrote: >> I wonder if someone could point me at documentation on how to debug >> some of the standard Unix

Re: Unix programmers and Idle

2009-03-30 Thread prakash jp
let run-cmd be used why go for IDLE 2009/3/31 Dale Amon > I wonder if someone could point me at documentation > on how to debug some of the standard Unix type things > in Idle. I cannot seem to figure out how to set my > argument line for the program I am debugging in an Idle > window. for examp

Re: Unix programmers and Idle

2009-03-30 Thread Dave Angel
I don't know what Idle has to do with it. sys.args contains the command line arguments used to start a script. Dale Amon wrote: I wonder if someone could point me at documentation on how to debug some of the standard Unix type things in Idle. I cannot seem to figure out how to set my argume

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

2009-03-30 Thread mark . seagoe
Just as feedback, I went back to the __init__ style routine, weeded out a few things, installed python 2.6.1, and it works great. Thanks for all your help. Now I've got to convince 1000 people at my company to switch. That's going to be the tough part. -- http://mail.python.org/mailman/listinfo

Re: Windows command line not displaying print commands

2009-03-30 Thread Terry Reedy
JonathanB wrote: Ok, I'm sure this is really simple, but I cannot for the life of me get any print statements from any of my python scripts to actually print when I call them from the windows command line. What am I doing wrong? hello.py: print "Hello World!" command line: E:\Python\dev>python

Re: i have to change default tab length in pydev

2009-03-30 Thread Rhodri James
i understand that you get request token,and you need to get Access tokens after that, my question is about Access tokens:which mechanism do u use to tore access tokens for future use I'm sorry, I have no idea what you're talking about or how it relates to bad indent levels. What *exactly* (inc

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

2009-03-30 Thread Rhodri James
On Mon, 30 Mar 2009 18:57:01 +0100, wrote: Thanks Scott. I think you are saying don't try to subclass from type long, because it is immutable (cannot be changed). If I subclass from type object, then the value can be changed, but I still can't print without explicitely casting back to long in

Re: Relative Imports, why the hell is it so hard?

2009-03-30 Thread Aahz
In article , Gabriel Genellina wrote: > >I'd recommend the oposite - use relative (intra-package) imports when >possible. Explicit is better than implicit - and starting with 2.7 -when >"absolute" import semantics will be enabled by default- you'll *have* to >use relative imports inside a pa

Unix programmers and Idle

2009-03-30 Thread Dale Amon
I wonder if someone could point me at documentation on how to debug some of the standard Unix type things in Idle. I cannot seem to figure out how to set my argument line for the program I am debugging in an Idle window. for example: vlmdeckcheck.py --strict --debug file.dat There must b

Re: unpack the source tarball on Windows

2009-03-30 Thread Gabriel Genellina
En Mon, 30 Mar 2009 20:10:28 -0300, Mensanator escribió: I'm looking for the Turtle Graphics Demos (apparently not included in the Windows install). So I downloaded the bzipped source tarball. I've got Cygwin installed and assume it has the needed utilities. What would I type at the Cygwin

Re: dict view to list

2009-03-30 Thread Tim Hoffman
Hi Larry I actually feel this is a bad idea, (that is making list() a method of all iterators) because quite often iterators are created that don't end. What happens then, is you have a method that will intentionally cause you to run out of memory or you exclude it from such iterators (creating i

unpack the source tarball on Windows

2009-03-30 Thread Mensanator
I'm looking for the Turtle Graphics Demos (apparently not included in the Windows install). So I downloaded the bzipped source tarball. I've got Cygwin installed and assume it has the needed utilities. What would I type at the Cygwin prompt to unpack this puppy? -- http://mail.python.org/mailman

Re: Windows command line not displaying print commands

2009-03-30 Thread JonathanB
#This is pyFind, a python replacement for find(1) import os, sys, re, fnmatch from os.path import join from optparse import OptionParser usage = "usage: %prog --name [directory1 directory2]" parser = OptionParser(usage=usage) parser.add_option("--regex", dest="regex", help="REGEX MATCHING DOES NO

Re: recursive outline numbering for object trees

2009-03-30 Thread Gabriel Genellina
En Mon, 30 Mar 2009 17:34:32 -0300, Alia K escribió: Thanks Gabriel. Your solution works like a charm. (-: You should thank Aaron Brady who wrote the original function. I just smoothed some edges and glued it with your own code. -- Gabriel Genellina -- http://mail.python.org/mailman/li

Re: Windows command line not displaying print commands

2009-03-30 Thread JonathanB
On Mar 30, 6:28 pm, John Machin wrote: > On Mar 31, 8:37 am, Irmen de Jong wrote: > > Does just typing: > > >    python Yes, just typing python takes me to my interactive prompt > > Or do you have a module in your E:\Python\dev directory called 'os', 'sys' > > or something > > else that may cl

Re: Windows command line not displaying print commands

2009-03-30 Thread John Machin
On Mar 31, 8:37 am, Irmen de Jong wrote: > JonathanB wrote: > > Ok, I'm sure this is really simple, but I cannot for the life of me > > get any print statements from any of my python scripts to actually > > print when I call them from the windows command line. What am I doing > > wrong? > > > hell

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

2009-03-30 Thread Dave Angel
Sorry, I meant I took out the stuff *before* the definition of class myclass, and also those things that referred to it. I didn't want to import ctypes, because it couldn't have any effect on the problem at hand. Since then I see that you've succeeded with the __int__() method call, and your

Re: dict view to list

2009-03-30 Thread Larry Riedel
I see list(x.f()) as like x.f().iter().list(), where "list()" is a method of all "iterator" objects, and "iter()" is a method of all "iterable" objects, and whatever object is returned by x.f() is of a type which conforms to the "iterable" interface. I am not saying this is the way things /should/

Re: Upgrade Python on a Mac

2009-03-30 Thread Graham Dumpleton
On Mar 31, 3:07 am, 7stud wrote: > On Mar 3, 4:01 am, Graham Dumpleton > wrote: > > > > > On Mar 3, 8:53 am, Rey Bango 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 > >

Re: Windows command line not displaying print commands

2009-03-30 Thread Irmen de Jong
JonathanB wrote: Ok, I'm sure this is really simple, but I cannot for the life of me get any print statements from any of my python scripts to actually print when I call them from the windows command line. What am I doing wrong? hello.py: print "Hello World!" command line: E:\Python\dev>python

Re: create a log level for python logging module

2009-03-30 Thread Vinay Sajip
On Mar 30, 4:13 pm, dj wrote: > I am trying to create a log level called userinfo for the pythonlogging. I > read the source code and tried to register the level to theloggingnamespace > with the following source: > > fromloggingimport Logger > > # create th

Re: Problems with background processes on Windows

2009-03-30 Thread geoffbache
On Mar 30, 6:57 am, Gabriel Genellina wrote: > Gabriel Genellina yahoo.com.ar> writes: > > > > > En Sat, 28 Mar 2009 06:03:33 -0300, geoffbache > jeppesen.com>   > > escribió: > > > > Well yes, but the point is surely that the standard output of the > > > background sleeping process is pointed t

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

2009-03-30 Thread mark . seagoe
On Mar 30, 12:05 pm, mark.sea...@gmail.com wrote: > On Mar 30, 12:01 pm, mark.sea...@gmail.com wrote: > > > > > > > On Mar 30, 11:53 am, Dave Angel 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 u

Windows command line not displaying print commands

2009-03-30 Thread JonathanB
Ok, I'm sure this is really simple, but I cannot for the life of me get any print statements from any of my python scripts to actually print when I call them from the windows command line. What am I doing wrong? hello.py: print "Hello World!" command line: E:\Python\dev>python hello.py E:\Python

Re: complaints about no replies last week

2009-03-30 Thread Arnaud Delobelle
prueba...@latinmail.com writes: [...] > 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. Since > I was getting paid I got an O(n*n) solution wor

Re: i have to change default tab length in pydev

2009-03-30 Thread Fabio Zadrozny
> 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

Re: Syntax disagreement between IDLE and pydev?

2009-03-30 Thread Fabio Zadrozny
>>> 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): >>> >>

Re: recursive outline numbering for object trees

2009-03-30 Thread Alia K
Thanks Gabriel. Your solution works like a charm. (-: AK -- 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 30, 12:01 pm, mark.sea...@gmail.com wrote: > On Mar 30, 11:53 am, Dave Angel 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 sy

Re: Syntax disagreement between IDLE and pydev?

2009-03-30 Thread Benjamin Kaplan
On Mon, Mar 30, 2009 at 2:23 PM, Jim Garrison 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

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 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 my m

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?

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: 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: 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 Mike Driscoll
On Mar 30, 12:40 pm, 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, colum

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 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 versions > of the C runtim

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 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 = reg_info

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 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 bit sel an

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.

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

Re: email from windows

2009-03-30 Thread Suraj Barkale
prakash jp 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 (http://www.example-code.com/p

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" http://www.catb.org/~esr/fa

Re: Re. suid/sudo in python

2009-03-30 Thread Martin P. Hellwig
Rustom Mody wrote: 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 the re

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 from

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

Re: Ordered Sets

2009-03-30 Thread pataphor
On Mon, 30 Mar 2009 03:30:04 -0500 Nick Craig-Wood 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 cla

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

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 insta

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 modifi

Re: Problems with code

2009-03-30 Thread Chris Rebert
2009/3/30 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

Re: recursive outline numbering for object trees

2009-03-30 Thread Gabriel Genellina
Alia Khouri 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: Upgrade Python on a Mac

2009-03-30 Thread 7stud
On Mar 3, 4:01 am, Graham Dumpleton wrote: > On Mar 3, 8:53 am, Rey Bango 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 wanted to get a better understanding o

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 Knight(g

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

Re: Thoughts on language-level configuration support?

2009-03-30 Thread jfager
On Mar 30, 11:17 am, Steven D'Aprano 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 might look like in Python, ava

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 w

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 nu

Re: Pyowa Meeting this week

2009-03-30 Thread Mike Driscoll
On Mar 30, 10:33 am, Mike Driscoll 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 PyCon atte

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

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 sni

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 = self.__cl

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 , > > > > cassiope   wrote: > > >In attempting to diagnose the cause, I tried directly executing the > >lines inside the python2.5 interpreter: > > >        import  smtplib > >

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 b

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 ) i

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

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

  1   2   >