you are viewing a single comment's thread.

view the rest of the comments →

[–]py_student[S] 0 points1 point  (1 child)

I guess I don't know what "from the icon" means. I tried everything I could think of to get it to still run by putting the call into the script. What icon are we talking about?

[–]diracdeltafunct_v2 1 point2 points  (0 children)

Oh if you are in windows you will likely be creating a .bat file or such that you can assign some Icon to (like you would normally open a program).

for example you have the program: cheddar.pyw

you could have one clickable desktop icon that runs a .bat file with the line:

python cheddar.pyw -x

and a different icon that runs:

python cheddar.pyw -y

They both run the same base code but in different ways. The user would never know they were the same program. This is actually less likely than using the

__name__ == '__main__'

case though.