Page 1 of 1
Eviews launch options
Posted: Tue Dec 22, 2015 7:57 am
by DannyB
Hi everyone,
I'm looking for a way to launch eviews from a python script in hidden mod or minimized mod.
Today i use this line in python : os.startfile('c:\Program Files\EViews 9\EViews9_x64.exe')
But i want to know i can i launch it with an option, for example : os.startfile('c:\Program Files\EViews 9\EViews9_x64.exe' -hidden) to not display eviews for the user.
Regards,
DannyB
Re: Eviews launch options
Posted: Tue Dec 22, 2015 12:21 pm
by EViews Steve
I assume you are trying to run an EViews program when you launch it?
Try this:
Code: Select all
"C:\Program Files\EViews 9\EViews9_x64.exe" "c:\files\my.prg" /programonly
The "/programonly" option only works with EViews 9 and it will automatically shutdown EViews at the end of the program. You may have to get rid of the EXIT command at the end of your program if there is one.
Steve
Re: Eviews launch options
Posted: Wed Dec 23, 2015 4:17 am
by DannyB
Actually im doing that :
Code: Select all
try:
subprocess.call(["c:"+os.path.sep+"program files"+os.path.sep+"eviews 9"+os.path.sep+"eviews9_x86.exe", "exec", "prog1"])
except:
subprocess.call(["c:"+os.path.sep+"program files"+os.path.sep+"eviews 9"+os.path.sep+"eviews9_x64.exe", "exec", "prg1"])
I call a subprocess from python tu launch Eviews x86/x64 an execute the programm "prg1" in the EViews Addins folder. In my program prg, at the end i have the "exit" function.
I tried exit and programonly options, but the same thing still remaining... The user can view starting EViews image and the GUI...
Nevermind, if i cant launch EViews in hidden mode i want to launch him un minimized tray.
Regards,
DannyB
Re: Eviews launch options
Posted: Wed Dec 23, 2015 8:55 am
by EViews Steve
Danny:
Make sure you test your command line options with a Windows shortcut to the EViews executable first before trying to call it from Python. The /programonly option should work for you, but you may need to update your copy of EViews 9 to the latest version. Go to our eviews.com/download page to download the latest patch.
Also, we do provide a COM automation interface for using EViews has a hidden application. You can read about that from our
whitepaper. I'm not familiar with Python myself, but I believe you can create and use COM objects. I found a "comtypes" library that might be useful here:
http://starship.python.net/crew/theller/comtypes
Steve
Re: Eviews launch options
Posted: Wed Oct 02, 2024 11:50 pm
by johansamuelsson
Hi,
I’m running this batch code. As I understand it, Eviews should run without opening, but when I execute this line, Eviews opens. What could be wrong?
Code: Select all
"C:\Program Files\EViews 14\EViews14.exe" "C:\Temp\Test.prg" /programonly
Regards Johan
Re: Eviews launch options
Posted: Thu Oct 03, 2024 1:19 pm
by EViews Steve
Put the "/programonly" argument first.
Code: Select all
"C:\Program Files\EViews 14\EViews14.exe" /programonly "C:\Temp\Test.prg"
This will launch EViews 14 (hidden), run the program, and then shutdown.
Re: Eviews launch options
Posted: Thu Oct 03, 2024 9:17 pm
by johansamuelsson
Thank you, Steve!
Re: Eviews launch options
Posted: Fri Jan 09, 2026 12:37 pm
by madm
I realize this is an old post, but I have a related question. When using the /programonly option, is there a way to put log output onto stdout or, if not, is there some other output command to do so?
Re: Eviews launch options
Posted: Fri Jan 09, 2026 2:10 pm
by EViews Steve
EViews is still a Windows program, even if you run it with the /programonly option. This means there isn't a stdout that can be redirected.
Instead, I would recommend you use our
LOGMODE command at the beginning of your program and specify the filename=file.txt & autosave=on options so you can see output in the specified file. LOGMODE can optionally display program lines, status line messages, any errors that occur, and explicit calls to
LOGMSG.