[Tutor] unclear topic

2013-01-14 Thread Matthew Ngaha
hey guys, this is not really a Python question. When ever im doing a
tutorial, it could be pygame or some gui application, i usually find
everything straight forward until the demonstration involves drawing.
Then maths is applied and i can't follow along as easily. In the end
by commenting out certain lines of code, i understand what each line
is doing but the fact is im still faced with being very weak at
drawing and working out the logic behind it. I also can't imagine if
im designing a program and need to do drawings of my own how i would
work out the calculations and be able to think for myself. The help im
asking for is what do i need to study to be able to design my own
programs that involve drawing? do i need to go off and learn maths? if
so which type? some sort of geometry? or do i start studying some sort
of physics? or does the answer lie within some framework/library
python tutorial?

on amazon ive seen:

maths books
physics book
2d engine physics books(box2d etc)
game physics books -  http://www.amazon.co.uk/Game-Physics-/dp/147103397X/


my other problem is i don't want to over do it. do i need to buy a
game physics book, if all i want to do is understand how to implement
my own calculations for complex objects etc? then again maybe that's
not so bad. If you know your way around this stuff? what did you learn
that gave you these skills?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] unclear topic

2013-01-14 Thread Prasad, Ramit
Matthew Ngaha wrote:
> hey guys, this is not really a Python question. When ever im doing a
> tutorial, it could be pygame or some gui application, i usually find
> everything straight forward until the demonstration involves drawing.
> Then maths is applied and i can't follow along as easily. In the end
> by commenting out certain lines of code, i understand what each line
> is doing but the fact is im still faced with being very weak at
> drawing and working out the logic behind it. I also can't imagine if
> im designing a program and need to do drawings of my own how i would
> work out the calculations and be able to think for myself. The help im
> asking for is what do i need to study to be able to design my own
> programs that involve drawing? do i need to go off and learn maths? if
> so which type? some sort of geometry? or do i start studying some sort
> of physics? or does the answer lie within some framework/library
> python tutorial?
> 
> on amazon ive seen:
> 
> maths books
> physics book
> 2d engine physics books(box2d etc)
> game physics books -  http://www.amazon.co.uk/Game-Physics-/dp/147103397X/
> 
> 
> my other problem is i don't want to over do it. do i need to buy a
> game physics book, if all i want to do is understand how to implement
> my own calculations for complex objects etc? then again maybe that's
> not so bad. If you know your way around this stuff? what did you learn
> that gave you these skills?

You should at least have enough math knowledge to understand Cartesian 
coordinates systems. Once you think of things in terms of objects 
based on their the coordinate location (x, y, z) it becomes easier 
to place objects where you want them and move them. Some trigonometry/
algebra might also be helpful.

I (personally) would not buy a game physics book unless you are 
looking to create a 3D game or a 2D game with an actual physics engine 
(e.g. World of Goo). Of course, this is based on my personal 
experience and education which may vastly vary from your own. Or, 
as they say "on them internets," YMMV. 


~Ramit


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] unclear topic

2013-01-14 Thread Kal Sze
On 15 January 2013 05:19, Prasad, Ramit  wrote:
>
> Matthew Ngaha wrote:
> > hey guys, this is not really a Python question. When ever im doing a
> > tutorial, it could be pygame or some gui application, i usually find
> > everything straight forward until the demonstration involves drawing.
> > Then maths is applied and i can't follow along as easily. In the end
> > by commenting out certain lines of code, i understand what each line
> > is doing but the fact is im still faced with being very weak at
> > drawing and working out the logic behind it. I also can't imagine if
> > im designing a program and need to do drawings of my own how i would
> > work out the calculations and be able to think for myself. The help im
> > asking for is what do i need to study to be able to design my own
> > programs that involve drawing? do i need to go off and learn maths? if
> > so which type? some sort of geometry? or do i start studying some sort
> > of physics? or does the answer lie within some framework/library
> > python tutorial?
> >
> > on amazon ive seen:
> >
> > maths books
> > physics book
> > 2d engine physics books(box2d etc)
> > game physics books -  http://www.amazon.co.uk/Game-Physics-/dp/147103397X/
> >
> >
> > my other problem is i don't want to over do it. do i need to buy a
> > game physics book, if all i want to do is understand how to implement
> > my own calculations for complex objects etc? then again maybe that's
> > not so bad. If you know your way around this stuff? what did you learn
> > that gave you these skills?
>
> You should at least have enough math knowledge to understand Cartesian
> coordinates systems. Once you think of things in terms of objects
> based on their the coordinate location (x, y, z) it becomes easier
> to place objects where you want them and move them. Some trigonometry/
> algebra might also be helpful.
>
> I (personally) would not buy a game physics book unless you are
> looking to create a 3D game or a 2D game with an actual physics engine
> (e.g. World of Goo). Of course, this is based on my personal
> experience and education which may vastly vary from your own. Or,
> as they say "on them internets," YMMV.
>
>
> ~Ramit
>
>
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at http://www.jpmorgan.com/pages/disclosures/email.
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor


Hi Matthew,

Knowledge of Lineage Algebra is also invaluable. It forms the basis
for geometric transformations in 2D and 3D.

~Kal
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Why doesn't line n execute before line n+1?

2013-01-14 Thread DoanVietTrungAtGmail
Dear tutors

In learning about the __call__ magic method, in the code below I
deliberately omitted __call__ and, as expected, I got the error message
"TypeError: 'Test' object is not callable". But I am surprised that the
print statement was not executed, even though the interpreter sees it
first. Why is that?

I thought that the Python interpreter executes line by line. That is, in
the code below,:
-First, it executes the class definition because these 2 lines are what it
sees first
-Second, it creates an instance of the class Test, called test
-Third, it executes the print statement
-Only then would it encounter the error of calling the instance as if it
were callable

class Test(object):
pass
test  = Test()
print "I am puzzled. Why isn't this line printed?"
test()

Making the puzzle worse for me, when I tried adding another print statement
before the test = Test() line, the interpreter behaved as I expected!

Trung
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Why doesn't line n execute before line n+1?

2013-01-14 Thread Mitya Sirenef

On Mon 14 Jan 2013 10:14:24 PM EST, DoanVietTrungAtGmail wrote:

Dear tutors

In learning about the __call__ magic method, in the code below I
deliberately omitted __call__ and, as expected, I got the error
message "TypeError: 'Test' object is not callable". But I am surprised
that the print statement was not executed, even though the interpreter
sees it first. Why is that?

I thought that the Python interpreter executes line by line. That is,
in the code below,:
-First, it executes the class definition because these 2 lines are
what it sees first
-Second, it creates an instance of the class Test, called test
-Third, it executes the print statement
-Only then would it encounter the error of calling the instance as if
it were callable

class Test(object):
pass
test  = Test()
print "I am puzzled. Why isn't this line printed?"
test()

Making the puzzle worse for me, when I tried adding another print
statement before the test = Test() line, the interpreter behaved as I
expected!

Trung


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


It does print the line for both in 2.7 and 3.3.  - mitya


--
Lark's Tongue Guide to Python: http://lightbird.net/larks/
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Why doesn't line n execute before line n+1?

2013-01-14 Thread DoanVietTrungAtGmail
Yes you are right, it was printed. I think my eyes are tired. I left the
PC, came back, and saw your reply plus the printed line. Thanks Mitya, and
I apologise to everyone about false alarm! The answer of 42 was staring at
me and I didn't see it.

Trung

On Tue, Jan 15, 2013 at 2:33 PM, Mitya Sirenef wrote:

> On Mon 14 Jan 2013 10:14:24 PM EST, DoanVietTrungAtGmail wrote:
>
>> Dear tutors
>>
>> In learning about the __call__ magic method, in the code below I
>> deliberately omitted __call__ and, as expected, I got the error
>> message "TypeError: 'Test' object is not callable". But I am surprised
>> that the print statement was not executed, even though the interpreter
>> sees it first. Why is that?
>>
>> I thought that the Python interpreter executes line by line. That is,
>> in the code below,:
>> -First, it executes the class definition because these 2 lines are
>> what it sees first
>> -Second, it creates an instance of the class Test, called test
>> -Third, it executes the print statement
>> -Only then would it encounter the error of calling the instance as if
>> it were callable
>>
>> class Test(object):
>> pass
>> test  = Test()
>> print "I am puzzled. Why isn't this line printed?"
>> test()
>>
>> Making the puzzle worse for me, when I tried adding another print
>> statement before the test = Test() line, the interpreter behaved as I
>> expected!
>>
>> Trung
>>
>>
>> __**_
>> Tutor maillist  -  Tutor@python.org
>> To unsubscribe or change subscription options:
>> http://mail.python.org/**mailman/listinfo/tutor
>>
>
> It does print the line for both in 2.7 and 3.3.  - mitya
>
>
> --
> Lark's Tongue Guide to Python: http://lightbird.net/larks/
> __**_
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/**mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor