Re: Code review

2014-11-05 Thread Jean-Michel Pichavant
- Original Message - > From: "C Smith" > I read that with 2.7 that I had to initialize class variables to > immutable types. I think because I was working with the lists before > they had been altered and were still empty lists. I will mess around > tomorrow with the classes you suggested

Re: pkcs7 signing

2014-11-05 Thread Robin Becker
On 05/11/2014 06:40, dieter wrote: Robin Becker writes: Is there a way to do pkcs7 / 12 signing with python. Have you checked whether "OpenSSL" supports this kind of signing? If it does, then you likely can use this via several Python wrappings for "OpenSSL". I checked that the openssl libr

Re: Regex substitution trouble

2014-11-05 Thread Eugene
massi_...@msn.com wrote: > Hi everyone, > > I'm not really sure if this is the right place to ask about regular > expressions, but since I'm usin python I thought I could give a try :-) > Here is the problem, I'm trying to write a regex in order to substitute > all the occurences in the form $"

Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Ivan Evstegneev
Hello everyone, I'm a Python beginner and just getting familiar with it. (I need it for my EE B.Sc. project) For the learning purposes I use IDLE and (Learning Python by written by Mark Lutz). Let's say that I have some earlier experience with C language, but still Python is a different one

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Jean-Michel Pichavant
Original Message - > From: "Ivan Evstegneev" > To: python-list@python.org > Sent: Wednesday, 5 November, 2014 12:00:16 PM > Subject: Understanding "help" command description syntax - explanation needed > So here is the question itself: > > If I use the help command to check the “range” c

I need algorithm for my task

2014-11-05 Thread lordvital21
I have line 'pythonpythonpyth'. How do I know which word is the foundation line?. Other examples: "pythonpythonpyth" is python "DOLORIUMD" is DOLORIUM "HELLOLHELLO" is HELLOL "thewordword" is thewordword I need to know whether the word in the text is repeated and get it. This will be the key. --

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Mark Lawrence
On 05/11/2014 11:55, Jean-Michel Pichavant wrote: Original Message - From: "Ivan Evstegneev" To: python-list@python.org Sent: Wednesday, 5 November, 2014 12:00:16 PM Subject: Understanding "help" command description syntax - explanation needed So here is the question itself: If I use

RE: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Ivan Evstegneev
Firtst of all thanks for reply. >>brackets [] means that the argument is optional. That's what I'm talking about (asking actually), where do you know it from? I mean, if there are some resources, which explain all these syntax abbreviations? The general concept. Like this one(just for example

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Chris Angelico
On Wed, Nov 5, 2014 at 10:00 PM, Ivan Evstegneev wrote: > range(start, stop[, step]) -> range object > > For instance, how do I need to understand that (start,stop[,step]) it’s > just a three numbers? > > What do those brackets--> [,] mean? The docs for range() in Python 3 do need improvement, a

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Larry Martell
On Wed, Nov 5, 2014 at 7:13 AM, Ivan Evstegneev wrote: > Firtst of all thanks for reply. > >>>brackets [] means that the argument is optional. > > That's what I'm talking about (asking actually), where do you know it from? I know it because I've been a programmer for 39 years. -- https://mail.py

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Chris Angelico
On Wed, Nov 5, 2014 at 11:13 PM, Ivan Evstegneev wrote: > That's what I'm talking about (asking actually), where do you know it from? > I mean, if there are some resources, which explain all these syntax > abbreviations? The general concept. > > > Like this one(just for example): > class bytearra

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Chris Angelico
On Wed, Nov 5, 2014 at 11:13 PM, Ivan Evstegneev wrote: > That's what I'm talking about (asking actually), where do you know it from? > I mean, if there are some resources, which explain all these syntax > abbreviations? The general concept. The best way to find clues about what the conventions

Re: I need algorithm for my task

2014-11-05 Thread Chris Angelico
On Wed, Nov 5, 2014 at 10:58 PM, wrote: > I have line 'pythonpythonpyth'. How do I know which word is the foundation > line?. > Other examples: > "pythonpythonpyth" is python > "DOLORIUMD" is DOLORIUM > "HELLOLHELLO" is HELLOL > "thewordword" is thewordword > > I need to know whether the word in

RE: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Ivan Evstegneev
Chris, You got my point exactly. ^_^ This is not about a "range" command itself, but those conventions. Thanks. Larry, >> That's what I'm talking about (asking actually), where do you know it from? >>I know it because I've been a programmer for 39 years. I didn't intend to offence anyone here

Re: I need algorithm for my task

2014-11-05 Thread Peter Otten
lordvita...@gmail.com wrote: > I have line 'pythonpythonpyth'. How do I know which word is the foundation > line?. Other examples: > "pythonpythonpyth" is python > "DOLORIUMD" is DOLORIUM > "HELLOLHELLO" is HELLOL > "thewordword" is thewordword > > I need to know whether the word in the text is r

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Chris Angelico
On Wed, Nov 5, 2014 at 11:31 PM, Ivan Evstegneev wrote: >>> That's what I'm talking about (asking actually), where do you know it from? > >>>I know it because I've been a programmer for 39 years. > > I didn't intend to offence anyone here. Just asked a questions ^_^ Don't worry about offending pe

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread Grant Edwards
On 2014-11-05, Dennis Lee Bieber wrote: > "machine code" typically implies an instruction set specific > to that machine... ALL computers operate in BINARY logic (a bit only > holds 0 or 1). How you get those bits into the computer is > irrelevant. Just to muddy the water... _Most_ parts of mo

Re: I need algorithm for my task

2014-11-05 Thread Denis McMahon
On Wed, 05 Nov 2014 03:58:33 -0800, lordvital21 wrote: > I have line 'pythonpythonpyth'. How do I know which word is the > foundation line?. > Other examples: > "pythonpythonpyth" is python "DOLORIUMD" is DOLORIUM "HELLOLHELLO" is > HELLOL "thewordword" is thewordword > > I need to know whether t

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread Chris Angelico
On Thu, Nov 6, 2014 at 2:05 AM, Grant Edwards wrote: > On 2014-11-05, Dennis Lee Bieber wrote: > >> "machine code" typically implies an instruction set specific >> to that machine... ALL computers operate in BINARY logic (a bit only >> holds 0 or 1). How you get those bits into the computer is >

Re: Build Question: How to Add -Wl, --option Before Objects In Setup.py?

2014-11-05 Thread Cyd Haselton
On Sun, Nov 2, 2014 at 3:38 PM, Ned Deily wrote: > In article > , > Cyd Haselton wrote: >> Just checking: is sincos() the same as sin() and cos()? Nm output for >> my toolchain's libm does show sin() and cos() just not sincos() > > See, this is what you get when you ask for free help: bad info.

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread Denis McMahon
On Tue, 04 Nov 2014 21:30:06 -0500, Dennis Lee Bieber wrote: > If you have an old system with front-panel toggle switches, you set the > switches for binary values, and then push the "enter" switch. You've booted a PDP-8 then ;) -- Denis McMahon, denismfmcma...@gmail.com -- https://mail

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Larry Martell
On Wed, Nov 5, 2014 at 7:41 AM, Chris Angelico wrote: > On Wed, Nov 5, 2014 at 11:31 PM, Ivan Evstegneev > wrote: That's what I'm talking about (asking actually), where do you know it from? >> I know it because I've been a programmer for 39 years. >> >> I didn't intend to offence anyone

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Chris Angelico
On Thu, Nov 6, 2014 at 2:56 AM, Larry Martell wrote: >> And I don't think >> Larry was actually offended; it's just that some questions don't >> really have easy answers - imagine someone asking a great >> mathematician "But how do you KNOW that 2 + 2 is 4? Where's it written >> down?"... all he c

Real-world use of Counter

2014-11-05 Thread Ethan Furman
I'm looking for real-world uses of collections.Counter, specifically to see if anyone has been surprised by, or had to spend extra-time debugging, issues with the in-place operators. Background: Most Python data types will cause a TypeError to be raised if unusable types are passed in: --> {'

Misunderstanding buffering - flushing isn't

2014-11-05 Thread Skip Montanaro
I've been developing a little web server. The request handler subclasses SimpleHTTPRequestHandler. It has a do_GET method which figures out what work to actually do, then ends with this: def do_GET(self): ... sys.stdout.flush() sys.stderr.flush() As it's still being ac

Re: Misunderstanding buffering - flushing isn't

2014-11-05 Thread Skip Montanaro
On Wed, Nov 5, 2014 at 10:44 AM, Skip Montanaro wrote: > I figured everything would be flushed to the respective .stdout and > .stderr files at the end of every request, but that appears not to be > the case. I stand corrected. I added print ">> request finished" to the end of do_GET (j

Re: Misunderstanding buffering - flushing isn't

2014-11-05 Thread Irmen de Jong
On 5-11-2014 17:44, Skip Montanaro wrote: > As it's still being actively developed, I've been dumping all sorts of > diagnostic prints to stdout and stderr. Any reason you're not using the logging module and get it all nicely dumped into a log file instead? (asks he who regularly inserts prints

Re: pkcs7 signing

2014-11-05 Thread Irmen de Jong
On 5-11-2014 11:14, Robin Becker wrote: > On 05/11/2014 06:40, dieter wrote: >> Robin Becker writes: >> >>> Is there a way to do pkcs7 / 12 signing with python. >> >> Have you checked whether "OpenSSL" supports this kind of signing? >> If it does, then you likely can use this via several Python wr

Re: Real-world use of Counter

2014-11-05 Thread Peter Otten
Ethan Furman wrote: > I'm looking for real-world uses of collections.Counter, specifically to > see if anyone has been surprised by, or had to spend extra-time debugging, > issues with the in-place operators. > > Background: > > Most Python data types will cause a TypeError to be raised if unusa

Re: I need algorithm for my task

2014-11-05 Thread MRAB
On 2014-11-05 11:58, lordvita...@gmail.com wrote: I have line 'pythonpythonpyth'. How do I know which word is the foundation line?. Other examples: "pythonpythonpyth" is python "DOLORIUMD" is DOLORIUM "HELLOLHELLO" is HELLOL "thewordword" is thewordword I need to know whether the word in the te

Re: Misunderstanding buffering - flushing isn't

2014-11-05 Thread Skip Montanaro
On Wed, Nov 5, 2014 at 11:29 AM, Irmen de Jong wrote: > Any reason you're not using the logging module and get it all nicely dumped > into a log > file instead? I'm an old fart. What can I say? BITD, (as Irmen is well aware, being about as old as I am in Python years), print was all we had. (We

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread MRAB
On 2014-11-05 02:30, Dennis Lee Bieber wrote: On Tue, 4 Nov 2014 13:45:32 -0300, françai s declaimed the following: I intend to write in lowest level of computer programming as a hobby. It is true that is impossible write in binary code, the lowest level of programming that you can write is i

Re: Misunderstanding buffering - flushing isn't

2014-11-05 Thread Chris Angelico
On Thu, Nov 6, 2014 at 4:54 AM, Skip Montanaro wrote: > I'm an old fart. What can I say? BITD, (as Irmen is well aware, being > about as old as I am in Python years), print was all we had. (We also > walked uphill to school in both directions, in the snow.) While I use > the logging module in othe

Re: I need algorithm for my task

2014-11-05 Thread C@rlos
I thing this work: stg='pythonpython' foundationline=stg[ 0:( stg [ 1: ].index( stg[ 0 ])+1 ) ] On 2014-11-05 11:58, lordvita...@gmail.com wrote: > I have line 'pythonpythonpyth'. How do I know which word is the foundation > line?. > Other examples: > "pythonpythonpyth" is python > "DOLOR

Re: I need algorithm for my task

2014-11-05 Thread MRAB
On 2014-11-05 18:05, C@rlos wrote: I thing this work: stg='pythonpython' foundationline=stg[ 0:( stg [ 1: ].index( stg[ 0 ])+1 ) ] It doesn't work for the final example or "barbaz". -- https://mail.python.org/mailman/listinfo/python-list

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Neil D. Cerutti
On 11/5/2014 7:41 AM, Chris Angelico wrote: On Wed, Nov 5, 2014 at 11:31 PM, Ivan Evstegneev wrote: That's what I'm talking about (asking actually), where do you know it from? I know it because I've been a programmer for 39 years. I didn't intend to offence anyone here. Just asked a questi

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Terry Reedy
On 11/5/2014 7:31 AM, Ivan Evstegneev wrote: You got my point exactly. ^_^ This is not about a "range" command itself, but those conventions. The Language Manual 1. Introduction has a section on the grammar notation conventions. The Library Manual 1. Introduction does not. I would agree tha

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Gene Heskett
On Wednesday 05 November 2014 10:56:57 Larry Martell did opine And Gene did reply: > On Wed, Nov 5, 2014 at 7:41 AM, Chris Angelico wrote: > > On Wed, Nov 5, 2014 at 11:31 PM, Ivan Evstegneev > > > > wrote: > That's what I'm talking about (asking actually), where do you know > it from?

Re: detect mouse pointer type

2014-11-05 Thread Joel Goldstick
On Tue, Nov 4, 2014 at 9:07 PM, Peter Irbizon wrote: > Hello, > please how can I detect mouse pointer type? I would like to print every > mouse pointer change (arrow, hand, ...) while moving my mouse over screen. > How can I do this? (for now I need it for windows, but cross-platform > solution is

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread Cameron Simpson
On 05Nov2014 15:38, Denis McMahon wrote: On Tue, 04 Nov 2014 21:30:06 -0500, Dennis Lee Bieber wrote: If you have an old system with front-panel toggle switches, you set the switches for binary values, and then push the "enter" switch. You've booted a PDP-8 then ;) Not me, but I hav

Re: detect mouse pointer type

2014-11-05 Thread Marc Aymerich
On Wed, Nov 5, 2014 at 11:31 PM, Joel Goldstick wrote: > On Tue, Nov 4, 2014 at 9:07 PM, Peter Irbizon > wrote: > > Hello, > > please how can I detect mouse pointer type? I would like to print every > > mouse pointer change (arrow, hand, ...) while moving my mouse over > screen. > > How can I do

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread Dan Stromberg
On Tue, Nov 4, 2014 at 10:39 PM, Cameron Simpson wrote: > Bah! He asked if there were lower levels than binary. Ergo: chip design! > (And microcode, the intermediate layer. Or one of the layers, depending > where you draw the line.) Should we stop before we reach the quantum foam of > spacetime?

Machine Learning Startup Hiring

2014-11-05 Thread Charles Weitzer
My name is Charles Weitzer. I do recruiting with a focus on quantitative sciences. One of my clients is a machine learning startup located in Northern California. The founders include a successful veteran entrepreneur with a PhD in CS from Stanford, while the other founder is on the faculty at UC

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread Cameron Simpson
On 05Nov2014 18:09, Chris Angelico wrote: On Wed, Nov 5, 2014 at 5:39 PM, Cameron Simpson wrote: Bah! He asked if there were lower levels than binary. Ergo: chip design! (And microcode, the intermediate layer. Or one of the layers, depending where you draw the line.) Should we stop before we r

Re: Misunderstanding buffering - flushing isn't

2014-11-05 Thread Mark Lawrence
On 05/11/2014 17:54, Skip Montanaro wrote: On Wed, Nov 5, 2014 at 11:29 AM, Irmen de Jong wrote: Any reason you're not using the logging module and get it all nicely dumped into a log file instead? I'm an old fart. What can I say? BITD, (as Irmen is well aware, being about as old as I am in

Re:[OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-05 Thread Dave Angel
françai s Wrote in message: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, the lowest level > of programming that you can write is in hex code? > > What is the lowest level of programming computers that you can writ

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Dave Angel
Chris Angelico Wrote in message: > On Thu, Nov 6, 2014 at 2:56 AM, Larry Martell wrote: >>> And I don't think >>> Larry was actually offended; it's just that some questions don't >>> really have easy answers - imagine someone asking a great >>> mathematician "But how do you KNOW that 2 + 2 is 4?

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Mark Lawrence
On 06/11/2014 02:37, Dave Angel wrote: Chris Angelico Wrote in message: On Thu, Nov 6, 2014 at 2:56 AM, Larry Martell wrote: And I don't think Larry was actually offended; it's just that some questions don't really have easy answers - imagine someone asking a great mathematician "But how do y

Re: I need algorithm for my task

2014-11-05 Thread Denis McMahon
On Wed, 05 Nov 2014 18:49:01 +, MRAB wrote: > On 2014-11-05 18:05, C@rlos wrote: >> I thing this work: >> >> stg='pythonpython' >> foundationline=stg[ 0:( stg [ 1: ].index( stg[ 0 ])+1 ) ] >> > It doesn't work for the final example or "barbaz". I have two algorithms I've implemented. Still n

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Chris Angelico
On Thu, Nov 6, 2014 at 1:52 PM, Mark Lawrence wrote: > Against a requirements specification that changes on a daily basis, I want > it delivered yesterday and no you can't have any more resources to help out, > so don't ask :) Or maybe "Look, I'll give you five bucks if you can have the whole thi

Re: I need algorithm for my task

2014-11-05 Thread Denis McMahon
On Wed, 05 Nov 2014 18:49:01 +, MRAB wrote: > It doesn't work for the final example or "barbaz". Oh, and we really need a private "python homework answers" list where we can discuss the most pythonic solution we can think of for all these homework / coursework questions without showing the

Re: I need algorithm for my task

2014-11-05 Thread Chris Angelico
On Thu, Nov 6, 2014 at 2:36 PM, Denis McMahon wrote: > On Wed, 05 Nov 2014 18:49:01 +, MRAB wrote: > >> It doesn't work for the final example or "barbaz". > > Oh, and we really need a private "python homework answers" list where we > can discuss the most pythonic solution we can think of for a

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Gene Heskett
On Wednesday 05 November 2014 21:52:42 Mark Lawrence did opine And Gene did reply: > On 06/11/2014 02:37, Dave Angel wrote: > > Chris Angelico Wrote in message: > >> On Thu, Nov 6, 2014 at 2:56 AM, Larry Martell wrote: > And I don't think > Larry was actually offended; it's just that s

Re: I need algorithm for my task

2014-11-05 Thread Denis McMahon
On Thu, 06 Nov 2014 03:36:40 +, Denis McMahon wrote: > On Wed, 05 Nov 2014 18:49:01 +, MRAB wrote: > >> It doesn't work for the final example or "barbaz". > > Oh, and we really need a private "python homework answers" list where we > can discuss the most pythonic solution we can think of

Re: Misunderstanding buffering - flushing isn't

2014-11-05 Thread Dave Angel
Skip Montanaro Wrote in message: > On Wed, Nov 5, 2014 at 10:44 AM, Skip Montanaro > wrote: >> I figured everything would be flushed to the respective .stdout and >> .stderr files at the end of every request, but that appears not to be >> the case. > > I stand corrected. I added > > pri

Re: I need algorithm for my task

2014-11-05 Thread Chris Angelico
On Thu, Nov 6, 2014 at 3:00 PM, Denis McMahon wrote: > def baseword(s): > """find shortest sequence which repeats to generate s""" > return s[0:["".join([s[0:x]for k in range(int(len(s)/x)+1)])[0:len > (s)]for x in range(1,len(s)+1)].index(s)+1] That's hardly a PEP-8 compliant line, but I

Re: I need algorithm for my task

2014-11-05 Thread Denis McMahon
On Thu, 06 Nov 2014 15:14:05 +1100, Chris Angelico wrote: > On Thu, Nov 6, 2014 at 3:00 PM, Denis McMahon > wrote: >> def baseword(s): >> """find shortest sequence which repeats to generate s""" >> return s[0:["".join([s[0:x]for k in range(int(len(s)/x)+1)])[0:len >> (s)]for x in range(1,

Re: Real-world use of Counter

2014-11-05 Thread Rustom Mody
On Wednesday, November 5, 2014 9:57:08 PM UTC+5:30, Ethan Furman wrote: > In order to avoid unnecessary code churn (the fix itself is quite simple), > the maintainer of the collections module > wants to know if anybody has actually been affected by these inconsistencies, > and if so, whether it

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Larry Hudson
On 11/05/2014 03:00 AM, Ivan Evstegneev wrote: Hello everyone, I’m a Python beginner and just getting familiar with it. (I need it for my EE B.Sc. project) For the learning purposes I use IDLE and (Learning Python by written by Mark Lutz). Let’s say that I have some earlier experience with C l