Re: staticmethod and namespaces

2010-02-26 Thread darnzen
On Feb 26, 10:20 am, "Diez B. Roggisch" wrote: > Am 26.02.10 17:08, schrieb Diez B. Roggisch: > > > > > > > Am 26.02.10 16:57, schrieb darnzen: > >> On Feb 26, 9:41 am, "Diez B. Roggisch" wrote: > >>> Am 26.02.10 16:32, schrieb darnzen: > > On Feb 26, 3:15 am, "Diez B. Roggisch" wrote: >

mobiletrickS

2010-02-26 Thread raghumech
FREE CALL TO ANYWHERE .. http://mobiletricks777.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: A more specific query ...

2010-02-26 Thread Gib Bogle
Dennis Lee Bieber wrote: On Sat, 27 Feb 2010 13:00:32 +1300, Gib Bogle declaimed the following in gmane.comp.python.general: The PyQt4 problem results from having copies of the Qt DLLs in directories that are in the PATH, as Doug Bell discovered. In my case I have two programs that use Qt, A

Re: DreamPie - The Python shell you've always dreamed about!

2010-02-26 Thread alex23
Mensanator wrote: > "You're" not getting the point. If every link has to be accompanied by a summary of all of the information at the end of it, what point is there to linking? (Programmers are the _only_ people I know of who complain about the arduousness of tasks like typing quotes or clicking

Re: Variable definition

2010-02-26 Thread Dave Angel
Steven D'Aprano wrote: for key, value in varDic.iteritems(): varDic['myPrefix_' + key] = value del varDic[key] Watch out if any of the existing values already startswith 'myPrefix' You can end up with trouble just as confusing as if 'myPrefix' is an empty string DaveA -- http:/

Re: Docstrings considered too complicated

2010-02-26 Thread Steven D'Aprano
On Fri, 26 Feb 2010 21:51:17 -0600, Tim Daneliuk wrote: > The only possible exception to this I can think of is when there is some > non-obvious side-effect (i.e. language and/or hardware is > "misfeatured"): > > mov A,B; Moving A into B also will also arm >

Re: Docstrings considered too complicated

2010-02-26 Thread Steven D'Aprano
On Sat, 27 Feb 2010 03:25:47 +, MRAB wrote: >> Also, some assemblies perform the move in different directions >> according to the arguments. So you might have: >> >> mv AX,BX ; move contents of BX into AX mv @CX,DX ; move contents of >> @CX into DX >> >> Horrible, yes, but apparently some a

Re: Docstrings considered too complicated

2010-02-26 Thread Steven D'Aprano
On Sat, 27 Feb 2010 00:54:53 +, MRAB wrote: > The assembly languages of virtually all the processors that I've come > across put the destination first, eg. x86: Incorrect. x86 assembly has two distinct syntax branches, "Intel syntax" (which is most common in the Windows world according to W

Re: How to end TCP socket data while using readline()?

2010-02-26 Thread Cameron Simpson
On 26Feb2010 10:39, Arjun wrote: | Hi, I have a small script that runs a TCP server. A client connects to | this server and transmits a stored file line-by-line, and then waits | for a confirmation "done". However, when I run them the first loop | never really ends -- as the TCP server keeps expec

Re: Docstrings considered too complicated

2010-02-26 Thread Tim Daneliuk
On 2/26/2010 9:25 PM, MRAB wrote: > Steven D'Aprano wrote: >> On Fri, 26 Feb 2010 18:47:26 -0600, John Bokma wrote: >> >>> Steven D'Aprano writes: >>> On Fri, 26 Feb 2010 09:09:36 -0600, Tim Daneliuk wrote: > Reminiscent of: > > mov AX,BX ; Move the contents of

Re: Docstrings considered too complicated

2010-02-26 Thread D'Arcy J.M. Cain
On 27 Feb 2010 00:02:40 GMT Steven D'Aprano wrote: > On Fri, 26 Feb 2010 09:09:36 -0600, Tim Daneliuk wrote: > > mov AX,BX ; Move the contents of BX into AX > > That's a *good* comment, because without it most English-speaking people > would assume you were moving the contents of

Re: importing libraries not working 2.6.4

2010-02-26 Thread Rami Chowdhury
On Feb 26, 2010, at 19:47 , Isaiah Coberly wrote: > C:\OpenCV2.0\Python2.6\Lib\site-packages > > no .py files here.. > > cv.pyd > libcv.dll.a > > > C:\OpenCV2.0\Python2.6\Lib\site-packages\opencv > > _init_.py > matlan_syntax.py > adaptors.py > cv.py > It looks to me like 'opencv' is stru

Re: Variable definition

2010-02-26 Thread Steven D'Aprano
On Fri, 26 Feb 2010 15:32:27 -0800, Raphael Mayoraz wrote: > Hello, > > I'd like to define variables with some specific name that has a common > prefix. > Something like this: > > varDic = {'red': 'a', 'green': 'b', 'blue': 'c'} > for key, value in varDic.iteritems(): > 'myPrefix' + key = va

Re: Variable definition

2010-02-26 Thread John Posner
On 2/26/2010 10:20 PM, Steven D'Aprano wrote: On Fri, 26 Feb 2010 20:15:16 -0500, John Posner wrote: On 2/26/2010 6:32 PM, Raphael Mayoraz wrote: Hello, I'd like to define variables with some specific name that has a common prefix. Something like this: varDic = {'red': 'a', 'green': 'b', 'bl

Re: Docstrings considered too complicated

2010-02-26 Thread MRAB
Steven D'Aprano wrote: On Fri, 26 Feb 2010 18:47:26 -0600, John Bokma wrote: Steven D'Aprano writes: On Fri, 26 Feb 2010 09:09:36 -0600, Tim Daneliuk wrote: Reminiscent of: mov AX,BX ; Move the contents of BX into AX That's a *good* comment, because without it most Englis

Re: Variable definition

2010-02-26 Thread Steven D'Aprano
On Fri, 26 Feb 2010 20:15:16 -0500, John Posner wrote: > On 2/26/2010 6:32 PM, Raphael Mayoraz wrote: >> Hello, >> >> I'd like to define variables with some specific name that has a common >> prefix. >> Something like this: >> >> varDic = {'red': 'a', 'green': 'b', 'blue': 'c'} for key, value in >

Re: Docstrings considered too complicated

2010-02-26 Thread Steven D'Aprano
On Fri, 26 Feb 2010 18:47:26 -0600, John Bokma wrote: > Steven D'Aprano writes: > >> On Fri, 26 Feb 2010 09:09:36 -0600, Tim Daneliuk wrote: >> >>> Reminiscent of: >>> >>> mov AX,BX ; Move the contents of BX into AX >> >> >> That's a *good* comment, because without it most Englis

Re: random.gauss: range

2010-02-26 Thread Steven D'Aprano
On Fri, 26 Feb 2010 13:26:44 -0800, pistacchio wrote: > hi, > i'm trying the random.gauss function. can anyone explain how to get a > number between a given range? like, from 0 to 20 with an average of 10? That's not what a Gaussian distribution does. It has an infinite range. Are you sure you w

Re: Dictionary or Database—Please advise

2010-02-26 Thread Paul Rubin
Jeremy writes: > I have lots of data that I currently store in dictionaries. However, > the memory requirements are becoming a problem. I am considering > using a database of some sorts instead, but I have never used them > before. Would a database be more memory efficient than a dictionary? W

Re: Dictionary or Database—Please advise

2010-02-26 Thread Steven D'Aprano
On Fri, 26 Feb 2010 21:56:47 +0100, Patrick Sabin wrote: >> Shelve looks like an interesting option, but what might pose an issue >> is that I'm reading the data from a disk instead of memory. I didn't >> mention this in my original post, but I was hoping that by using a >> database it would be m

Re: importing libraries not working 2.6.4

2010-02-26 Thread Rami Chowdhury
On Friday 26 February 2010 17:42:04 Isaiah Coberly wrote: > Thanks for the reply. > > I tried putting the files from > > C:\OpenCV2.0\Python2.6\Lib > > too > > C:\Python26\Lib\site-packages > > and Python still wont import.. > > I adjusted the environment variables to try and import maya.sta

PyAutoRun

2010-02-26 Thread Zubin Mithra
Hello, I have been using python for quite some time; however this is the first python project i have worked on. The code is hosted at http://github.com/zubin71/PyAutoRun The code needs re-factoring and feature additions; i have put up a TODO list there too. It`d be great if anyone could work on

Re: Docstrings considered too complicated

2010-02-26 Thread Alf P. Steinbach
* MRAB: Steven D'Aprano wrote: On Fri, 26 Feb 2010 09:09:36 -0600, Tim Daneliuk wrote: Reminiscent of: mov AX,BX ; Move the contents of BX into AX That's a *good* comment, because without it most English-speaking people would assume you were moving the contents of AX into B

Re: Variable definition

2010-02-26 Thread John Posner
On 2/26/2010 6:32 PM, Raphael Mayoraz wrote: Hello, I'd like to define variables with some specific name that has a common prefix. Something like this: varDic = {'red': 'a', 'green': 'b', 'blue': 'c'} for key, value in varDic.iteritems(): 'myPrefix' + key = value No trick, just swap a new ke

Re: Docstrings considered too complicated

2010-02-26 Thread MRAB
Steven D'Aprano wrote: On Fri, 26 Feb 2010 09:09:36 -0600, Tim Daneliuk wrote: Reminiscent of: mov AX,BX ; Move the contents of BX into AX That's a *good* comment, because without it most English-speaking people would assume you were moving the contents of AX into BX. [sn

Re: Docstrings considered too complicated

2010-02-26 Thread John Bokma
Steven D'Aprano writes: > On Fri, 26 Feb 2010 09:09:36 -0600, Tim Daneliuk wrote: > >> Reminiscent of: >> >> mov AX,BX ; Move the contents of BX into AX > > > That's a *good* comment, because without it most English-speaking people > would assume you were moving the contents of A

Re: random.gauss: range

2010-02-26 Thread Raymond Hettinger
On Feb 26, 1:26 pm, pistacchio wrote: > hi, > i'm trying the random.gauss function. can anyone explain how to get a > number between a given range? like, from 0 to 20 with an average of > 10? and how to determine the "steep" of the curve? i've never studied > it, so mu and sigma don't really tell

Re: random.gauss: range

2010-02-26 Thread pistacchio
thanks, betadistribute did the work... and i learned a new thing! On 26 Feb, 22:56, Robert Kern wrote: > On 2010-02-26 15:26 PM, pistacchio wrote: > > > hi, > > i'm trying the random.gauss function. can anyone explain how to get a > > number between a given range? > > You don't. The Gaussian dist

Re: Variable definition

2010-02-26 Thread alex goretoy
On Fri, Feb 26, 2010 at 6:22 PM, Alf P. Steinbach wrote: > * Raphael Mayoraz: > >> Hello, >> >> >> I'd like to define variables with some specific name that has a common >> prefix. >> Something like this: >> >> varDic = {'red': 'a', 'green': 'b', 'blue': 'c'} >> for key, value in varDic.iteritems

Re: importing libraries not working 2.6.4

2010-02-26 Thread Rami Chowdhury
On Friday 26 February 2010 16:06:56 Routb3d wrote: > I used the x86 Python 2.6.4 installer. I am working in x64 Win7 pro. > > I have tried adjusting environment variables as well as putting the > files directly in the search path of Python.. Python still returns > this.. Any ideas? Where are you

Re: Variable definition

2010-02-26 Thread Alf P. Steinbach
* Raphael Mayoraz: Hello, I'd like to define variables with some specific name that has a common prefix. Something like this: varDic = {'red': 'a', 'green': 'b', 'blue': 'c'} for key, value in varDic.iteritems(): 'myPrefix' + key = value I know this is illegal, but there must be a trick s

Re: Variable definition

2010-02-26 Thread Rhodri James
On Fri, 26 Feb 2010 23:32:27 -, Raphael Mayoraz wrote: I'd like to define variables with some specific name that has a common prefix. Why? No seriously, how do you think this is going to solve whatever problem you clearly think it will solve? -- Rhodri James *-* Wildebeeste Herder

importing libraries not working 2.6.4

2010-02-26 Thread Routb3d
I used the x86 Python 2.6.4 installer. I am working in x64 Win7 pro. I have tried adjusting environment variables as well as putting the files directly in the search path of Python.. Python still returns this.. Any ideas? >>> import sys >>> sys.path ['C:\\Python26\\Lib\\idlelib', 'C:\\Program Fil

Re: Docstrings considered too complicated

2010-02-26 Thread Steven D'Aprano
On Fri, 26 Feb 2010 09:09:36 -0600, Tim Daneliuk wrote: > Reminiscent of: > > mov AX,BX ; Move the contents of BX into AX That's a *good* comment, because without it most English-speaking people would assume you were moving the contents of AX into BX. > And, yes, I've actually

Re: A more specific query ...

2010-02-26 Thread Gib Bogle
The PyQt4 problem results from having copies of the Qt DLLs in directories that are in the PATH, as Doug Bell discovered. In my case I have two programs that use Qt, AMD CodeAnalyst and Matlab. If I rename BOTH these directories I can import the PyQt4 modules. Since this behaviour did not oc

Re: A more specific query ...

2010-02-26 Thread Gib Bogle
The PyQt4 problem results from having copies of the Qt DLLs in directories that are in the PATH, as Doug Bell discovered. In my case I have two programs that use Qt, AMD CodeAnalyst and Matlab. If I rename BOTH these directories I can import the PyQt4 modules. Since this behaviour did not oc

Re: Get dosctring without import

2010-02-26 Thread Ben Finney
Joan Miller writes: > On 26 feb, 12:35, Ben Finney wrote: > > A common convention is to have a ‘README’ text file, written in > > reStructuredText for rendering to various output formats as part of > > the documentation. You could then have the ‘setup.py’ program read > > the contents of that fi

Re: loop through each line in a text file

2010-02-26 Thread alex goretoy
I smell homework -- http://mail.python.org/mailman/listinfo/python-list

Variable definition

2010-02-26 Thread Raphael Mayoraz
Hello, I'd like to define variables with some specific name that has a common prefix. Something like this: varDic = {'red': 'a', 'green': 'b', 'blue': 'c'} for key, value in varDic.iteritems(): 'myPrefix' + key = value I know this is illegal, but there must be a trick somewhere. Thanks,

Re: loop through each line in a text file

2010-02-26 Thread rurpy
On Feb 26, 2:21 pm, qtrimble wrote: > On Feb 26, 4:14 pm, OdarR wrote: > > > > below is just a sample.  There are well over 500,000 lines that need > > > processed. > > > > wer1999001 > > >       31.2234      82.2367 > > >       37.9535      82.3456 > > > wer1999002 > > >       31.2234      82.2

Re: Dictionary or Database—Please advise

2010-02-26 Thread Phlip
On Feb 26, 7:58 am, Jeremy wrote: > I have lots of data that I currently store in dictionaries.  However, > the memory requirements are becoming a problem.  I am considering > using a database of some sorts instead, but I have never used them > before.  Would a database be more memory efficien

Re: Dictionary or Database—Please advise

2010-02-26 Thread Aahz
In article <891a98fa-c398-455a-981f-bf72af772...@s36g2000prh.googlegroups.com>, Jeremy wrote: > >I have lots of data that I currently store in dictionaries. However, >the memory requirements are becoming a problem. I am considering >using a database of some sorts instead, but I have never used

Re: Dictionary or Database�Please advise

2010-02-26 Thread Aahz
In article , Roy Smith wrote: > >Whatever database you pick, you're almost certainly going to end up having >to install it wherever you install your application. There's no such thing >as a universally available database that you can expect to be available >everywhere. ...unless you use SQLi

Re: Dictionary or Database—Please advise

2010-02-26 Thread Luis M . González
On Feb 26, 12:58 pm, Jeremy wrote: > I have lots of data that I currently store in dictionaries.  However, > the memory requirements are becoming a problem.  I am considering > using a database of some sorts instead, but I have never used them > before.  Would a database be more memory efficie

Re: Dictionary or Database—Please advise

2010-02-26 Thread Aahz
In article , Patrick Sabin wrote: > >A database usually stores data on disk and not in RAM. However you could >use sqlite with :memory:, so that it runs in RAM. The OP wants transparent caching, so :memory: wouldn't work. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncr

Re: loop through each line in a text file

2010-02-26 Thread John Posner
On 2/26/2010 4:21 PM, qtrimble wrote: fileIN = open(r"C:\testing.txt", "r") for line in fileIN: year = line[3:7] day = line[7:10] print year, day This is good since i can get the year and day of year into a variable but I haven't gotten any further. That's an excellent start.

Re: Six Minutes and fourty two seconds

2010-02-26 Thread Mark Lawrence
Tobiah wrote: Now that I use python, this is the amount of time per day that I spend adding forgotten semicolons while debugging other languages. You think that's bad? I've spent hours today converting the J language that I don't dare mention to Python. Once in a blue moon I came across a

Re: Quoting quotes

2010-02-26 Thread Lawrence D'Oliveiro
In message , William Lohrmann wrote: > The best thing would be to backslash the single quote: print 'The play > "All\'s Well That Ends Well"' Backslash-type escapes are the most general solution to this type of problem. They’re also the easiest to apply automatically: for ch in input_stri

How to determine if threads are active in an application?

2010-02-26 Thread python
Is there technique to determine if threads are active in a Python application? The only technique I can think of is to check sys.modules for thread and threading. But this will only show whether these modules were imported - not whether there are actually background threads running. Motivation: W

Re: A more specific query ...

2010-02-26 Thread Gib Bogle
The point of my question was that sys.path is clearly not being used in this case. When I start Python sys.path includes D:\python26\lib\site-packages which seems to be the Python default. Using sys.path.append I have tried adding both D:\python26\lib\site-packages\PyQt4 and D:\python26\lib\si

Re: Docstrings considered too complicated

2010-02-26 Thread Mark Lawrence
Jean-Michel Pichavant wrote: Andreas Waldenburger wrote: On Fri, 26 Feb 2010 09:09:36 -0600 Tim Daneliuk wrote: On 2/24/2010 2:23 PM, Andreas Waldenburger wrote: [stuff] Reminiscent of: mov AX,BX ; Move the contents of BX into AX Well, there might be some

Re: random.gauss: range

2010-02-26 Thread Robert Kern
On 2010-02-26 15:26 PM, pistacchio wrote: hi, i'm trying the random.gauss function. can anyone explain how to get a number between a given range? You don't. The Gaussian distribution has infinite range. The best you can do with the standard library is to keep sampling until you get a number in

Re: Problems uploading to IIS using FTP over SSL

2010-02-26 Thread Stephen Nelson-Smith
On Feb 26, 2:05 pm, Stephen Nelson-Smith wrote: > Hello, I'm sorry - I hadn't realised that python-list ended up here as well. Sincere apologies for double-posting. S. -- http://mail.python.org/mailman/listinfo/python-list

Re: A more specific query ...

2010-02-26 Thread Gib Bogle
Chris Rebert wrote: On Fri, Feb 26, 2010 at 12:45 PM, Gib Bogle wrote: How can I interrogate Python to find out where it is looking to find the PyQt4 DLLs in a Windows installation? import sys print(sys.path) Note this thread: http://www.mail-archive.com/p...@riverbankcomputing.com/msg20121

Re: Renaming identifiers & debugging

2010-02-26 Thread Luca
Roald de Vries wrote: I would suggest to do choose the same strategy as 'from __future__ import ...' takes, which does similar things and limits them to the module it is used in. I would be curious to hear about your results. Kind regards, Roald Hi, well, i have thought on the issue and i th

random.gauss: range

2010-02-26 Thread pistacchio
hi, i'm trying the random.gauss function. can anyone explain how to get a number between a given range? like, from 0 to 20 with an average of 10? and how to determine the "steep" of the curve? i've never studied it, so mu and sigma don't really tell me a thing. thanks in advange -- http://mail.py

Re: loop through each line in a text file

2010-02-26 Thread qtrimble
On Feb 26, 4:14 pm, OdarR wrote: > On 26 fév, 22:08, qtrimble wrote: > > > > > I'm a python newbie but I do have some basic scripting experience.  I > > need to take the line starting with "wer" and extract the year and day > > of year from that string.  I want to be able to add the year and day

Re: A more specific query ...

2010-02-26 Thread Chris Rebert
On Fri, Feb 26, 2010 at 12:45 PM, Gib Bogle wrote: > How can I interrogate Python to find out where it is looking to find the > PyQt4 DLLs in a Windows installation? import sys print(sys.path) Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: loop through each line in a text file

2010-02-26 Thread OdarR
On 26 fév, 22:08, qtrimble wrote: > I'm a python newbie but I do have some basic scripting experience.  I > need to take the line starting with "wer" and extract the year and day > of year from that string.  I want to be able to add the year and day > of year from the last line having "wer*" to th

Re: loop through each line in a text file

2010-02-26 Thread Alf P. Steinbach
* qtrimble: I'm a python newbie but I do have some basic scripting experience. I need to take the line starting with "wer" and extract the year and day of year from that string. I want to be able to add the year and day of year from the last line having "wer*" to the lines occurring in between

loop through each line in a text file

2010-02-26 Thread qtrimble
I'm a python newbie but I do have some basic scripting experience. I need to take the line starting with "wer" and extract the year and day of year from that string. I want to be able to add the year and day of year from the last line having "wer*" to the lines occurring in between "wer*" lines.

Re: Docstrings considered too complicated

2010-02-26 Thread Grant Edwards
On 2010-02-26, Jean-Michel Pichavant wrote: > Andreas Waldenburger wrote: >> On Fri, 26 Feb 2010 09:09:36 -0600 Tim Daneliuk >> wrote: >> >> >>> On 2/24/2010 2:23 PM, Andreas Waldenburger wrote: >>> [stuff] >>> Reminiscent of: >>> >>> mov AX,BX ; Move the c

Re: Dictionary or Database—Please advise

2010-02-26 Thread Patrick Sabin
Shelve looks like an interesting option, but what might pose an issue is that I'm reading the data from a disk instead of memory. I didn't mention this in my original post, but I was hoping that by using a database it would be more memory efficient in storing data in RAM so I wouldn't have to r

Re: Docstrings considered too complicated

2010-02-26 Thread Mel
Jean-Michel Pichavant wrote: > Andreas Waldenburger wrote: >> On Fri, 26 Feb 2010 09:09:36 -0600 Tim Daneliuk >> wrote: >>> Reminiscent of: >>> mov AX,BX ; Move the contents of BX into AX >> Well, there might be some confusion there as to what gets moved where, >> wouldn't you say?

any news from Python Magazine ?

2010-02-26 Thread OdarR
Seems rather late...: http://pythonmagazine.com/ "We'll be back, better than ever, on January 26th, 2010. " Olivier -- http://mail.python.org/mailman/listinfo/python-list

A more specific query ...

2010-02-26 Thread Gib Bogle
How can I interrogate Python to find out where it is looking to find the PyQt4 DLLs in a Windows installation? Secondarily, how is this search path set? -- http://mail.python.org/mailman/listinfo/python-list

Re: lists of variables

2010-02-26 Thread Alf P. Steinbach
* Michael Pardee: I'm relatively new to python and I was very surprised by the following behavior: a=1 b=2 'a' refers to an object representing the integer 1. Since 1 is an immutable value you can just as well think of it as 'a' containing the value 1, because a reference to an immutable va

Re: Dictionary or Database—Please advise

2010-02-26 Thread CM
On Feb 26, 10:58 am, Jeremy wrote: > I have lots of data How much is "lots"? > that I currently store in dictionaries.  However, > the memory requirements are becoming a problem.  I am considering > using a database of some sorts instead, but I have never used them > before.  Would a databas

Re: Is this secure?

2010-02-26 Thread Peter Pearson
On Wed, 24 Feb 2010 21:02:07 +0100, mk wrote: [snip] > > rand_str_SystemRandom_seeding > mean 3845.15384615 std dev 46.2016419186 > l 3926 1.75 std devs away from mean > y 3916 1.53 std devs away from mean > d 3909 1.38 std devs away from mean > a 3898 1.14 std devs away from mean > p 3898 1.14 st

Re: collections use __next__() in python 2.6?

2010-02-26 Thread Raymond Hettinger
On Feb 26, 10:08 am, Gary Robinson wrote: > The Python 2.6.4 docs for collections > athttp://docs.python.org/library/collections.htmlsay that __next__() is an > abstract method for the Iterable ABC. But my understanding is that __next__() > isn't supposed to be used until Python 3. Also, I'm us

Re: Is this secure?

2010-02-26 Thread Peter Pearson
On Wed, 24 Feb 2010 20:16:24 +0100, mk wrote: > On 2010-02-24 20:01, Robert Kern wrote: >> I will repeat my advice to just use random.SystemRandom.choice() instead >> of trying to interpret the bytes from /dev/urandom directly. > > Out of curiosity: > > def gen_rand_string(length): > prng = r

Re: Possible to import from a cStringIO file object vs. file on disk?

2010-02-26 Thread python
Steve, > You'll need to write a custom importer. PEP 302 contains the necessary > details. Thanks for pointing me to PEP 302 and the imp module. It looks like "imp.load_compiled(name, pathname[, file])" is what I need, but the description of this method (and similar methods) has the following

Re: How to end TCP socket data while using readline()?

2010-02-26 Thread MRAB
Arjun Chennu wrote: No need to flush because you're writing to a file and it'll be flushed anyway when you close it. True. I had introduced those flush lines while I was trying to troubleshoot this annoying situation. :-) You've closed the file view, but the underlying socket is sti

Re: Six Minutes and fourty two seconds

2010-02-26 Thread mk
Tobiah wrote: Now that I use python, this is the amount of time per day that I spend adding forgotten semicolons while debugging other languages. My objects are flat and I don't know who's Guido. I blame it all on Python. How about a PEP "Let's make Python look like PHP"? Regards, mk -- ht

Re: SystemError: error return without exception set

2010-02-26 Thread MRAB
Shailendra wrote: Hi All, I am getting error in "SystemError: error return without exception set" which i am not able debug. I made following test program which gives same error. =test.py== import numpy class testClass: def __init__(self,param1=1,param2=2): self

Re: Six Minutes and fourty two seconds

2010-02-26 Thread Matt Nordhoff
Tobiah wrote: > Now that I use python, this is the amount of time > per day that I spend adding forgotten semicolons while > debugging other languages. You can fix that by not using other languages. :> -- Matt Nordhoff -- http://mail.python.org/mailman/listinfo/python-list

Re: lists of variables

2010-02-26 Thread Aahz
In article , Michael Pardee wrote: > >I'm relatively new to python and I was very surprised by the following >behavior: http://starship.python.net/crew/mwh/hacks/objectthink.html -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "Many customs in this life persist

Six Minutes and fourty two seconds

2010-02-26 Thread Tobiah
Now that I use python, this is the amount of time per day that I spend adding forgotten semicolons while debugging other languages. -- http://mail.python.org/mailman/listinfo/python-list

Re: When will Java go mainstream like Python?

2010-02-26 Thread John Nagle
Gregory Ewing wrote: Lawrence D'Oliveiro wrote: And then there’s caching. Modern CPUs owe most of their speed to assumptions that programs will obey locality of reference. Pointer-chasing is a cache- hostile activity. Another thing to consider is the rate at which garbage is created. Java's

collections use __next__() in python 2.6?

2010-02-26 Thread Gary Robinson
The Python 2.6.4 docs for collections at http://docs.python.org/library/collections.html say that __next__() is an abstract method for the Iterable ABC. But my understanding is that __next__() isn't supposed to be used until Python 3. Also, I'm using the Mapping ABC, which inherits from Iterabl

SystemError: error return without exception set

2010-02-26 Thread Shailendra
Hi All, I am getting error in "SystemError: error return without exception set" which i am not able debug. I made following test program which gives same error. =test.py== import numpy class testClass: def __init__(self,param1=1,param2=2): self.param1,self.param2=

Re: Docstrings considered too complicated

2010-02-26 Thread mk
Roy Smith wrote: /** * Tracing facility. Writes the message to the specified output stream. * If output stream is NULL, writes the message to the process log. * * @param msg_id The message id to use for lookup. * @param ostrThe output stream. * @param p1 The first substition p

How to end TCP socket data while using readline()?

2010-02-26 Thread Arjun
Hi, I have a small script that runs a TCP server. A client connects to this server and transmits a stored file line-by-line, and then waits for a confirmation "done". However, when I run them the first loop never really ends -- as the TCP server keeps expecting more data. I am using a file-like-obj

Re: Docstrings considered too complicated

2010-02-26 Thread Jean-Michel Pichavant
Roy Smith wrote: In article , Tim Daneliuk wrote: On 2/24/2010 2:23 PM, Andreas Waldenburger wrote: Hi all, a company that works with my company writes a lot of of their code in Python (lucky jerks). I've seen their code and it basically looks like this: """Function that does stuff

Re: Dictionary or Database_Please advise

2010-02-26 Thread mk
D'Arcy J.M. Cain wrote: Or PostgreSQL. It's free, runs on lots of platforms, has good Python support, and there's lots of people on the net who know it and are willing to give help and advice. In addition, it is a truly enterprise level, SQL standard, fully transactional database. Don't start

Re: Docstrings considered too complicated

2010-02-26 Thread Jean-Michel Pichavant
Andreas Waldenburger wrote: On Fri, 26 Feb 2010 09:09:36 -0600 Tim Daneliuk wrote: On 2/24/2010 2:23 PM, Andreas Waldenburger wrote: [stuff] Reminiscent of: mov AX,BX ; Move the contents of BX into AX Well, there might be some confusion there as to what

Re: Dictionary or Database—Please advise

2010-02-26 Thread mk
Jeremy wrote: Shelve looks like an interesting option, but what might pose an issue is that I'm reading the data from a disk instead of memory. I didn't mention this in my original post, but I was hoping that by using a database it would be more memory efficient in storing data in RAM so I woul

Re: Dictionary or Database—Please advise

2010-02-26 Thread mk
Jeremy wrote: I have lots of data that I currently store in dictionaries. However, the memory requirements are becoming a problem. I am considering using a database of some sorts instead, but I have never used them before. Would a database be more memory efficient than a dictionary? I also nee

Re: Dictionary or Database輝lease advise

2010-02-26 Thread km
Hi, Probably u should try couchdb! its a document oriented database. ( apache.couchdb.org) u can store your dictionaries as json documents and yes they are simple text files; data structures cna be directly stored into JSON documents. memory efficient too.. python module @ http://code.google.com/

Re: Dictionary or Database_Please advise

2010-02-26 Thread D'Arcy J.M. Cain
On Fri, 26 Feb 2010 11:39:51 -0500 Roy Smith wrote: > Once you get into databases, platform independence will be an issue. There > are many databases out there to pick from. If you want something which > will work on a lot of platforms, a reasonable place to start looking is > MySQL. It's fr

Re: Dictionary or Database—Please advise

2010-02-26 Thread Jeremy
On Feb 26, 9:29 am, Chris Rebert wrote: > On Fri, Feb 26, 2010 at 7:58 AM, Jeremy wrote: > > I have lots of data that I currently store in dictionaries.  However, > > the memory requirements are becoming a problem.  I am considering > > using a database of some sorts instead, but I have never

Exception in pydoc

2010-02-26 Thread Ricardo Aráoz
I'm developing an in house app. Many coders here are not fluent in english, so docstrings must be in Spanish in spite of recommendations that docstrings better be in English. When I use accented characters (in this case an 'ó') in my docstrings I get : >>> help('OpMejoraBizobj') Traceback (most rec

Re: Docstrings considered too complicated

2010-02-26 Thread Richard Brodie
"Andreas Waldenburger" wrote in message news:20100226173907.55676...@geekmail.invalid... >> Reminiscent of: >> >> mov AX,BX ; Move the contents of BX into AX >> > Well, there might be some confusion there as to what gets moved where, > wouldn't you say? Depends on what assembler

Re: Possible to import from a cStringIO file object vs. file on disk?

2010-02-26 Thread Steve Holden
pyt...@bdurham.com wrote: > Is it possible to import from a cStringIO file object (containing > compiled byte code) vs. a physical file on disk? > > I'm thinking that this is possible, given Python's ability to import > from zip files, but I'm not sure where to look next. > > Thank you, > Malco

Re: Docstrings considered too complicated

2010-02-26 Thread Phlip
Andreas Waldenburger wrote: > """Function that does stuff""" > def doStuff(): >     while not wise(up): >         yield scorn > > Now my question is this: How do I kill these people without the > authorities thinking they didn't deserve it? Their unit tests are just as complete, illustrative, and

Re: Docstrings considered too complicated

2010-02-26 Thread Roy Smith
In article , Tim Daneliuk wrote: > On 2/24/2010 2:23 PM, Andreas Waldenburger wrote: > > Hi all, > > > > a company that works with my company writes a lot of of their code in > > Python (lucky jerks). I've seen their code and it basically looks like > > this: > > > > """Function that does stuf

Re: Dictionary or Database�Please advise

2010-02-26 Thread Roy Smith
In article <891a98fa-c398-455a-981f-bf72af772...@s36g2000prh.googlegroups.com>, Jeremy wrote: > I have lots of data that I currently store in dictionaries. However, > the memory requirements are becoming a problem. I am considering > using a database of some sorts instead, but I have never us

Re: Docstrings considered too complicated

2010-02-26 Thread Andreas Waldenburger
On Fri, 26 Feb 2010 09:09:36 -0600 Tim Daneliuk wrote: > On 2/24/2010 2:23 PM, Andreas Waldenburger wrote: > > [stuff] > > Reminiscent of: > > mov AX,BX ; Move the contents of BX into AX > Well, there might be some confusion there as to what gets moved where, wouldn't you say? I

Re: Docstrings considered too complicated

2010-02-26 Thread Andreas Waldenburger
On Fri, 26 Feb 2010 15:50:25 +0100 Jean-Michel Pichavant wrote: > Andreas Waldenburger wrote: > > > And they use mixedCase function/method names. > > > and ? whatIsTheProblem ? Thanks for proving my point. ;) No seriously though: Let it go. I wasn't being serious. As long as it works and I

Re: Dictionary or Database—Please advise

2010-02-26 Thread lbolla
On Feb 26, 3:58 pm, Jeremy wrote: > I have lots of data that I currently store in dictionaries.  However, > the memory requirements are becoming a problem.  I am considering > using a database of some sorts instead, but I have never used them > before.  Would a database be more memory efficien

  1   2   >