471,337 Members | 1,177 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Help with List

1
Hi.I'm very interesting in Python programing, i'm starting with a program with but I have one question. I do a list with append that changes the hue each time and the saturation and brightness is the same.

todos=[]
todos.append('color('+str(hue) + ',' + str(saturacion)+ ',' + str(brillo)+')')
print todos

['color(0.27777778,100,100)', 'color(0.55555556,100,100)', 'color(0.83333334,100,100)', 'color(1.11111112,100,100)', 'color(1.3888889,100,100)', 'color(1.66666668,100,100)', 'color(1.94444446,100,100)'...etc

The problem arrive because i need to do for example:

fill(todos[0])

and it's imposible because the list appears with , i need transform or make different the list without and i don't now how, i need something like that.

[color(0.27777778,100,100), color(0.55555556,100,100), color(0.83333334,100,100), color(1.11111112,100,100), color(1.3888889,100,100), color(1.66666668,100,100), color(1.94444446,100,100)...etc

thank for your time and excuse me for my poor english.
Jul 28 '07 #1
1 968
bartonc
6,596 Expert 4TB
Hi.I'm very interesting in Python programing, i'm starting with a program with but I have one question. I do a list with append that changes the hue each time and the saturation and brightness is the same.

todos=[]
todos.append('color('+str(hue) + ',' + str(saturacion)+ ',' + str(brillo)+')')
print todos

['color(0.27777778,100,100)', 'color(0.55555556,100,100)', 'color(0.83333334,100,100)', 'color(1.11111112,100,100)', 'color(1.3888889,100,100)', 'color(1.66666668,100,100)', 'color(1.94444446,100,100)'...etc

The problem arrive because i need to do for example:

fill(todos[0])

and it's imposible because the list appears with , i need transform or make different the list without and i don't now how, i need something like that.

[color(0.27777778,100,100), color(0.55555556,100,100), color(0.83333334,100,100), color(1.11111112,100,100), color(1.3888889,100,100), color(1.66666668,100,100), color(1.94444446,100,100)...etc

thank for your time and excuse me for my poor english.
I think that you are looking for
Expand|Select|Wrap|Line Numbers
  1. fill(eval(todos[0]))
Jul 28 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by wukexin | last post: by
5 posts views Thread by jhon02148 | last post: by
7 posts views Thread by Christian Christmann | last post: by
5 posts views Thread by Steve Patrick | last post: by
2 posts views Thread by Foodbank | last post: by
2 posts views Thread by duncanblacksmithmath | last post: by
1 post views Thread by Rahul | last post: by
83 posts views Thread by deppy_3 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.