Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using wxpython to build a GUI. I have two questions: 1.How Can I get values from textfield in the interface? 2.Can I run a python script through my interface(for examlpe when clicking on a button) and How to do it ?

Another question: after the execution of the script, which is supposed to return a result (a string) , how can I get the result from script and display it in my interface? Thanks.

PS: The values in question 1 are arguments for the Python script in question 2.

share|improve this question

1 Answer 1

up vote 1 down vote accepted
  1. If by textfiled you mean a wx.TextCtrl you get the value from it by calling its GetValue method.
  2. You bind an event handler to the buttons event wx.EVT_BUTTON, in the handler you get the values from the TextCtrl and then call you functions/methods using them.

See the wxpython demo (available from wxpython site downloads) for examples of the above and a whole lot more

share|improve this answer
    
yes @Yoriz I mean a wx.TextControl, thank you for answering my question –  farfalla Mar 8 at 14:41
2  
@farfalla If you got the answer to your question then please select it as an answer. This helps other users to know that this question has been solved. –  ρss Mar 8 at 16:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.