Hi,
Below is my code. Hopefully it is in the correct format.
I would like to know how to ask the user the dir and file name of certain file formats (they are red in the code) and have the program take those answers and put them into the program, and re save those files with the correct file format. I have put a small sample below. It is line 11 of the program. 'C:\Temp\TestPy\y08_09sR3.sav' The directory is:C:\Temp\TestPy\. The file name would be: y08_09sR3.sav. Once the user gives the program these parameters I would like to put it into the file below on line 11 and re save it as Compare # 2.asc.
Thanks,
Joe
Example:
*C - *C PSSĀ®MUST 9.1 Response File - Recorded: Saturday, Apr 25,2009 00:31:40 *C - optn 2 9999999 3 1 *blank y pscase 'C:\Temp\TestPy\y08_09sR3.sav' acsolv/opt/adj/1 1/2 0/3 1/4 0/5 1/ gen/1 1/3 0/ sol/1 30/2 0.6/3 0/4 0/5 0.9/7 0.7/8 15/// ACSOLV/LFN *if *MUST_STATUS LE 2 then subs/read 'C:\Temp\TestPy\ACCC-MUST.sub' *blank *endif *if *MUST_STATUS LE 2 then constr 1 2.00000 2 1 3 100 4 3 5 100 6 4 7 0 8 3 9 10000 /y *endif *if *MUST_STATUS LE 2 then read 'C:\Temp\TestPy\OUC.mon' 'C:\Temp\TestPy\FL230-FMPP.con' *blank *endif *if *MUST_STATUS LE 2 then constr//excl/read/ 'C:\Temp\TestPy\NonFirmExclude.exc'// *endif *if *MUST_STATUS LE 2 then must 1 0 2 1 3 50000 4 0.03000 5 3 6 1 7 1 8 0.00000 9 0.00000 10 0.00000 /y *endif *C AC MENU shifts indirectly recorded *C >> MENU SHIFT <<<<<< /3/ MUST 1 0 2 1 3 50000 4 0.02000 5 100 6 0 7 1 8 0.00000 9 0.00000 10 0.00000 /y *C >> MENU SHIFT <<<<<< /3/ACCONT lfopt adj/1 1/2 0/3 1/4 0/5 1/ gen/1 1/3 0 /sol/1 30/2 0.6/3 0/4 0/5 0.9/7 0.7/8 15// opt/1 1/2 2 3 0 4 5/ exe *C *C Select all constraints constra bra/sel/all/ int/sel/all/ fgate/sel/all/ *blank *C *C *C Select all contingencies contin/sel/all/ *C dir/f/'ContSum.lis' *C >> MODIFIED REF TO EXCEL INTERFACE <<<<<< constr/print sum/print bviol/ *C >> REF TO TERMINAL OUTPUT <<<<<< dir/t cont/sel HSEV/100 /constraints/Branch/sel/all *C >> MODIFIED REF TO EXCEL INTERFACE <<<<<< dir/f/MonElRep/ opt/1 100/2 100//pr viol/dir/t// save/'C:\Temp\TestPy\Case1.acc' / /MUST 1 0 2 1 3 50000 4 0.03000 5 3 6 1 7 1 8 0.00000 9 0.00000 10 0.00000 /y /3/ stop [/code tag ends here][code tag starts here]
*C -
*C PSSĀ®MUST 9.1 Response File - Recorded: Saturday, Apr 25,2009 00:31:40
*C -
optn
2 9999999
3 1
*blank
y
pscase
'C:\Temp\TestPy\y08_09sR3.sav'
acsolv/opt/adj/1 1/2 0/3 1/4 0/5 1/
gen/1 1/3 0/
sol/1 30/2 0.6/3 0/4 0/5 0.9/7 0.7/8 15///
ACSOLV/LFN
*if *MUST_STATUS LE 2 then
subs/read
'C:\Temp\TestPy\ACCC-MUST.sub'
*blank
*endif
*if *MUST_STATUS LE 2 then
constr
1 2.00000
2 1
3 100
4 3
5 100
6 4
7 0
8 3
9 10000
/y
*endif
*if *MUST_STATUS LE 2 then
read
'C:\Temp\TestPy\OUC.mon'
'C:\Temp\TestPy\FL230-FMPP.con'
*blank
*endif
*if *MUST_STATUS LE 2 then
constr//excl/read/ 'C:\Temp\TestPy\NonFirmExclude.exc'//
*endif
*if *MUST_STATUS LE 2 then
must
1 0
2 1
3 50000
4 0.03000
5 3
6 1
7 1
8 0.00000
9 0.00000
10 0.00000
/y
*endif
*C AC MENU shifts indirectly recorded
*C >> MENU SHIFT <<<<<<
/3/
MUST
1 0
2 1
3 50000
4 0.02000
5 100
6 0
7 1
8 0.00000
9 0.00000
10 0.00000
/y
*C >> MENU SHIFT <<<<<<
/3/ACCONT
lfopt
adj/1 1/2 0/3 1/4 0/5 1/
gen/1 1/3 0
/sol/1 30/2 0.6/3 0/4 0/5 0.9/7 0.7/8 15//
opt/1 1/2 2
3 0
4 5/
exe
*C
*C Select all constraints
constra
bra/sel/all/
int/sel/all/
fgate/sel/all/
*blank
*C
*C
*C Select all contingencies
contin/sel/all/
*C
dir/f/'ContSum.lis'
*C >> MODIFIED REF TO EXCEL INTERFACE <<<<<<
constr/print sum/print bviol/
*C >> REF TO TERMINAL OUTPUT <<<<<<
dir/t
cont/sel
HSEV/100
/constraints/Branch/sel/all
*C >> MODIFIED REF TO EXCEL INTERFACE <<<<<<
dir/f/MonElRep/ opt/1 100/2 100//pr viol/dir/t//
save/'C:\Temp\TestPy\Case1.acc'
/
/MUST
1 0
2 1
3 50000
4 0.03000
5 3
6 1
7 1
8 0.00000
9 0.00000
10 0.00000
/y
/3/
stop
[/code tag ends here]