小编Voi*_*ode的帖子

如何用Python Popen做多个参数?

我正在尝试制作一个有按钮的PyGtk Gui.当用户按下此按钮时,gnome-terminal提示用户输入密码.

然后它将为JQuery片段克隆这个Git存储库gedit.

然后,它将js.xml文件复制到/usr/share/gedit/plugins/snippets/js.xml

最后,它强制删除了Git存储库.

命令:

gnome-terminal -x sudo git clone git://github.com/pererinha/gedit-snippet-jquery.git && sudo cp -f gedit-snippet-jquery/js.xml /usr/share/gedit/plugins/snippets/js.xml && sudo rm -rf gedit-snippet-jquery
Run Code Online (Sandbox Code Playgroud)

它在我的终端工作正常.

但是,通过它刚打开的GUI,我添加了我的密码,按回车键,然后再次关闭.

我只想将命令运行到第一个命令 &&

这是我的Python函数(带命令):

    def on_install_jquery_code_snippet_for_gedit_activate(self, widget):
        """ Install Jquery code snippet for Gedit. """
        cmd="gnome-terminal -x sudo git clone git://github.com/pererinha/gedit-snippet-jquery.git && sudo cp -f gedit-snippet-jquery/js.xml /usr/share/gedit/plugins/snippets/js.xml && sudo rm -rf gedit-snippet-jquery"
        p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT,
                 close_fds=False)
        self.status.set_text(p.stdout.read()) #show response in 'status
Run Code Online (Sandbox Code Playgroud)

python subprocess pygtk popen gnome-terminal

17
推荐指数
1
解决办法
5万
查看次数

SherlockActionBar:导出签名apk,然后Eclipse崩溃:(

今天我完成了测试我的新Android应用程序..

我使用SherlockActionBar.

导入为/库

我的操作系统是Ubuntu 12.10 64bit ..

我可以从Eclipse构建.apk,应用程序在我的Android 2.3.3(移动设备)和我的Android 4.0(平板电脑)上运行.

但当我尝试:Android tools -> Export signed application package,然后Eclipse崩溃:(

我收到此错误:(在导出/崩溃之前)

Invalid ZIP archive: /home/voidcode/Ubuntu One/workspace/JakeWharton-ActionBarSherlock-e5c2d1c/library/bin/library.jar
Run Code Online (Sandbox Code Playgroud)

这是我在崩溃后在Eclipse文件夹中找到的错误日志:http: //paste.ubuntu.com/1677938/

我的AndroidManifest.xml看起来像这样:

<uses-sdk
    android:minSdkVersion="4"
    android:targetSdkVersion="15" />
Run Code Online (Sandbox Code Playgroud)

我的project.properties看起来像这样:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by …
Run Code Online (Sandbox Code Playgroud)

eclipse ubuntu android actionbarsherlock

7
推荐指数
1
解决办法
2690
查看次数