Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are a few issues with your script:</p> <p>1) A typo in your <code>execute_script()</code> function: <code>for name in been_cliked</code></p> <p>2) You are actually <em>calling</em> the <code>check()</code> function when you create your radio buttons. That's why you're seeing the windows pop up when you run your program.</p> <p>You need to change this:</p> <pre><code>radio1 = Radiobutton(app, text=name, value=name, \ variable=relStatus, command=check(file_name, relStatus)) </code></pre> <p>to this:</p> <pre><code>radio1 = Radiobutton(app, text=name, value=name, \ variable=relStatus, command=check) </code></pre> <p>See how <code>check</code> no longer has brackets? That's means you're passing the function name as an argument, instead of actually <em>calling</em> the function. Of course, you'll see an immediate problem is that you can no longer pass arguments to your callback function! That's a bigger issue. Here's a couple links to help get you started:</p> <ul> <li><a href="https://stackoverflow.com/questions/3296893/how-to-pass-an-argument-to-event-handler-python-tkinter-programming">How to pass an argument to event handler in tkinter?</a></li> <li><a href="https://stackoverflow.com/questions/6922621/how-can-i-pass-arguments-to-tkinter-buttons-callback-command">How can I pass arguments to Tkinter button&#39;s callback command?</a></li> </ul> <p>Here is the solution:</p> <p>Change this:</p> <pre><code>command=check(file_name, reStatus) </code></pre> <p>to this:</p> <pre><code>command = lambda: check(file_name, relStatus) </code></pre> <p>3) You don't actually <code>pack()</code> your radio buttons anywhere. Add something like this just after you create your radio buttons in your <code>for</code> loop: <code>radio1.pack(side='top')</code></p> <p>4) You have the same problem with your callback for your <code>Click Here</code> button. You need to change your command to not call the function, but just refer to it: <code>command = execute_script</code></p> <p>5) In <code>execute_script()</code>, make sure you <code>import subprocessing</code></p> <p>6) Are you sure you want <code>yield</code> instead of <code>return</code> in your <code>execute_script()</code> function?</p> <p>7) In all your functions, you need to make sure that <code>been_clicked</code> is global.</p> <p>I think if you fix these issues you'll be closer to getting what you're looking for. Good luck.!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload