-
Notifications
You must be signed in to change notification settings - Fork 0
/
new-post.py
executable file
·46 lines (35 loc) · 1.41 KB
/
new-post.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
#!/usr/bin/python
import os
zhpath='/home/kusime/Desktop/blog/content/zh/posts/'
enpath='/home/kusime/Desktop/blog/content/en/posts/'
path='/home/kusime/Desktop/blog/content/'
print("THIS SCRPIT FILE RUN AT " + path +" FLODER")
signal='.md'
muten='.en.md'
mutzh='.zh.md'
print("zh or en")
x=input("please input the language for this content >>>")
if x == "zh":
print("do you want to creat english file for this post ??")
choise=input("y or n>>>")
name=input("please input the name for the post>>")
if choise == "y":
os.system("echo "+name+">" + zhpath + name + muten )
os.system("echo "+name+">" + zhpath + name + signal)
os.system("gedit -w " + zhpath + name + muten + ' ' + zhpath + name + signal)
else:
os.system("echo "+name+">" + zhpath + name + signal )
os.system("gedit -w " + zhpath + name + signal)
elif x == "en":
print("do you want to creat chinese file for this post ??")
choise=input("y or n>>>")
name=input("please input the name for the post>>")
if choise == "y":
os.system("echo "+name+">" + enpath + name + mutzh )
os.system("echo "+name+">" + enpath + name + signal)
os.system("gedit -w " + enpath + name + mutzh + ' ' + enpath + name + signal)
else:
os.system("echo "+name+">" + enpath + name + signal )
os.system("gedit -w " + enpath + name + signal)
else:
print("creat error")