On 3/5/06, ingo <[EMAIL PROTECTED]> wrote:
Yep. I was suggesting calling printtime as part of your *call* to main, not when you define main. Sorry to be unclear.
It appeared from your code that you never bound printtime to a variable name when you called it (in fact, I don't remember you ever actually *calling* it but I may be misremembering.) If it's not bound to a variable name, the function does its work and the return value just disappears into the ether. So - to capture the return value, bind the function call to a variable name. Or, alternately, pass the function call directly as the argument for the function, in your case main(), that wants to use the return value, such as:
main(printtime(strf=None))
Note that, when you define main in the first place, you'll need to ensure that it takes a parameter like:
def main(pt):
dosomethingwith pt
so that when you later call main(), you can pass it an argument like primetime() or whatever variable name you bound primetime()'s return value to.
Hope that makes more sense.
Anna
in news:[EMAIL PROTECTED] Kent Johnson wrote:
>>>>[...]
>>>
>>>main(printtime(strf=None))
>>>
>>>[...]
>>
>> Anna,
>>
>> that results in an syntax error / invalid syntax
>
> It's very helpful to show the actual error and traceback.
>
Sorry, here it is:
File "D:\Ingo\PyScript\VIDEOC~1.9\_ij\_time_lapse.py", line 23
def main(printtime(strf=None)):
^
SyntaxError: invalid syntax
Yep. I was suggesting calling printtime as part of your *call* to main, not when you define main. Sorry to be unclear.
It appeared from your code that you never bound printtime to a variable name when you called it (in fact, I don't remember you ever actually *calling* it but I may be misremembering.) If it's not bound to a variable name, the function does its work and the return value just disappears into the ether. So - to capture the return value, bind the function call to a variable name. Or, alternately, pass the function call directly as the argument for the function, in your case main(), that wants to use the return value, such as:
main(printtime(strf=None))
Note that, when you define main in the first place, you'll need to ensure that it takes a parameter like:
def main(pt):
dosomethingwith pt
so that when you later call main(), you can pass it an argument like primetime() or whatever variable name you bound primetime()'s return value to.
Hope that makes more sense.
Anna
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor