> How would I go about creating custom GUI elements? For example,
> if I wanted to make a simple LEGO maker app, how would I write the
> code for the bricks so that the user could drag them around and then
> build LEGO models?
For 2D legos, using the wxPython widget toolkit, you could probab
Thanks to everyone who replied. Some of the methods presented where some I
had thought of, others were new to me. Particularly, I did not realize I
could apply a slice to a list. The for x in some_stuff[:value] form worked
very well for my purposes. I can also see I need to look into the ite
On 9/4/2010 10:14 AM, lists wrote:
Hi folks,
I'm new to Python, I'm working my way through some intro books, and I
have a question that I wonder if someone could help me with please?
This is my attempt at solving an exercise where the program is
supposed to flip a coin 100 times and then tell
On Sun, 5 Sep 2010 08:39:07 am lists wrote:
> while tossNo <= 99:
> coinToss = random.randint
Move that out of the loop. There's no need to make the assignment 100
times.
> tossNo += 1
> if coinToss(1,2) == 1:
> heads += 1
> else:
> tails += 1
Rather than count
>> if coinToss(1,2) == 1:
>> heads += 1
>> tossNo += 1
>> else:
>> tails += 1
>> tossNo += 1
>
> Looking good. You can hoist "tossNo += 1" out of each branch of your if
> statement too, if you like, to make it even more streamlined (In
> other words, execute
> if coinToss(1,2) == 1:
> heads += 1
> tossNo += 1
> else:
> tails += 1
> tossNo += 1
Looking good. You can hoist "tossNo += 1" out of each branch of your if
statement too, if you like, to make it even more streamlined (In
other words, execute it once, righ
>> On 9/4/10, lists wrote:
>> > Hi folks,
>> >
>> > I'm new to Python, I'm working my way through some intro books, and I
>> > have a question that I wonder if someone could help me with please?
>> >
>> > This is my attempt at solving an exercise where the program is
>> > supposed to flip a coin 1
"aug dawg" wrote
How would I go about creating custom GUI elements? For example, if I
wanted
to make a simple LEGO maker app, how would I write the code for the
bricks
so that the user could drag them around and then build LEGO models?
You find the nearest widget to what you want then you
- Original message -
> On 9/4/10, lists wrote:
> > Hi folks,
> >
> > I'm new to Python, I'm working my way through some intro books, and I
> > have a question that I wonder if someone could help me with please?
> >
> > This is my attempt at solving an exercise where the program is
> > su
Bill Allen wrote:
Say I have and iterable called some_stuff which is thousands of items in
length and I am looping thru it as such:
for x in some_stuff
etc...
However, what if I want only to iterate through only the first ten items of
some_stuff, for testing purposes. Is there a concise
On Sat, Sep 4, 2010 at 1:40 PM, aug dawg wrote:
> Hey guys,
>
> How would I go about creating custom GUI elements? For example, if I wanted
> to make a simple LEGO maker app, how would I write the code for the bricks
> so that the user could drag them around and then build LEGO models?
>
> Thanks
lists wrote:
Hi folks,
I'm new to Python, I'm working my way through some intro books, and I
have a question that I wonder if someone could help me with please?
This is my attempt at solving an exercise where the program is
supposed to flip a coin 100 times and then tell you the number of
heads
On Sun, 5 Sep 2010 03:14:24 am Bill Allen wrote:
> Say I have and iterable called some_stuff which is thousands of items
> in length and I am looping thru it as such:
>
> for x in some_stuff
> etc...
>
> However, what if I want only to iterate through only the first ten
> items of some_stuff,
On 04/09/2010 18:29, Sander Sweers wrote:
On 4 September 2010 19:25, Sander Sweers wrote:
for x in some_stuff:
if x<= 10:
print x
else:
break
Oops, corrected version...
count = 0
for x in some_stuff:
if count< 10:
print x
count +=1
else:
Hey guys,
How would I go about creating custom GUI elements? For example, if I wanted
to make a simple LEGO maker app, how would I write the code for the bricks
so that the user could drag them around and then build LEGO models?
Thanks!
___
Tutor mailli
On 4 September 2010 19:25, Sander Sweers wrote:
> for x in some_stuff:
> if x <= 10:
> print x
> else:
> break
Oops, corrected version...
count = 0
for x in some_stuff:
if count < 10:
print x
count +=1
else:
break
Greets
Sander
___
On 4 September 2010 19:14, Bill Allen wrote:
> Say I have and iterable called some_stuff which is thousands of items in
> length and I am looping thru it as such:
>
> for x in some_stuff
> etc...
>
> However, what if I want only to iterate through only the first ten items of
> some_stuff, for
if its a dictionary, then I think you will need to use limit
if its normal array you can use range(0,10) and access some_stuff[i]
On Sat, Sep 4, 2010 at 10:44 PM, Bill Allen wrote:
> Say I have and iterable called some_stuff which is thousands of items in
> length and I am looping thru it as su
Say I have and iterable called some_stuff which is thousands of items in
length and I am looping thru it as such:
for x in some_stuff
etc...
However, what if I want only to iterate through only the first ten items of
some_stuff, for testing purposes. Is there a concise way of specifying tha
On 9/4/10, lists wrote:
> Hi folks,
>
> I'm new to Python, I'm working my way through some intro books, and I
> have a question that I wonder if someone could help me with please?
>
> This is my attempt at solving an exercise where the program is
> supposed to flip a coin 100 times and then tell y
Hi folks,
I'm new to Python, I'm working my way through some intro books, and I
have a question that I wonder if someone could help me with please?
This is my attempt at solving an exercise where the program is
supposed to flip a coin 100 times and then tell you the number of
heads and tails.
AT
> hello,
> i have to plug two functions b() and c() inside another one a();
> i wonder if the code defining b and c must be in the same text file of
> a or it is possible to import b and c somehow, hence giving the code a
> neater appearance
Definitely!
Read through http://docs.python.org/tutorial
hello,
i have to plug two functions b() and c() inside another one a();
i wonder if the code defining b and c must be in the same text file of
a or it is possible to import b and c somehow, hence giving the code a
neater appearance
thank you !
--
roberto
On Sat, 4 Sep 2010 11:57:00 am David Hutto wrote:
> First of all, I'll respond more thoroughly tomorrow, when I can
> review what you said more clearly, but for now I'll clarify.
>
> Here is the whole code that I'm using:
>
> http://pastebin.com/Ak8DFjrb
David, in genrandfiles() you say this:
"Gregory, Matthew" wrote
Is there a guideline on where instance member variables should
be set within a class? That is, is it a bad idea to set self
variables
within private member functions rather than returning them to
the enclosing caller?
There is nothing really specific to OOPP its j
25 matches
Mail list logo