multiscript-windows 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- multiscript/__init__.py +2 -0
- multiscript/multiscript.py +41 -0
- multiscript_windows-1.0.0.dist-info/METADATA +89 -0
- multiscript_windows-1.0.0.dist-info/RECORD +7 -0
- multiscript_windows-1.0.0.dist-info/WHEEL +5 -0
- multiscript_windows-1.0.0.dist-info/licenses/LICENSE +69 -0
- multiscript_windows-1.0.0.dist-info/top_level.txt +1 -0
multiscript/__init__.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess
|
|
3
|
+
|
|
4
|
+
def batchscript(scr, err=False, rcd=False):
|
|
5
|
+
with open("temp.bat", "w") as batfile:
|
|
6
|
+
batfile.write(scr)
|
|
7
|
+
snd = subprocess.run(["cmd.exe", "/c", "temp.bat"], capture_output=True, text=True)
|
|
8
|
+
rtn = snd.stdout
|
|
9
|
+
if err:
|
|
10
|
+
rtn = (rtn + "\n" + snd.stderr)
|
|
11
|
+
if rcd:
|
|
12
|
+
rtn = (rtn + "\n" + str(snd.returncode))
|
|
13
|
+
os.remove("temp.bat")
|
|
14
|
+
return rtn
|
|
15
|
+
def commandlist():
|
|
16
|
+
print(
|
|
17
|
+
"""
|
|
18
|
+
-=#COMMANDS#=-
|
|
19
|
+
batchscript(script, showerrorcode, showreturncode)
|
|
20
|
+
Runs a batch script.
|
|
21
|
+
If not specified, showerrorcode and showreturncode will be set to False.
|
|
22
|
+
vbscript(script, showerrorcode, showreturncode, usewscript)
|
|
23
|
+
Runs a visual basic script.
|
|
24
|
+
If not specified, showerrorcode, showreturncode and usewscript will be set to False.
|
|
25
|
+
The usewscript argument controls if cscript or wscript is used to execute.
|
|
26
|
+
"""
|
|
27
|
+
)
|
|
28
|
+
def vbscript(scr, err=False, rcd=False, wsc=False):
|
|
29
|
+
with open("temp.vbs", "w") as vbsfile:
|
|
30
|
+
vbsfile.write(scr)
|
|
31
|
+
if wsc:
|
|
32
|
+
snd = subprocess.run(["wscript.exe", "temp.vbs"], capture_output=True, text=True)
|
|
33
|
+
else:
|
|
34
|
+
snd = subprocess.run(["cscript.exe", "//Nologo", "temp.vbs"], capture_output=True, text=True)
|
|
35
|
+
rtn = snd.stdout
|
|
36
|
+
if err:
|
|
37
|
+
rtn = (rtn + "\n" + snd.stderr)
|
|
38
|
+
if rcd:
|
|
39
|
+
rtn = (rtn + "\n" + snd.returncode)
|
|
40
|
+
os.remove("temp.vbs")
|
|
41
|
+
return rtn
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: multiscript-windows
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A lightweight wrapper to run Batch and VBScript within Python.
|
|
5
|
+
Author-email: KingTheCoder <kingjd490@gmail.com>
|
|
6
|
+
License: GPL-3.0-only
|
|
7
|
+
Project-URL: Homepage, https://github.com/KingTheCoder/multiscript-windows
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
11
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
12
|
+
Requires-Python: >=3.7
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# multiscript-windows
|
|
18
|
+
Multiscript is a small, open-source Python module made for executing code in other languages within Python.
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
Install multiscript with this command: `pip install multiscript-windows`.
|
|
22
|
+
|
|
23
|
+
## Use
|
|
24
|
+
Multiscript is amazing for simplifying operations that python fails to expose easily, but how does it work?
|
|
25
|
+
|
|
26
|
+
The way you import multiscript into your project is through this line: `import multiscript`.
|
|
27
|
+
|
|
28
|
+
Now, you have three functions exposed to you.
|
|
29
|
+
|
|
30
|
+
Those three functions are `batchscript`, `vbscript` and `commandlist`.
|
|
31
|
+
|
|
32
|
+
The function `commandlist` gives you a list of commands that you can use in multiscript.
|
|
33
|
+
|
|
34
|
+
This includes the `batchscript` and `vbscript` commands and how to use them.
|
|
35
|
+
|
|
36
|
+
Run this command for more information.
|
|
37
|
+
|
|
38
|
+
The `batchscript` command executes batch in a string.
|
|
39
|
+
|
|
40
|
+
Example:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
import multiscript
|
|
44
|
+
|
|
45
|
+
batchscript(
|
|
46
|
+
r"""
|
|
47
|
+
move test.txt .\destination
|
|
48
|
+
del deleteme.png
|
|
49
|
+
echo Test Complete!
|
|
50
|
+
"""
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
print("And we're still in python!")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The `vbscript` command executes visual basic in a string.
|
|
57
|
+
|
|
58
|
+
Example:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
import multiscript
|
|
62
|
+
|
|
63
|
+
vbscript(
|
|
64
|
+
r"""
|
|
65
|
+
MsgBox "Hi, there!", 64 + vbOkOnly, "Hi!"
|
|
66
|
+
MsgBox "Goodbye!", 64 + vbOkOnly, "Bye!"
|
|
67
|
+
"""
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
print("And we can still use more python!")
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Licensing
|
|
74
|
+
|
|
75
|
+
Licensed under the GNU General Public License v3 (GPLv3).
|
|
76
|
+
|
|
77
|
+
For more information, read the LICENSE file in the project directory.
|
|
78
|
+
|
|
79
|
+
## Some Extra
|
|
80
|
+
|
|
81
|
+
Hey, thanks for reading all the way to the end!
|
|
82
|
+
|
|
83
|
+
This README took a long time to make.
|
|
84
|
+
|
|
85
|
+
I just wanted to give you a fun thing to try in Python.
|
|
86
|
+
|
|
87
|
+
Try this command in the Python REPL (or a script). `import this`
|
|
88
|
+
|
|
89
|
+
This gives you "The Zen of Python", a fun guide to some additional things about Python!
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
multiscript/__init__.py,sha256=fh72PBOkUD_3VuUei2Qw2r_9hYpZIpRbI10umeGXg_4,113
|
|
2
|
+
multiscript/multiscript.py,sha256=KJMUqtqinR2YUZrNx8z68k1KIki9G5FB6O25GYb6dN4,1442
|
|
3
|
+
multiscript_windows-1.0.0.dist-info/licenses/LICENSE,sha256=9CmvZLwtcGspP_JayNRrx3a7plzMvwN2_uUntp04ABk,3608
|
|
4
|
+
multiscript_windows-1.0.0.dist-info/METADATA,sha256=j403GUZ73TsnUlXg35tfEq2N0nMs5lqPcN5dVTdDqKg,2427
|
|
5
|
+
multiscript_windows-1.0.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
6
|
+
multiscript_windows-1.0.0.dist-info/top_level.txt,sha256=CprGvs7nnM0X2vOx_vM9ET_xspRKflTHUa-yktjblIo,12
|
|
7
|
+
multiscript_windows-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 KingTheCoder
|
|
5
|
+
|
|
6
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
7
|
+
of this license document, but changing it is not allowed.
|
|
8
|
+
|
|
9
|
+
Preamble
|
|
10
|
+
|
|
11
|
+
The GNU General Public License is a free, copyleft license for
|
|
12
|
+
software and other kinds of works.
|
|
13
|
+
|
|
14
|
+
The licenses for most software and other practical works are designed
|
|
15
|
+
to take away your freedom to share and change the works. By contrast,
|
|
16
|
+
the GNU General Public License is intended to guarantee your freedom to
|
|
17
|
+
share and change all versions of a program--to make sure it remains free
|
|
18
|
+
software for all its users. We, the Free Software Foundation, use the
|
|
19
|
+
GNU General Public License for most of our software; it applies also to
|
|
20
|
+
any other work released this way by its authors. You can apply it to
|
|
21
|
+
your programs, too.
|
|
22
|
+
|
|
23
|
+
When we speak of free software, we are referring to freedom, not
|
|
24
|
+
price. Our General Public Licenses are designed to make sure that you
|
|
25
|
+
have the freedom to distribute copies of free software (and charge for
|
|
26
|
+
them if you wish), that you receive source code or can get it if you
|
|
27
|
+
want it, that you can change the software or use pieces of it in new
|
|
28
|
+
free programs, and that you know you can do these things.
|
|
29
|
+
|
|
30
|
+
To protect your rights, we need to prevent others from denying you
|
|
31
|
+
these rights or asking you to surrender the rights. Therefore, you have
|
|
32
|
+
certain responsibilities if you distribute copies of the software, or if
|
|
33
|
+
you modify it: responsibilities to respect the freedom of others.
|
|
34
|
+
|
|
35
|
+
For example, if you distribute copies of such a program, whether
|
|
36
|
+
gratis or for a fee, you must give the recipients all the rights that
|
|
37
|
+
you have. You must make sure that they, too, receive or can get the
|
|
38
|
+
source code. And you must show them these terms so they know their rights.
|
|
39
|
+
|
|
40
|
+
Developers that use the GNU GPL protect your rights with two steps:
|
|
41
|
+
(1) assert copyright on the software, and (2) offer you this License
|
|
42
|
+
giving you legal permission to copy, distribute and/or modify it.
|
|
43
|
+
|
|
44
|
+
For the developers' and authors' protection, the GPL clearly explains
|
|
45
|
+
that there is no warranty for the free software. For both users' and
|
|
46
|
+
authors' sake, the GPL requires that modified versions be marked as
|
|
47
|
+
changed, so that their problems will not be attributed erroneously to
|
|
48
|
+
authors of previous versions.
|
|
49
|
+
|
|
50
|
+
Some devices are designed to deny users access to install or run
|
|
51
|
+
modified versions of the software inside them, although the manufacturer
|
|
52
|
+
can do so. This is fundamentally incompatible with the aim of
|
|
53
|
+
protecting users' freedom to change the software. The systematic
|
|
54
|
+
pattern of such abuses occurs in the area of products for individuals to
|
|
55
|
+
use, which is precisely where it is most unacceptable. Therefore, we
|
|
56
|
+
have designed this version of the GPL to prohibit the practice for those
|
|
57
|
+
products. If such problems arise substantially in other domains, we
|
|
58
|
+
stand ready to extend this provision to those domains in future versions
|
|
59
|
+
of the GPL, as needed to protect the freedom of users.
|
|
60
|
+
|
|
61
|
+
Finally, every program is threatened constantly by software patents.
|
|
62
|
+
States should not allow patents to restrict development and use of
|
|
63
|
+
software on general-purpose computers, but in those that do, we wish to
|
|
64
|
+
avoid the special danger that patents applied to a free program could
|
|
65
|
+
make it effectively proprietary. To prevent this, the GPL assures that
|
|
66
|
+
patents cannot be used to render the program non-free.
|
|
67
|
+
|
|
68
|
+
The precise terms and conditions for copying, distribution and
|
|
69
|
+
modification follow.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
multiscript
|