I am making an application using PySide. I want to embed a Terminal Emulator (like the Linux Konsole, or xterm). I want to have it in the application and not open up as a new window.
Does anyone know of any Python libraries that can do this? And how would I incorporate it, would I have to use a special QWidget to run it properly?
I also would like to be able to run linux commands. How can this be done?
You can create the terminal with the python subprocess. I put down a little more info here Terminal like app in PySide .
To embed it in your application just add the widget to the layout.
Related
I am looking to create a python application in linux which should have a GUI interface as well as console for inputs . Console name what user want.
shell> python my_application.py OR executable
my_app> (opens gui too)
Can someone please help me get this or any link where I can learn this.
Thanks
Look into learning tkinter (easier) for making GUIs or PyQt5 (better). Then, I'd use argparse to specify if you want to launch the GUI.
I created a little application with Python3 and gtk glade, I'm using the terminal to see if I'm doing something wrong. However I want to launch the application without the terminal in the back at the end of the developement. So my question is, is there a way to do that?
You can change the file extension from .py to .pyw to make the Python script run without the terminal window. More on this here.
The Windows 7 Control Panel "Notification Area Icons" allows you to customize which system tray icons are visible. For each of the icons, it shows two things:
an application name
a subtitle
It looks like the subtitle comes from the tooltip text, because I can set that.
But what about the application name? I'm writing a GUI in PySide and can't figure out what incantations I need to do, to set this to something other than "python.exe".
python.exe will always show up if the module is run under the python executable, regardless of via a shortcut or not. It also shows up in task manager under the process name python.exe.
To circumvent this, it is necessary to create a custom executable to run the python script under it's own name. This doesn't have to be a monolithic exe packer such as py2exe, but can be something a little more discrete.
Using effbot.org's open source ExeMaker for instance, the following steps will result in what you want.
After downloading exemaker, simply run it from the command line with
exemaker scriptname.py
and it'll create scriptname.exe.
You may then run scriptname.exe by double clicking it, and it shall run the python script under it's own name.
The advantage of this small tool is that any changes made to the python script do not require recompilation of the exe - they are effective immediately.
This is because you are launching your application using Python.exe. In your case the main application running is Python.exe, so the Notification Area Icons will always show you Python.exe as running application.
When you are done with the development of your application, use pyinstaller or py2exe to package your application. After this process you will have a exe file for your application, when you will run your application, the name in the Notification Area Icons for your application will be same as you will set for your main window title.
I did not really test it but it may work. Create a link to your .py file and choose the name. If you run that link it should show the name of the link.
PS: On command prompt title bar it works fine
I am developing a texteditor using PYQT, the text editor is used for processing a DSL, one that I am making up. Now I would really like to have the ability to click on on an ICON, say a console icon in my gui toolbar that will launch a console, from the console I could run my custom commands that allow me to do things like manipulate my SQLITE database directly.
I am somewhat familiar with the CMD Module which allows me to create simple commands that do the things that I want, but how can I integrate my gui texteditor and a CMD module console?
A similar idea can be found in
Integration of Python console into a GUI C++ application
only difference is that I don't want a full python interpreter,and i'm not using C++
Any suggestions
After much searching I found
http://obswww.unige.ch/~revaz/git/old.glups-4.0/glups/pycutext.py
This module implements a QT4 python interpreter widget.
It is inspired bu PyCute : http://gerard.vermeulen.free.fr
I cannot take credit for the solution, but it effectively redirects all python stdin,stdout and even stderr to the pyQt Widget. Its exactly what I was looking for.
i launched the application using the following code i.e.
import os
cmd = r'start C:\WindowsMediaPlayer\wmplayer.exe'
os.system(cmd)
say i launched win media player.. now i want to control the buttons/the menus to open a file . or do some audio settings.. any thing that is related to media player using the python script.. please any on can help me with this....
Maybe you should use a framework such as pywinauto
Using this, you can launch windows applications and control them.
Check this out