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
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
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
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.
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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:
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
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
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
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
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
> 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
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
> 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
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
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
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
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
'.'
>>
在 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
在 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 ?
--
http://mail.python.org/mailman/listinfo/python-list
See the identical thread you posted on tutor, where it was a better match.
--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
-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
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))
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)):
>
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
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
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
49 matches
Mail list logo