That worked perfectly - thank you very much Joe.
Original Message:
Sent: 11-04-2024 12:35
From: Joe Goldthwaite
Subject: Start .atsc file using python
Hi Mike,
Popen may not understand the file associations the way the command line and file explorer do. Try executing the actual command and pass the file at the command line:
p = Popen(["c://program files (x86)//atwin71//atwin71.exe","patmore_login.atsc"], stdout=PIPE, stderr=PIPE) stdout, stderr = p.communicate()
You're version of AccuTerm may be different or be in a different place. You also might have to include the full path to your atsc file.
Sorry if this posts twice. I posted it once and it seems to have just disappeared. Maybe Rocket is having trouble and the first one I posted will eventually go through.
------------------------------
Joe Goldthwaite
Consultant
Phoenix AZ US
Original Message:
Sent: 11-04-2024 12:03
From: Mike Lankester
Subject: Start .atsc file using python
Good afternoon, I am trying to open a .atsc file that runs a simple macro to automatically log the user in to accuterm.
I am using the following code:
from subprocess import Popen
p = Popen(["patmore_login.atsc"], stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
But I get the following error:
File "C:\Users\mike\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1548, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
# no special security
^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
cwd,
^^^^
startupinfo)
^^^^^^^^^^^^
OSError: [WinError 193] %1 is not a valid Win32 application
I can find no information for opening this type of file on google/stackexchange etc
Any help to go in the right direction would be greatly appreciated.
Kind regards
Mike Lankester
------------------------------
Mike Lankester
Rocket Forum Shared Account
------------------------------