Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import self as self
- from os import listdir
- from os.path import isfile, join
- import os
- # so this program works like this:
- # it takes path were are the list of folders. for example folder add, sum.
- # it will go into add, sum folder and will try to find add.asm and sum.asm
- def create_path(path, name):
- return path + '\\' + name + '\\' + name + '.' + 'asm'
- def open(path):
- # onlyfiles = [f for f in listdir(path) if isfile(join(path, f))]
- file_list = listdir(path);
- file_list = [create_path(path, name) for name in file_list]
- for my_file in file_list:
- if not os.path.isfile(my_file):
- print("File path {} does not exist. Exiting...".format(my_file))
- sys.exit()
- for line in file(my_file).readlines():
- strip_line = string.strip(line)
- def main():
- try:
- path = sys.argv[1]
- except:
- print("No path entered!\n")
- # open the file!
- open(path)
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement