Giter Club home page Giter Club logo

Comments (3)

adipandas avatar adipandas commented on June 1, 2024

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.

shijithkappoor avatar shijithkappoor commented on June 1, 2024

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.

adipandas avatar adipandas commented on June 1, 2024

To run a python script from you python code, there are more than few ways.

  1. You can treat your python script file like a module where you can just do import file. Note that if your file is called file.py, your import should not include the .py extension at the end.
  2. You can also use exec command: execfile('file.py').
  3. 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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.