- lfuns_path = argv[2]
- if os.path.isdir(lfuns_path):
- lfuns_path = lfuns_path + "LFUNs.lyx"
- elif os.path.exists(lfuns_path):
- error(script_name + ": %s already exists, delete it and rerun the script" % lfuns_path)
+ if len(argv) == 3:
+ lfuns_path = argv[2]
+ if os.path.isdir(lfuns_path):
+ lfuns_path = lfuns_path + "LFUNs.lyx"
+ elif os.path.exists(lfuns_path):
+ error(script_name + ": %s already exists, delete it and rerun the script" % lfuns_path)
+ lfuns_file = open(lfuns_path, 'wb')
+ else:
+ lfuns_file = sys.stdout