Hello,
I am working my way through the tutorial, and I like trying
variations, just to see what expected errors look like, and other ways
things could be written.
I tried a, b = 0, 0 and that worked.
Then I tried this to (maybe) set both a and b to 0:
>>> a, b = 0
Traceback (most recent call la
"Christopher Spears" wrote
I'm trying to move a bunch of files and directories into another
directory.
Unfortunately, I keep getting an error message:
OSError: [Errno 17] File exists: './TAPE_ARCHIVES'
The problem seems to happen when I try to move a directory into another
directory:
I
Jeff R. Allen wrote:
a, b = 0
Traceback (most recent call last):
File "", line 1, in
TypeError: 'int' object is not iterable
I understand why it doesn't work, but I don't understand the wording
of the exception. Could someone explain how I accidentally introduced
iteration into the picture
List,
How do I get a print statement to call a class method? I'm using
python 2.5. I did it long ago, but can't remember how, or even where I
learned it from. Something like:
class Foo():
def __init__(self):
pass
def ***part I can't remember goes here***
print "hello world!"
Ahoy!
On Do, 2009-11-12 at 06:34 +0300, Khalid Al-Ghamdi wrote:
> can anyone tell me why on python 2.6 i can enter os.environ and then
> get all the items that that pertain to the os while on python 3 you
> just get the following:
>
> with no items?
Seems like os.environ has changed a little si
2009/11/12 Jeff R. Allen :
> Then I tried this to (maybe) set both a and b to 0:
>
a, b = 0
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: 'int' object is not iterable
I think you are looking for.
>>> a = b = c = 300
Greets
Sander
_
On Thu, Nov 12, 2009 at 5:31 AM, Modulok wrote:
> List,
>
> How do I get a print statement to call a class method? I'm using
> python 2.5. I did it long ago, but can't remember how, or even where I
> learned it from. Something like:
>
> class Foo():
> def __init__(self):
> pass
>
> def *
You are looking for the __str__ method. See
http://docs.python.org/reference/datamodel.html#object.__str__
class Foo():
def __init__(self):
pass
def __str__(self)
return "hello world!"
-jeff
___
Tutor maillist - Tutor@python.org
To u
On Thu, Nov 12, 2009 at 5:29 AM, Jeff R. Allen wrote:
> You are looking for the __str__ method. See
> http://docs.python.org/reference/datamodel.html#object.__str__
>
> Can't you also implement __repr__?
(bottom-posted for Dave)
-Luke
___
Tutor maillis
On Wed, Nov 11, 2009 at 10:34 PM, Khalid Al-Ghamdi wrote:
> hi,
> can anyone tell me why on python 2.6 i can enter os.environ and then get all
> the items that that pertain to the os while on python 3 you just get the
> following:
>
> with no items?
I think this is perhaps an oversight in Python
On Thu, Nov 12, 2009 at 6:35 AM, Luke Paireepinart
wrote:
>
>
> On Thu, Nov 12, 2009 at 5:29 AM, Jeff R. Allen wrote:
>>
>> You are looking for the __str__ method. See
>> http://docs.python.org/reference/datamodel.html#object.__str__
>>
> Can't you also implement __repr__?
Yes, in fact if you ar
On Thu, Nov 12, 2009 at 6:00 AM, Kent Johnson wrote:
>
>
> Defining __repr__ will give the custom representation when you just
> give the name of the object:
>
> In [5]: class Foo2():
> ...: def __repr__(self):
> ...: return "I'm a Foo2"
> ...:
> ...:
>
> In [6]: f2=Foo2()
>
Hi guys,
Im trying to do something and hit a bit of a wall, potentially im
going about this the wrong way. Essentially the problem is:
features file contains
rt='''text'''
import features
a = 'rt'
print features.rt #this works
print features.a #this fails
I need to use features.a as i am ite
"Stefan Lesicnik" wrote
features file contains
rt='''text'''
import features
a = 'rt'
print features.rt #this works
print features.a #this fails
Because you defined a in your current file.
You need to define it in features.
I need to use features.a as i am iterating through a list and
On Thu, Nov 12, 2009 at 4:38 PM, Alan Gauld wrote:
>
> "Stefan Lesicnik" wrote
>
>> features file contains
>> rt='''text'''
>>
>> import features
>>
>> a = 'rt'
>> print features.rt #this works
>> print features.a #this fails
>
> Because you defined a in your current file.
> You need to define
Jeff R. Allen wrote:
Hello,
I am working my way through the tutorial, and I like trying
variations, just to see what expected errors look like, and other ways
things could be written.
I tried a, b = 0, 0 and that worked.
Then I tried this to (maybe) set both a and b to 0:
a, b = 0
Kent Johnson wrote:
On Thu, Nov 12, 2009 at 6:35 AM, Luke Paireepinart
wrote:
On Thu, Nov 12, 2009 at 5:29 AM, Jeff R. Allen wrote:
You are looking for the __str__ method. See
http://docs.python.org/reference/datamodel.html#object.__str__
Can't you also implement __repr__?
Stefan Lesicnik wrote:
Hi guys,
Im trying to do something and hit a bit of a wall, potentially im
going about this the wrong way. Essentially the problem is:
features file contains
rt='''text'''
import features
a = 'rt'
print features.rt #this works
print features.a #this fails
I need to u
On Thu, Nov 12, 2009 at 6:26 PM, bob gailer wrote:
> Stefan Lesicnik wrote:
>>
>> Hi guys,
>>
>> Im trying to do something and hit a bit of a wall, potentially im
>> going about this the wrong way. Essentially the problem is:
>>
>> features file contains
>> rt='''text'''
>>
>> import features
>>
>
On Thu, 2009-11-12 at 00:05 -0600, Wayne Werner wrote:
>
>
> On Wed, Nov 11, 2009 at 10:10 PM, andré palma
> wrote:
> Hi all!
> I'm developing a django web application but i'm having a
> trouble with
> the internationalization.
>
>
> I don't know much about D
"bob gailer" wrote
I need to use features.a as i am iterating through a list and a would
be the different features i want to check if they exist, and then use
the variable.
I hope that makes sense, or if anyone has any suggestion on how
properly to do this!
Even though Alan missed your poin
Stefan Lesicnik wrote:
On Thu, Nov 12, 2009 at 6:26 PM, bob gailer wrote:
Stefan Lesicnik wrote:
Hi guys,
Im trying to do something and hit a bit of a wall, potentially im
going about this the wrong way. Essentially the problem is:
features file contains
rt='text'''
import features
Hi Guys
I am trying to create a simple test COM server , but am have trouble
assigning any property value to it through excel VBA.
Please point out where i am going wrong.
#COM server
class test(object):
_reg_clsid_ = "{B5901450-F9A1-4F76-8FCF-2BFFA96ED210}"
_reg_progid_ = "Python.Test
"Yashwin Kanchan" wrote
I am trying to create a simple test COM server , but am have trouble
assigning any property value to it through excel VBA.
I've never tried using properties via COM.
Does it work if you disable the property aspect and expose
the set/get methods directly? Can you access
24 matches
Mail list logo