Re: Newbie: where's the new python gone?

2012-09-09 Thread Mark Lawrence
On 10/09/2012 07:10, Dwight Hutto wrote: I have several installations on my windows, so I use c:\python27_64\python.exe module_file.py or c:\python26\python.exe module_file.py in the command line. Not to show that this shouldn't be a discussion, but usually it's searching. Here's search term

Re: Is there any difference between print 3 and print '3' in Python ?

2012-09-09 Thread Dwight Hutto
On Sun, Sep 9, 2012 at 10:41 AM, Ian Foote wrote: > On 09/09/12 14:23, iMath wrote: > >> 在 2012年3月26日星期一UTC+8下午7时45分26秒,**iMath写道: >> >>> I know the print statement produces the same result when both of these >>> two instructions are executed ,I just want to know Is there any difference >>> betwe

Re: Newbie: where's the new python gone?

2012-09-09 Thread Dwight Hutto
I have several installations on my windows, so I use c:\python27_64\python.exe module_file.py or c:\python26\python.exe module_file.py in the command line. Not to show that this shouldn't be a discussion, but usually it's searching. Here's search term a link, and some python docs: install pyt

Re: Beginner Q: What does the double underscore __ mean?

2012-09-09 Thread Bryan
StarPilgrim wrote: > Brand new to python. I was wondering what the __ underscore means? > For example, there is a line of code: > > __name__=='__main__' > > and I don't know what the double underscore is used for. Ah, tricky. That's not just double underscore; it's double ended double underscore.

Re: Standard Asynchronous Python

2012-09-09 Thread Bryan
Dustin J. Mitchell wrote: > After seeing David Mertz's talk at PyCon 2012, "Coroutines, event > loops, and the history of Python generators" [1], I got thinking again > about Python's expressive power for asynchronous programming. I lament the confusion of generators and coroutines. Generators are

Re: Standard Asynchronous Python

2012-09-09 Thread Steven D'Aprano
On Sun, 09 Sep 2012 20:07:51 -0400, Dustin J. Mitchell wrote: > After seeing David Mertz's talk at PyCon 2012, "Coroutines, event loops, > and the history of Python generators" [1], I got thinking again about > Python's expressive power for asynchronous programming. [...] > I'm considering re-draf

Standard Asynchronous Python

2012-09-09 Thread Dustin J. Mitchell
After seeing David Mertz's talk at PyCon 2012, "Coroutines, event loops, and the history of Python generators" [1], I got thinking again about Python's expressive power for asynchronous programming. Generators, particularly with the addition of 'yield from' and 'return' in PEP 380 [2], allow us to

Re: Beginner Q: What does the double underscore __ mean?

2012-09-09 Thread Steven D'Aprano
On Sun, 09 Sep 2012 10:04:18 -0600, hamilton wrote: > On 9/9/2012 6:39 AM, Dave Angel wrote: >> See the identical thread you posted on tutor, where it was a better >> match. >> >> >> > Would you please post that link for those of us that did not see that > one. http://mail.python.org/pipermail/tu

Re: Beginner Q: What does the double underscore __ mean?

2012-09-09 Thread Dave Angel
On 09/09/2012 12:04 PM, hamilton wrote: > On 9/9/2012 6:39 AM, Dave Angel wrote: >> See the identical thread you posted on tutor, where it was a better >> match. >> >> >> > Would you please post that link for those of us that did not see that > one. > > Thanks > it's a mailing list. There's no lin

Re: Symbolic computations

2012-09-09 Thread Steven D'Aprano
On Sun, 09 Sep 2012 19:26:25 +0200, Mok-Kong Shen wrote: > I heard of names of two systems for Python users to do symbolic > computations: SymPy and Sage. Could someone say a few lines from > experiences about their comparisons? Thanks in advance. Sage includes and is compatible with sympy. See f

Re: Looking for an IPC solution

2012-09-09 Thread Andrew Cooper
On 08/09/2012 16:11, Ramchandra Apte wrote: > On Friday, 7 September 2012 02:25:15 UTC+5:30, Dave Angel wrote: >> On 09/06/2012 04:33 PM, Dennis Lee Bieber wrote: >> >>> >> >> >> >>> Note that this difference mainly applies to how the processes are >> >>> themselves are created... How the library

