-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOpening_.exe_files_in_Python.py
More file actions
35 lines (17 loc) · 1.7 KB
/
Copy pathOpening_.exe_files_in_Python.py
File metadata and controls
35 lines (17 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Please note that you will need to install the appopener library before you can use it. You can install it using the following command:
!pip install appopener
To install the subprocess module, you do not need to install any additional packages as it is included in the standard Python library.
To install the webbrowser module, you do not need to install any additional packages as it is included in the standard Python library.
"""
import os # Importing the os module
import subprocess # Importing the subprocess module
import webbrowser # Importing the webbrowser module. There is a syntax error in this line. The dot at the end should be removed.
#from AppOpener import open, close, mklist, give_appnames
subprocess.call("write.exe") # This line calls the Windows WordPad application using the subprocess module.
#or uncomment below
#subprocess.call("C:\Windows\write.exe") # This line calls the Windows WordPad application using the subprocess module. Please note that the path to the `write.exe` file may vary depending on your system configuration.
#os.system("write.exe") # This line opens the Windows WordPad application using the os module.
#os.system('"C:\Windows\write.exe"') # This line opens the Windows WordPad application using the os module. Please note that the path to the `write.exe` file may vary depending on your system configuration.
#webbrowser.open("C:\Windows\write.exe") # This line opens the Windows WordPad application using the webbrowser module. However, this module is not suitable for opening .exe files. It is used to open URLs in web browsers.
#open("write") # This line opens the Windows WordPad application using the appopener library.