Monday, August 29, 2022

How to access the operating system of your device using python

import os
a=input("Enter the name of the file you wish to open")
c=os.startfile(a)
print("opening",a)
b=input("Do you wish to do it again(Y/N)-->")
if(b.lower()=="y"):
    d=input("Enter the name of the file you wish to open")
    e=os.startfile(d)
    print("opening",d)
    f=input("Do you wish to do it again(Y/N)-->")
elif(b.lower()=="n"):
    print("Operation Ended")
else:
    print("Invalid Input")

No comments:

Post a Comment

 for i in range (65,91):     print(chr(i))