On Sat, Feb 11, 2017 at 7:08 PM, Steven D'Aprano wrote:
> On Sat, Feb 11, 2017 at 02:28:42PM -0600, boB Stepp wrote:
>
>> Back in the main Python list thread, Marko Rauhamaa suggested
>> (https://mail.python.org/pipermail/python-list/2017-February/719322.html):
>>
>> "
>> ...
>> Haven't been follo
On Sat, Feb 11, 2017 at 09:10:04AM -0800, Alex Kleider wrote:
> What your 's' represents seems quite different to 'mine.'
> There must be something else going on.
> ???
I think there's an easy explanation for that, which is that eryksun
probably just created a variable "s" but didn't show the co
On Sat, Feb 11, 2017 at 02:28:42PM -0600, boB Stepp wrote:
> Back in the main Python list thread, Marko Rauhamaa suggested
> (https://mail.python.org/pipermail/python-list/2017-February/719322.html):
>
> "
> ...
> Haven't been following the discussion, but this should be simply:
>
>ast.liter
On 11/02/17 18:59, Pooja Bhalode wrote:
> Hi Alan,
>
> I had done what you suggested here, I also tried creating another file for
> that snipet of the code to see if that section works. The other file works,
> but I am not able to figure out why the original one doesn't work.
Too late at night fo
Believe it or not, a change in two characters should make this even faster. :)
Change the line:
file_list = [i[:-1] for i in my_list.readlines()]
to:
file_list = {i[:-1] for i in my_list.readlines()}
The change is to use a "set comprehension" instead of a "list
comprehension". Sets
It is probably better to store your key file in memory
then loop over the large data file and check the
line against each key. Better to check 2000 data
keys in memory for one loop of the data file.
That way you only read the key file and data file
once each - 502,000 reads instead of a billion.
Hi Alan,
I had done what you suggested here, I also tried creating another file for
that snipet of the code to see if that section works. The other file works,
but I am not able to figure out why the original one doesn't work.
The variable here is entrynumberspeciesvar
Code:
from Tkinter import *
On Sat, Feb 11, 2017 at 2:06 AM, Steven D'Aprano wrote:
> On Fri, Feb 10, 2017 at 07:59:04PM -0600, boB Stepp wrote:
>
>> He cannot figure out how to reliably tell if the user's input is an
>> integer, float or neither. So I thought I would come up with my
>> solution, which currently is:
>>
>> p
On Sat, Feb 11, 2017 at 11:10 AM, Alex Kleider wrote:
> On 2017-02-11 00:36, eryk sun wrote:
>>
>> Note that Python 3 uses the Unicode database to determine the decimal
>> value of characters, if any. It's not limited to the ASCII decimal
>> digits 0-9. For example:
>>
>> >>> s
>> '௧꘢୩'
>
On Sat, Feb 11, 2017 at 11:10 AM, Alex Kleider wrote:
> Also of interest (at least to me) was the 'magic' you demonstrated in the
> print function parameter list; my efforts to figure it out:
Isn't this just argument unpacking? Thus the necessary "*".
word = "Hello"
print((c for c in
On Fri, Feb 10, 2017 at 7:59 PM, boB Stepp wrote:
> I have been following the thread "int vs. float"
> (https://mail.python.org/pipermail/python-list/2017-February/719287.html)
> on the main list. A search for the OP on the Tutor archive came up
> negative, so I am hoping he is not following Tuto
On 11/02/17 15:28, Pooja Bhalode wrote:
> I am trying to create a label and an entry widget. I am not able to
> understand as to how to access the value input by the user in the entry
> widget.
>
> Label(frame1, text = "Number of species:").grid(row=0, column = 1, sticky=W)
> entrynumberspecies =
On 2017-02-11 00:36, eryk sun wrote:
On Sat, Feb 11, 2017 at 8:06 AM, Steven D'Aprano
wrote:
Valid digits for integers include 0 through 9 in decimal
Note that Python 3 uses the Unicode database to determine the decimal
value of characters, if any. It's not limited to the ASCII decimal
digits
Hi,
I am trying to create a label and an entry widget. I am not able to
understand as to how to access the value input by the user in the entry
widget.
Label(frame1, text = "Number of species:").grid(row=0, column = 1, sticky=W)
entrynumberspecies = Entry(frame1)
entrynumberspecies.grid(row=0, co
On Sat, Feb 11, 2017 at 01:00:11PM +1100, Ben Finney wrote:
> boB Stepp writes:
>
> > I was playing around with type() tonight. If I type (pun intended), I get:
> >
> > py3: type(5)
> >
>
> Ceci n'est pas un ‘int’.
[...]
> https://en.wikipedia.org/wiki/The_Treachery_of_Images>
For anyone int
On Fri, Feb 10, 2017 at 07:34:35PM -0600, boB Stepp wrote:
> I was playing around with type() tonight. If I type (pun intended), I get:
>
> py3: type(5)
>
>
> So I naively thought a test for type int should go like:
>
> py3: type(5) == ""
> False
The interactive intepreter is great, but you
On Sat, Feb 11, 2017 at 8:06 AM, Steven D'Aprano wrote:
> Valid digits for integers include 0 through 9 in decimal
Note that Python 3 uses the Unicode database to determine the decimal
value of characters, if any. It's not limited to the ASCII decimal
digits 0-9. For example:
>>> s
'௧꘢୩'
On Fri, Feb 10, 2017 at 07:59:04PM -0600, boB Stepp wrote:
> He cannot figure out how to reliably tell if the user's input is an
> integer, float or neither. So I thought I would come up with my
> solution, which currently is:
>
> py3: def ck_input():
> ... value_to_ck = input('Enter a numbe
On Sat, Feb 11, 2017 at 7:35 AM, boB Stepp wrote:
> Has this PEP been implemented yet? I am running Python 3.5.2 and it
> appears not to work. Also, in "What's New In Python 3.6"
> (https://docs.python.org/3/whatsnew/3.6.html) I did not see a mention
> of it.
You can see in the document header
19 matches
Mail list logo