SQLObject 0.11.4

2010-03-04 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.11.4, a minor bugfix release of 0.11 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

Python Bootcamp - Last week to Register (March 15-19, 2010)

2010-03-04 Thread Chander Ganesan
Just a reminder that there are only 3 weeks remaining to register for the Open Technology Group's Python Bootcamp, a 5 day hands-on, intensive, in-depth introduction to Python. This course is confirmed and guaranteed to run. Worried about the costs of air and hotel to travel for training?

Re: PYTHONPATH and eggs

2010-03-04 Thread geoffbache
On Mar 4, 3:24 am, David Cournapeau courn...@gmail.com wrote: On Wed, Mar 3, 2010 at 7:14 PM, geoffbache geoff.ba...@jeppesen.com wrote: Unfortunately, the location from PYTHONPATH ends up after the eggs in sys.path so I can't persuade Python to import my version. The only way I've found

Don't work __getattr__ with __add__

2010-03-04 Thread Андрей Симурзин
It is object of the class A, in conteiner's class tmpA. Not all method from A are in the tmpA. So for exapmle: A + B -- yes , tmpA + B no. I try to call method from A for tmpA. I can to call simple method, such as change(), bit __add__ - don't work. If to remove inheritance from object, the code

Re: Don't work __getattr__ with __add__

2010-03-04 Thread Chris Rebert
On Thu, Mar 4, 2010 at 12:25 AM, Андрей Симурзин asimur...@gmail.com wrote: It is object of the class A, in conteiner's class tmpA. Not all method from A are in the tmpA. So for exapmle: A + B -- yes , tmpA + B no. I try to call method from A for tmpA. I can to call simple method,  such as

Re: Don't work __getattr__ with __add__

2010-03-04 Thread Andrey Simurzin
On 4 мар, 11:38, Chris Rebert c...@rebertia.com wrote: On Thu, Mar 4, 2010 at 12:25 AM, Андрей Симурзин asimur...@gmail.com wrote: It is object of the class A, in conteiner's class tmpA. Not all method from A are in the tmpA. So for exapmle: A + B -- yes , tmpA + B no. I try to call method

Re: Draft PEP on RSON configuration file format

2010-03-04 Thread Paul Rubin
mk mrk...@gmail.com writes: OK, but how? How would you make up e.g. for JSON's lack of comments? Modify the JSON standard so that JSON 2.0 allows comments. OTOH, if YAML produces net benefit for as few as, say, 200 people in real world, the effort to make it has been well worth it. Not if

My four-yorkshireprogrammers contribution

2010-03-04 Thread Gregory Ewing
MRAB wrote: Mk14 from Science of Cambridge, a kit with hex keypad and 7-segment display, which I had to solder together, and also make my own power supply. I had the extra RAM and the I/O chip, so that's 256B (including the memory used by the monitor) + 256B additional RAM + 128B more in the

Re: Docstrings considered too complicated

2010-03-04 Thread Gregory Ewing
D'Arcy J.M. Cain wrote: And that is why text files in MS-DOS and CP/M before it end with ^Z. They needed a way to tell where the end of the information was. Why they used ^Z (SUB - Substitute) instead of ^C (ETX - End of TeXt) or even ^D (EOT - End Of Transmission) is anyone's guess. Well,

Re: Docstrings considered too complicated

2010-03-04 Thread Gregory Ewing
Richard Brodie wrote: It goes back to ancient PDP operating systems, so may well predate Unix, depending which exact OS was the first to use it. Yes, I think it was used in RT-11, which also had block-oriented disk files. There were two kinds of devices in RT-11, character and block, and the

Re: Docstrings considered too complicated

2010-03-04 Thread Gregory Ewing
Steve Holden wrote: Puts me in mind of Mario Wolczko's early attempts to implement SmallTalk on a VAX 11/750. The only bitmapped display we had available was a Three Rivers PERQ, connected by a 9600bps serial line. We left it running at seven o'clock one evening, and by nine am the next day it

Re: case do problem

2010-03-04 Thread Michael Rudolf
Am 03.03.2010 18:38, schrieb Tracubik: Il Wed, 03 Mar 2010 09:39:54 +0100, Peter Otten ha scritto: def loop(): count = 0 m = 0 lookup = {1: 1, 2: 10, 3: 100} for iterations in range(20): # off by one # ... print %2d %1d %3d % (iterations, count, m) # ...

