當前位置: 首頁>>代碼示例>>Python>>正文


Python GNUScreen.move方法代碼示例

本文整理匯總了Python中GNUScreen.move方法的典型用法代碼示例。如果您正苦於以下問題:Python GNUScreen.move方法的具體用法?Python GNUScreen.move怎麽用?Python GNUScreen.move使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GNUScreen的用法示例。


在下文中一共展示了GNUScreen.move方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: out

# 需要導入模塊: import GNUScreen [as 別名]
# 或者: from GNUScreen import move [as 別名]
# pids=sc.sort_by_ppid(pids)
thepid = pids[len(pids) - 1]
thedir = sc.get_pid_info(thepid)[0]

out(thedir, bPrint)

os.chdir(thedir)

# command='screen %s -X screen' % (session_arg)
command = "screen"
if len(sys.argv) > 2:
    command += ' -t "%s"' % (" ".join(["%s" % v for v in sys.argv[2:]]))
else:
    command += ' -t "%s"' % (thedir)


for arg in sys.argv[2:]:
    command += " " + arg
out(command, bPrint)
os.system(command)


windows_new = sc.parse_windows(sc.get_windows(session))[0]
out(str(windows_new), bPrint)
windows_diff = sc.find_new_windows(windows_old, windows_new)
target = windows_diff[0]
out("%s to %s" % (target, cwin), bPrint)
moveto = int(cwin) + 1
sc.move(int(target), moveto, True, session)
# os.system('screen %s -p %s -X title blah'%(session,endpos))
開發者ID:testacc,項目名稱:screen-session,代碼行數:32,代碼來源:screen-in-dir.py

示例2: int

# 需要導入模塊: import GNUScreen [as 別名]
# 或者: from GNUScreen import move [as 別名]
command += primer
command += [thedir]

try:
    program = (sys.argv)[ARGSNUM]
    command += (sys.argv)[ARGSNUM:]
except:
    command += [os.getenv('SHELL')]
#print command
#os.spawnvp(os.P_WAIT, SCREEN , command)
f = os.popen2(command)[1]
nwin = f.readline().split(':')[1].strip()
f.close()
nwin = '-'

if tgroup != '-1':
    # '-' may be used instead of nwin
    os.spawnv(os.P_WAIT, SCREEN , ['screen', '-S', session, '-p', nwin, '-X', 'group', tgroup])

if nwin != '-1':
    if number != '-1':
        sc.move(int(nwin), int(number), True, session)
        print(number)
    elif bRenumber:
        targ_num = int(cwin) + 1
        sc.move(int(nwin), targ_num, True, session)
        print(targ_num)
else:
    print(nwin)

開發者ID:chronidev,項目名稱:screen-session,代碼行數:31,代碼來源:new-window.py


注:本文中的GNUScreen.move方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。