-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.py
46 lines (38 loc) · 1.05 KB
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
print("Importing packages...")
import pprint
from xyzimport import *
import colorama
from colorama import Fore, Style
print("\n\n\n......................")
print(".. ..")
print(".. UnikornSuite ..")
print(".. ..")
print("......................")
print("\n\nBy Ayush Nayak")
input(Fore.GREEN+ "\n\nPress Enter to continue...")
print("Select the file to import:")
path = ""
while True:
try:
path = input(Fore.WHITE + "\n\nFile: ")
file = path.strip()
file = open(file, "r")
break
except:
print(Fore.RED +"\nFile not found.")
print(Fore.BLUE + "Select Operation: [1] = Update XYZ, [2] = Merge XYZ")
item = "0"
while True:
x = input(Fore.WHITE + "> ")
if(x == "1" or x == "2"):
item = x
break
if(x == "1"):
X = input("Amount to update x by > ")
Y = input("Amount to update y by > ")
Z = input("Amount to update z by > ")
print("\n\nUpdating XYZ...")
molecule = importMolecule(path)
molecules = updateXYZ(molecule, float(X), float(Y), float(Z))
print("\n\nSaving...")
printXYZ(molecules, "output.xyz")