Re: Old farts playing with their toys

2010-03-04 Thread Gregory Ewing
D'Arcy J.M. Cain wrote: Did you ever play Star Trek with sound effects? Not on that machine, but I played a version on an Apple II that had normal speaker-generated sounds. I can still remember the sound that a photon torpedo (a # character IIRC) made as it lurched its way drunkenly across

Re: Docstrings considered too complicated

2010-03-04 Thread Gregory Ewing
Steven D'Aprano wrote: True, but one can look at best practice, or even standard practice. For Python coders, using docstrings is standard practice if not best practice. Using strings as comments is not. In that particular case, yes, it would be possible to objectively examine the code and

Re: taking python enterprise level?...

2010-03-04 Thread simn_stv
till i think i absolutely need to trade-off easier and less complicated code, better db structure (from a relational perspective) and generally less head aches for speed, i think i'll stick with the joins for now!...;) the thought of denormalization really doesnt appeal to me... --

Re: Adding to a module's __dict__?

2010-03-04 Thread Gregory Ewing
Roy Smith wrote: The idea is I want to put in the beginning of the module: declare('XYZ_FOO', 0, The foo property) declare('XYZ_BAR', 1, The bar property) declare('XYZ_BAZ', 2, reserved for future use) Okay, that seems like a passable excuse. One thing to watch out for is that if your

Re: Queue peek?

2010-03-04 Thread Gregory Ewing
Floris Bruynooghe wrote: I was just wondering if other people ever missed the q.put_at_front_of_queue() method or if it is just me. Sounds like you don't want a queue, but a stack. Or maybe a double-ended queue. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Pylint Argument number differs from overridden method

2010-03-04 Thread Jean-Michel Pichavant
Wanderer wrote: On Mar 3, 2:33 pm, Robert Kern robert.k...@gmail.com wrote: On 2010-03-03 11:39 AM, Wanderer wrote: Pylint W0221 gives the warning Argument number differs from overridden method. Why is this a problem? I'm overriding the method to add additional functionality.

Partly erratic wrong behaviour, Python 3, lxml

2010-03-04 Thread Jussi Piitulainen
Dear group, I am observing weird semi-erratic behaviour that involves Python 3 and lxml, is extremely sensitive to changes in the input data, and only occurs when I name a partial result. I would like some help with this, please. (Python 3.1.1; GNU/Linux; how do I find lxml version?) The test

Re: case do problem

2010-03-04 Thread Gregory Ewing
Peter Otten wrote: Something must be wrong with me today because I find the Pascal code /more/ readable... Actually I don't find either of them very readable. The control flow is pretty convoluted either way. It might be better if it used real-life variable and function names to give some

Re: A scopeguard for Python

2010-03-04 Thread Jean-Michel Pichavant
Alf P. Steinbach wrote: From your post, the scope guard technique is used to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception. This is precisely what the try: finally: syntax is for. You'd have to nest it. That's ugly. And more importantly,

Re: Method / Functions - What are the differences?

2010-03-04 Thread Bruno Desthuilliers
Eike Welk a écrit : Bruno Desthuilliers wrote: John Posner a écrit : Done -- see http://wiki.python.org/moin/FromFunctionToMethod Done and well done !-) Thanks again for the good job John. I like it too, thanks to both of you! I have two small ideas for improvement: - Swap the first two

Re: Working group for Python CPAN-equivalence?

2010-03-04 Thread Gregory Ewing
Peter Billam wrote: A very important thing about CPAN modules is the consistent basic install method: perl Makefile.PL ; make ; make install Well, we more or less have that with Python, too: python setup.py install It may not always work smoothly, but it's the one obvious thing to try

Re: Working group for Python CPAN-equivalence?

2010-03-04 Thread Olof Bjarnason
2010/3/4 Gregory Ewing greg.ew...@canterbury.ac.nz: Peter Billam wrote: A very important thing about CPAN modules is the consistent basic install method:   perl Makefile.PL ; make ; make install Well, we more or less have that with Python, too:  python setup.py install It may not always

Re: Generic singleton

