MOTOSHARE 🚗🏍️
Turning Idle Vehicles into Shared Rides & Earnings
From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.
With Motoshare, every parked vehicle finds a purpose.
Owners earn. Renters ride.
🚀 Everyone wins.
Write a python program which should following
- Prompt Input from user one Location of Linux filesystem and list each files of the directory.
- file name must be listed with row and serical num ie. 1.2.3.4.5 along with size | owner | last modified date.
- User must be promoted with a options to delete files by choosing serical num ie. 1.2.3.4.5
- User must be promoted every time with 2 options. 1. Exit the interactive session 2. Continue with file delete ops.
import osCode language: JavaScript (javascript)
listofiledict={}
directoryName=""
path=""
def showfiles():
directoryName=input("Enter your directory name with full path")
#print(os.system(('ls %s -l')% directoryName))
listFiles=os.listdir(directoryName)
i=1;
for f in listFiles:
path=directoryName + "/" + f
#print(i,os.system(('ls -l %s')% '"'+path+'"'))
listofiledict[i]=path
i+=1Code language: PHP (php)
def delfileaction():
delyes=input("Do you want to delte file Enter yes or no ")
if(delyes == "yes" or delyes == "y"):
delfileNum=input("Enter the seq number to delete the file")
delfile(delfileNum)
if(delyes == "no" or delyes == "n"):
exit()
def choosefuncrtion():
action=input("Enter your action: showlist or delete")
print(action)
if(action == "showlist"):
showfiles()
if(action == "delete"):
showfiles()
delfileaction()Code language: PHP (php)
def delfile(delfileNum):
print(listofiledict)
filestodel=listofiledict[int(delfileNum)]
delaction=os.system(('rm %s -f')% filestodel)
delyes=input("Do you want to delte more file Enter yes or no")
if(delyes == "yes" or delyes == "y"):
delfileNum=input("Enter the seq number to delete the file")
delfile(delfileNum)
if(delyes == "no" or delyes == "n"):
exit()Code language: PHP (php)
choosefuncrtion()