Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread xliiv
> >> Like the topic.. . > >> I use Python a lot, both Windows and Linux, and it's little weird to have > >> many python process without fast distinction which is what. > > > > I've no idea if it's even possible on Windows. On Linux, what you want > > is the prctl function, which (AFAIK) isn't dire

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread xliiv
> >> Like the topic.. . > >> I use Python a lot, both Windows and Linux, and it's little weird to have > >> many python process without fast distinction which is what. > > > > I've no idea if it's even possible on Windows. On Linux, what you want > > is the prctl function, which (AFAIK) isn't dire

pyserial for GPS data

2012-03-15 Thread Arun p das
I have a USB GPS dongle using this for getting position information. I installed gpsd daemon so that any clients can read data from that. It is working fine used xgps, cgps as clients. *gpsd -n -N -D2 /dev/ttyUSB0 * import gps, os, time g = gps.gps(mode=gps.WATCH_NEWSTYLE) while 1: os.system('cl

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Robert Kern
On 3/15/12 5:59 AM, Cameron Simpson wrote: On 15Mar2012 12:22, Ben Finney wrote: | Roy Smith writes: |> I'll admit I hadn't considered that, but I don't see it as a major |> problem. The type intuition could be designed to only work for types |> other than NoneType. | | −1, then. It's growin

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Cameron Simpson
On 15Mar2012 10:06, Robert Kern wrote: | On 3/15/12 5:59 AM, Cameron Simpson wrote: | > On 15Mar2012 12:22, Ben Finney wrote: | > | Roy Smith writes: | > |> I'll admit I hadn't considered that, but I don't see it as a major | > |> problem. The type intuition could be designed to only work for

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 7:23, alex23 wrote: Rick Johnson wrote: However, when we are talking about the Python programming language "readable" simply means: "neophyte readable". That is, "readable to someone with little or no experience with the language". Nonsense. List comprehensions are not immediatel

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Thu, Mar 15, 2012 at 9:44 PM, Kiuhnm wrote: > Let's try that. > Show me an example of "list comprehensions" and "with" (whatever they are). I'll do a list comp, because they lend themselves well to one-liners. what_am_i = '\n'.join(["%X\t%c"%(i,i) for i in range(128)]) Okay, that one also use

Re: Python is readable

2012-03-15 Thread Thomas Rachel
Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of "list comprehensions" and "with" (whatever they are). with open("filename", "w") as f: f.write(stuff) with lock: do_something_exclusively() Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 11:50, Chris Angelico wrote: On Thu, Mar 15, 2012 at 9:44 PM, Kiuhnm wrote: Let's try that. Show me an example of "list comprehensions" and "with" (whatever they are). I'll do a list comp, because they lend themselves well to one-liners. what_am_i = '\n'.join(["%X\t%c"%(i,i) for

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Thu, Mar 15, 2012 at 10:27 PM, Kiuhnm wrote: > On 3/15/2012 11:50, Chris Angelico wrote: >> I'll do a list comp, because they lend themselves well to one-liners. >> what_am_i = '\n'.join(["%X\t%c"%(i,i) for i in range(128)]) > > > A few conjectures: > 1) '\n' is an object and join one of its me

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 12:14, Thomas Rachel wrote: Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of "list comprehensions" and "with" (whatever they are). with open("filename", "w") as f: f.write(stuff) Here f is created before executing the block and destroyed right after

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 12:47, Chris Angelico wrote: On Thu, Mar 15, 2012 at 10:27 PM, Kiuhnm Your first example suggests that range(n) is a sequence iterator which returns, if queried n times, 0,...,n-1 (which is a bit counterintuitive, IMHO). It's a little odd, perhaps, if seen in a vacuum. But every

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Thu, Mar 15, 2012 at 10:59 PM, Kiuhnm wrote: > On 3/15/2012 12:47, Chris Angelico wrote: >> It's a little odd, perhaps, if seen in a vacuum. But everything counts >> from zero - list indices, etc - so it makes sense for range(len(lst)) >> to return indices valid for lst. > > Maybe range uses [.

Re: Is there a ConfigParser which keeps comments

2012-03-15 Thread Steven W. Orr
On 3/14/2012 6:07 AM, Gelonida N wrote: Hi, At the moment I use ConfigParser http://docs.python.org/library/configparser.html for one of my applications. Now I'm looking for a library, which behaves like config parser, but with one minor difference. The write() mehtod should keep existing co

Re: Python is readable

2012-03-15 Thread Ben Finney
Chris Angelico writes: > Yup. It's amazing how accurate your conjectures are - it's almost like > you've been reading the docs! :D But yeah, that's pretty logical IMHO; > and having gotten used to [) intervals in many areas of computing, > I've come to find [] intervals disconcerting. Bible passa

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Thu, Mar 15, 2012 at 11:31 PM, Ben Finney wrote: > Another good reason to advocate for proper typography. "John 14:5-7" > indicates a range (because it uses U+2013 EN DASH), whereas "7-5" > indicates subtraction (because it uses U+2212 MINUS SIGN). A hyphen ('-' > U+002D) is inappropriate in ei

ANN: python-ldap 2.4.9

2012-03-15 Thread Michael Ströder
Find a new release of python-ldap: http://pypi.python.org/pypi/python-ldap/2.4.8 python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related st

Re: Python is readable

2012-03-15 Thread Ben Finney
Chris Angelico writes: > On Thu, Mar 15, 2012 at 11:31 PM, Ben Finney > wrote: > > Another good reason to advocate for proper typography. "John 14:5-7" > > indicates a range (because it uses U+2013 EN DASH), whereas "7-5" > > indicates subtraction (because it uses U+2212 MINUS SIGN). A hyphen >

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Roy Smith
In article , Robert Kern wrote: > Yes. Not all type(default) types can be called with a string to produce a > valid > value. Note that "type=" is really a misnomer. argparse doesn't really want a > type object there; it wants a converter function that takes a string to an > object. Orthogon

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 12:16 AM, Ben Finney wrote: > Chris Angelico writes: > >> On Thu, Mar 15, 2012 at 11:31 PM, Ben Finney >> wrote: >> > Another good reason to advocate for proper typography. "John 14:5-7" >> > indicates a range (because it uses U+2013 EN DASH), whereas "7-5" >> > indicate

Re: Python is readable

2012-03-15 Thread Ben Finney
Chris Angelico writes: > On Fri, Mar 16, 2012 at 12:16 AM, Ben Finney > wrote: > > Hopefully, the fact that your quoting of my text munged the > > characters down to ASCII is also pure coincidence, and is soon to be > > corrected at your end? Or has your client program not joined the > > rest o

Re: Python is readable

2012-03-15 Thread Mark Lawrence
On 15/03/2012 11:48, Kiuhnm wrote: On 3/15/2012 12:14, Thomas Rachel wrote: Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of "list comprehensions" and "with" (whatever they are). with open("filename", "w") as f: f.write(stuff) Here f is created before executing the

Re: Python is readable

2012-03-15 Thread Alec Taylor
On Fri, Mar 16, 2012 at 1:06 AM, Mark Lawrence wrote: > Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > with open("filename", "w") as f >  File "", line 1 > >    with open("filename

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 13:21, Chris Angelico wrote: On Thu, Mar 15, 2012 at 10:59 PM, Kiuhnm wrote: On 3/15/2012 12:47, Chris Angelico wrote: It's a little odd, perhaps, if seen in a vacuum. But everything counts from zero - list indices, etc - so it makes sense for range(len(lst)) to return indices va

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:06, Mark Lawrence wrote: On 15/03/2012 11:48, Kiuhnm wrote: On 3/15/2012 12:14, Thomas Rachel wrote: Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of "list comprehensions" and "with" (whatever they are). with open("filename", "w") as f: f.write(stuff

Re: Python is readable

2012-03-15 Thread Tim Golden
On 15/03/2012 14:19, Kiuhnm wrote: On 3/15/2012 15:06, Mark Lawrence wrote: On 15/03/2012 11:48, Kiuhnm wrote: BTW, aren't those ':' redundant? Kiuhnm Nope. Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" fo

Re: Python is readable

2012-03-15 Thread Duncan Booth
Kiuhnm wrote: > BTW, aren't those ':' redundant? > They are required by the grammar, but in a sense you are correct. You could modify Python's grammar to make the colons optional and still keep it unambiguous but that would make it harder for other tools (such as text editors or indeed human

client ssl verification

2012-03-15 Thread Robin Becker
I'm trying to do client ssl verification with code that looks like the sample below. I am able to reach and read urls that are secure and have no client certificate requirement OK. If I set explicit_check to True then verbose output indicates that the server certs are being checked fine ie I see

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 1:16 AM, Kiuhnm wrote: > Don't worry. Soon you'll be using C++0x :))) I use gcc/g++ with most of the new features enabled. There's some pretty handy features in it. Frankly, though, if I'd known about Cython when I started the current project, I would have argued to write

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:23, Duncan Booth wrote: Kiuhnm wrote: BTW, aren't those ':' redundant? They are required by the grammar, but in a sense you are correct. You could modify Python's grammar to make the colons optional and still keep it unambiguous but that would make it harder for other tools

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:29, Chris Angelico wrote: On Fri, Mar 16, 2012 at 1:16 AM, Kiuhnm wrote: Don't worry. Soon you'll be using C++0x :))) I use gcc/g++ with most of the new features enabled. There's some pretty handy features in it. Frankly, though, if I'd known about Cython when I started the c

Re: Python is readable

2012-03-15 Thread Robert Kern
On 3/15/12 2:30 PM, Kiuhnm wrote: On 3/15/2012 15:23, Duncan Booth wrote: Kiuhnm wrote: BTW, aren't those ':' redundant? They are required by the grammar, but in a sense you are correct. You could modify Python's grammar to make the colons optional and still keep it unambiguous but that wou

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 1:30 AM, Kiuhnm wrote: > Sorry, but I can't see how it would make it harder for humans to understand. > Are there particular situations you're referring to? In a trivial example, it's mostly just noise: if a == b# who needs the colon? print(c) But when your condi

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:28, Tim Golden wrote: On 15/03/2012 14:19, Kiuhnm wrote: On 3/15/2012 15:06, Mark Lawrence wrote: On 15/03/2012 11:48, Kiuhnm wrote: BTW, aren't those ':' redundant? Kiuhnm Nope. Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "help",

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 1:55 AM, Kiuhnm wrote: > By the way, the more elaborate parsing consists of looking for an > END_OF_LINE followed by one or more spaces. It doesn't sound that > complicated. Only in the trivial case. What if you want to break your condition over multiple lines? (Although y

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:48, Chris Angelico wrote: On Fri, Mar 16, 2012 at 1:30 AM, Kiuhnm wrote: Sorry, but I can't see how it would make it harder for humans to understand. Are there particular situations you're referring to? In a trivial example, it's mostly just noise: if a == b# who needs t