2010-03-04 Thread mk
Steven D'Aprano wrote: Groan. What is it with the Singleton design pattern? It is one of the least useful design patterns, and yet it's *everywhere* in Java and C++ world. It's useful when larking about in language internals for learning purposes, for instance. I don't recall ever actually

Re: memory usage, temporary and otherwise

2010-03-04 Thread mk
Bruno Desthuilliers wrote: mk a écrit : Obviously, don't try this on low-memory machine: a={} for i in range(1000): Note that in Python 2, this will build a list of 1000 int objects. You may want to use xrange instead... Huh? I was under impression that some time after 2.0 range

Re: Docstrings considered too complicated

2010-03-04 Thread Ben Finney
Gregory Ewing greg.ew...@canterbury.ac.nz writes: However, that's only a very small part of what goes to make good code. Much more important are questions like: Are the comments meaningful and helpful? Is the code reasonably self-explanatory outside of the comments? Is it well modularised,

Re: Interest check in some delicious syntactic sugar for except:pass

2010-03-04 Thread Bruno Desthuilliers
Oren Elrad a écrit : Howdy all, longtime appreciative user, first time mailer-inner. I'm wondering if there is any support (tepid better than none) for the following syntactic sugar: silence: block - try: block except: pass Hopefully not.

How to login https sever with inputing account name and password?

2010-03-04 Thread Karen Wang
Hi all, I want to use python to access to https server, like https://212.218.229.10/chinatest/; If open it from IE, will see the pop-up login windows like this I tried several ways but always only get page for HTTP Error 401.2 - Unauthorized error. ( myusername and mypassword are all

Re: NoSQL Movement?

2010-03-04 Thread mk
Jonathan Gardner wrote: When you are starting a new project and you don't have a definitive picture of what the data is going to look like or how it is going to be queried, SQL databases (like PostgreSQL) will help you quickly formalize and understand what your data needs to do. In this role,

Re: Generic singleton

2010-03-04 Thread Duncan Booth
Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 03 Mar 2010 19:54:52 +0100, mk wrote: Hello, So I set out to write generic singleton, i.e. the one that would do a singleton with attributes of specified class. At first: Groan. What is it with the Singleton design

Re: memory usage, temporary and otherwise

2010-03-04 Thread Duncan Booth
mk mrk...@gmail.com wrote: Hm, apparently Python didn't spot that 'spam'*10 in a's values is really the same string, right? If you want it to spot that then give it a hint that it should be looking for identical strings: a={} for i in range(1000): ... a[i]=intern('spam'*10)

Re: taking python enterprise level?...

2010-03-04 Thread mk
Philip Semanchuk wrote: Well OK, but that's a very different argument. Yes, joins can be expensive. They're often still the best option, though. The first step people usually take to get away from joins is denormalization which can improve SELECT performance at the expense of slowing down

WANTED: A good name for the pair (args, kwargs)

2010-03-04 Thread Jonathan Fine
Hi We can call a function fn using val = fn(*args, **kwargs) I'm looking for a good name for the pair (args, kwargs). Any suggestions? Here's my use case: def doit(fn , wibble, expect): args, kwargs = wibble actual = fn(*args, **kwargs) if actual != expect:

15541 - Best, Cheapest Web-Hosting, Domain at $1.99!

2010-03-04 Thread jack
World's Cheapest Rate Hosting, 99.9% Uptime US Based Dedicated Server, Fast Customer Service Register Domain only at $1.99 per Year 3 Month Hosting Free with 1 year Package http://hostwebspaces.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to login https sever with inputing account name and password?

2010-03-04 Thread Michael Rudolf
Am 04.03.2010 11:38, schrieb Karen Wang: Hi all, I want to use python to access to https server, like https://212.218.229.10/chinatest/; If open it from IE, will see the pop-up login windows like this I tried several ways but always only get page for HTTP Error 401.2 - Unauthorized error. (

Re: WANTED: A good name for the pair (args, kwargs)

2010-03-04 Thread Tim Chase
Jonathan Fine wrote: We can call a function fn using val = fn(*args, **kwargs) I'm looking for a good name for the pair (args, kwargs). Any suggestions? For now I'll use argpair, but if anyone has a better idea, I'll use it. In the legacy of C and Java (okay, that doesn't carry _much_

Re: How to login https sever with inputing account name and password?

