Ask Your Question
0

psspy.runrspnsfile(Idev_file)

asked 2015-02-13 11:57:16 -0500

anonymous user

Anonymous

Hello folks,

I'm having a hard time to run this code to run a multiple Idev files from a python code. When I run this function for a single idev file, for example: psspy.runrspnsfile('example.idv'), it works great! But what I'm trying to do is to make a loop that which iteration, it reads from a given txt file (with a list of idev file names) and executes this function:

f = open(giventextfile, 'r') # This file contains a list of idev file names. while 1: varname = f.readline() psspy.runrspnsfile(varname) ... break f.close()

So even though the path for each idev file is correct I'm getting this error below:

File not found. "blablabla.idv" (OPENIDV/OPNSEA)

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-02-13 13:26:01 -0500

jconto gravatar image

The API runrspnsfile works fine inside a loop. Please check again the path of the individuals IDVs files being passed to runrspnsfile, in relation to the working folder. Print "varname" after being read. Print the current working directory [print os.getcwd()].

edit flag offensive delete link more
0

answered 2015-02-13 13:53:01 -0500

john_smith gravatar image

Thanks for the response jconto.

The working folder and where the individuals Idevs are not the same. But, in the text file from where I read those Idevs, I'm giving the full path, so each line of has for example, 1st line: P:\folder\file1.idv, 2nd line: P:\folder\file2.idv, and so on.

Anyways, I don't know, maybe it not the way to do it! :(

edit flag offensive delete link more

Comments

I think 'varname' contains also the "end-of-line" character, as read by readline(). When you print 'varname', do you get two lines? If so, replace '\n' with ''

jconto gravatar imagejconto ( 2015-02-13 20:28:54 -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

Stats

Asked: 2015-02-13 11:57:16 -0500

Seen: 1,074 times

Last updated: Feb 13 '15