On Sat, 24 Apr 2010 03:41:04 pm David Hutto wrote:
> In previous post I asked about turtle module importing from tkinter.
> But what I don't understand is why does Tkinter default it's casnvas
> to ScrolledCanvas in turtle.py, and then as a 'metaclass' for
> ScrolledCanvas in turtle it calls TK.Fr
In previous post I asked about turtle module importing from tkinter.
But what I don't understand is why does Tkinter default it's casnvas
to ScrolledCanvas in turtle.py, and then as a 'metaclass' for
ScrolledCanvas in turtle it calls TK.Frame, which could have
been set as a default within Tkinter
Hi Marco (and everybody),
in another thread you showed your code and made extensive use of
property(). Wrongful use I might say.
Let's see an example:
>>> class C(object):
... def __init__(self): self._x = None
... def getx(self): return self._x - 10
... def setx(self, value): self.
Dear Friends,
I'm new to the list, and new to Python. The last time I've tried
anything like the below was 20 years ago on a NeXT machine, and I had
no clue what I was doing then, either.
I've gotten IDLE up and have done some hello worlding.
I am now trying to get the NLTK working on my new iM
On Sat, 24 Apr 2010 01:33:46 pm Marco Rompré wrote:
> I tried to enter model = Modele (nom_fichier) but it still does not
> work.
What does "still does not work" mean?
Please copy and paste the error you get.
> And for the list I don't understand very well,
Open an interactive session and
I tried to enter model = Modele (nom_fichier) but it still does not work.
And for the list I don't understand very well, Do you know where I can pay
someone to help with my programming.
Because I feel to annoy tutors with my basic stuff
On Fri, Apr 23, 2010 at 11:22 PM, Steven D'Aprano wrote:
> O
On Sat, 24 Apr 2010 01:07:11 pm Marco Rompré wrote:
> Here's my code:
[...]
> class Modele:
> """
> La definition d'un modele avec les magasins.
> """
> def __init__(self, nom_fichier, magasins =[]):
> self.nom_fichier = nom_fichier
> self.magasins = magasins
[...]
On Sat, 24 Apr 2010 12:27:12 pm Joson wrote:
> Hi all,
> I have a problem about variables efficiency.
99% of the time, you waste more of your time than you save by worrying
about tiny efficiencies. Saving 1 minute in a program that runs for 3
minutes is worthwhile. Saving 0.0002 seconds in a pro
Hi everybody, I would appreciate your help on this one
In this program I want to create 2 concepts each with 2 or 3 properties
My first concept is magasin(shop in french) and my shop has 3 attributes:
nom(name in french), items and ville (city in french)
the second one is items and its 2 attributes
Hi all,
I have a problem about variables efficiency.
As below, I import f from config.py, Then f is appended to app1.py global
variables.
In class App, there're two ways to use this variable. One is "self.file =f",
then use self.file; the other is using "f" directory. Which way is high
efficient?
On Sat, 24 Apr 2010 10:37:15 am Steven D'Aprano wrote:
> For the record, here's some timing benchmarks to see how badly it
> turned out:
[...]
> 0.0346097946167
> 0.461233854294
> 3.04955101013
> 5.70547604561
>
> For comparison, here's the timing on a plain binary search:
Oops, I hit send too soo
On Sat, 24 Apr 2010 09:41:05 am Alan Gauld wrote:
> "Emile van Sebille" wrote
>
> >> For completeness sake, on a 1 item list, using the in operator
> >> takes *in the worst case* around 7 seconds.
> >
> > Well on my system checking for the last element of a 100k item list
> > returns true almo
Bien,
>for starters please get rid of all those set_ methods. They are
> doing nothing, it's not pythonic. Just assign the value straight away.
> e.g.: from """ item01.set_prix("999.99") """ to """ item01.prix =
"999.99" """
>
Our teacher showed us this method and in our exercise we had
On Sat, 24 Apr 2010 01:22:54 am David Hutto wrote:
> I'm new, I touched the Holy lib, and
> didn't check to reset the original Tkinter directory before posting.
> Won't happen again.
I'm sorry we got off on the wrong foot, you caught me at a time when I
was frustrated about other things, and afte
On Sat, 24 Apr 2010 09:11:21 am Robert Berman wrote:
> Wow. I feel I have just been b…h slapped across the face.
There's no need to be so sensitive.
> I think
> Hugo’s test results pretty much confirmed ‘in’ is not the way to go
If that is the *only* thing you have learned from this email threa
D'Oh!
Of course!
I feel like a right pillock now.
Cheers for that though.
--
James
At Saturday, 24-04-2010 on 0:39 Jerry Hill wrote:
On Fri, Apr 23, 2010 at 6:41 PM, James Chapman wrote:
> Hi there gurus and everyone else. This is my first post to this
group, and
> I'm turning here because I
"James Chapman" wrote
import smtplib
and when I run it, I get this:
import email.utils
ImportError: No module named utils
And I can also confirm that email.utils exists
Definitely looks like a fault in the install/configure setup.
Is there an __init__.py file in the emails folder?
B
"Emile van Sebille" wrote
For completeness sake, on a 1 item list, using the in operator
takes *in the worst case* around 7 seconds.
Well on my system checking for the last element of a 100k item list
returns true almost upon hitting the enter key. Surely 7 seconds for a
list 1/10th the
On Fri, Apr 23, 2010 at 6:41 PM, James Chapman wrote:
> Hi there gurus and everyone else. This is my first post to this group, and
> I'm turning here because I'm stumped and search engines are not helping.
> I've used smtplib for a few things already and while wanting to use it again
> today, I'm
"Robert Berman" wrote
But, even though my years of experience using Python is less than 4 I would be
reluctant to use 'in' just based on what I have been reading from those who
took the time to answer my post. Just my $0.02 worth.
It depends, if you are transmitting the data across a slow ne
On Sat, 24 Apr 2010 07:21:13 am Alan Gauld wrote:
> "Emile van Sebille" wrote
>
> > It's expensive enough that for a list this size I'd convert it to a
> > dict and use in on that. eg,
> >
> > a = range(10)
> > d = dict(zip(a,a))
>
> Surely that would depend on how often you do the search?
>
From: tutor-bounces+bermanrl=cfl.rr@python.org
[mailto:tutor-bounces+bermanrl=cfl.rr@python.org] On Behalf Of Ricardo
Aráoz
Sent: Friday, April 23, 2010 6:33 PM
To: Hugo Arts
Cc: tutor@python.org; Emile van Sebille
Subject: Re: [Tutor] Binary search question
Hugo Arts wrote:
On Fri, Apr 2
Marco Rompré wrote:
> Its supposed to be a object magasin (shop in french) with some golf
> items in it
>
>
> class Magasin:
> """
> Le concept magasin pour la gestion d'inventaire des items de golf.
> """
> def __init__(self, nom ="", items =[] ):
> self.nom = nom
>
> -Original Message-
> From: tutor-bounces+bermanrl=cfl.rr@python.org [mailto:tutor-
> bounces+bermanrl=cfl.rr@python.org] On Behalf Of Hugo Arts
> Sent: Friday, April 23, 2010 5:55 PM
> To: Emile van Sebille
> Cc: tutor@python.org
> Subject: Re: [Tutor] Binary search question
>
>
Hi there gurus and everyone else. This is my first post to this group,
and I'm turning here because I'm stumped and search engines are not
helping.
I've used smtplib for a few things already and while wanting to use
it again today, I'm having weird things happen.
Basically, my code looks like thi
On 4/23/2010 2:55 PM Hugo Arts said...
For completeness sake, on a 1 item list, using the in operator
takes *in the worst case* around 7 seconds.
:)
Well on my system checking for the last element of a 100k item list
returns true almost upon hitting the enter key. Surely 7 seconds for a
Hugo Arts wrote:
> On Fri, Apr 23, 2010 at 11:33 PM, Emile van Sebille wrote:
>
>> On 4/23/2010 2:21 PM Alan Gauld said...
>>
>>> "Emile van Sebille" wrote
>>>
It's expensive enough that for a list this size I'd convert it to a
dict and use in on that. eg,
a = r
Its supposed to be a object magasin (shop in french) with some golf items in
it
class Magasin:
"""
Le concept magasin pour la gestion d'inventaire des items de golf.
"""
def __init__(self, nom ="", items =[] ):
self.nom = nom
self.items = items
def set_nom(se
On Fri, Apr 23, 2010 at 11:33 PM, Emile van Sebille wrote:
> On 4/23/2010 2:21 PM Alan Gauld said...
>>
>> "Emile van Sebille" wrote
>>>
>>> It's expensive enough that for a list this size I'd convert it to a
>>> dict and use in on that. eg,
>>>
>>> a = range(10)
>>> d = dict(zip(a,a))
>>>
>>
On 4/23/2010 2:21 PM Alan Gauld said...
"Emile van Sebille" wrote
It's expensive enough that for a list this size I'd convert it to a
dict and use in on that. eg,
a = range(10)
d = dict(zip(a,a))
Surely that would depend on how often you do the search? If its a one
off occurence I'd ex
"Emile van Sebille" wrote
It's expensive enough that for a list this size I'd convert it to a dict
and use in on that. eg,
a = range(10)
d = dict(zip(a,a))
Surely that would depend on how often you do the search?
If its a one off occurence I'd expect the overhead of zipping
and co
"Hugo Arts" wrote
A binary search requires data to be sorted, but works in O(log n), so
It will always be faster than a naive linear search like the in
operator performs.
Being picky but 'in' could be faster if the item searched for happens
to be very near the front of the list. "Always" is
Thank you all for your ideas and suggestions. The detailed explanations were
most useful.
Robert Berman
What you don't see with your eyes, don't invent with your mouth.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscript
On Fri, Apr 23, 2010 at 5:29 PM, Emile van Sebille wrote:
>
>
> It's expensive enough that for a list this size I'd convert it to a dict and
> use in on that. eg,
>
> a = range(10)
> d = dict(zip(a,a))
>
> 5 in d
>
you will want to nuance that statement just a little. If you're going
to
On 4/23/2010 7:05 AM Robert Berman said...
Hi,
Given a list, list1 having 100,000 non repeating, sorted integers , which of
the following methods is fastest to find an item fully understanding the item
may or may not be in the list: The binary search method which is the standard
search for such
On Fri, Apr 23, 2010 at 4:05 PM, Robert Berman wrote:
> Hi,
>
> Given a list, list1 having 100,000 non repeating, sorted integers , which of
> the following methods is fastest to find an item fully understanding the item
> may or may not be in the list: The binary search method which is the stand
Robert Berman wrote:
Hi,
Given a list, list1 having 100,000 non repeating, sorted integers , which of
the following methods is fastest to find an item fully understanding the item
may or may not be in the list: The binary search method which is the standard
search for such a small sample size,
Hi,
Given a list, list1 having 100,000 non repeating, sorted integers , which of
the following methods is fastest to find an item fully understanding the item
may or may not be in the list: The binary search method which is the standard
search for such a small sample size, or the more python type
On Fri, 23 Apr 2010 04:54:11 pm David Hutto wrote:
[...]
> > Something is screwy there. I believe you have broken your
> > installation by making changes to files without having any
> > understanding of what you are doing.
>
> My original post was incorrect: the first error should be:
>
> C:\Users\
Garry Willgoose wrote:
My
question is so simple I'm surprised I can't find an answer somewhere.
I'm interested if I can rely on the order of the directories in the
sys.path list. When I'm running a file from the comand line like
python tellusim.py
The string in entry sys.path[0] appears to b
"David Hutto" wrote
While experimenting with Tkinter(python2.6), when from Tkinter import*
is used I came across the following error:
File "C:\Python26\lib\lib-tk\Tkinter.py", line 44, in
from turtle import *
Huh? Why is Tkinter.py importing from turtle?
It doesn't in my Pyt
41 matches
Mail list logo