Thanks, James, but John Gordon identified my usage error so I'm good
to go now.
On Mon, 14 May 2012 09:28:06 -0700 (PDT), james hedley
wrote:
>On Monday, 14 May 2012 17:01:49 UTC+1, Steve Sawyer wrote:
>> Brand-new to Python (that's a warning, folks)
>>
>> Trying to write a routine to import a
On Monday, 14 May 2012 17:01:49 UTC+1, Steve Sawyer wrote:
> Brand-new to Python (that's a warning, folks)
>
> Trying to write a routine to import a CSV file into a SQL Server
> table. To ensure that I convert the data from the CSV appropriately,
> I"m executing a query that gives me the schema (
On Tue, May 15, 2012 at 5:09 AM, Steve Sawyer wrote:
> Thanks - now, given my query that returns the table structure, this
> works fine:
>
> table_dict = {}
> table_specs = cursor.execute(query_string)
> for row in table_specs:
> row_dict = {}
> row_dict['type'] = row.DataType
>
Thanks, John.
>What are you trying that isn't working?
Typical newbie trick - trying to make things more complicated than
they are. I didn't realize that syntax would establish the key/value
pairs of the dictionary - I thought that would only allow you to
establish the value to correspond to a spe
In Steve Sawyer
writes:
> What I think I want to do is to construct a dictionary using the
> column names as the index value, and a list containing the various
> attributes (data type, lenghth, precision).
If you're using just the column name as the dictionary key, make sure
there are no dupli
Steve Sawyer wrote:
Brand-new to Python (that's a warning, folks)
Trying to write a routine to import a CSV file into a SQL Server
table. To ensure that I convert the data from the CSV appropriately,
I"m executing a query that gives me the schema (data column names,
data types and sizes) from th
On Tue, May 15, 2012 at 2:01 AM, Steve Sawyer wrote:
> Brand-new to Python (that's a warning, folks)
It's one we're familiar with :) Welcome!
> Trying to write a routine to import a CSV file into a SQL Server
> table. To ensure that I convert the data from the CSV appropriately,
> I"m executing
Brand-new to Python (that's a warning, folks)
Trying to write a routine to import a CSV file into a SQL Server
table. To ensure that I convert the data from the CSV appropriately,
I"m executing a query that gives me the schema (data column names,
data types and sizes) from the target table.
What
Hi
It turns out I should have used
t=turtle.Pen()
and not
t=turtle.pen()
My stupid mistake!
"Neil" wrote in message
news:jyydnb8xe8hpoghunz2dnuvz8juwn...@bt.com...
> Thanks everyone!
>
> It appears the info in the book is wrong. Trying what you have all
> suggested
> has got it to work!
>
Thanks everyone!
It appears the info in the book is wrong. Trying what you have all suggested
has got it to work!
Many thanks, and I am sure I will be back here again with other newbie
problems!
Neil
"Neil" wrote in message
news:ifidnr_gysdmfqhunz2dnekdnzzin...@bt.com...
> Hello
>
> Sorry if
On Feb 18, 4:16 pm, "Neil" wrote:
> Hello
>
> Sorry if this is not an appropriate newsgroup for this problem. I am very
> new to Python but not new to programming.
>
> I am hoping to use Python to teach a class and have been looking at the
> online book 'Snake Wrangling for Kids'.
>
> I have follo
Neil wrote:
Forgot to say, that after the error message the turtle window 'hangs' as
unresponsive ...
"Neil" wrote in message
news:ifidnr_gysdmfqhunz2dnekdnzzin...@bt.com...
Hello
I am hoping to use Python to teach a class and have been looking at the
online book 'Snake Wrangling for Kids'.
Thanks for the very speedy reply!
Not sure what your reply means but I have emailed the author with the
problem!
Cheers
Neil
"sjbrown" wrote in message
news:9ba48cb7-d32b-40ef-a6a6-d22508863...@l33g2000pri.googlegroups.com...
It looks like there may be a bug if you were expecting t to be som
It looks like there may be a bug if you were expecting t to be some
object other than a dict. You can apparently contact the authour
here:
http://www.briggs.net.nz/log/contact/
On Feb 18, 2:16 pm, "Neil" wrote:
> Hello
>
> Sorry if this is not an appropriate newsgroup for this problem. I am ver
Forgot to say, that after the error message the turtle window 'hangs' as
unresponsive ...
"Neil" wrote in message
news:ifidnr_gysdmfqhunz2dnekdnzzin...@bt.com...
> Hello
>
> Sorry if this is not an appropriate newsgroup for this problem. I am very
> new to Python but not new to programming.
>
Hello
Sorry if this is not an appropriate newsgroup for this problem. I am very
new to Python but not new to programming.
I am hoping to use Python to teach a class and have been looking at the
online book 'Snake Wrangling for Kids'.
I have followed the example
>>>import turtle
>>>t=turtle.pe
John Dann wrote:
I'm learning Python using the Komodo Edit freeware code editor. One
thing I'm finding a little confusing is that the code completion lists
(what I would call Intellisense coming from a .Net background) are
often very incomplete, especially with imported classes like wx. It's
like
I'm learning Python using the Komodo Edit freeware code editor. One
thing I'm finding a little confusing is that the code completion lists
(what I would call Intellisense coming from a .Net background) are
often very incomplete, especially with imported classes like wx. It's
like KE can't look far
On 12/01/08 00:23 +0100, Hrvoje Niksic wrote:
> "Faber J. Fedor" <[EMAIL PROTECTED]> writes:
> > Does this '("" if not where...' syntax actually work?
>
> http://docs.python.org/whatsnew/pep-308.html
C'mon! I'm in Day Two of learning Python. You can't expect me to be
reading "What's New" docs a
On 11/01/08 18:29 -0500, Mike Meyer wrote:
> It is a 2.5 feature, though.
I was beginning to wonder of that was the case.
> I converted all my clients to 2.5.1,
> shortly after it was available, and haven't used anything older
> since. Sorry 'bout that.
No prob.
--
Regards,
Faber Fedor
"Faber J. Fedor" <[EMAIL PROTECTED]> writes:
> On 10/01/08 22:53 -0500, Mike Meyer wrote:
>> Personally, I think it would be more pythonic to not try and use two
>> different APIs to walk the list of jobs (... One Way To Do it):
>>
>> def __call__(self, where=None):
>> q = "select * from %s"
On Fri, 11 Jan 2008 18:11:41 -0500 "Faber J. Fedor" <[EMAIL PROTECTED]> wrote:
> On 10/01/08 22:53 -0500, Mike Meyer wrote:
> > Personally, I think it would be more pythonic to not try and use two
> > different APIs to walk the list of jobs (... One Way To Do it):
> >
> > def __call__(self, where
On 10/01/08 22:53 -0500, Mike Meyer wrote:
> Personally, I think it would be more pythonic to not try and use two
> different APIs to walk the list of jobs (... One Way To Do it):
>
> def __call__(self, where=None):
> q = "select * from %s" % (self.name,) + ("" if not where else (" where
> %s
On Thu, 10 Jan 2008 20:32:06 -0500 "Faber J. Fedor" <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm in the process of learning Python by writing a job queue program.
> Nothing fancy, mind you, just read from a table, shell out to a program,
> write back to the table.
>
> I'm working off of the tuto
Hi all,
I'm in the process of learning Python by writing a job queue program.
Nothing fancy, mind you, just read from a table, shell out to a program,
write back to the table.
I'm working off of the tutorial listed here (amongst many places):
http://www.devx.com/dbzone/Article/22093
In my Jobs c
On Mon, 19 Nov 2007 16:06:36 -0500, Sells, Fred wrote:
>> >>> a, b = [], []
>> >>> a.append(b)
>> >>> b.append(a)
> did you perhaps mean a.append('b'); b.append('a'); otherwise this seems
> pretty advanced for a newbie
If you had bothered to read the rest of the post, you'd see that he meant
exa
> >>> a, b = [], []
> >>> a.append(b)
> >>> b.append(a)
did you perhaps mean a.append('b'); b.append('a'); otherwise this seems pretty
advanced for a newbie
> >>> b in a
> True
> >>> a in a
> Traceback (most recent call last):
> File "", line 1, in
> RuntimeError: maximum recursion depth exce
En Mon, 19 Nov 2007 03:32:12 -0300, saccade <[EMAIL PROTECTED]> escribió:
> So if I am permitted to think of integers as immutable objects with
> predefined labels (i.e. the integers used in the text of the program
> code) that cannot de or re referenced then what a similar treatment of
> characte
>
> On Nov 17, 4:35 am, John Machin <[EMAIL PROTECTED]> wrote:
>> Worse: Consider z = ['A1', 'Z9']. It's highly likely that when x ==
>> 'A1', "x is_in z" is True -- because an unguaranteed implementation-
>> dependent caper caches or "interns" some values, so that x and z[0]
>> are the same objec
On Nov 19, 12:32 am, saccade <[EMAIL PROTECTED]> wrote:
> I am not a programmer so I feel odd commenting about language design
> decisions. When my Prof. introduced python the first question that
> popped into mind was that since "x=9; y=9; print x is y and x == y"
> prints "True" is there a way t
On Nov 17, 3:40 am, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
>
> You can write your own membership test based on identity ('is'):
>
Thank you for the practical (usable) advice and explanation of the
'==' operator.
On Nov 17, 4:35 am, John Machin <[EMAIL PROTECTED]> wrote:
>
> And that can
On Nov 17, 6:02 pm, saccade <[EMAIL PROTECTED]> wrote:
> >>> a, b = [], []
> >>> a.append(b)
> >>> b.append(a)
> >>> b in a
> True
> >>> a in a
>
> Traceback (most recent call last):
> File "", line 1, in
> RuntimeError: maximum recursion depth exceeded in cmp
>
> >>> a is a[0]
> False
> >>> a =
En Sat, 17 Nov 2007 04:02:12 -0300, saccade <[EMAIL PROTECTED]> escribió:
a, b = [], []
a.append(b)
b.append(a)
b in a
> True
a in a
> Traceback (most recent call last):
> File "", line 1, in
> RuntimeError: maximum recursion depth exceeded in cmp
a is a[0]
>
>>> a, b = [], []
>>> a.append(b)
>>> b.append(a)
>>> b in a
True
>>> a in a
Traceback (most recent call last):
File "", line 1, in
RuntimeError: maximum recursion depth exceeded in cmp
>>>
>>> a is a[0]
False
>>> a == a[0]
Traceback (most recent call last):
File "", line 1, in
RuntimeError:
On 2006-08-02, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
>> I find that a strange purpose because when you are working on a class,
>> you don't necessarily know if you will ever know many instance of that
>> class. So should I use __slots__ in all my classes, just to be sure
>> for when someone w
In <[EMAIL PROTECTED]>, Antoon Pardon wrote:
> On 2006-07-28, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> This avoids the problem but you get others in return. And it's an
>> abuse of `__slots__` which is meant as a way to save memory if you need
>> really many objects of that type an
> I find that a strange purpose because when you are working on a class,
> you don't necessarily know if you will ever know many instance of that
> class. So should I use __slots__ in all my classes, just to be sure
> for when someone wants many instances of one?
I find that a strange reasoning b
On 2006-07-28, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>>
>> class MyClass(object):
>>
>> __slots__ = ('bar',)
>>
>> def func(self):
>> return 123
>>
>> x = MyClass()
>> x.instance_var_not_defined_in_the_class = 456
>> ==>
>> AttributeError: 'MyClass' object has no a
Ben Sizer wrote:
> Ray wrote:
> But remember, at no point did they think to make that stuff
> deliberately hard so that it would give you safety. It's hard because
> the implementation is relatively complex. The flipside of that is
> writing function objects in C++, which are an ugly hack to get a
Ray wrote:
> Yeah, I know... but the thing is that it's easy to "do it". Say in C++,
> you can rebind the method of a class to another function if you want
> to, you can muck around with the vtable and stuff, but you've gotta do
> something different than, say, a normal assignment.
But remember, a
Bruno Desthuilliers wrote:
> Ray wrote:
> > Bruno Desthuilliers wrote:
> > Actually Bruno, don't you think that the notion of flexibility in
> > Python comes at the expense of "security" is simply due to the fact
> > that the syntax of "screw up" is exactly the same as the syntax of "I
> > mean it
In <[EMAIL PROTECTED]>, Timo wrote:
> Steve Jobless kirjoitti:
>
>> Let's say the class is defined as:
>>
>> class MyClass:
>> def __init__(self):
>> pass
>> def func(self):
>> return 123
>>
>> But from the outside of the class my interpreter let me do:
>>
>> x = MyClass()
Ray wrote:
> Bruno Desthuilliers wrote:
>>> I'd rather let a machine to do that. Wasn't computer created for tasks
>>> like this? (No, not really. But...)
>> There's obviously a trade-off between 'security' and flexibility. As I
>> said, I do make lots of typo too, but OTOH the edit/test cycle in P
Steve Jobless wrote:
> Bruno Desthuilliers wrote:
>> Steve Jobless wrote:
>>> Sybren Stuvel wrote:
>>>
Steve Jobless enlightened us with:
> The first case can be just a typo, like:
>
> x.valeu = 5
>
> I make typos all the time. Without a spell checker, this message
>>
Steve Jobless wrote:
> Unfortunately, I don't see a way
> to separate interface from implementation in Python. So, it may not make
> much difference whether you subclass it or hack it from the outside.
Documentation. (And name-mangling, underscore prepending, all the stuff
the others said.) Whenev
Steve Jobless kirjoitti:
> Let's say the class is defined as:
>
> class MyClass:
> def __init__(self):
> pass
> def func(self):
> return 123
>
> But from the outside of the class my interpreter let me do:
>
> x = MyClass()
> x.instance_var_not_defined_in_the_class = 456
>
Ben Sizer wrote:
> Ray wrote:
> > Actually Bruno, don't you think that the notion of flexibility in
> > Python comes at the expense of "security" is simply due to the fact
> > that the syntax of "screw up" is exactly the same as the syntax of "I
> > mean it this way and I do want it"?
> >
> > Per
Ray wrote:
> Actually Bruno, don't you think that the notion of flexibility in
> Python comes at the expense of "security" is simply due to the fact
> that the syntax of "screw up" is exactly the same as the syntax of "I
> mean it this way and I do want it"?
>
> Perhaps if we use a different synta
In <[EMAIL PROTECTED]>, Steve Jobless wrote:
> Bruno Desthuilliers wrote:
>>
>> Steve Jobless wrote:
>> > But what about adding a method to the class? Am I supposed to ask "Is
>> > anyone using name xxx?"
>>
>> assert 'xxx' not in dir(SomeClassOrObject)
>>
>> > The class may be used by develop
Bruno Desthuilliers wrote:
> > I'd rather let a machine to do that. Wasn't computer created for tasks
> > like this? (No, not really. But...)
>
> There's obviously a trade-off between 'security' and flexibility. As I
> said, I do make lots of typo too, but OTOH the edit/test cycle in Python
> is u
Bruno Desthuilliers wrote:
>
> Steve Jobless wrote:
> > Sybren Stuvel wrote:
> >
> >>Steve Jobless enlightened us with:
> >>
> >>>The first case can be just a typo, like:
> >>>
> >>> x.valeu = 5
> >>>
> >>>I make typos all the time. Without a spell checker, this message
> >>>would be unreadable :
Steve Jobless wrote:
> Sybren Stuvel wrote:
> >
> > Steve Jobless enlightened us with:
> > > The first case can be just a typo, like:
> > >
> > > x.valeu = 5
> > >
> > > I make typos all the time. Without a spell checker, this message
> > > would be unreadable :).
> >
> > Then learn to read what
Bruno Desthuilliers wrote:
> Ray wrote:
> > Bruno Desthuilliers wrote:
> >
> >>Ray wrote:
> >>Ray, please, don't top-post
> >
> >
> > Um, top-post? I'm using Google News and it looks like it is placed
> > correctly in the thread... or you're referring to a different thing?
>
> http://en.wikipedia.
Ray wrote:
> Bruno Desthuilliers wrote:
>
>>Ray wrote:
>>Ray, please, don't top-post
>
>
> Um, top-post? I'm using Google News and it looks like it is placed
> correctly in the thread... or you're referring to a different thing?
http://en.wikipedia.org/wiki/Top-posting
--
bruno desthuilliers
Bruno Desthuilliers wrote:
> Ray wrote:
> Ray, please, don't top-post
Um, top-post? I'm using Google News and it looks like it is placed
correctly in the thread... or you're referring to a different thing?
Ray
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> Ray wrote:
>
> > The argument against this is that since development with Python is so
> > rapid, you're supposed to always equip your code with extensive unit
> > tests. I like Python but I've never really bought that argument--I
> > guess I've been doing Java too long :)
> >
Sybren Stuvel wrote:
> Ray enlightened us with:
> > Huh? No. The compiler will always tell you. Have you ever tried Java
> > before?
>
> I know what I'm talking about, I've got a degree in Computer Science
> from the University of Amsterdam.
Then how come you didn't know that the Java compiler wi
Steve Jobless wrote:
> Sybren Stuvel wrote:
>
>>Steve Jobless enlightened us with:
>>
>>>The first case can be just a typo, like:
>>>
>>> x.valeu = 5
>>>
>>>I make typos all the time. Without a spell checker, this message
>>>would be unreadable :).
>>
>>Then learn to read what you type, as you ty
Ray wrote:
> The argument against this is that since development with Python is so
> rapid, you're supposed to always equip your code with extensive unit
> tests. I like Python but I've never really bought that argument--I
> guess I've been doing Java too long :)
>
In Java, if you don't always e
Ray wrote:
Ray, please, don't top-post
(snip)
> Also having to check whether a name has already existed can be a major
> pain in the butt with Python.
assert 'somename' not in dir(someObject)
(snip)
> Regarding the lack of privacy,
s/privacy/language-inforced access restriction/
> --I guess
Sybren Stuvel wrote:
> Ray enlightened us with:
> > Also having to check whether a name has already existed can be a
> > major pain in the butt with Python. With Java you always know when a
> > name has already existed, and what type is bound to the name. I
> > consider this to be a Good Thing (tm
Hey Steve,
Yes, I agree with you. The lack of checking can get confusing fast.
It's not about typing without errors. Regardless of how you train as
long as you're human you WILL make typos.
Also having to check whether a name has already existed can be a major
pain in the butt with Python. With J
Sybren Stuvel wrote:
>
> Steve Jobless enlightened us with:
> > The first case can be just a typo, like:
> >
> > x.valeu = 5
> >
> > I make typos all the time. Without a spell checker, this message
> > would be unreadable :).
>
> Then learn to read what you type, as you type it. Typing without
Steve Jobless:
> I'm hearing that "they are features, but don't use them."
You can use them if you know why you are doing it.
You can also take a look at PyChecker and PyLint, they may help you.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
On 7/26/06, Steve Jobless <[EMAIL PROTECTED]> wrote:
> If I was working on a large project with many engineers, I'd assume
> someone will do things like this sooner or later. I've seen many
> horrendous code in my life and I have no control over who I work with.
If you work with cowboys, not P
Steve Jobless wrote:
>
> Hi,
>
> I just started learning Python. I went through most of the tutorial at
> python.org. But I noticed something weird. I'm not talking about the
> __private hack.
>
> Let's say the class is defined as:
>
> class MyClass:
> def __init__(self):
> pass
>
Steve Jobless wrote:
> Hi,
>
> I just started learning Python. I went through most of the tutorial at
> python.org. But I noticed something weird. I'm not talking about the
> __private hack.
Actually this is __ultra_private. For normal privacy, _private is enough !-)
> Let's say the class is def
Steve Jobless wrote:
> Hi,
>
> I just started learning Python. I went through most of the tutorial at
> python.org. But I noticed something weird. I'm not talking about the
> __private hack.
>
> Let's say the class is defined as:
>
> class MyClass:
> def __init__(self):
> pass
> def
See:
http://redhanded.hobix.com/inspect/monkeypytching.html
Shouldn't be done unless you have a really cool reason for doing so.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 25 Jul 2006 02:49:06 GMT, Steve Jobless <[EMAIL PROTECTED]> wrote:
>Hi,
>
>I just started learning Python. I went through most of the tutorial at
>python.org. But I noticed something weird. I'm not talking about the
>__private hack.
>
>Let's say the class is defined as:
>
> class MyClass:
Hi,
I just started learning Python. I went through most of the tutorial at
python.org. But I noticed something weird. I'm not talking about the
__private hack.
Let's say the class is defined as:
class MyClass:
def __init__(self):
pass
def func(self):
return 123
But from th
hi all,
i am new to python programming, so thanks for your patience in advance.
I have a small script that I am working on that i want to restart
multiple instances of apaches on our developers servers. We have about
25 developers each with their own apache.
import sys, os
try:
file = open(
Pretty tough to beat Alan Gauld, but the more examples the merrier for
me, and the infogami has plenty of those. Thanks.
http://www.freenetpages.co.uk/hp/alan.gauld/tutclass.htm
rpd
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> Couldn't we also say that this issue of namespace scope is a little more
> specific to Python than OOP in general? I could very easily be wrong,
> but I wouldn't want the poster to think that this is how OOP works always.
No, the confusion in the OP was between class attrib
[EMAIL PROTECTED] wrote:
> Thanks guys,
>
> It is starting to make much more sense. Most documentation I find about
> OO is very academic
Couldn't we also say that this issue of namespace scope is a little more
specific to Python than OOP in general? I could very easily be wrong,
but I wouldn't
[EMAIL PROTECTED] wrote:
> It is starting to make much more sense. Most documentation I find about
> OO is very academic
you may find Jay Parlar's new python class tutorial helpful:
http://parlar.infogami.com/pytut_classes_copy
(this is a proposed addition/replacement for the class chapter
Thanks guys,
It is starting to make much more sense. Most documentation I find about
OO is very academic
--
http://mail.python.org/mailman/listinfo/python-list
J Rice wrote:
> Someone should correct me if I'm wrong but:
> If
> you want to change myVar for the whole class, you need to reference it
> as self.myVar.
>
wrong: If you want to change myVar for the whole *class*, you need to
reference it as Obj.myVar (prefix with classname).
self.myVar will c
On 2006-04-13, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I just started with Python and I am new to OO programming.
> Here is a simple code:
> "
> class Obj:
> myVar = 1
>
> def __init__(self):
> myVar = 2
>
> #
>
>
> myObj = Obj()
>
> print myObj.myVar
> "
>
Someone should correct me if I'm wrong but:
If you add "print myVar" to __init__, you will see that myVar is
assigned to "2" in that function. It doesn't change the assignment of
"1" in the class because myVar in __init__ is local to __init__. If
you want to change myVar for the whole class, yo
[EMAIL PROTECTED] wrote:
> Hi,
>
> I just started with Python and I am new to OO programming.
> Here is a simple code:
> "
> class Obj:
> myVar = 1
>
> def __init__(self):
> myVar = 2
>
> #
>
>
> myObj = Obj()
>
> print myObj.myVar
> "
>
> The output is of this scri
Hi,
I just started with Python and I am new to OO programming.
Here is a simple code:
"
class Obj:
myVar = 1
def __init__(self):
myVar = 2
#
myObj = Obj()
print myObj.myVar
"
The output is of this script is '1'. I would except it to be '2'.
I not understanding
Well, my Perl way of doing it would be to have all attributes in a dict
(hash), then create the accessor vi a dynamic function. I knew Python
would have a right way to do it for Python, but when I went looking I
neglected to look at the core of the language. I suppose I'm just too
accustomed to the
Ben Wilson <[EMAIL PROTECTED]> wrote:
>I would like to dynamically assign object attributes:
>
>dict = {
> a : 1,
> b : 2,
>}
>
>for key,val in dict :
> obj.key = val
>
>I've googled to no effect, or maybe I'm needing to be hit with the
>appropriately sized clue-by-four.
The conventional clue-by-
No problem. There are, in fact, ugly class-based methods of doing this.
You could assign to an instance's __dict__ dictionary, or -- if the
class is a new-style class -- you can call the __setattr__(self, name,
value) method.
--
http://mail.python.org/mailman/listinfo/python-list
That's it. I should spend more time R-ingTFM. I kept looking for some
class-based solution and there was a built in. Perfectly logical.
Thanks,
Ben
--
http://mail.python.org/mailman/listinfo/python-list
Take a look at the built-in function setattr:
http://ftp.python.org/doc/lib/built-in-funcs.html#l2h-64
--
http://mail.python.org/mailman/listinfo/python-list
I would like to dynamically assign object attributes:
dict = {
a : 1,
b : 2,
}
for key,val in dict :
obj.key = val
To get:
print obj.a
1
I've googled to no effect, or maybe I'm needing to be hit with the
appropriately sized clue-by-four. Any assistance would be appreciated.
Regards,
Ben
Thanks, exactly what I was looking for.
I should go and buy you book ;-)
Bernd
Fredrik Lundh wrote:
> "Bernd" wrote:
>
>
>>I'm on a Linux env and try to get
>>word completion form sdtin done,
>>like Perl's
>> $stdin = Complete( "\t: ", @choices );
>>
>>What I have so far shows me the directory
"Bernd" wrote:
> I'm on a Linux env and try to get
> word completion form sdtin done,
> like Perl's
> $stdin = Complete( "\t: ", @choices );
>
> What I have so far shows me the directory listing
> on the second hit on TAB and not the list of
> choices on the first like I wanted to have.
your com
Hi,
I'm on a Linux env and try to get
word completion form sdtin done,
like Perl's
$stdin = Complete( "\t: ", @choices );
What I have so far shows me the directory listing
on the second hit on TAB and not the list of
choices on the first like I wanted to have.
Any help appreciated,
Ber
[EMAIL PROTECTED] wrote:
> Hi,
>
> I want to display a window containing an image and when I move the
> mouse over the image and click on the left Mb, I want to get the
> position of the mouse on the image.
> I listed the code to view the image below (so far so good) but for some
> reason the EVT_
Hi,
I want to display a window containing an image and when I move the
mouse over the image and click on the left Mb, I want to get the
position of the mouse on the image.
I listed the code to view the image below (so far so good) but for some
reason the EVT_LEFT_DOWN/UP does not work.
Any idea w
Hi "Py's",
is there anyone who has written a kind of converter (?) for visualizing
python-classes with "poseidon for uml"?
I couldn't find a plug-in-hint(?) on the HP; or am I looking wrong?
A good hint to another free tool would be also nice.
(I only want to see if I am totally wrong with self
On Mon, 28 Mar 2005 08:42:22 -0600, Larry Bates wrote:
> Others have answered your specific question, I thought I
> would add some suggestions (not tested):
>
> 1) You don't need a separate set_title method. You can
> change the title attribute at any time by just saying
> m.title="new title".
Others have answered your specific question, I thought I
would add some suggestions (not tested):
1) You don't need a separate set_title method. You can
change the title attribute at any time by just saying
m.title="new title". No method is required unless you
need to do some pre/post processing
A subject line should say what the message is about, for example
"Create HTML tag using objects (newbie Q)"
and enable people who are not interested in or knowledgable about a
topic to skip it, while grabbing the attention of people who are
knowledgable/interested.
--
http://mail.
On Mon, 28 Mar 2005 01:15:34 +, Jp Calderone wrote:
>
> Notice that you have a method named "url" as well as an attribute
> named "url". You have the same problem for "thumb". These methods
> and attributes are in collision with each other. When you try to
> look up the
On Sun, 27 Mar 2005 17:06:05 -0800, Captain Dondo <[EMAIL PROTECTED]> wrote:
> [snip]
>
> def url (self):
> self.url = ...
>
> def thumb (self):
> self.thumb = ...
>
> [snip]
>
> The problem is that m.html in the test section fails with
>
> TypeError: cannot concatenat
OK, I know this is covered somewhere in Python 101, but for the life of me
I cannot figure this out. I really need a basic intro to Python book
I am trying to do something very simple - create an HTML tag using objects:
class Movie:
def __init__ (self, t="", a="", d=""):
#
1 - 100 of 109 matches
Mail list logo