Script works with hardcoded path.
This commit is contained in:
parent
84c65689a4
commit
7c77f76f05
1 changed files with 27 additions and 0 deletions
27
pleromoji.py
27
pleromoji.py
|
@ -1,2 +1,29 @@
|
|||
import os
|
||||
from os import listdir
|
||||
from os.path import isfile, join
|
||||
|
||||
print("Hello, world!")
|
||||
|
||||
input_path = "./ms-emoji"
|
||||
|
||||
real_path = os.path.dirname(os.path.realpath(input_path))
|
||||
|
||||
def pleromoji(current_path):
|
||||
output_path = ""
|
||||
output_shortcode = ""
|
||||
output_line = ""
|
||||
|
||||
for f in listdir(current_path):
|
||||
if isfile(join(current_path, f)):
|
||||
output_path = os.path.dirname(os.path.realpath(join(current_path, f))).replace(real_path, "") + "/" + f
|
||||
output_path = "emoji" + output_path
|
||||
|
||||
output_shortcode = f.replace(".png", "")
|
||||
|
||||
output_line = output_shortcode + ", " + output_path
|
||||
print(output_line)
|
||||
else:
|
||||
pleromoji(join(current_path,f))
|
||||
|
||||
pleromoji(input_path)
|
||||
|
||||
|
|
Reference in a new issue