main.py 文件源码

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

项目:Codeforces-Sublime-Plugin 作者: karunk 项目源码 文件源码
def run(self):
        head, tail = os.path.split(self.window.active_view().file_name())
        CurrentWindowFileName = self.window.active_view().file_name().split('/')[-1].split('.')[0]
        CurrentWindowFileType = self.window.active_view().file_name().split('/')[-1].split('.')[-1]

        if os.path.isfile(CurrentWindowFileName) == False:
            sublime.error_message("You have not complied your solution! Build the executable using sublime text")
            return

        inputFile = CurrentWindowFileName+"_input.in"
        outputFile = CurrentWindowFileName+"_output.out"

        if os.path.isfile(inputFile) == False:
            print(os.path.isfile(inputFile), inputFile)
            sublime.error_message("Initialize the input first! Enter your custom testcases here")
            self.window.open_file(inputFile)
            return


        cmd = QuoteFunc(head + '/' + tail.split('.')[0])+"<"+QuoteFunc(head + '/' + inputFile)+">"+QuoteFunc(head + '/' + outputFile)
        command = Command(cmd)
        command.run(timeout = 3)
        self.window.open_file(outputFile)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号