PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
Usar python code en windev
Usar python code en windev
Started by Walter Louis, Oct., 07 2020 2:13 AM - 2 replies
Connect yourself…
Walter Louis
#1
Posted on October, 07 2020 - 2:13 AM
Tengo una aplicación donde quiero usar codigo PYTHON para unas tareas específicas de matemática simbolica.
No encuentro información que me podrá ayudar. Alguien me puede dar un empujon con algun ejemplo, Gracias
Report
0
0
Jonathan
#2
Posted on February, 27 2023 - 10:25 PM
Download python embeddable
https://www.python.org/downloads/windows/
Unzip into windev exe dir
Create script.py
lines = ['Readme', 'How to write text files in Python']
with open('readme.txt', 'w') as f:
for line in lines:
f.write(line)
f.write('\n')
On windev
ExeRun
(
"python script.py"
,
exeIconize
,
exeWait
)
s
Res
is string
=
fLoadText
(
"readme.txt"
)
Info
(
sres
)
Report
0
0
Eden Wheeler
#3
Posted on February, 28 2023 - 11:10 AM
To use Python code in a WinDev application, you can use the Python for Windows extensions (pywin32) library, which provides a way to call Python functions from a Win32 application. Here is an example of how you can do this:
Install Python and pywin32 on your computer.
In your WinDev application, create a button or other control that will trigger the Python code.
In the button's click event, use the PyWin32 library to execute the Python code. For example:
PROCEDURE Button1Click()
sPythonCode is string = "import math; x = math.sin(1)"
Python = iPythonCreate("Python.Test")
iPythonExec(Python, sPythonCode)
iPythonRelease(Python)
END
In this example, we import the math module and use it to calculate the sine of 1. The iPythonCreate function creates a new Python interpreter, and iPythonExec executes the code in that interpreter. Finally, we release the interpreter with iPythonRelease.
Note that you will need to adjust the code to fit your specific use case, including the name of the Python module and any additional Python code you want to execute.
Also, keep in mind that using Python code in a WinDev application may have performance implications and may require additional setup and configuration.
You can also visit:
[
code
:
xml
]
https
:
/
/
www.igmguru.com
/
machine
-
learning
-
ai
/
rpa
-
automation
-
anywhere
-
training
/
[/code]
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text