Ask Your Question
0

Dismissing interactive prompt in python

asked 2020-05-25 20:19:13 -0500

boat14 gravatar image

updated 2020-05-25 20:30:45 -0500

Is it possible to interact with a PSS/e prompt using a python script?

I'm trying to initialize a case for dynamics but it has a user written model that prompts the user for a filename at initialization. I can press enter when prompted during manual initialization through the PSS/e GUI, however the command line waits for user input when I attempt to do it through a python script.

Less graceful ways of bypassing this that I can think of are:

  1. Do the initialization in the GUI, dismiss the prompt, save the .snp and .cnv files, and use that as the start point for the python scripts.
  2. Make an .idv that does the STRT command with an extra carriage return, and call the .idv from python. This also means I'd have to make a distinct .idv for each .out file or rename them before starting a separate dynamics run.
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-05-25 23:59:52 -0500

perolofl gravatar image

The python script should do the following:

  1. Write the .idv file with correct outfile name before initialization.

  2. Call the response file from python.

  3. Remove the response file.

edit flag offensive delete link more

Comments

Thanks, that's a great suggestion.

boat14 gravatar imageboat14 ( 2020-05-26 06:27:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2020-05-25 20:19:13 -0500

Seen: 313 times

Last updated: May 25 '20