Martin P. Hellwig ha scritto:
On 05/04/10 12:59, superpollo wrote:
Martin P. Hellwig ha scritto:
<cut>
For the corner cases (I can think of a couple) it is good to know you
can use ';' most of the time.


most but not always as i noted (think about loops or function definition)

Well through in some exec magic then, for example:
for number in [1,2,3,4]:
    def nprint(number):
        print(number)
    number += 1
    nprint(number

translates to:

>>> exec('for number in [1,2,3,4]:\n\tdef nprint(number):\n\t\tprint(number)\n\tnumber += 1\n\tnprint(number)')
2
3
4
5

But if you have an example why indentation is still a problem please give it :-)


i think your exec example solved most of my problems. thanks a lot.

bye

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to