Re: [Tutor] under, under

2013-05-13 Thread Jonatán Guadamuz Espinoza
On Mon, May 13, 2013 at 10:21 AM, Stafford Baines staffordbai...@yahoo.com
wrote:

 Please explain the significance of __some term__.  For example  __name__
as in

 If __name__ == ‘__main__’:

   main()

 When is the under, under used?

Section 2.3.2
http://docs.python.org/3/reference/lexical_analysis.html#reserved-classes-of-identifiers

Explain as follows:
__*__System-defined names. These names are defined by the interpreter and
its implementation (including the standard library). Current system names
are discussed in the Special method names section and elsewhere. More will
likely be defined in future versions of Python. Any use of __*__ names, in
any context, that does not follow explicitly documented use, is subject to
breakage without warning.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Running EXE file with arguments

2013-03-08 Thread Jonatán Guadamuz Espinoza
El viernes, 8 de marzo de 2013, 3n2 Solutions 3n2soluti...@gmail.com
escribió:

 Below is the shell command that works fine if ran as is:
 C:\FinalTestfix.exe -com 17 -baud 38400 -setconfig base.dat

 I'm trying to automate it using the following python command but it
 gives me an error: returned non-zero exit status 1

 subprocess.check_call(['c:/FinalTest/fix.exe', '-com 17','-baud
 38400', '-setconfig base.dat'])

 Where is the problem?


Maybe you could try to give the full path for base.dat as you did with
fix.exe




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


Re: [Tutor] First Python Test

2013-02-03 Thread Jonatán Guadamuz
El 03/02/2013, a las 06:53 a.m., Shall, Sydney
sydney.sh...@kcl.ac.uk escribió:

 Dear Alan,
 I installed Cocoa emacs successfully.
 But it does not run on OS X 10.6.8.
 The notes with it say that it was built for 10.4.
 Where may I look for an update, please?
 With many thanks for your help.
 Sydney

Maybe you can look here

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


Re: [Tutor] Set Reply-To field to Tutor@python.org

2013-01-29 Thread Jonatán Guadamuz
El 29/01/2013, a las 04:14 a.m., Oscar Benjamin
oscar.j.benja...@gmail.com escribió:

 I see the mailing list as being fundamentally a public message forum
 and only very occasionally send an off-list message.

 Often this means that the archives are incomplete, so that there is a
 thread but the part of the thread where the OP says Thanks, this is
 the solution that worked or Sorry, that's not what I meant. My
 actual problem is... is missing. Not having this information on the
 list is unhelpful. It is unhelpful for people reading the archives in
 the future, for people who keep replying to a thread that is
 essentially solved, and for people who offer suggestions and don't get
 feedback on whether their suggestions were useful.

 For me at least, it is replying off-list that requires explicit
 consideration.

The fact of giving and receiving help by a public mean, and having
this help available to others as well, complete in the archives, it's
for me enough reason to give +1 to set reply-to field to tutor
address.
If I am reading something which comes from a mailing list then I think
the most proper way to reply would be to send an answer to all the
people which originally received the same message. That way, I can
avoid duplicate answers, even better this conduct can lead to
additional complementary answers because someone can construct on
previous partial solutions/suggestions. But this needs all answers are
available to everyone.

This is my opinion. I hope my writing is understandable.

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


Re: [Tutor] reverse diagonal

2012-12-01 Thread Jonatán Guadamuz Espinoza
On Sat, Dec 1, 2012 at 9:40 AM, richard kappler richkapp...@gmail.com wrote:
 I'm working through Mark Lutz's Python, reviewing the section on lists. I
 understand the list comprehension so far, but ran into a snag with the
 matrix. I've created the matrix M as follows:

 M = [[1, 2, 3[, [4, 5, 6], [7, 8, 9]]

 then ran through the various comprehension examples, including:

 diag = [M[i][i] for i in [0, 1, 2]]

 which, of course, gave me [1, 5, 9].

 Then I tried creating revdiag, wanting to return [3, 5, 7], tried several
 different ways, never quite got what I was looking for, so I'm looking for
 guidance as I'm stuck on this idea. Here's the various attempts I made and
 the tracebacks:

 revdiag = [M[i][i] for i in [2, 1, 0]]
 revdiag
 [9, 5, 1]
 # once I saw the output, this one made sense to me.

 revdiag = [M[i][j] for i in [0, 1, 2] and for j in [2, 1, 0]]
   File stdin, line 1
 revdiag = [M[i][j] for i in [0, 1, 2] and for j in [2, 1, 0]]
^
 SyntaxError: invalid syntax

 revdiag = [M[i][j] for i in [0, 1, 2] and j in [2, 1, 0]]
 Traceback (most recent call last):
   File stdin, line 1, in module
 NameError: name 'j' is not defined

 revdiag = [M[i][j] for i in [0, 1, 2], for j in [2, 1, 0]]
   File stdin, line 1
 revdiag = [M[i][j] for i in [0, 1, 2], for j in [2, 1, 0]]
   ^
 SyntaxError: invalid syntax

 revdiag = [M[i][j] for i in [0, 1, 2], and for j in [2, 1, 0]]
   File stdin, line 1
 revdiag = [M[i][j] for i in [0, 1, 2], and for j in [2, 1, 0]]
^
 SyntaxError: invalid syntax


The way you are trying to do it would be

 revdiag = [M[i][j] for i,j in [(0,2),(1,1),(2,0)]]
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Pygame problem with mac

2012-11-18 Thread Jonatán Guadamuz Espinoza
El nov 17, 2012 11:39 a.m., Ciaran Mooney dancingb...@gmail.com
escribió:

 Hi,

 Was hoping u could help me.

 I can't seem to download a version of pygame that is compatible with
python 3.2 on my Mac powerbook with OS tiger.

You could look at this page

http://packages.debian.org/experimental/python3-pygame

Here you can get source could suited for python 3.


 I only seem to he able to get pygame for python 2.7 which i have never
used.

 Thanks
 Ciaran


 ___
 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