How to create a console in GUI app using pyqt?
-
wrote on 15 Jul 2019, 19:50 last edited by
Does anyone have an idea?
I used QTextEdit and QLineEdit to create a console.
I used eval to run custom command.
Is it the correct method to do it? -
Does anyone have an idea?
I used QTextEdit and QLineEdit to create a console.
I used eval to run custom command.
Is it the correct method to do it?@Moeka_Chan said in How to create a console in GUI app using pyqt?:
Is it the correct method to do it?
Depends on what you mean with "console". Do you want to embed the console of your system (which OS is it?) into your app?
-
@Moeka_Chan said in How to create a console in GUI app using pyqt?:
Is it the correct method to do it?
Depends on what you mean with "console". Do you want to embed the console of your system (which OS is it?) into your app?
wrote on 17 Jul 2019, 15:14 last edited by@jsulm My OS is windows 10. I want to embed python console. Also, the console can run my custom command. I don't find any tutorials related it from Google... It should be like console in Blender.
-
@jsulm My OS is windows 10. I want to embed python console. Also, the console can run my custom command. I don't find any tutorials related it from Google... It should be like console in Blender.
@Moeka_Chan Did you already check this: https://docs.python.org/2/extending/embedding.html
-
wrote on 18 Jul 2019, 13:59 last edited by
@Denni-0 I want to interact with the terminal window. I am a Blender user. I can create a customized class or function to run in Blender. I think I need to create a widget for a console to be added in my App. There is no console widget, but PyqtGraph has consolewidget. I also checked console application, script window, command window, console interface, dev console. Because they are shown in App GUI, I don't know what correct word to search...
One more question, some games have their own console. For example, players can change a mouse cursor size or select game server in Dota 2 console. I am not sure whether I can create some variables, like a = 2, in Dota 2 console. (I didn't test it before). Do you have any ideas on how to create this console?
-
@Moeka_Chan Did you already check this: https://docs.python.org/2/extending/embedding.html
wrote on 18 Jul 2019, 15:27 last edited by@jsulm No. I will check it later.
-
wrote on 19 Jul 2019, 05:34 last edited by Moeka_Chan
@Denni-0
I want to create my own program that has a console. It is like Command Window in Matlab or Console in Blender, which is shown in the red rectangle in the images above. -
wrote on 19 Jul 2019, 15:49 last edited by
@Denni-0 Most of the software I used has a scripting section. For example, Motionbuilder, Maya, Blender, Unity, Matlab... Users can write their scripts to run there. Currently, I am not going to add this feature in my program. Usually, the scripting section includes TextEdit for scripting and a console to run some internal functions or execute the scripts. I am going to create a console in my program, but I have no blueprint on it. I found a tutorial showing how to create a dev console on a webpage, and it used TextEdit and LineEdit to achieve it. However, the console in the tutorial only works for customized command. It can't run any Python, Java method.....
-
wrote on 19 Jul 2019, 17:43 last edited by
@Denni-0 wrap it and then call a python or command line execute function to run it
Does it use methods like eval, subprocess?
9/9