Re: PEP 450 Adding a statistics module to Python

2013-08-14 Thread CM
On Friday, August 9, 2013 9:10:18 PM UTC-4, Steven D'Aprano wrote: > I am seeking comments on PEP 450, Adding a statistics module to Python's > standard library: I think it's a very good idea. Good PEP points, too. I hope it happens. -- http://mail.python.org/mailman/listinfo/python-list

Re: .split() Qeustion

2013-08-14 Thread Terry Reedy
On 8/14/2013 1:05 PM, random...@fastmail.us wrote: On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: I'm always and still be suprised by the number of hard coded '\n' one can find in Python code when the portable (here win) os.linesep '\r\n' exists. Because high-level code isn't

Re: Verifying Variable value

2013-08-14 Thread Terry Reedy
On 8/14/2013 12:36 PM, Prasad, Ramit wrote: chandan kumar wrote: Is there a way to validate variable values while debugging any python code. In addition to pdb, I would imagine most Python IDEs would support debugging in this manner. Idle also has a debugger. It uses the same bdb base debu

Re: many constructors in a class?

2013-08-14 Thread Beth McNany
On Wed, Aug 14, 2013 at 10:16 AM, climb65 wrote: > Hello, > > here is a small basic question : > > Is it possible to have more than one constructor (__init__ function) in a > class? For instance, to create an object with 2 different ways? If my > memory is good, I think that with C++ it is possib

Re: .split() Qeustion

2013-08-14 Thread Chris Angelico
On Wed, Aug 14, 2013 at 6:29 PM, Tim Chase wrote: > On 2013-08-14 18:14, Chris Angelico wrote: >> On Wed, Aug 14, 2013 at 6:05 PM, wrote: >> > On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: >> >> I'm always and still be suprised by the number of hard coded >> >> '\n' one can find in

Re: .split() Qeustion

2013-08-14 Thread Skip Montanaro
On Wed, Aug 14, 2013 at 12:05 PM, wrote: > Because high-level code isn't supposed to use the os module directly. That seems a bit extreme. One would hope that Guido and the rest of the crew created the os module so people would use it instead of resorting to other lower level hacks. A quick fi

Re: .split() Qeustion

2013-08-14 Thread Tim Chase
On 2013-08-14 18:14, Chris Angelico wrote: > On Wed, Aug 14, 2013 at 6:05 PM, wrote: > > On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: > >> I'm always and still be suprised by the number of hard coded > >> '\n' one can find in Python code when the portable (here > >> win) > >> > >> >

Re: .split() Qeustion

2013-08-14 Thread Chris Angelico
On Wed, Aug 14, 2013 at 6:05 PM, wrote: > On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: >> I'm always and still be suprised by the number of hard coded >> '\n' one can find in Python code when the portable (here >> win) >> >> >>> os.linesep >> '\r\n' >> >> exists. > > Because high-le

Re: .split() Qeustion

2013-08-14 Thread random832
On Wed, Aug 14, 2013, at 10:32, wxjmfa...@gmail.com wrote: > I'm always and still be suprised by the number of hard coded > '\n' one can find in Python code when the portable (here > win) > > >>> os.linesep > '\r\n' > > exists. Because high-level code isn't supposed to use the os module directly

RE: Verifying Variable value

2013-08-14 Thread Prasad, Ramit
chandan kumar wrote: > Hi , > > Is there a way to validate variable values while debugging any python > code.Run below example  in > debugging mode and i would like to know the value of c (I know print is an > option) with any other > option other than printing. > In C# or some other tools we c

Re: Getting a value that follows string.find()

2013-08-14 Thread John Gordon
In <40816fed-38d4-4baa-92cc-c80cd8feb...@googlegroups.com> englishkevin...@gmail.com writes: > I know the title doesn't make much sense, but I didnt know how to explain my > problem. > Anywho, I've opened a page's source in URLLIB > starturlsource = starturlopen.read() > string.find(starturlsou

ANN: Pyrolite 1.12 - native pickle and Pyro client library for java and .net

