本文整理汇总了Python中Analyzer.Analyzer.analyze_file方法的典型用法代码示例。如果您正苦于以下问题:Python Analyzer.analyze_file方法的具体用法?Python Analyzer.analyze_file怎么用?Python Analyzer.analyze_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analyzer.Analyzer
的用法示例。
在下文中一共展示了Analyzer.analyze_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from Analyzer import Analyzer [as 别名]
# 或者: from Analyzer.Analyzer import analyze_file [as 别名]
Created by Patrick Flanagan on 2/20/2015
This is the main process. It passes the name of the file to be processed
to the Analyzer class. The main processes are to have the file opened, analyzed, and
then closed. The analysis will also be written to a log file.
"""
import sys
import os.path
from Analyzer import Analyzer
# input should be one file name
if len(sys.argv) != 2:
print "Incorrect number of arguments given. Program is expecting exactly one argument."
print "The argument should be a name of a file at the base location of the program."
else:
if not os.path.isfile(sys.argv[1] + ".mal"):
print "Argument given could not be found at the base-level of the program."
print "Check if file exists and if the name matches the given argument."
else:
analyzer = Analyzer(sys.argv[1])
analyzer.initialize_log_file()
analyzer.analyze_file()
analyzer.input_file.close()
analyzer.output_file.close()