File: RunInTerminal.py

package info (click to toggle)
drpython 1%3A3.11.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,572 kB
  • ctags: 1,504
  • sloc: python: 16,099; sh: 319; makefile: 39
file content (20 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#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)