Re: simple client data base

2012-09-09 Thread Paul Rubin
Tim Chase writes: > urge you in a direction less fraught with peril. Rather than starting > by duplicating existing functionality of a complex domain More importantly, as others have mentioned, the main peril comes from having someone else relying on the success of the program. If you want to l

Re: What’s the differences between these two pieces of code ?

2012-09-09 Thread Piet van Oostrum
iMath writes: > What’s the differences between these two pieces of code ? > (1) > for i in range(1, 7): > print(2 * i, end=' ') > > > (2) > for i in range(1, 7): > print(2 * i, end=' ') > print() > > > when executed both respectively in Python shell ,I get the same effect . > Who can

Re: simple client data base

2012-09-09 Thread Tim Chase
On 09/08/12 14:47, Mark R Rivet wrote: > Well I have to say that this is most discouraging. I should give > up learning to program. I don't have a chance at all. Thanks. I think the intent is not to deter you from learning to program, but rather to urge you in a direction less fraught with peril.

Re: Newbie: where's the new python gone?

2012-09-09 Thread Hans Mulder
On 9/09/12 16:28:55, BobAalsma wrote: > I think I've installed Python 2.7.3 according to the instructions in the > README, and now want to use that version. > However, when typing "python" in Terminal, I get "Python 2.6.4 (r264:75821M, > Oct 27 2009, 19:48:32) ". Was that a freshly opened Termi

Re: Newbie: where's the new python gone?

2012-09-09 Thread Ned Deily
In article <9fcf4eb6-1ea3-4f75-bf2a-031b754a2...@googlegroups.com>, BobAalsma wrote: > Umm2, as said, I think I've installed (at least downloaded) 2.7.3 (note the > three there) and with "python2.7" I now see "Python 2.7.1 (r271:86832, Jun 16 > 2011, 16:59:05)" Did you use a binary installer f

Symbolic computations

2012-09-09 Thread Mok-Kong Shen
I heard of names of two systems for Python users to do symbolic computations: SymPy and Sage. Could someone say a few lines from experiences about their comparisons? Thanks in advance. M. K. Shen -- http://mail.python.org/mailman/listinfo/python-list

Re: What’s the differences between these two pieces of code ?

2012-09-09 Thread Kwpolska
On Sun, Sep 9, 2012 at 3:27 PM, iMath wrote: > 在 2012年7月7日星期六UTC+8下午12时56分35秒,iMath写道: >> What’s the differences between these two pieces of code ? >> >> (1) >> >> for i in range(1, 7): >> >> print(2 * i, end=' ') >> >> >> >> thx everyone >> >> (2) >> >> for i in range(1, 7): >> >> print(2

Re: simple client data base

2012-09-09 Thread Bryan
Mark R Rivet wrote: > Well I have to say that this is most discouraging. Sorry to to be a drag, but the thread needed a bit a realism. -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner Q: What does the double underscore __ mean?

2012-09-09 Thread hamilton
On 9/9/2012 6:39 AM, Dave Angel wrote: See the identical thread you posted on tutor, where it was a better match. Would you please post that link for those of us that did not see that one. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: where's the new python gone?

2012-09-09 Thread Ben Finney
BobAalsma writes: > I think I've installed Python 2.7.3 according to the instructions in > the README, and now want to use that version. > However, when typing "python" in Terminal, I get "Python 2.6.4 > (r264:75821M, Oct 27 2009, 19:48:32) ". I think you might have made a mistake. Without mor

Re: Newbie: where's the new python gone?

2012-09-09 Thread BobAalsma
Op zondag 9 september 2012 16:28:55 UTC+2 schreef BobAalsma het volgende: > I think I've installed Python 2.7.3 according to the instructions in the > README, and now want to use that version. > > However, when typing "python" in Terminal, I get "Python 2.6.4 (r264:75821M, > Oct 27 2009, 19:48:

Re: Newbie: where's the new python gone?

2012-09-09 Thread Steven D'Aprano
On Sun, 09 Sep 2012 07:28:55 -0700, BobAalsma wrote: > I think I've installed Python 2.7.3 according to the instructions in the > README, and now want to use that version. However, when typing "python" > in Terminal, I get "Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) ". Did you run "make al

Re: Is there any difference between print 3 and print '3' in Python ?

2012-09-09 Thread Ian Foote
On 09/09/12 14:23, iMath wrote: 在 2012年3月26日星期一UTC+8下午7时45分26秒,iMath写道: I know the print statement produces the same result when both of these two instructions are executed ,I just want to know Is there any difference between print 3 and print '3' in Python ? thx everyone The difference is

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Roy Smith
In article , Token Type wrote: > > structures are simple, just plain print will work, but for more > > > > complicated structures, pprint.pprint() is a life saver. > > > > I did try . However, > > >>> pprint.pprint(lemma_list) > > Traceback (most recent call last): > File "", line 1, in

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Roy Smith
In article <43a68990-d6cf-4362-8c47-b13ce780b...@googlegroups.com>, Token Type wrote: > Thanks very much for all of your tips. Take noun as an example. First, I need > find all the lemma_names in all the synsets whose pos is 'n'. Second, for > each lemma_name, I will check all their sense numb

Newbie: where's the new python gone?

2012-09-09 Thread BobAalsma
I think I've installed Python 2.7.3 according to the instructions in the README, and now want to use that version. However, when typing "python" in Terminal, I get "Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) ". So: (1) I can't seem to find where the new software has gone and (2) can't se

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Token Type
> structures are simple, just plain print will work, but for more > > complicated structures, pprint.pprint() is a life saver. > I did try . However, >>> pprint.pprint(lemma_list) Traceback (most recent call last): File "", line 1, in pprint.pprint(lemma_list) NameError: name 'pprint

Re: Is there a unique method in python to unique a list?

2012-09-09 Thread Chris Angelico
On Sun, Sep 9, 2012 at 11:44 PM, Token Type wrote: > lemma_set.add(synset.lemma_names) That tries to add the whole list as a single object, which doesn't work because lists can't go into sets. There are two solutions, depending on what you want to do. 1) If you want each addition t

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Token Type
> In fact, I'm guessing that's your problem. I think you're ending up > > with a list of lists of strings, when you think you're getting a list of > > strings. > Thanks. You guess right. It turns out that lemma_list is a list of list, as I tested in the previous post. -- http://mail.python

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Token Type
Thanks very much for all of your tips. Take noun as an example. First, I need find all the lemma_names in all the synsets whose pos is 'n'. Second, for each lemma_name, I will check all their sense number. 1) Surely,we can know the number of synset whose pos is noun by >>> len([synset for syn

Re: Is there a unique method in python to unique a list?

2012-09-09 Thread Token Type
Thanks. I try to use set() suggested by you. However, not successful. Please see: >>> synsets = list(wn.all_synsets('n')) >>> synsets[:5] [Synset('entity.n.01'), Synset('physical_entity.n.01'), Synset('abstraction.n.06'), Synset('thing.n.12'), Synset('object.n.01')] >>> lemma_set = set() >>> for

Re: Does os.getcwd() and os.curdir have the same effect ?

2012-09-09 Thread Steven D'Aprano
On Sun, 09 Sep 2012 06:22:09 -0700, iMath wrote: > Does os.getcwd() and os.curdir have the same effect ? You could answer that yourself with two seconds experimentation at the interactive prompt. py> os.getcwd() '/home/steve' py> os.curdir '.' For more information, you can try reading the Fin

Re: Does os.getcwd() and os.curdir have the same effect ?

2012-09-09 Thread Thomas Jollans
On 09/09/2012 03:22 PM, iMath wrote: > Does os.getcwd() and os.curdir have the same effect ? > Python 3.2.3 (default, May 3 2012, 15:51:42) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.getcwd() '/home/tjol' >>> os.curdir '.' >>

Re: What’s the differences between these two pieces of code ?

2012-09-09 Thread iMath
在 2012年7月7日星期六UTC+8下午12时56分35秒,iMath写道: > What’s the differences between these two pieces of code ? > > (1) > > for i in range(1, 7): > > print(2 * i, end=' ') > > > > thx everyone > > (2) > > for i in range(1, 7): > > print(2 * i, end=' ') > > print() > > > > > > when execu

Re: Is there any difference between print 3 and print '3' in Python ?

2012-09-09 Thread iMath
在 2012年3月26日星期一UTC+8下午7时45分26秒,iMath写道: > I know the print statement produces the same result when both of these two > instructions are executed ,I just want to know Is there any difference > between print 3 and print '3' in Python ? thx everyone -- http://mail.python.org/mailman/listinfo/pytho

Does os.getcwd() and os.curdir have the same effect ?

2012-09-09 Thread iMath
Does os.getcwd() and os.curdir have the same effect ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner Q: What does the double underscore __ mean?

2012-09-09 Thread Dave Angel
See the identical thread you posted on tutor, where it was a better match. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-09 Thread Roy Smith
In article , Thomas Jollans wrote: > The ISO date/time format is dead simple and well-defined. Well defined, perhaps. But nobody who has read the standard could call it "dead simple". ISO-8601-2004(E) is 40 pages long. Of course, that fact that it's complicated enough to generate 40 pages

Re: Beginner Q: What does the double underscore __ mean?

2012-09-09 Thread Mark Lawrence
On 09/09/2012 12:03, StarPilgrim wrote: Hi all, Brand new to python. I was wondering what the __ underscore means? For example, there is a line of code: __name__=='__main__' and I don't know what the double underscore is used for. Start here http://docs.python.org/reference/datamodel.html#s

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-09 Thread Mark Lawrence
On 09/09/2012 11:15, Roy Smith wrote: In article , John Nagle wrote: This really should be handled in the standard library, instead of everybody rolling their own, badly. +1 I'll second that given "There should be one-- and preferably only one --obvious way to do it". -- Cheers. Mark

Beginner Q: What does the double underscore __ mean?

2012-09-09 Thread StarPilgrim
Hi all, Brand new to python. I was wondering what the __ underscore means? For example, there is a line of code: __name__=='__main__' and I don't know what the double underscore is used for. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing ISO date/time strings - where did the parser go?

2012-09-09 Thread Roy Smith
In article , John Nagle wrote: > This really should be handled in the standard library, instead of > everybody rolling their own, badly. +1 -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.3.0 release candidate 2

2012-09-09 Thread Georg Brandl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team, I'm delighted to announce the second release candidate of Python 3.3.0. This is a preview release, and its use is not recommended in production settings. Python 3.3 includes a range of improvements of the 3.x

Re: Is there a unique method in python to unique a list?

2012-09-09 Thread Paul Rubin
Paul Rubin writes: > I think you mean (untested): > > synsets = wn.all_synsets(pos) > sense_number = 0 > lemma_set = set() > for synset in synsets: > lemma_set.add(synset.lemma_names) > for lemma in lemma_set: > sense_number += len(wn.synsets(lemma,pos))

Re: Is there a unique method in python to unique a list?

2012-09-09 Thread Paul Rubin
Token Type writes: def average_polysemy(pos): > synset_list = list(wn.all_synsets(pos)) > sense_number = 0 > lemma_list = [] > for synset in synset_list: > lemma_list.extend(synset.lemma_names) > for lemma in list(set(lemma_list)): >

Re: Is there a unique method in python to unique a list?

2012-09-09 Thread Serhiy Storchaka
On 09.09.12 08:47, Donald Stufft wrote: If you don't need to retain order you can just use a set, Only if elements are hashable. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a unique method in python to unique a list?

2012-09-09 Thread John H. Li
One more test result to add, if I use your first method to unique: seen = set() uniqued = [] for x in original: if not x in seen: seen.add(x) uniqued.append(x) The results pops up in a few seconds. It makes a dramatic difference. Thanks. See the following fasted codes: >>> imp

Re: Is there a unique method in python to unique a list?

2012-09-09 Thread John H. Li
Thanks again. What you explain is reasonable. I try to the second method to unique the list. It does turn out that python just works and works without result. Maybe because it do iterate a long list in my example and slow. >>> def average_polysemy(pos): synset_list = list(wn.all_synsets(pos)) sens