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
  • Hey guys,
     
    I just came across this discussion.
     
    @Kent:
     
    • Is your Qt-related suggested approach still valid?
    • Have new features been developed in ADAMS 2018?
    • Or where are we now wrt. Python implementation?
    • Is there a set of propotype Python code (Alpha, beta, whatever) stuff we can nibble at?
     
    At this point, my main hurdle is how to get data or input from ADAMS to Python in a structured approach.
     
    What I do now is mayor clunky:
    1. get the user input in a AView dialog,
    2. Store them in global vars in AView and
    3. Spoon them out in a Python module.
     
    But being able to directly build Python scripts with automated AView dialog box generation (in Qt?) would be an enormous step to get me going further, and motivate me to invest more in Python in ADAMS !!!!!,
     
    At this point, motivation is - 45.6 %
     
    Hope it helps,
     
    Regards,
     
    Chris
Reply
  • Hey guys,
     
    I just came across this discussion.
     
    @Kent:
     
    • Is your Qt-related suggested approach still valid?
    • Have new features been developed in ADAMS 2018?
    • Or where are we now wrt. Python implementation?
    • Is there a set of propotype Python code (Alpha, beta, whatever) stuff we can nibble at?
     
    At this point, my main hurdle is how to get data or input from ADAMS to Python in a structured approach.
     
    What I do now is mayor clunky:
    1. get the user input in a AView dialog,
    2. Store them in global vars in AView and
    3. Spoon them out in a Python module.
     
    But being able to directly build Python scripts with automated AView dialog box generation (in Qt?) would be an enormous step to get me going further, and motivate me to invest more in Python in ADAMS !!!!!,
     
    At this point, motivation is - 45.6 %
     
    Hope it helps,
     
    Regards,
     
    Chris
Children
No Data