FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Usar python code en windev
Usar python code en windev
Débuté par Walter Louis, 07 oct. 2020 02:13 - 2 réponses
Connectez-vous…
Walter Louis
#1
Posté le 07 octobre 2020 - 02:13
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
Signaler
0
0
Jonathan
#2
Posté le 27 février 2023 - 22:25
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
)
Signaler
0
0
Eden Wheeler
#3
Posté le 28 février 2023 - 11:10
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]
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte