Sophie

Sophie

distrib > Mandriva > 2010.2 > x86_64 > by-pkgid > 3bf8f74efdd94e04496b0ee1b958e061 > files > 335

drpython-3.11.1-2mdv2010.1.noarch.rpm

#drscript
#This currently only works on linux (if you have rxvt installed).
#You will need to modify it otherwise.

#By Daniel Pozmanter
#Released under the GPL

import os, sys

if sys.platform.find("linux") > -1:
    pathtoterminal = "/usr/bin/X11/rxvt"
    termarg = "-e"
    withargs = ""
    if DrScript.VariableExists("RunInTerminalArgs"):
        withargs = " " + DrScript.RunInTerminalArgs
        
    pyexec = "/usr/bin/python " + DrFrame.GetFileName() + withargs
    os.spawnl(os.P_NOWAIT, pathtoterminal, pathtoterminal, termarg, pyexec)
else:
    wx.MessageBox("Only supported under Linux", "RunInTerminal", wx.OK, DrFrame)