hexagon logo

Simple input in python script

Hello everyone, i am learning python, and trying simple programs using python in Adams.
My problem is how to ask for input string:
 
Something like:
name=input()
 
is giving error such:
 
File "<string>", line 1, in <module>
EOFError: EOF when reading a line
 
or macros in adams python should be just script without input?
 
Jozef
Parents
  • Hi Jozef,
     
    Sorry: I should have addressed your question directly: you are correct: input() should work but it doesn't.
    The interpreter shell in Adams/View isn't the "usual" Python shell that you interact with. We have to do some input processing on anything that's typed in, unfortunately. Initially multi-line commands (for, def, while, if) didn't work properly and we had to do some special things to get around that. I'll log a defect report on input() and hope that we can fix it for a future version.
     
    I think that our final goal is to provide the 'standard' Python shell that can be incorporated into another tool, like a debugger. Then everything would just work properly and we wouldn't have limitations on the command line behaviour...
     
    Thanks,
    Kent
Reply
  • Hi Jozef,
     
    Sorry: I should have addressed your question directly: you are correct: input() should work but it doesn't.
    The interpreter shell in Adams/View isn't the "usual" Python shell that you interact with. We have to do some input processing on anything that's typed in, unfortunately. Initially multi-line commands (for, def, while, if) didn't work properly and we had to do some special things to get around that. I'll log a defect report on input() and hope that we can fix it for a future version.
     
    I think that our final goal is to provide the 'standard' Python shell that can be incorporated into another tool, like a debugger. Then everything would just work properly and we wouldn't have limitations on the command line behaviour...
     
    Thanks,
    Kent
Children
No Data