Re: zero argument member functions versus properties

2013-11-02 Thread Steven D'Aprano
On Sat, 02 Nov 2013 23:09:09 -0700, Peter Cacioppi wrote: > Python makes it very easy to turn a zero argument member function into a > property (hooray!) by simply adding the @property decorator. > > (Meme for well thought py feature - "Guido was here") It is well-thought out, but it's also quit

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-02 Thread Mark Janssen
>> Congratulations Jonas. My kill file for this list used to have only one >> name, but now has 2. > > You have more patience than I! Jonas just made mine seven. :) Gosh, don't kill the guy. It's not an obvious thing to hardly anyone but computer scientists. It's an easy mistake to make. --

Re: Basic Python Questions - Oct. 31, 2013

2013-11-02 Thread E.D.G.
"William Ray Wing" wrote in message news:mailman.1934.1383320554.18130.python-l...@python.org... If you look here: http://wiki.wxpython.org/MatplotlibFourierDemo A suggestion that I would like to add is that when people make "Demo" programs like that available they might want to cre

Re: Basic Python Questions - Oct. 31, 2013

2013-11-02 Thread E.D.G.
"Mark Lawrence" wrote in message news:mailman.1873.1383227352.18130.python-l...@python.org... https://pypi.python.org/pypi/pywinauto/0.3.9 or http://stackoverflow.com/questions/1823762/sendkeys-for-python-3-1-on-windows Python "SendKey" looks like it probably works about the same as the Perl

Re: zero argument member functions versus properties

2013-11-02 Thread Peter Cacioppi
I just said "1-> the zero argument function is sort of factory-like. It potentially has non-trivial run time, or it substitutes calling a class constructor when building certain objects. 2-> it simply retrieves a stored value (perhaps lazily evaluating it first) so 1 should clearly be a zero

Re: How to add a current string into an already existing list

2013-11-02 Thread Gregory Ewing
Nick the Gr33k wrote: I just want a mysql column type that can be eligible to store an array of elements, a list that is, no need for having a seperate extra table for that if we can have a column that can store a list of values. Relational database systems typically don't provide any such typ

zero argument member functions versus properties

2013-11-02 Thread Peter Cacioppi
Python makes it very easy to turn a zero argument member function into a property (hooray!) by simply adding the @property decorator. (Meme for well thought py feature - "Guido was here") But the ease with which you can do this makes the "zero argument member function or property" discussion t

Re: Basic Python Questions - Oct. 31, 2013

2013-11-02 Thread E.D.G.
"E.D.G." wrote in message news:udgdnadga6n9vu_pnz2dnuvz_umdn...@earthlink.com... Thanks for all of the comments. I have been away from my Internet connection for several days and could not respond to them when they were first posted here. The comments have all been considered. A

Re: How to use variables across modules

2013-11-02 Thread Steven D'Aprano
On Sat, 02 Nov 2013 14:33:54 -0700, juel4700 wrote: > Im a newbee at python, and im trying to figure out how to use variables > and setups across modules. [...] > What is best practice for working across modules. Depends on whether you are working on a framework, a library or an application. Fr

Re: Basic Python Questions - Oct. 31, 2013