Re: Python is readable

2012-03-15 Thread Robert Kern
On 3/15/12 2:55 PM, Kiuhnm wrote: On 3/15/2012 15:28, Tim Golden wrote: http://docs.python.org/faq/design.html#why-are-colons-required-for-the-if-while-def-class-statements The second one is slightly easier to read because it's syntax-highlighted. Was that on purpose? No, it's an unintende

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 2:05 AM, Kiuhnm wrote: > I had thought about the single-line case. What I hadn't thought about is > that Python strives to be as regular as possible, so having different cases > just for saving one keystroke isn't worth it. Yep. Have you read the Zen of Python? >>> import

Re: Python is readable

2012-03-15 Thread Roy Smith
In article , Chris Angelico wrote: > I use gcc/g++ with most of the new features enabled. There's some > pretty handy features in it. Frankly, though, if I'd known about > Cython when I started the current project, I would have argued to > write it all in Python and Cify (is that a word?) the mo

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 15:43, Robert Kern wrote: On 3/15/12 2:30 PM, Kiuhnm wrote: On 3/15/2012 15:23, Duncan Booth wrote: Kiuhnm wrote: BTW, aren't those ':' redundant? They are required by the grammar, but in a sense you are correct. You could modify Python's grammar to make the colons optional an

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 2:14 AM, Roy Smith wrote: > While it's nice to know that we've got the ability to write extensions > in C, not once have we ever felt the need.  I suppose if you're running > a CPU-bound application, that might not be the case, but surprisingly > few applications really are

Re: Python is readable

2012-03-15 Thread Roy Smith
In article , Chris Angelico wrote: > "We're talking about a file that someone's uploaded to us, so it > won't matter". Whatever processing we do is massively dwarfed by > network time, and both scale linearly with the size of the file. That last part (both scaling linearly) may not be true.

Re: Python is readable

2012-03-15 Thread Thomas Rachel
Am 15.03.2012 12:48 schrieb Kiuhnm: On 3/15/2012 12:14, Thomas Rachel wrote: Am 15.03.2012 11:44 schrieb Kiuhnm: Let's try that. Show me an example of "list comprehensions" and "with" (whatever they are). with open("filename", "w") as f: f.write(stuff) Here f is created before executing th

Re: Python is readable

2012-03-15 Thread Alec Taylor
On Fri, Mar 16, 2012 at 1:16 AM, Kiuhnm wrote: > On 3/15/2012 13:21, Chris Angelico wrote: >> >> On Thu, Mar 15, 2012 at 10:59 PM, Kiuhnm >>  wrote: >>> >>> On 3/15/2012 12:47, Chris Angelico wrote: It's a little odd, perhaps, if seen in a vacuum. But everything counts from zero -

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread Dave Angel
On 03/15/2012 03:26 AM, xliiv wrote: Like the topic.. . I use Python a lot, both Windows and Linux, and it's little weird to have many python process without fast distinction which is what. I did google, I've played with Exemaker (it works perfect, but not py3) and i've seen questions on St

Pragmas, foreign keys in sqlite3?

2012-03-15 Thread llanitedave
Several questions here, but they're related. I'm trying to incorporate an sqlite3 database that was created using Sqliteman1.2.2. I don't know what version of sqlite3 that one uses, but it seems to have ignored any attempts to create foreign keys for its tables. I'm using Python 2.7.2, and I kno

Re: Style question (Poll)

2012-03-15 Thread Jon Clements
On Wednesday, 14 March 2012 21:16:05 UTC, Terry Reedy wrote: > On 3/14/2012 4:49 PM, Arnaud Delobelle wrote: > > On 14 March 2012 20:37, Croepha wrote: > >> Which is preferred: > >> > >> for value in list: > >> if not value is another_value: > >> value.do_something() > >> break > > Do

Questions about the use of descriptors.

2012-03-15 Thread Steven W. Orr
Question 1: I have a class A with one attribute and I define __get__ and __set__ for that class. Then I create another class B that uses it. Why does B require that the instance of A be a class variable in B and not created as an instance variable in __init__? E.g., # This works fine. class

Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Prasad, Ramit
So I have a context manager used to catch errors def __exit__( self, exceptionClass, exception, tracebackObject ): if isinstance( exception, self.exceptionClasses ): #do something here Normally exception would be the exception instance, but for AttributeError it seems to be a string

Re: Python is readable

2012-03-15 Thread Mark Lawrence
On 15/03/2012 16:01, Alec Taylor wrote: C++0x? You mean C++11? :P On that note, is Python upgrading to use C11? :V Not for Windows given http://mail.python.org/pipermail/python-dev/2012-February/116258.html. I've no idea regarding *nix, os x or whatever. -- Cheers. Mark Lawrence. -- htt

Re: Python is readable

2012-03-15 Thread Devin Jeanpierre
On Wed, Mar 14, 2012 at 8:27 PM, Chris Angelico wrote: > On Thu, Mar 15, 2012 at 10:54 AM, Arnaud Delobelle wrote: >> I don't know this book and there may be a pedagogical reason for the >> implementation you quote, but pairwise_sum is probably better >> implemented in Python 3.X as: >> >> def pa

RE: Python is readable

2012-03-15 Thread Prasad, Ramit
> > > Hopefully, the fact that your quoting of my text munged the > > > characters down to ASCII is also pure coincidence, and is soon to be > > > corrected at your end? Or has your client program not joined the > > > rest of us in the third millennium with Unicode? Outlook showed the EN DASH but

Re: Questions about the use of descriptors.

2012-03-15 Thread Ian Kelly
On Thu, Mar 15, 2012 at 11:32 AM, Steven W. Orr wrote: > Question 1: > > I have a class A with one attribute and I define __get__ and __set__ for > that class. Then I create another class B that uses it. > > Why does B require that the instance of A be a class variable in B and not > created as an

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread Grant Edwards
On 2012-03-15, Dave Angel wrote: > On 03/15/2012 03:26 AM, xliiv wrote: > Like the topic.. . > I use Python a lot, both Windows and Linux, and it's little weird to have > many python process without fast distinction which is what. >>> >> >> I did google, I've played with Exemaker (it

Re: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Peter Otten
Prasad, Ramit wrote: > So I have a context manager used to catch errors > > def __exit__( self, exceptionClass, exception, tracebackObject ): > if isinstance( exception, self.exceptionClasses ): > #do something here > > Normally exception would be the exception instance, but for > A

RE: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Prasad, Ramit
> Prasad, Ramit wrote: > > > So I have a context manager used to catch errors > > > > def __exit__( self, exceptionClass, exception, tracebackObject ): > > if isinstance( exception, self.exceptionClasses ): > > #do something here > > > > Normally exception would be the exception insta

Re: Python is readable

2012-03-15 Thread Serhiy Storchaka
15.03.12 16:19, Kiuhnm написав(ла): > Ok, so they're mandatory, but I was mainly talking of design. Why are they > needed? http://python-history.blogspot.com/2011/07/karin-dewar-indentation-and-colon.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 16:08, Chris Angelico wrote: On Fri, Mar 16, 2012 at 1:55 AM, Kiuhnm wrote: By the way, the more elaborate parsing consists of looking for an END_OF_LINE followed by one or more spaces. It doesn't sound that complicated. Only in the trivial case. What if you want to break your c

Re: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Ian Kelly
On Thu, Mar 15, 2012 at 1:10 PM, Prasad, Ramit wrote: >> Prasad, Ramit wrote: >> >> > So I have a context manager used to catch errors >> > >> > def __exit__( self, exceptionClass, exception, tracebackObject ): >> >     if isinstance( exception, self.exceptionClasses ): >> >          #do something

RE: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Prasad, Ramit
> > ... > > (, "'A' object has no attribute 'x'", > ) > > AttributeError: 'A' object has no attribute 'x' > > > > As you can see, I am getting a string while you are not. > >Ian Kelly said: > Looks like a version difference. I don't have Python 2.6 handy to > test on, but I get a str in Python 2

Re: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Ian Kelly
On Thu, Mar 15, 2012 at 2:25 PM, Prasad, Ramit wrote: >> > ... >> > (, "'A' object has no attribute 'x'", >> ) >> > AttributeError: 'A' object has no attribute 'x' >> > >> > As you can see, I am getting a string while you are not. >> >>Ian Kelly said: >> Looks like a version difference.  I don't h

RE: Context Manager getting str instead of AttributeError instance

2012-03-15 Thread Peter Otten
Prasad, Ramit wrote: >> Prasad, Ramit wrote: >> >> > So I have a context manager used to catch errors >> > >> > def __exit__( self, exceptionClass, exception, tracebackObject ): >> > if isinstance( exception, self.exceptionClasses ): >> > #do something here >> > >> > Normally excepti

Re: Python is readable

2012-03-15 Thread Arnaud Delobelle
On 15 March 2012 00:27, Chris Angelico wrote: > On Thu, Mar 15, 2012 at 10:54 AM, Arnaud Delobelle wrote: >> I don't know this book and there may be a pedagogical reason for the >> implementation you quote, but pairwise_sum is probably better >> implemented in Python 3.X as: >> >> def pairwise_su

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Cameron Simpson
On 15Mar2012 09:28, Roy Smith wrote: | In article , | Robert Kern wrote: | > Yes. Not all type(default) types can be called with a string to produce a | > valid | > value. Note that "type=" is really a misnomer. argparse doesn't really want a | > type object there; it wants a converter funct

Re: Is there a ConfigParser which keeps comments

2012-03-15 Thread Cameron Simpson
On 14Mar2012 13:13, Tim Chase wrote: | On 03/14/12 12:06, Terry Reedy wrote: | > On 3/14/2012 6:07 AM, Gelonida N wrote: | >> Now I'm looking for a library, which behaves like config parser, but | >> with one minor difference. | >> | >> The write() mehtod should keep existing comments. | > | > Ass

Re: Is there a ConfigParser which keeps comments

2012-03-15 Thread Karim
Le 15/03/2012 03:48, Steven W. Orr a écrit : On 3/14/2012 6:07 AM, Gelonida N wrote: Hi, At the moment I use ConfigParser http://docs.python.org/library/configparser.html for one of my applications. Now I'm looking for a library, which behaves like config parser, but with one minor differenc

Re: Python is readable

2012-03-15 Thread Michael Torrie
On 03/15/2012 01:40 PM, Kiuhnm wrote: > Moreover, I think that >if ( > >): > > > > is not very readable anyway. Sure but neither is if ( \ \

Re: Python is readable

2012-03-15 Thread Michael Torrie
On 03/15/2012 09:18 AM, Kiuhnm wrote: > > After early user testing without the colon, it was discovered that > the meaning of the indentation was unclear to beginners being taught the > first steps of programming. < > > The addition of the colon clarified it significantly: the colon some

Re: Python is readable

2012-03-15 Thread Ben Finney
Kiuhnm writes: > Moreover, I think that > if ( > > ): > > > > is not very readable anyway. I agree, and am glad PEP 8 has been updated to recommend an extra level of indentation for contin

Re: Python is readable

2012-03-15 Thread Arnaud Delobelle
On 15 March 2012 22:35, Ben Finney wrote: > Kiuhnm writes: > >> Moreover, I think that >>   if ( >>       >>       ): >>       >>       >>       >> is not very readable anyway. > > I agree, and am glad PEP 8 has been upda

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/15/2012 23:17, Michael Torrie wrote: On 03/15/2012 09:18 AM, Kiuhnm wrote: > After early user testing without the colon, it was discovered that the meaning of the indentation was unclear to beginners being taught the first steps of programming.< The addition of the colon clarified

Re: Python is readable

2012-03-15 Thread Kiuhnm
On 3/16/2012 0:00, Arnaud Delobelle wrote: On 15 March 2012 22:35, Ben Finney wrote: Kiuhnm writes: Moreover, I think that if ( ): is not very readable anyway. I agree, and am

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Fri, 16 Mar 2012 01:48:09 +1100, Chris Angelico wrote: > On Fri, Mar 16, 2012 at 1:30 AM, Kiuhnm > wrote: >> Sorry, but I can't see how it would make it harder for humans to >> understand. Are there particular situations you're referring to? > > In a trivial example, it's mostly just noise: >

Re: Python is readable

2012-03-15 Thread Ben Finney
Arnaud Delobelle writes: > On 15 March 2012 22:35, Ben Finney wrote: > > I agree, and am glad PEP 8 has been updated to recommend an extra > > level of indentation for continuation, to distinguish from the new > > block that follows > > http://www.python.org/dev/peps/pep-0008/#indentation>. > >

Re: Python is readable

2012-03-15 Thread Mark Lawrence
On 15/03/2012 23:46, Kiuhnm wrote: On 3/16/2012 0:00, Arnaud Delobelle wrote: On 15 March 2012 22:35, Ben Finney wrote: Kiuhnm writes: Moreover, I think that if ( ): is not very readable anyway. I agree, and am glad

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Fri, 16 Mar 2012 00:46:35 +0100, Kiuhnm wrote: > On 3/16/2012 0:00, Arnaud Delobelle wrote: >> On 15 March 2012 22:35, Ben Finney wrote: >>> Kiuhnm writes: >>> Moreover, I think that if ( ): >>>

Re: Is there a ConfigParser which keeps comments

2012-03-15 Thread Gelonida N
On 03/15/2012 10:42 PM, Cameron Simpson wrote: > On 14Mar2012 13:13, Tim Chase wrote: > | On 03/14/12 12:06, Terry Reedy wrote: > | > On 3/14/2012 6:07 AM, Gelonida N wrote: > | >> Now I'm looking for a library, which behaves like config parser, but > | >> with one minor difference. > | >> > | >>

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Thu, 15 Mar 2012 00:34:47 +0100, Kiuhnm wrote: > I've just started to read >The Quick Python Book (2nd ed.) Is this the one? http://manning.com/ceder/ > The author claims that Python code is more readable than Perl code and > provides this example: > > --- Perl --- > sub pairwise_sum {

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread Dave Angel
On 03/15/2012 02:39 PM, Grant Edwards wrote: On 2012-03-15, Dave Angel wrote: On 03/15/2012 03:26 AM, xliiv wrote: Like the topic.. . I use Python a lot, both Windows and Linux, and it's little weird to have many python process without fast distinction which is what. I did google, I've playe

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Thu, 15 Mar 2012 20:54:30 +, Arnaud Delobelle wrote: > On 15 March 2012 00:27, Chris Angelico wrote: >> On Thu, Mar 15, 2012 at 10:54 AM, Arnaud Delobelle >> wrote: >>> I don't know this book and there may be a pedagogical reason for the >>> implementation you quote, but pairwise_sum is p

Re: Python is readable

2012-03-15 Thread Mark Lawrence
On 16/03/2012 01:53, Steven D'Aprano wrote: On Thu, 15 Mar 2012 00:34:47 +0100, Kiuhnm wrote: I've just started to read The Quick Python Book (2nd ed.) Is this the one? http://manning.com/ceder/ The author claims that Python code is more readable than Perl code and provides this examp

Python simulate browser activity

2012-03-15 Thread choi2k
Hi, everyone I am trying to write a small application using python but I am not sure whether it is possible to do so.. The application aims to simulate user activity including visit a website and perform some interactive actions (click on the menu, submit a form, redirect to another pages...etc) I

Re: Python simulate browser activity

2012-03-15 Thread Chris Rebert
On Thu, Mar 15, 2012 at 7:23 PM, choi2k wrote: > Hi, everyone > > I am trying to write a small application using python but I am not > sure whether it is possible to do so.. > The application aims to simulate user activity including visit a > website and perform some interactive actions (click on

Re: Python is readable

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 10:52 AM, Steven D'Aprano wrote: > On Fri, 16 Mar 2012 01:48:09 +1100, Chris Angelico wrote: > >> In a trivial example, it's mostly just noise: >> >> if a == b    # who needs the colon? >>     print(c) > > The reader, for the same reason that above you wrote: > > "In a triv

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread Chris Angelico
On Fri, Mar 16, 2012 at 5:39 AM, Grant Edwards wrote: > Seems like an awfully obtuse way of doing things -- I don't really > want to have 15 different copies of Python (or even links), and it > requires root privleges every time you want to run a Python program > with the "correct" name. Why do y

Re: Python simulate browser activity

2012-03-15 Thread Jerry Hill
On Thu, Mar 15, 2012 at 10:54 PM, Chris Rebert wrote: > On Thu, Mar 15, 2012 at 7:23 PM, choi2k wrote: >> The application aims to simulate user activity including visit a >> website and perform some interactive actions (click on the menu, >> submit a form, redirect to another pages...etc) > > Did

Re: Python is readable

2012-03-15 Thread Steven D'Aprano
On Fri, 16 Mar 2012 00:32:52 +0100, Kiuhnm wrote: > Pick up two math books about the same topic but on two different levels > (e.g. under-graduated and graduated). If you compare the proofs you'll > see that those in the higher-level book are almost always sketched. Why > is that? Because they're