creating variable names by adding 2 strings?

Lee lee.reilly at ntlworld.com
Sun Jan 21 22:34:10 EST 2001


Hi there,

This is my first post here. I've got a problem, which I can find any
solutions for using my books or docs on the WWW. I would really
appreciate it if someone could tell me whether the following is
possible...

I'm creating variables in but I am having trouble creating them when
they're *named* using other variables. Here's an example;

while (p!=0):
        p+`p`= string.replace(component[control], ",", "")
        # e.g. I want 'p1 = string.replace.blah...'
        p=p-1
        control=control+1

==> SyntaxError: can't assign to operator :(

I've tried various things but I cannot find a solution. I've got a nasty
feeling that it's not possible...

If someone could confirm this or hopefully, tell me how to do it I would
be_extremely_grateful.

Thanks.

- Best regards,

Lee

--
Lee Reilly
mailto:lee.reilly at ntlworld.com

ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

</shameless plug>





More information about the Python-list mailing list