0
私は、端末に別名を入力したときと同じように、私が選んだユーザーのエイリアスを表示するために、Pythonでスクリプトを作成しようとしています。Pythonでユーザーエイリアスを表示する方法
tt = open("/etc/passwd" , "r")
with tt as f2:
with open("passwd" , "w+") as f1:
f1.write(f2.read())
f1.seek(0,0)
command = f1.read()
print
print command
chose = raw_input("select user's name from this list > ")
rootlist = "1) Show user groups \n2) Show user id \n3) Show users alias\n4) Add new alias \n5) Change Password \n6) Back"
print
print rootlist
print
chose2 = int(raw_input("Choose a command > "))
if choose == 3:
os.system("alias ")
しかしos.system(「エイリアス」)は動作しないと私はtはそれを行う適切な方法を見つけるように見えることはできません。 これまでのコードは次のようになります。