pygtk

How to do multiple arguments with Python Popen?

百般思念 提交于 2019-11-27 13:13:33
问题 I am trying to make a PyGtk Gui, that has a button. When the user presses this button, gnome-terminal prompts the user to write their password. Then it will clone this Git repository for gedit JQuery snippets. And then, it copies the js.xml file to /usr/share/gedit/plugins/snippets/js.xml In the end, it forcefully removes the Git repository. The command: gnome-terminal -x sudo git clone git://github.com/pererinha/gedit-snippet-jquery.git && sudo cp -f gedit-snippet-jquery/js.xml /usr/share

Where is PyGTK for Mac OS X?

感情迁移 提交于 2019-11-27 10:47:05
问题 Is there a binary out there for the current mac os x, python for PyGTK? I work with multiple desktop environments (mac, windows, gnome) and really consider python's lack of cross platform GUI's a problem. Does anyone know where I can find a built version of PyGTK and GTK for Mac? I cant clone the git repository, it keeps timing out. 回答1: I don't use macports but it seems that jhbuild works for me. Below is the steps that I've done. download gtk-osx-build-setup.sh from: https://raw.github.com

GtkDialog mapped without a transient parent

落爺英雄遲暮 提交于 2019-11-27 05:21:44
问题 I have a GUI built in Glade (3.18) which is called by a Python 3 program (using PyGObject). I get a lot of warnings when running the program (Fedora 21) that say: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged. How can I fix this warning? I tried filling in the field Transient for: main_window in Glade for all the dialog windows, but the warnings still appear. 回答1: You fix this warning by giving the GtkDialog a parent to be modal to. The relevant functions are

Cannot Import GST in Python

耗尽温柔 提交于 2019-11-27 03:49:30
问题 I'm in a quandary. I'm following the following tutorial (specifically, 6.4.2) http://majorsilence.com/pygtk_audio_and_video_playback_gstreamer I'm running Python 2.7, PyGTK 2.24, and GStreamer WinBuilds 10.7 (the main installer and the SDK). When I try and compile the program, I get the following error: Traceback (most recent call last): File "", line 1, in import gst File "C:\Program Files\OSSBuild\GStreamer\v0.10.6\lib\site-packages\gst-0.10\gst__init__.py", line 193, in from _gst import *

Best practices for adding .gitignore file for Python projects? [closed]

房东的猫 提交于 2019-11-26 21:23:41
I'm trying to collect some of my default settings, and one thing I realized I don't have a standard for is .gitignore files. There's a great thread showing a good .gitignore for Visual Studio projects , but I don't see many recommendations for Python and related tools (PyGTK, Django). So far, I have... *.pyc *.pyo ...for the compiled objects and... build/ dist/ ...for the setuptools output. What are some best practices for .gitignore files, and where can I go for more about these best practices? When using buildout I have following in .gitignore (along with *.pyo and *.pyc ): .installed.cfg

authentication in python script to run as root

眉间皱痕 提交于 2019-11-26 16:34:53
问题 I am doing a project in Linux at system level in Python. So that, I want to know that if i am running my code as a normal user and if i am accessing system files then it should have root permissions for it, then how can i prompt for root password and run further code as superuser. I want to know that, how to run python script as superuser with password prompt for it.. Any help will be appreciated. Thank you in advance.. 回答1: The other thing you can do is have your script automatically invoke