GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 2024
→
Usar python code en windev
Usar python code en windev
Iniciado por Walter Louis, out., 07 2020 2:13 AM - 2 respostas
Conecte-se…
Walter Louis
#1
Publicado em outubro, 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
Denunciar
0
0
Jonathan
#2
Publicado em fevereiro, 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
)
Denunciar
0
0
Eden Wheeler
#3
Publicado em fevereiro, 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]
Denunciar
0
0
→ Voltar para WINDEV 2024
WINDEV 2024
WEBDEV 2024
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto