Skip to content

Commit

Permalink
Code improved!
Browse files Browse the repository at this point in the history
The following changes were applied:
-At line 118, the input message will be "Now It's time to define the order in which the Cartesian Products will be made" instead of  "Now It's time to define the order in which the Permutations will be made..." 
-At line 123, this program will now add the last key name available to the Keys_input array automatically
-At line 183, this program will do some magic tricks to transform the df into a more useful and convenient df called "res", then it will export that "res" as a csv file instead of the old "df"
  • Loading branch information
noahverner1995 authored Jan 10, 2022
1 parent 5a4ecec commit 97a0083
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions SAND-wich.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,16 @@ def exist(key, value, diccionario):
while True:
AllKeysNames = the_dictionary_list.keys()
print('\033[46m'+str(AllKeysNames)+'\033[0m')
ele = input("\033[0;37;40mNow It's time to define the order in which the Permutations will be made, tell me which valid key you want me to set now:\033[0m ")
ele = input("\033[0;37;40mNow It's time to define the order in which the Cartesian Products will be made, tell me which valid key you want me to set now:\033[0m ")
if ele in the_dictionary_list and ele not in Keys_input:
Keys_input.append(ele) # adding the element
i += 1
print(f'\033[0;37;42mThe array has been updated, its current storage is the following {Keys_input}\033[0m')
if i == n:
if i == (n-1):
for key in the_dictionary_list:
if key not in Keys_input:
Keys_input.append(key)
print(f'\033[0;37;42mLet me add the last key, the final storage is the following {Keys_input}\033[0m')
print("\u001b[45mThe array is now full, let's continue with the next step\033[0m")
break
else:
Expand Down Expand Up @@ -176,8 +180,10 @@ def exist(key, value, diccionario):
result_image.save(f"{final_path}/{i}.png")
time.sleep(0.3)
print('\n')
res = pd.concat([df.Permutations.str.split('+', expand=True), df.FilePermutations.str.split('+', expand=True)], axis=1).replace({'_': ' ', '.png': ''}, regex=True) #Change the Metadata format
res.sort_index(axis=1, inplace=True)
print(f'Exporting {folder_name}_NFTs_Metadata.csv to: {final_path}')
df.to_csv(f'{final_path}/{folder_name}_NFTs_Metadata.csv')
res.to_csv(f'{final_path}/{folder_name}_NFTs_Metadata.csv')
time.sleep(0.1)
print('\n')
print('\033[0;37;42mAll done!, Thank you for using SAND-wich, built by @NoahVerner, see you next time :)\033[0m')
Expand Down

0 comments on commit 97a0083

Please sign in to comment.