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
Eviews launch options
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Eviews launch options
I assume you are trying to run an EViews program when you launch it?
Try this:
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
Try this:
Code: Select all
"C:\Program Files\EViews 9\EViews9_x64.exe" "c:\files\my.prg" /programonlySteve
Re: Eviews launch options
Actually im doing that :
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
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 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
-
EViews Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Eviews launch options
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
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
-
johansamuelsson
- Posts: 165
- Joined: Thu Mar 03, 2011 10:07 pm
- Contact:
Re: Eviews launch options
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?
Regards Johan
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-
EViews Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Eviews launch options
Put the "/programonly" argument first.
This will launch EViews 14 (hidden), run the program, and then shutdown.
Code: Select all
"C:\Program Files\EViews 14\EViews14.exe" /programonly "C:\Temp\Test.prg"-
johansamuelsson
- Posts: 165
- Joined: Thu Mar 03, 2011 10:07 pm
- Contact:
Re: Eviews launch options
Thank you, Steve!
Re: Eviews launch options
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?
-
EViews Steve
- EViews Developer
- Posts: 844
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Eviews launch options
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.
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.
Who is online
Users browsing this forum: No registered users and 2 guests