2013-08-14 Thread Irmen de Jong
Hi, I'd like to announce Pyrolite 1.12, a tiny (~60k) pickle and Pyro client library for Java and .NET. Question: "what is a java/.net library doing in this newsgroup?" Answer 1: This library is meant to connect a Java or .NET program to Python in a very simple way, using the Pyro protocol. Pyr

Re: many constructors in a class?

2013-08-14 Thread duncan smith
On 14/08/13 15:16, climb65 wrote: Hello, here is a small basic question : Is it possible to have more than one constructor (__init__ function) in a class? For instance, to create an object with 2 different ways? If my memory is good, I think that with C++ it is possible. Thanks for your answer

Re: many constructors in a class?

2013-08-14 Thread Phil Le Bienheureux
2013/8/14 climb65 > Hello, > > here is a small basic question : > > Is it possible to have more than one constructor (__init__ function) in a > class? For instance, to create an object with 2 different ways? If my > memory is good, I think that with C++ it is possible. > > Thanks for your answer.

Re: .split() Qeustion

2013-08-14 Thread wxjmfauth
Le mercredi 14 août 2013 13:55:23 UTC+2, Joshua Landau a écrit : > On 14 August 2013 12:45, Peter Otten <__pete...@web.de> wrote: > > > Joshua Landau wrote: > > >> On 14 August 2013 09:30, Alister wrote: > > >>> I would agree with the last statement. > > >>> Please write list definitions as li

Re: Digging into multiprocessing

2013-08-14 Thread Demian Brecht
Awesome, thanks for the detailed response Chris. On Tue, Aug 13, 2013 at 8:03 AM, Chris Angelico wrote: > On Tue, Aug 13, 2013 at 12:17 AM, Demian Brecht > wrote: >> Hi all, >> >> Some work that I'm doing atm is in some serious need of >> parallelization. As such, I've been digging into the mul

many constructors in a class?

2013-08-14 Thread climb65
Hello, here is a small basic question : Is it possible to have more than one constructor (__init__ function) in a class? For instance, to create an object with 2 different ways? If my memory is good, I think that with C++ it is possible. Thanks for your answer. -- http://mail.python.org/mailm

Re: Reading log and saving data to DB

2013-08-14 Thread mar...@python.net
On Wed, Aug 14, 2013, at 09:18 AM, Guy Tamir wrote: > Hi all, > > I have a Ubuntu server running NGINX that logs data for me. > I want to write a python script that reads my customized logs and after > a little rearrangement save the new data into my DB (postgresql). > > The process should run

Re: .split() Qeustion

2013-08-14 Thread Alister
On Wed, 14 Aug 2013 11:31:01 +0100, Joshua Landau wrote: > On 14 August 2013 09:30, Alister wrote: >> On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: >> >>> On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: How can I use the '.split()' method (am I right in calling it a met

Reading log and saving data to DB

2013-08-14 Thread Guy Tamir
Hi all, I have a Ubuntu server running NGINX that logs data for me. I want to write a python script that reads my customized logs and after a little rearrangement save the new data into my DB (postgresql). The process should run about every 5 minutes and i'm expecting large chunks of data on se

Re: Verifying Variable value

2013-08-14 Thread Krishnan Shankar
You can even use logging module in python to validate the variable values. You can import the module and use any of the following levels in your program import logging logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG For more you can refer to, http://docs.python.or

Re: Am I not seeing the Error?

2013-08-14 Thread Roy Smith
In article , Chris Angelico wrote: > On Wed, Aug 14, 2013 at 7:59 AM, Joshua Landau wrote: > > On 14 August 2013 02:20, Gregory Ewing wrote: > >> Ned Batchelder wrote: > >>> > >>> Everyone: this program seems to be a direct and misguided transliteration > >>> from a bash script. > >> > >> Not

Re: Am I not seeing the Error?

2013-08-14 Thread Joshua Landau
On 14 August 2013 13:07, Chris Angelico wrote: > On Wed, Aug 14, 2013 at 7:59 AM, Joshua Landau wrote: >> >> What's wrong with cat? Sure it's superfluous but what makes it *bad*? >> Personally I often prefer the pipe "cat x | y" form to "x < y"... or >> "< y x". > > What's the use of it, in that

Re: Am I not seeing the Error?

2013-08-14 Thread Chris Angelico
On Wed, Aug 14, 2013 at 7:59 AM, Joshua Landau wrote: > On 14 August 2013 02:20, Gregory Ewing wrote: >> Ned Batchelder wrote: >>> >>> Everyone: this program seems to be a direct and misguided transliteration >>> from a bash script. >> >> Not a particularly well-written bash script, either -- >>

Re: Verifying Variable value

2013-08-14 Thread Dave Angel
chandan kumar wrote: > Hi , > > Is there a way to validate variable values while debugging any python > code.Run below example  in debugging mode and i would like to know the value > of c (I know print is an option) with any other option other than printing. > In C# or some other tools we can v

Re: .split() Qeustion

2013-08-14 Thread Joshua Landau
On 14 August 2013 12:45, Peter Otten <__pete...@web.de> wrote: > Joshua Landau wrote: >> On 14 August 2013 09:30, Alister wrote: >>> I would agree with the last statement. >>> Please write list definitions as lists rather than taking a short-cut to >>> save a few key presses >> >> That's true with

Re: .split() Qeustion

2013-08-14 Thread Peter Otten
Joshua Landau wrote: > On 14 August 2013 09:30, Alister wrote: >> On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: >> >>> On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: How can I use the '.split()' method (am I right in calling it a method?) without instead of writing eac

Re: Verifying Variable value

2013-08-14 Thread Krishnan Shankar
Hi Chandan, Python has built-in module called pdb which can be used for debugging. Importing it in the right place will be like setting break point in code and will change the execution to debugging mode. We can use different debugging commands ((n)ext, (c)ontinue, (s)tep etc) to evaluate through

Re: .split() Qeustion

2013-08-14 Thread Joshua Landau
On 14 August 2013 09:30, Alister wrote: > On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: > >> On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: >>> How can I use the '.split()' method (am I right in calling it a >>> method?) without instead of writing each comma between words in the

Verifying Variable value

2013-08-14 Thread chandan kumar
Hi , Is there a way to validate variable values while debugging any python code.Run below example  in debugging mode and i would like to know the value of c (I know print is an option) with any other option other than printing. In C# or some other tools we can verify each statement and values. I

Re: .split() Qeustion

2013-08-14 Thread Alister
On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: > On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: >> How can I use the '.split()' method (am I right in calling it a >> method?) without instead of writing each comma between words in the pie >> list in the following code? Also, is the

Re: Pair of filenos read/write each other?

2013-08-14 Thread Antoine Pitrou
Nobody nowhere.com> writes: > > On Tue, 13 Aug 2013 16:10:41 -0700, Jack Bates wrote: > > > Is there anything like os.pipe() where you can read/write both ends? > > There's socket.socketpair(), but it's only available on Unix. > > Windows doesn't have AF_UNIX sockets, and anonymous pipes (like

Re: Pair of filenos read/write each other?

2013-08-14 Thread Nobody
On Tue, 13 Aug 2013 16:10:41 -0700, Jack Bates wrote: > Is there anything like os.pipe() where you can read/write both ends? There's socket.socketpair(), but it's only available on Unix. Windows doesn't have AF_UNIX sockets, and anonymous pipes (like the ones created by os.pipe()) aren't bidirec

Re: python and displaying on 10 bit monitors

2013-08-14 Thread Nobody
On Tue, 13 Aug 2013 05:25:34 -0700, rlkling wrote: > Or, asking another way, are there any python libraries that display images > to 10 bit monitors as 10 bit images, and not scaled to 8 bit? This should be possible using PyOpenGL and GLUT, with: glutInitDisplayString("red=10 green=10 bl

Re: Am I not seeing the Error?

2013-08-14 Thread Joshua Landau
On 14 August 2013 02:20, Gregory Ewing wrote: > Ned Batchelder wrote: >> >> Everyone: this program seems to be a direct and misguided transliteration >> from a bash script. > > Not a particularly well-written bash script, either -- > it's full of superfluous uses of 'cat'. What's wrong with cat?