On Tue, 02 Sep 2014 16:13:39 -0400, Seymore4Head
wrote:
>I still can't get the syntax
>test='Hey buddy get away from my car'
>if test[0].alpha():
>return True
I have a huge head cold right now. Never mind the question.
Sorry
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Sep 2, 2014 at 3:13 PM, Seymore4Head
wrote:
> I still can't get the syntax
> test='Hey buddy get away from my car'
> if test[0].alpha():
> return True
>
My guess is you meant isalpha(), as Mark indicated. Here's a cheap way to
see what an object can do:
>>> test='Hey buddy get away
On 02/09/2014 21:13, Seymore4Head wrote:
I still can't get the syntax
test='Hey buddy get away from my car'
if test[0].alpha():
return True
isalpha?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.p
On Wed, Sep 3, 2014 at 6:13 AM, Seymore4Head
wrote:
> I still can't get the syntax
> test='Hey buddy get away from my car'
> if test[0].alpha():
> return True
If that's not in a function, "return" makes no sense, as the
SyntaxError will have told you. As to the actual check, that's
isalpha(),
On 9/2/14 4:13 PM, Seymore4Head wrote:
I still can't get the syntax
test='Hey buddy get away from my car'
if test[0].alpha():
return True
A really good skill to learn early on is how to ask for help. You need
to tell us what you expected it to do, and also what it did that
displeased y
En Thu, 19 Mar 2009 19:33:36 -0300, Ryan Kelly escribió:
newCylinderTempertature = newCylinderTemperature + deltaTemp
Take a careful look at the variable name here: "Tempertature". Python's
dynamic nature provides a lot of wonderful benefits, but you've just hit
one of the drawbacks
In article ,
Linuxguy123 wrote:
>
>I've got a small piece of code that I don't understand. Basically, a
>variable inside an if statement inside a for loop doesn't seem to be
>updating. Is this a scope issue ?
Nope, it's a spelling issue. I suggest you change your code to a more
readable:
new
Linuxguy123 gmail.com> writes:
>
>
> Hi people.
>
> I've got a small piece of code that I don't understand. Basically, a
> variable inside an if statement inside a for loop doesn't seem to be
> updating. Is this a scope issue ?
No, it's because you mispelled the variables.
--
http://ma
> newCylinderTempertature = newCylinderTemperature + deltaTemp
Take a careful look at the variable name here: "Tempertature". Python's
dynamic nature provides a lot of wonderful benefits, but you've just hit
one of the drawbacks - you don't get any protection from typos in
variable names.
On Jan 30, 11:03 am, Linuxguy123 wrote:
> I'm trying to build a small Python app in Eclipse under Fedora 10.
>
> I have the following code:
>
> import os
> import sys
> import pexpect
>
> child = pexpect.spawn('/bin/bash')
> child.interact()
>
> When I run it in Eclipse, I get:
>
> Traceback (most
In article <[EMAIL PROTECTED]>,
Larry Bates <[EMAIL PROTECTED]> wrote:
> Because datetime is a new-style class:
Ah.
> The Constructor __new__
>
> If you are like me, then you probably always thought of the __init__ method
> as
> the Python equivalent of what is called a constructor in C++. Th
Because datetime is a new-style class:
The Constructor __new__
If you are like me, then you probably always thought of the __init__ method as
the Python equivalent of what is called a constructor in C++. This isn't the
whole story.
When an instance of a class is created, Python first calls the _
Well what do you know, that worked! It's one of those errors that you
can't see yourself, but someone else can see it instantly.
Thanks,
Jeremy
--
http://mail.python.org/mailman/listinfo/python-list
jeremito wrote:
> I have written a simple C++ program in my efforts to learn how to
> extend Python. It is shown below. Everything compiles and installs
> correctly, but I get strange answers. I know the function "Pi" is
> correct because when I call it from a C++ code it gives the correct
> ans
Jeremy Moles <[EMAIL PROTECTED]> wrote:
> Am I misunderstanding something fundamental about the builtin __*
> functions? Can they not be "static?"
They can and must be static when their specification say they are (e.g.,
__new__) and they cannot and must not be static when their specification
says
On Fri, 2005-10-28 at 14:50 -0400, Chris Lambacher wrote:
> I think what you really want is:
>
> try:
> # this will fail and be caught
> # below, w
> import foobar
>
> except ImportError, error:
> class foobarclass:
> def __getattr__(*args, **kargs):
>
I think what you really want is:
try:
# this will fail and be caught
# below, w
import foobar
except ImportError, error:
class foobarclass:
def __getattr__(*args, **kargs):
return None
foobar = foobarclass()
print fo
17 matches
Mail list logo