software_updation.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:smartschool 作者: asifkodur 项目源码 文件源码
def install(self,DB):
        import stat
        self.backup_db(DB)
        '''output=Popen(['gksudo','rmdir','/var/21'],stdout=PIPE,stderr=PIPE)
        output = p.stdout.read()
        print output
        '''

        #print subprocess.check_call('cd /tmp/smart_school', shell=True)# IF OUT PUT 0 success, if 1, fail, 3 password error
        #print subprocess.call('gksu chmod +x /tmp/smart_school/install.sh',shell=True,stderr=subprocess.STDOUT)# IF OUT PUT 0 success, if 1, fail, 3 password error
        os.chmod('/tmp/smart_school/install.sh', stat.S_IEXEC)
        output=subprocess.call('cd /tmp/smart_school\ngksu ./install.sh',shell=True)#,stderr=subprocess.STDOUT)# IF OUT PUT 0 success, if 1, fail, 3 password error
        return output # success if out put is 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号