python中doc=parased.getroot()_在中查找理解sed命令的帮助操作系统Python线()

我正在把我写的一些代码翻译成一个并行进程,然后分发到我家大学的计算机集群上。为了准备为集群编写脚本,我首先阅读了集群提供的Python代码示例:#! /usr/bin/python

# This script replicates a given test with varied parameters

# creating unique submit scripts and executing the submission to the CRC SGE queue

# Imports

import os

import shutil

import string

basedir=os.getcwd()

origTestFol='wwd'

templFol='template'

origTestDir= basedir + '/' + origTestFol

templFolDir= basedir + '/' + templFol

steps=[0,1,2,3,4,5,6,7,8,9]

primes=[2,3,5,7,11,13,17,19,23,29,31]

trials=[6,7,8,9,10]

for step in steps:

newTestDir= origTestDir + '_nm_' + str(step)

if not os.path.exists(newTestDir):

os.mkdir(newTestDir)

os.chdir(newTestDir)

for trial in trials:

newTestSubDir= newTestDir + '/' + str(trial)

if not os.path.exists(newTestSubDir):

shutil.copytree(templFolDir,newTestSubDir)

os.chdir(newTestSubDir)

os.system('sed -i \'s/seedvalue/' + str(primes[trial]) + '/g\' wwd.nm.conf')

os.system('sed -i \'s/stepval/' + str(step) + '/g\' qsubScript.sh')

os.system('qsub qsubScript.sh')

os.chdir(basedir)

我可以跟踪代码到最后四行[例如,直到”操作系统('sed-i…“)但是很难遵循代码。有没有其他人可以帮我理解这最后四行的意思。有没有一种方法来描述伪代码中的谎言?据我所知,第一行sed试图用素数的值替换“seedvalue”,但我不确定seedvalue是什么。我也不知道怎么在后面的那一行。如果其他人能对这些问题有所了解,我们将不胜感激。在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值