Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OSError occurs in Linux.
#1
Hello.
OSError occurs in Linux.

In Linux, OSError occurs.
What bug occurs in Linux in the code below?
Please Help me.

import subprocess
import os
import sys

exePath = “C:\subpro.exe” #<==This(subpro.exe) is an EXE developed in C#.
argument = “Apple”

process = subprocess.Popen([exePath, argument], stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE);
stdout, stderr = process.communicate();
if process.returncode == 0:
print(“succeed, returned” + stdout.decode(“CP949”))
else:
print(“returned” + stdout.decode(“CP949”))
print(“failed, error” + str(process.returncode) + stderr.decode(“CP949”))
process.stdin.close();
if process.stderr is not None:
process.stderr.close()
process.wait()
Reply
#2
Please post the entire error message, including traceback
Reply
#3
(Mar-23-2024, 08:25 PM)anna17 Wrote: In Linux, OSError occurs.
What bug occurs in Linux in the code below?
Code will not work on Linux,like C:\subpro.exe is a Path that only work on Windows.
Path in Linux dos not have drive letters,eg like this /path/to/subpro
subpro.exe is an executable developed in C# for Windows.
Linux cannot natively run Windows executables.
Also all quotation marks are wrong,is a Unicode Character.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  OSError with SMPT script Milan 0 783 Apr-28-2023, 01:34 PM
Last Post: Milan
  OSERROR When mkdir Oshadha 4 1,718 Jun-29-2022, 08:50 AM
Last Post: DeaD_EyE
  OSError: Unable to load libjvm when connecting to hdfs with pyarrow 3.0.0 aupres 0 3,177 Mar-22-2021, 10:25 AM
Last Post: aupres
  pyarrow throws oserror winerror 193 1 is not a valid win32 application aupres 2 3,797 Oct-21-2020, 01:04 AM
Last Post: aupres
  OSError: [Errno 26] Text file busy: '/var/tmp/tmp5qbeydbp batchenr 1 4,230 Mar-20-2020, 01:58 PM
Last Post: ibreeden
  Multiprocessing OSError 'too many open files' DreamingInsanity 3 10,387 Dec-27-2019, 04:50 PM
Last Post: DreamingInsanity
  .py to exe error "oserror winerror 193" michael1789 3 4,899 Dec-03-2019, 05:49 AM
Last Post: michael1789
  how do i loop a "def ..." when error occurs? Stan2292 0 1,625 Aug-12-2019, 05:28 AM
Last Post: Stan2292
  New df from existing when condition occurs Devilish 0 1,365 Jan-10-2019, 12:03 AM
Last Post: Devilish
  OSError: [Errno 13] Permission denied Kolterdyx 3 17,891 Sep-07-2018, 11:01 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020