Joshua Kugler wrote:
"Beautiful is better than ugly."
And I think putting parenthesis around a multi-line statement is much
prettier.
So there! :)
j
And PEP 8 agrees with you. Another vote for parens.
-Jordan
--
http://mail.python.org/mailman/listinfo/python-list
T. Crane wrote:
> Hi,
>
> If I define a class like so:
>
> class myClass:
> import numpy
> a = 1
> b = 2
> c = 3
>
> def myFun(self):
> print a,b,c
> return numpy.sin(a)
>
>
> I get the error that the global names a,b,c,numpy are not defined. Fairly
> stra
[EMAIL PROTECTED] wrote:
> Hi,
> Any ideas of what could be the problem?
>
Hard to say without seeing your code.
Jordan Greenberg
--
Posted via a free Usenet account from http://www.teranews.com
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney wrote:
> Jordan Greenberg <[EMAIL PROTECTED]> writes:
>
>> [EMAIL PROTECTED] wrote:
>>> This is a test message, please ignore.
>> I could do that, but reminding you that test messages go in *.test
>> groups is way more fun.
>
> I'
[EMAIL PROTECTED] wrote:
> This is a test message, please ignore.
I could do that, but reminding you that test messages go in *.test
groups is way more fun. And there are about a billion of them to choose
from. The great thing about test groups is that when you use them, you
don't clutter up my (a
4
> 3
> 2
> 1
>>> def printreverse(lst):
if lst:
printreverse(lst[1:])
print lst[:1][0]
>>> printreverse([1,2,3,4])
No good reason at all to do it this way. But recursion is fun.
-Jordan Greenberg
--
Posted via a free Usenet account from http://www.teranews.com
--
http://mail.python.org/mailman/listinfo/python-list
d
Universities:
UniversityID
Name
City
Etc,etc)
In general, when you're having trouble representing something in a
database, it helps to break it down and model the smaller relationships
first, and use those as building blocks to model the whole relationship.
HTH.
Jordan Greenberg
ect (or medium sized, or anything more then a few lines,
really) this gets really unwieldy really quickly (imagine if you had
thousands of functions! Madness!) Terry's suggestion is a much better
solution then this. If this looks easier, consider changing the rest of
your program before klud
x=1
while not x==3:
if x==1:
print 'hello'
x = input('what is x now?: ')
if x==2:
print 'hello again'
x=input('what is x now?: ')
any code you want to repeat needs to be in some sort of a loop
structure. Program execution doesn't just jump around unless you t
in the parameter list, **param gets a dict of arguments that dont
correspond to somthing in the formal parameter list.
More & examples in the python docs:
http://docs.python.org/tut/node6.html#SECTION00672
--
Jordan T. Greenberg
--
http://mail.python.org/mailman/listinfo/python
I see no problem with finding existing code on the Internet and used to
learn a subject, so long as it isn't just stolen and handed in as is.
I guess I still believe people are good, no matter how hard Usenet and
IRC tries to convince me otherwise.
--
http://mail.python.org/mailman/listinfo/pyth
11 matches
Mail list logo