Skip to content

Commit 8b2f772

Browse files
authored
Update README.md
1 parent acfa258 commit 8b2f772

File tree

1 file changed

+21
-32
lines changed

1 file changed

+21
-32
lines changed

README.md

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
# PythonWIMVBA
22
> Python With VBA ! Run python via VBA
33
---
4-
**✨✨ New on PythonWimVBA 5.3 ✨✨**
5-
+ Added multiple threads (Run multiple RunPy functions)
6-
+ Improve function, add new `newengine`
7-
+ Enhanced PyWimVBA performance
8-
+ Keeps the old PyWimVBA function (In version 5.2) and renames it to `RunPyOld`
9-
- ~~Add new `RunPyWid()` - with `showcmd=True` function doesn't need to create file~~ (Removed!)
4+
# **🖥 PyWimVBA 6.0! - New release! ⚔**
5+
> New features, with many changes from 5.x
6+
### 🎉🎉**New Features**🎉🎉
7+
- Create new RunPy
8+
- Require `PyServer` (1.0 for PyWVBA 6.0)
9+
- Added cache value
10+
- Huge Performance improves from 5.x
11+
+ Added some server function like `ClearPyServer()` - Clear all variable cached
12+
+ Don't need to create logfile or codefile
13+
+ Keep 5.4 `RunPy()` and renamed it to `RunPyOld()`
14+
+ ⚠ Warning: `PyServer 1.0` using localhost with port : `9812`
1015
# Where's the lower version of PythonWimVBA?
1116
> **Lower Version is tested privately; some versions are publicly released, but they are pre-release. They're outdated, unsecure and unstable, so please use only versions 5.2 or above**.
1217
1318
# Installation
1419
+ Install python (Any version, NOTE: Checks Add python to path when start setup)
1520
+ Install PyWimVBA to your vba project (Install .bas file and see [here](https://support.tetcos.com/support/solutions/articles/14000143233-how-to-import-vba-script-bas-file-in-ms-excel-) )
1621

17-
# Usage
18-
**Command:** ``LoadPy(file,[iline = False])``
19-
+ Load a python file and convert it to PyWimVBA Syntax
22+
# 🎨 PyWimVBA Example
23+
### Example usage
24+
#### 💎PyWimVBA 6.0 New Function
25+
+ `StartPyServer(Optional: pythonPath = "python",Optional useCustomPyServer: False,Optional : silent=false)` : Starts **`PyServer`** (PyServer supports only single server) `silent=true` will hide command prompt of `PyServer`. Set `useCustomPyServer` to path of your PyServer (can use in offline or a older pyserver)
26+
+ `EndPyServer(Optional deletePyServer: True)` - A server doesn't close automatically with VBA, so you need to close it before end VBA code . Use `deletePyServer=False` to keep your PyServer to reuse in `StartPyServer` (Not recommend)
27+
+ `CheckPyServer()` - Check a or any server is running.
28+
+ `ClearPyServer()` - Because `PyServer` support only one server, you can use this function to clear cached data like value,etc...
29+
+ `RunPy(code)` - Simply run a code of python, split new line with `;;`
30+
+ ``LoadPy(file,[iline = False])`` - Load a python file and convert it to PyWimVBA Syntax
2031
- For example, it'll convert this file code
2132

2233
`examplefile.py`
@@ -28,32 +39,10 @@
2839
- To `import time;time.sleep(5)`
2940
- APPLY TO USE: `RunPy(LoadPy("mycodefile.anyextension"))`
3041

31-
**Command:** ``RunPy(code,[pythonPath = "python"] , [newengine = False], [ keepFileData = False] , [UseDebug = False])``
42+
+ ``RunPyOld(code,[pythonPath = "python"] , [newengine = False], [ keepFileData = False] , [UseDebug = False])``
3243
+ Code splitting by ";;" , e.x : `import time;;time.sleep(5)`
3344
+ [Optional] newengine : Improve performance, doesn't need to create logfile - still create code file . But it's will show up a cmd splash - doesn't work with UseDebug
3445
+ [Optional] keepFileData: Keep the output file and code file after finishing execution.
3546
+ [Optional] UseDebug: Show cmd that runs python code and keep it alive with it's output [Use debug to catch errors, the output file may not catch them. So when debug is enabled, Output file does nothing.
3647
+ E.x : `MsgBox RunPy("Welcome to \'Python With VBA!\'")`
3748

38-
> In lastest fix, Remove RunPyOld, RunPyWid (Issued and Too Unstable)
39-
40-
**Command:** `RunPyWid(code, [pythonPath = "python"], [showcmd = True], [iline = False], [UseDebug =False])`
41-
+ Code splitting by ";;" , e.x : `import time;;time.sleep(5)`
42-
+ With `showcmd=True` performance will be better than `showcmd=False` (because of `showcmd=False` must create logfile to catch log, `showcmd=True` mustn't)
43-
- **[Optional OR Compulsory]iline**
44-
- `Iline` attributes convert code from
45-
- `import time`
46-
- `time.sleep(2)`
47-
- To `exec("import time\ntime.sleep(2)")`
48-
- (convert multiple line to single line)
49-
+ :warning: `Iline` is custom with `showcmd=True` but it's must for `showcmd=False`
50-
+ [Optional] UseDebug: Show-up cmd that runs python code, keep it alive with it's output [Use debug to catch errors, Output file may not catch them. Only works with `showcmd=False`]
51-
- New release (Unstable!)
52-
- Aready know bugs : Syntax error (Error with `\"` and `\'` in string python, e.x: `RunPyWid("print('This function failed with \'')")` , )
53-
54-
**Command:** ``RunPyOld(code,pythonPath, [ keepFileData = False] , [UseDebug = False])``
55-
+ Code splitting by ";;" , e.x : `import time;;time.sleep(5)`
56-
+ [Optional] keepFileData: Keep the output file and code file after finishing execution.
57-
+ [Optional] UseDebug: Show cmd that runs python code and keep it alive with it's output [Use debug to catch errors, the output file may not catch them. So when debug is enabled, Output file does nothing.
58-
59-

0 commit comments

Comments
 (0)