2013-11-02 Thread E.D.G.
"rusi" wrote in message news:1e63687b-4269-42d9-8700-e3a8dcc57...@googlegroups.com... Not sure what will… you may look at Julia: http://julialang.org/ That program language speed comparison table looks quite interesting. And I asked some of the other people that I work with to take a

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-02 Thread Steven D'Aprano
On Sat, 02 Nov 2013 18:22:38 +, Joshua Landau wrote: [...] > Sure, you in all probability didn't mean it like that but rurpy isn't > uncalled for in raising the concern. Really I just want to remind you > that you're both on the same side here. Thanks for the comments Joshua, but I'm afraid I

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-02 Thread Ethan Furman
On 10/30/2013 12:23 PM, jonas.thornv...@gmail.com wrote: What i actually saying is that you are indeed... [insult snipped] *plonk* -- https://mail.python.org/mailman/listinfo/python-list

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-02 Thread Ethan Furman
On 10/30/2013 01:32 PM, Gene Heskett wrote: Congratulations Jonas. My kill file for this list used to have only one name, but now has 2. You have more patience than I! Jonas just made mine seven. :) -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-02 Thread Chris Angelico
On Sun, Nov 3, 2013 at 6:49 AM, Skybuck Flying wrote: > For those programmers that want to write clear/understandable/less buggy > code instead of the fastest it could be interesting. "it", without context? What could be interesting? You're not quoting any text, so I have no idea what you're refe

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-02 Thread Skybuck Flying
For those programmers that want to write clear/understandable/less buggy code instead of the fastest it could be interesting. Also ultimately compilers are free to implement it they way they want it ;) Thus freeing the programmer from strange assembler instruction orders as usual ;) If you e

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-02 Thread Chris Angelico
On Sun, Nov 3, 2013 at 2:17 PM, Steven D'Aprano wrote: > There is a way to apparently get around these limits: store data > externally, perhaps inside the compression application itself. Then, if > you just look at the compressed file (the "data.zip" equivalent, although > I stress that zip compre

Re: getpeername() on stdin?

2013-11-02 Thread Nobody
On Fri, 01 Nov 2013 14:55:38 -0400, random832 wrote: > If it's possible to get this information with only the fd, then why does > socket.fromfd require them? The only person who can answer that is whoever came up with socket.fromfd() in the first place. I initially suspected that it might have b

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-02 Thread Steven D'Aprano
On Sat, 02 Nov 2013 14:31:09 -0700, Tim Roberts wrote: > jonas.thornv...@gmail.com wrote: >> >>Well then i have news for you. > > Well, then, why don't you share it? > > Let me try to get you to understand WHY what you say is impossible. [snip reasons] Expanding on Tim's post... the first scena

Re: multiprocessing: child process race to answer (forgot to Cc: the list)

2013-11-02 Thread William Ray Wing
On Nov 2, 2013, at 11:44 AM, Sherard Hall wrote: > Thank you for the response. Processing time is very important so I suspect > having to write to disk will take more time than letting the other processes > complete without finding the answer. So I did some profiling one process > finds the an

Re: New to using re. Search for a number before a string.

2013-11-02 Thread Mark Lawrence
On 03/11/2013 00:19, Captain Dunsel wrote: On Friday, November 1, 2013 5:33:43 PM UTC-4, Captain Dunsel wrote: I have a text file that has lines with numbers occasionally appearing right before a person's name. For example: COLLEGE:ENROLLMENT:COMPLETED EVALUATIONS:624309FUDD, ELMER where

Re: New to using re. Search for a number before a string.

2013-11-02 Thread Captain Dunsel
On Friday, November 1, 2013 5:33:43 PM UTC-4, Captain Dunsel wrote: > I have a text file that has lines with numbers occasionally appearing right > before a person's name. For example: > > > > COLLEGE:ENROLLMENT:COMPLETED EVALUATIONS:624309FUDD, ELMER > > > > where I want to search for the

Re: How to use variables across modules

2013-11-02 Thread Mark Lawrence
On 02/11/2013 21:33, juel4...@gmail.com wrote: Im a newbee at python, and im trying to figure out how to use variables and setups across modules. Am I right when i think its smart to keep seperate functions of a program in seperate modules? If your code base gets too large to handle in one m

Re: How to add a current string into an already existing list

2013-11-02 Thread Chris Angelico
On Sun, Nov 3, 2013 at 9:00 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> On Sun, Nov 3, 2013 at 5:30 AM, Jussi Piitulainen >> wrote: >> > Suppose a database allowed structured values like lists of strings, >> > lists of numbers, or even lists of such lists and more. Then it

Re: How to use variables across modules

2013-11-02 Thread Chris Angelico
On Sun, Nov 3, 2013 at 8:33 AM, wrote: > I have a main program module called main.py and in that main.py i have this: > > # Sets GPIO's to HIGH = Relays OFF > try: > import RPi.GPIO as GPIO > except RuntimeError: > Print("Error importing RPi.GPIO!!") > > GPIO.setmo

Re: How to add a current string into an already existing list