2010-03-04 Thread Shashwat Anand
You may also want to look into mechanize module. On Thu, Mar 4, 2010 at 6:11 PM, Michael Rudolf spamfres...@ch3ka.de wrote: Am 04.03.2010 11:38, schrieb Karen Wang: Hi all, I want to use python to access to https server, like https://212.218.229.10/chinatest/; If open it from IE, will

Re: NoSQL Movement?

2010-03-04 Thread Duncan Booth
Avid Fan m...@privacy.net wrote: Jonathan Gardner wrote: I see it as a sign of maturity with sufficiently scaled software that they no longer use an SQL database to manage their data. At some point in the project's lifetime, the data is understood well enough that the general nature of

Re: Instance factory - am I doing this right?

2010-03-04 Thread eb303
On Mar 3, 6:41 pm, Laszlo Nagy gand...@shopzeus.com wrote: This is just an interesting code pattern that I have recently used: class CacheStorage(object):     Generic cache storage class.     @classmethod     def get_factory(cls,*args,**kwargs):         Create factory for a given set of

Re: Method / Functions - What are the differences?

2010-03-04 Thread John Posner
On 3/4/2010 5:59 AM, Bruno Desthuilliers wrote: I have two small ideas for improvement: - Swap the first two paragraphs. First say what it is, and then give the motivation. Mmm... As far as I'm concerned, I like it the way its. John ? I think it doesn't make very much difference. But in the

SQLObject 0.12.2

2010-03-04 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.12.2, a bugfix release of branch 0.12 of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to

Re: Passing FILE * types using ctypes

2010-03-04 Thread Francesco Bochicchio
On Mar 4, 12:50 am, Zeeshan Quireshi zeeshan.quire...@gmail.com wrote: Hello, I'm using ctypes to wrap a library i wrote. I am trying to pass it a FILE *pointer, how do i open a file in Python and convert it to a FILE *pointer. Or do i have to call the C library using ctypes first, get the

SQLObject 0.11.4

2010-03-04 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.11.4, a minor bugfix release of 0.11 branch of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

Re: WANTED: A good name for the pair (args, kwargs)

2010-03-04 Thread Paul Rubin
Jonathan Fine j.f...@open.ac.uk writes: I'm looking for a good name for the pair (args, kwargs). Any suggestions? Here's my use case: def doit(fn , wibble, expect): args, kwargs = wibble actual = fn(*args, **kwargs) I think this may have been broken in 3.x, but in 2.6

Re: NoSQL Movement?

2010-03-04 Thread ccc31807
On Mar 3, 4:55 pm, toby t...@telegraphics.com.au wrote:  where you have to store data and relational data Data is neither relational nor unrelational. Data is data. Relationships are an artifact, something we impose on the data. Relations are for human convenience, not something inherent in

Re: Working group for Python CPAN-equivalence?

2010-03-04 Thread John Gabriele
On Mar 3, 9:11 pm, John Bokma j...@castleamber.com wrote: Philip Semanchuk phi...@semanchuk.com writes: In other words, if I was a Perl user under Ubuntu would I use the pkg manager to add a Perl module, or CPAN, or would both work? Both would work, but I would make very sure to use a

Re: NoSQL Movement?

2010-03-04 Thread mk
Duncan Booth wrote: If you look at some of the uses of bigtable you may begin to understand the tradeoffs that are made with sql. When you use bigtable you have records with fields, and you have indices, but there are limitations on the kinds of queries you can perform: in particular you

Re: taking python enterprise level?...

2010-03-04 Thread Tim Wintle
On Wed, 2010-03-03 at 20:39 +0100, mk wrote: Hello Tim, Pardon the questions but I haven't had the need to use denormalization yet, so: IOW you basically merged the tables like follows? CREATE TABLE projects ( client_id BIGINT NOT NULL, project_id BIGINT NOT NULL, cost

Re: taking python enterprise level?...

2010-03-04 Thread Tim Wintle
On Wed, 2010-03-03 at 16:23 -0500, D'Arcy J.M. Cain wrote: On Wed, 03 Mar 2010 20:39:35 +0100 mk mrk...@gmail.com wrote: If you denormalise the table, and update the first index to be on (client_id, project_id, date) it can end up running far more quickly - Maybe. Don't start with

Re: A scopeguard for Python

2010-03-04 Thread Robert Kern
On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 15:35 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 13:32 PM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 11:18 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 09:56 AM, Alf P.

