Comments (3)
It should be easy. As you want to display a value on button click, use the button click callback and save that value as the member variable in your app class. And as the value of the member variable gets updated on button click, you can use the update for display.
You can refer the following code in the repo:
https://github.com/adipandas/python-gui-demos/blob/master/src/program4.py
from python-gui-demos.
What i really need is to run a .py file in my local system. When i click the button, it should run the python file within the system. Is that possible or do i have to copy the script to the gui code and and combine all to an exe file?
from python-gui-demos.
To run a python script from you python code, there are more than few ways.
- You can treat your python script file like a module where you can just do
import file
. Note that if your file is calledfile.py
, your import should not include the .py extension at the end. - You can also use
exec
command:execfile('file.py')
. - You can use
os
module (import os
) to execute the file:os.system('python file.py')
.
You can use any of these methods to execute another file in your python code. You will have to add these few lines in your callback function for the radio button.
from python-gui-demos.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-gui-demos.