2013-11-02 Thread Roy Smith
In article , Chris Angelico wrote: > On Sun, Nov 3, 2013 at 5:30 AM, Jussi Piitulainen > wrote: > > Suppose a database allowed structured values like lists of strings, > > lists of numbers, or even lists of such lists and more. Then it would > > actually be a Python issue how best to support th

Re: How to add a current string into an already existing list

2013-11-02 Thread Chris Angelico
On Sun, Nov 3, 2013 at 5:30 AM, Jussi Piitulainen wrote: > Suppose a database allowed structured values like lists of strings, > lists of numbers, or even lists of such lists and more. Then it would > actually be a Python issue how best to support that database. PostgreSQL supports some higher-le

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-02 Thread Mark Janssen
> Let me try to get you to understand WHY what you say is impossible. Let's > say you do have a function f(x) that can produce a compressed output y for > any given x, such that y is always smaller than x. If that were true, then > I could call f() recursively: > f(f(...f(f(f(f(f(x)...))

How to use variables across modules

2013-11-02 Thread juel4700
Im a newbee at python, and im trying to figure out how to use variables and setups across modules. Am I right when i think its smart to keep seperate functions of a program in seperate modules? I have a main program module called main.py and in that main.py i have this: # Sets GPIO's to HI

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-02 Thread Tim Roberts
jonas.thornv...@gmail.com wrote: > >Well then i have news for you. Well, then, why don't you share it? Let me try to get you to understand WHY what you say is impossible. Let's say you do have a function f(x) that can produce a compressed output y for any given x, such that y is always smaller t

Re: How to add a current string into an already existing list

2013-11-02 Thread Walter Hurry
On Sat, 02 Nov 2013 10:40:58 -0700, rusi wrote: > That Codd... > Should have studied some computer science > > [Ive a vague feeling I am repeating myself...] ROFL. Get thee into FNF! -- https://mail.python.org/mailman/listinfo/python-list

Re: First day beginner to python, add to counter after nested loop

2013-11-02 Thread Tim Roberts
jonas.thornv...@gmail.com wrote: > >I certainly do not like the old bracket style it was a catastrophe, but >in honesty the gui editor of python should have what i propose, a parser >that indent automaticly at loops, functions and end. Many editors do that. Vim, which is what I use, certainly do

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-02 Thread Peter Cacioppi
Mark said : "The White Flag before this also escalates out of control. " This word "before" ... I don't think it means what you think it means. This thread has been off the rails for days. -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing appropriately based on values retrieved

2013-11-02 Thread Nick the Gr33k
Στις 2/11/2013 8:25 μμ, ο/η Nick the Gr33k έγραψε: for row in newdata: (host, refs, city, useros, browser, visits, hits, downloads) = row if downloads != 'Δεν έχει κατεβάσει ταινία': print( '' ) for n, download in enumerate( downloads ): if n == 0:

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-02 Thread Mark Lawrence
On 02/11/2013 18:22, Joshua Landau wrote: On 1 November 2013 05:41, Steven D'Aprano wrote: On Thu, 31 Oct 2013 21:41:32 -0700, rurpy wrote: On 10/31/2013 02:41 AM, Steven D'Aprano wrote: On Wed, 30 Oct 2013 19:48:55 -0700, rurpy wrote: On 10/30/2013 04:22 AM, Steven D'Aprano wrote: Skybuck

Re: How to add a current string into an already existing list

2013-11-02 Thread Jussi Piitulainen
rusi writes: > On Saturday, November 2, 2013 10:13:06 PM UTC+5:30, Denis McMahon wrote: > > On Sat, 02 Nov 2013 18:25:31 +0200, Nick the Gr33k wrote: > > > > I just want a mysql column type that can be eligible to store an > > > array of elements, a list that is, no need for having a seperate > >

Printing appropriately based on values retrieved

2013-11-02 Thread Nick the Gr33k
for row in newdata: (host, refs, city, useros, browser, visits, hits, downloads) = row if downloads != 'Δεν έχει κατεβάσει ταινία': print( '' ) for n, download in enumerate( downloads ): if n == 0: op_

Re: How to add a current string into an already existing list

2013-11-02 Thread Mark Lawrence
On 02/11/2013 17:40, rusi wrote: On Saturday, November 2, 2013 10:13:06 PM UTC+5:30, Denis McMahon wrote: On Sat, 02 Nov 2013 18:25:31 +0200, Nick the Gr33k wrote: I just want a mysql column type that can be eligible to store an array of elements, a list that is, no need for having a seperate

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-02 Thread Joshua Landau
On 1 November 2013 05:41, Steven D'Aprano wrote: > On Thu, 31 Oct 2013 21:41:32 -0700, rurpy wrote: > >> On 10/31/2013 02:41 AM, Steven D'Aprano wrote: >>> On Wed, 30 Oct 2013 19:48:55 -0700, rurpy wrote: On 10/30/2013 04:22 AM, Steven D'Aprano wrote: > Skybuck's experience at programming

Re: How to add a current string into an already existing list

2013-11-02 Thread rusi
On Saturday, November 2, 2013 10:13:06 PM UTC+5:30, Denis McMahon wrote: > On Sat, 02 Nov 2013 18:25:31 +0200, Nick the Gr33k wrote: > > I just want a mysql column type that can be eligible to store an array > > of elements, a list that is, no need for having a seperate extra table > > for that if

Acquiring Python Consulting Clients

2013-11-02 Thread Mark Richman
If you're an independent Python developer/consultant, would you share some tips on acquiring clients? -- Mark Richman markrichman.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Python on a MacBook Pro (not my machine)

2013-11-02 Thread rusi
On Saturday, November 2, 2013 10:26:01 PM UTC+5:30, paul@rudin.co.uk wrote: > "nf7" writes: > > MacVim is the best text editor... > fighting talk! > :) No I am not muscular enough to return the fighting talk... Except to say that nf7 is top-posting -- https://mail.python.org/mailman/listin

Re: Python on a MacBook Pro (not my machine)

2013-11-02 Thread paul . nospam
"nf7" writes: > MacVim is the best text editor... fighting talk! :) -- https://mail.python.org/mailman/listinfo/python-list

Re: Python on a MacBook Pro (not my machine)

2013-11-02 Thread nf7
MacVim is the best text editor, but the key bindings might get in the way at first. I'd still suggest it though. Also, installing a version of Python from the website is a good idea since Apple has a custom (and usually older) version of Python pre-installed that functions a little differently.

Re: How to add a current string into an already existing list

2013-11-02 Thread Denis McMahon
On Sat, 02 Nov 2013 18:25:31 +0200, Nick the Gr33k wrote: > I just want a mysql column type that can be eligible to store an array > of elements, a list that is, no need for having a seperate extra table > for that if we can have a column that can store a list of values. You'd better take that up

Re: Retrieving possible list for use in a subsequent INSERT

2013-11-02 Thread Denis McMahon
On Sat, 02 Nov 2013 02:06:59 +0200, Nick the Gr33k wrote: > HOW this 'list' is supposed to get stored into the visitors database? > What colum is able to handle this list? A python list is a python datatype. mysql has no equivalent data type to a python list. You need to convert your python lis

Re: How to add a current string into an already existing list

2013-11-02 Thread Nick the Gr33k
Στις 2/11/2013 3:03 μμ, ο/η Andreas Perstinger έγραψε: On 02.11.2013 12:58, Nick the Gr33k wrote: Trying to add the current filename into the existent 'downloads' column Somehow i don't think i just use the plus sign into an existing column. We don't try to add numbers here but add an extra stri

Re: multiprocessing: child process race to answer

2013-11-02 Thread Sherard Hall
Thank you for the response. Processing time is very important so I suspect having to write to disk will take more time than letting the other processes complete without finding the answer. So I did some profiling one process finds the answer in about 250ms, but since I can't stop the other processe

Re: New to using re. Search for a number before a string.

2013-11-02 Thread Mark Lawrence
On 01/11/2013 21:33, Captain Dunsel wrote: I have a text file that has lines with numbers occasionally appearing right before a person's name. For example: COLLEGE:ENROLLMENT:COMPLETED EVALUATIONS:624309FUDD, ELMER where I want to search for the name "ELMER FUDD" and extract the number right

Re: How to add a current string into an already existing list

2013-11-02 Thread Andreas Perstinger
On 02.11.2013 12:58, Nick the Gr33k wrote: Trying to add the current filename into the existent 'downloads' column Somehow i don't think i just use the plus sign into an existing column. We don't try to add numbers here but add an extra string to an already existing array of strings(list). [SNI

Re: New to using re. Search for a number before a string.

2013-11-02 Thread Justin Barber
I'm guessing that the name "FUDD, ELMER" varies. In that case, you might try something like this: >>> id_num_regex = re.compile(r'\d+(?=\w+\b,.+?)') >>> id_num_regex.findall(t) ['624309'] This would account for first names such as 'Mary Ann' and also automatically matches characters only to the

Re: multiprocessing: child process race to answer

2013-11-02 Thread William Ray Wing
On Nov 2, 2013, at 1:03 AM, smhall05 wrote: > On Friday, November 1, 2013 10:52:40 PM UTC-4, MRAB wrote: >> On 02/11/2013 02:35, smhall05 wrote: >> >>> I am using a basic multiprocessing snippet I found: >>> >>> #- >>> from multiprocessing imp

How to add a current string into an already existing list

2013-11-02 Thread Nick the Gr33k
Trying to add the current filename into the existent 'downloads' column Somehow i don't think i just use the plus sign into an existing column. We don't try to add numbers here but add an extra string to an already existing array of strings(list). ==

Re: Retrieving possible list for use in a subsequent INSERT

2013-11-02 Thread Lele Gaifax
Nick the Gr33k writes: > sql = '''INSERT INTO visitors (counterID, refs, host, city, useros, > browser, visits, downloads) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)''' > % (cID, refs, host, city, useros, browser, visits, downloads) It was suggested *several* times but I'll reiterate: do not use Py

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-02 Thread Antoon Pardon
Op 02-11-13 02:51, ru...@yahoo.com schreef: > On 11/01/2013 06:50 AM, Antoon Pardon wrote: >> Op 01-11-13 05:41, ru...@yahoo.com schreef: >>> On 10/31/2013 02:41 AM, Steven D'Aprano wrote: >>> I don't know whether you are deliberately lying, or whether you're just such a careless reader

Re: Retrieving possible list for use in a subsequent INSERT

2013-11-02 Thread Nick the Gr33k
You can see the erro as its appearing here: http://superhost.gr/ Its weird that no single quotes are enclosing the string values though and the other bizarre thign is that 'downloads' list is tryign to fiull in all the movies. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python on a MacBook Pro (not my machine)

2013-11-02 Thread rusi
On Sunday, October 27, 2013 12:37:40 AM UTC+5:30, John Ladasky wrote: > Hi folks, > My side job as a Python tutor continues to grow. In two weeks, I > will start working with a high-school student who owns a MacBook > Pro. > So, what other free and lightweight editing options do I have for a > M

Re: Retrieving possible list for use in a subsequent INSERT

2013-11-02 Thread Nick the Gr33k
Στις 2/11/2013 4:00 πμ, ο/η ru...@yahoo.com έγραψε: On Friday, November 1, 2013 9:04:08 AM UTC-6, Ferrous Cranus wrote: Rurpy can you help me please solve this? is enum or set column types what needed here as proper columns to store 'download' list? I'd help if I could but I don't use MySql an

Re: Testing python command line apps -- Running from within the projects w/o installing

2013-11-02 Thread Göktuğ Kayaalp
> [...] > Testing at levels of abstraction above the unit is important, but > Python's ‘unittest’ is not a good fit. You'll need a different tool. > > For behaviour testing, I recommend Behave, which lets you describe > assertions in English and have them automatically tested > https://pypi.python.

Re: New to using re. Search for a number before a string.

2013-11-02 Thread Jussi Piitulainen
Captain Dunsel writes: > I have a text file that has lines with numbers occasionally > appearing right before a person's name. For example: > > COLLEGE:ENROLLMENT:COMPLETED EVALUATIONS:624309FUDD, ELMER > > where I want to search for the name "ELMER FUDD" and extract the > number right in front