Re: Working group for Python CPAN-equivalence?

2010-03-04 Thread John Gabriele
On Mar 3, 5:30 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Terry Reedy tjre...@udel.edu writes: On 3/3/2010 12:05 PM, John Nagle wrote: CPAN enforces standard organization on packages. PyPi does not. This is, I think, something we don't need as much in Python; there is a

Re: A scopeguard for Python

2010-03-04 Thread Alf P. Steinbach
* Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception. This is precisely what the try: finally: syntax is for. You'd have to nest it. That's

loop over list and process into groups

2010-03-04 Thread Sneaky Wombat
[ {'vlan_or_intf': 'VLAN2021'}, {'vlan_or_intf': 'Interface'}, {'vlan_or_intf': 'Po1'}, {'vlan_or_intf': 'Po306'}, {'vlan_or_intf': 'VLAN2022'}, {'vlan_or_intf': 'Interface'}, {'vlan_or_intf': 'Gi7/33'}, {'vlan_or_intf': 'Po1'}, {'vlan_or_intf': 'Po306'}, {'vlan_or_intf': 'VLAN2051'},

Re: A scopeguard for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 09:48 AM, Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception. This is precisely what the try: finally:

Re: My four-yorkshireprogrammers contribution

2010-03-04 Thread MRAB
Gregory Ewing wrote: MRAB wrote: Mk14 from Science of Cambridge, a kit with hex keypad and 7-segment display, which I had to solder together, and also make my own power supply. I had the extra RAM and the I/O chip, so that's 256B (including the memory used by the monitor) + 256B additional RAM

Re: A scopeguard for Python

2010-03-04 Thread Jean-Michel Pichavant
Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception. This is precisely what the try: finally: syntax is for. You'd

Re: How to login https sever with inputing account name and password?

2010-03-04 Thread Steve Holden
Karen Wang wrote: Hi all, I want to use python to access to https server, like “https://212.218.229.10/chinatest/” If open it from IE, will see the pop-up login windows like this I tried several ways but always only get page for” HTTP Error 401.2 – Unauthorized” error. ( myusername and

Re: My four-yorkshireprogrammers contribution

2010-03-04 Thread python
Not to out do you guys, but over here in the states, I started out with a Radio Shack 'computer' that consisted of 10 slideable switches and 10 flashlight bulbs. You ran wires betweens the slideable switches to create 'programs'. Wish I could remember what this thing was called - my google-fu

Re: NoSQL Movement?

2010-03-04 Thread Juan Pedro Bolivar Puente
On 04/03/10 16:21, ccc31807 wrote: On Mar 3, 4:55 pm, toby t...@telegraphics.com.au wrote: where you have to store data and relational data Data is neither relational nor unrelational. Data is data. Relationships are an artifact, something we impose on the data. Relations are for human

Re: loop over list and process into groups

2010-03-04 Thread mk
Sneaky Wombat wrote: I was going to write a def to loop through and look for certain pre- compiled regexs, and then put them in a new dictionary and append to a list, regexes are overkill in this case I think. [ 'VLAN4065', 'Interface', 'Gi9/6', 'Po2', 'Po3', 'Po306', 'VLAN4068',

Re: A scopeguard for Python

2010-03-04 Thread Alf P. Steinbach
* Robert Kern: On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: * Robert Kern: [snip] can you understand why we might think that you were saying that try: finally: was wrong and that you were proposing that your code was equivalent to some try: except: else: suite? No, not really. His code

Re: A scopeguard for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 10:32 AM, Jean-Michel Pichavant wrote: Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception. This is

Re: A scopeguard for Python

2010-03-04 Thread Alf P. Steinbach
* Robert Kern: On 2010-03-04 09:48 AM, Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used to ensure some desired cleanup at the end of a scope, even when the scope is exited via an exception. This is precisely what the

Re: A scopeguard for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 10:56 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: * Robert Kern: [snip] can you understand why we might think that you were saying that try: finally: was wrong and that you were proposing that your code was equivalent to some try:

Re: memory usage, temporary and otherwise

2010-03-04 Thread lbolla
On Mar 4, 12:24 pm, Duncan Booth duncan.bo...@invalid.invalid wrote:   a={}   for i in range(1000): ...     a[i]=intern('spam'*10) intern: another name borrowed from Lisp? -- http://mail.python.org/mailman/listinfo/python-list

Re: A scopeguard for Python

2010-03-04 Thread Robert Kern
On 2010-03-04 11:02 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-04 09:48 AM, Alf P. Steinbach wrote: * Jean-Michel Pichavant: Alf P. Steinbach wrote: From your post, the scope guard technique is used to ensure some desired cleanup at the end of a scope, even when the scope is

Re: loop over list and process into groups

2010-03-04 Thread Sneaky Wombat
On Mar 4, 10:55 am, mk mrk...@gmail.com wrote: Sneaky Wombat wrote: I was going to write a def to loop through and look for certain pre- compiled regexs, and then put them in a new dictionary and append to a list, regexes are overkill in this case I think. [ 'VLAN4065',  'Interface',

Re: NoSQL Movement?

2010-03-04 Thread George Neuner
On Thu, 04 Mar 2010 18:51:21 +0200, Juan Pedro Bolivar Puente magnic...@gmail.com wrote: On 04/03/10 16:21, ccc31807 wrote: On Mar 3, 4:55 pm, toby t...@telegraphics.com.au wrote: where you have to store data and relational data Data is neither relational nor unrelational. Data is data.

Re: NoSQL Movement?

2010-03-04 Thread ccc31807
On Mar 4, 11:51 am, Juan Pedro Bolivar Puente magnic...@gmail.com wrote: No, relations are data. This depends on your definition of 'data.' I would say that relationships is information gleaned from the data. Data is data says nothing. Data is information. To me, data and information are not

ANN: psutil 0.1.3 released

2010-03-04 Thread Giampaolo Rodola'
Hi, I'm pleased to announce the 0.1.3 release of psutil: http://code.google.com/p/psutil === About === psutil is a module providing an interface for retrieving information on running processes and system utilization (CPU, memory) in a portable way by using Python, implementing many

Re: loop over list and process into groups

2010-03-04 Thread lbolla
On Mar 4, 3:57 pm, Sneaky Wombat joe.hr...@gmail.com wrote: [ {'vlan_or_intf': 'VLAN2021'},  {'vlan_or_intf': 'Interface'},  {'vlan_or_intf': 'Po1'},  {'vlan_or_intf': 'Po306'},  {'vlan_or_intf': 'VLAN2022'},  {'vlan_or_intf': 'Interface'},  {'vlan_or_intf': 'Gi7/33'},  {'vlan_or_intf':

Re: memory usage, temporary and otherwise

2010-03-04 Thread Terry Reedy
On 3/4/2010 6:56 AM, mk wrote: Bruno Desthuilliers wrote: Huh? I was under impression that some time after 2.0 range was made to work under the covers like xrange when used in a loop? Or is it 3.0 that does that? 3.0. -- http://mail.python.org/mailman/listinfo/python-list

Re: A scopeguard for Python

2010-03-04 Thread Michael Rudolf
Am 04.03.2010 17:32, schrieb Jean-Michel Pichavant: It looks like to me that 'with' statements are like decorators: overrated. Oh no, you just insulted my favourite two python features, followed immediately by generators, iterators and list comprehensions / generator expressions :p No,

Re: A scopeguard for Python

2010-03-04 Thread Michael Rudolf
Am 04.03.2010 18:20, schrieb Robert Kern: What I'm trying to explain is that the with: statement has a use even if Cleanup doesn't. Arguing that Cleanup doesn't improve on try: finally: does not mean that the with: statement doesn't improve on try: finally:. Yes, the with-statement rocks :)

Re: memory usage, temporary and otherwise

2010-03-04 Thread Steve Holden
Duncan Booth wrote: mk mrk...@gmail.com wrote: Hm, apparently Python didn't spot that 'spam'*10 in a's values is really the same string, right? If you want it to spot that then give it a hint that it should be looking for identical strings: a={} for i in range(1000): ...

Re: Working group for Python CPAN-equivalence?

2010-03-04 Thread John Bokma
Ben Finney ben+pyt...@benfinney.id.au writes: Terry Reedy tjre...@udel.edu writes: On 3/3/2010 12:05 PM, John Nagle wrote: CPAN is a repository. PyPi is an collection of links. As Ben said, PyPI currently is also a respository and not just links to other repositories. [..] CPAN

Re: WANTED: A good name for the pair (args, kwargs)

2010-03-04 Thread Steve Holden
Jonathan Fine wrote: Hi We can call a function fn using val = fn(*args, **kwargs) I'm looking for a good name for the pair (args, kwargs). Any suggestions? Here's my use case: def doit(fn , wibble, expect): args, kwargs = wibble actual = fn(*args, **kwargs)

Re: A scopeguard for Python

2010-03-04 Thread Jean-Michel Pichavant
Michael Rudolf wrote: Am 04.03.2010 17:32, schrieb Jean-Michel Pichavant: It looks like to me that 'with' statements are like decorators: overrated. Oh no, you just insulted my favourite two python features, followed immediately by generators, iterators and list comprehensions / generator

Re: A scopeguard for Python

2010-03-04 Thread Alf P. Steinbach
* Robert Kern: On 2010-03-04 10:56 AM, Alf P. Steinbach wrote: * Robert Kern: On 2010-03-03 18:49 PM, Alf P. Steinbach wrote: [snippety] If you call the possibly failing operation A, then that systematic approach goes like this: if A fails, then it has cleaned up its own mess, but if A

Evaluate my first python script, please

2010-03-04 Thread Pete Emerson
I've written my first python program, and would love suggestions for improvement. I'm a perl programmer and used a perl version of this program to guide me. So in that sense, the python is perlesque This script parses /etc/hosts for hostnames, and based on terms given on the command line (argv),

Re: pyao makes the right sound but why?

2010-03-04 Thread Anssi Saari
'2+ electriclighthe...@gmail.com writes: dev = ao.AudioDevice('alsa') dev.play(x) could launch me a semi realtime dj kinda sys luckily .. it does seem to be making the right sound but why? the default of the samplerate and that 16bit happened to match with my thing x? Yes, that seems to

Re: Partly erratic wrong behaviour, Python 3, lxml

2010-03-04 Thread Stefan Behnel
Jussi Piitulainen, 04.03.2010 11:46: I am observing weird semi-erratic behaviour that involves Python 3 and lxml, is extremely sensitive to changes in the input data, and only occurs when I name a partial result. I would like some help with this, please. (Python 3.1.1; GNU/Linux; how do I find

Re: NoSQL Movement?

2010-03-04 Thread Duncan Booth
mk mrk...@gmail.com wrote: Duncan Booth wrote: If you look at some of the uses of bigtable you may begin to understand the tradeoffs that are made with sql. When you use bigtable you have records with fields, and you have indices, but there are limitations on the kinds of queries you can

Re: loop over list and process into groups

2010-03-04 Thread nn
lbolla wrote: On Mar 4, 3:57 pm, Sneaky Wombat joe.hr...@gmail.com wrote: [ {'vlan_or_intf': 'VLAN2021'},  {'vlan_or_intf': 'Interface'},  {'vlan_or_intf': 'Po1'},  {'vlan_or_intf': 'Po306'},  {'vlan_or_intf': 'VLAN2022'},  {'vlan_or_intf': 'Interface'},  {'vlan_or_intf':

Re: Generic singleton

2010-03-04 Thread David Bolen
Duncan Booth duncan.bo...@invalid.invalid writes: It is also *everywhere* in the Python world. Unlike Java and C++, Python even has its own built-in type for singletons. If you want a singleton in Python use a module. So the OP's original examples become: --- file singleton.py --- foo =

Re: Evaluate my first python script, please

2010-03-04 Thread MRAB
Pete Emerson wrote: I've written my first python program, and would love suggestions for improvement. I'm a perl programmer and used a perl version of this program to guide me. So in that sense, the python is perlesque This script parses /etc/hosts for hostnames, and based on terms given on

Re: Evaluate my first python script, please

2010-03-04 Thread nn
On Mar 4, 2:30 pm, MRAB pyt...@mrabarnett.plus.com wrote: Pete Emerson wrote: I've written my first python program, and would love suggestions for improvement. I'm a perl programmer and used a perl version of this program to guide me. So in that sense, the python is perlesque This

ANNOUNCE: Exscript 2.0

2010-03-04 Thread knipknap
Introduction - Exscript is a Python module and template processor for automating Telnet or SSH sessions. Exscript supports a wide range of features, such as parallelization, AAA authentication methods, TACACS, and a very simple template language. Please refer to the project page for

Re: A scopeguard for Python

2010-03-04 Thread Mike Kent
On Mar 3, 10:56 am, Alf P. Steinbach al...@start.no wrote: * Mike Kent: What's the compelling use case for this vs. a simple try/finally? if you thought about it you would mean a simple try/else. finally is always executed. which is incorrect for cleanup by the way, that's one

Re: Pylint Argument number differs from overridden method

2010-03-04 Thread Wanderer
On Mar 4, 5:45 am, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Wanderer wrote: On Mar 3, 2:33 pm, Robert Kern robert.k...@gmail.com wrote: On 2010-03-03 11:39 AM, Wanderer wrote: Pylint W0221 gives the warning Argument number differs from overridden method. Why is this a

Re: loop over list and process into groups

2010-03-04 Thread Chris Colbert
Man, deja-vu, I could have sworn I read this thread months ago... On Thu, Mar 4, 2010 at 2:18 PM, nn prueba...@latinmail.com wrote: lbolla wrote: On Mar 4, 3:57 pm, Sneaky Wombat joe.hr...@gmail.com wrote: [ {'vlan_or_intf': 'VLAN2021'}, {'vlan_or_intf': 'Interface'},

Re: A scopeguard for Python

2010-03-04 Thread Mike Kent
On Mar 4, 12:30 pm, Robert Kern robert.k...@gmail.com wrote: He's ignorant of the use cases of the with: statement, true. humor Ouch! Ignorant of the use cases of the with statement, am I? Odd, I use it all the time. /humor Given only your example of the with: statement, it is hard to fault

Re: Method / Functions - What are the differences?

2010-03-04 Thread John Posner
On 3/3/2010 6:56 PM, John Posner wrote: ... I was thinking today about doing a Bruno, and producing similar pieces on: * properties created with the @property decorator * the descriptor protocol I'll try to produce something over the next couple of days. Starting to think about a writeup

Re: A scopeguard for Python

2010-03-04 Thread Mike Kent
On Mar 3, 12:00 pm, Robert Kern robert.k...@gmail.com wrote: On 2010-03-03 09:39 AM, Mike Kent wrote: What's the compelling use case for this vs. a simple try/finally?     original_dir = os.getcwd()     try:         os.chdir(somewhere)         # Do other stuff     finally:        

_winreg and access registry settings of another user

2010-03-04 Thread News123
Hi, I habe administrator privilege on a window host and would like to write a script setting some registry entries for other users. There are potentially at least two wo ways of doing this: 1.) start a subprocess as other user and change the regitrey for CURRENT_USER However I don't know

Re: Partly erratic wrong behaviour, Python 3, lxml

2010-03-04 Thread Jussi Piitulainen
Stefan Behnel writes: Jussi Piitulainen, 04.03.2010 11:46: I am observing weird semi-erratic behaviour that involves Python 3 and lxml, is extremely sensitive to changes in the input data, and only occurs when I name a partial result. I would like some help with this, please. (Python

Re: python SUDS library

2010-03-04 Thread Diez B. Roggisch
Am 04.03.10 06:23, schrieb yamamoto: Hi, I tried to make a simple script with SUD library for caching torrent files. it doenst work! [versions] suds: 0.4, python: 2.6.4 [code] from suds.client import Client import base64 path = 'sample.torrent' doc = open(path, 'rb').read() encoded_doc =

Re: Partly erratic wrong behaviour, Python 3, lxml

2010-03-04 Thread Jussi Piitulainen
This is the full data file on which my regress/Tribug exhibits the behaviour that I find incomprehensible, described in the first post in this thread. The comment in the beginning of the file below was written before I commented out some records in the data, so the actual numbers now are not ten

Re: Evaluate my first python script, please

2010-03-04 Thread Jonathan Gardner
On Thu, Mar 4, 2010 at 10:39 AM, Pete Emerson pemer...@gmail.com wrote: #!/usr/bin/python More common: #!/usr/bin/env python import sys, fileinput, re, os filename = '/etc/hosts' hosts = [] for line in open(filename, 'r'):        match = re.search('\d+\.\d+\.\d+\.\d+\s+(\S+)', line)

  1   2   >