PyFWC 1.0 - она может работать пока, что тока с файлами.
Вот код + файл.
———————–
———————–
import os import time def HiUser(): print('================================================================================') print(' Hello! I PyFWC v1.0. Info FWC (info) ') print('================================================================================') #------------------------ OsDebug = 'CMD.PyFWC: ' ErrorOS = ' CMD.PyFWC: Error' CmdPrint = ' Command:' CloseLine = ' ============================================' #------------------------ def CommandOS(): print('') Command = input(OsDebug) if Command == 'help': print('') print(CloseLine) print(CmdPrint, 'help') print(CmdPrint, 'info') print(CloseLine) print(CmdPrint, 'dir - directory') print(CmdPrint, 'dir.. - open directory "C:"') print(CmdPrint, 'open - info open (commands)') print(CmdPrint, 'MoveFile (move) - move file the directory.') print(CmdPrint, 'remove - info remove. (commands)') print(CmdPrint, 'create - info create. (commands)') print(CloseLine) print(CmdPrint, 'ClearFWC (cls) - clear console PyOS') print(CloseLine) elif Command == 'info': print('') print(CloseLine) print(' it PyFWC v1.0, new FWC in python. input command "help"') print(' --------------------Update-1.0----------------------') print(' Create File System, Graphics Update, Error Update') print(CloseLine) elif Command == 'ClearFWC' or Command == 'cls': os.system('cls') HiUser() elif Command == 'MoveFile' or Command == 'move': try: print('') movefile = input('Move (name file or dir): ') movedir = input('Dir: ') os.system('Move {} {} '.format(movefile, movedir)) del movefile del movedir except OSError: print('') print(CloseLine) print(ErrorOS) print(CloseLine) elif Command == 'RenameFile' or Command == 'rename': print('') filestname = input('File: ') filenvname = input('Rename: ') os.rename(filestname, filenvname) elif Command == 'dir': print('') print(CloseLine) print(' ',os.listdir(os.getcwd())) print(CloseLine) elif Command == 'dir..': os.chdir('C://') elif Command == 'open': print('') print(CloseLine) print(' open.dir - open directory. (You directory)') print(' read.file (open.file) - read file. (You file)') print(CloseLine) elif Command == 'open.dir': try: print('') dir = input('Directory: ') print('') try: os.chdir(dir) except OSError: print(CloseLine) print(' Error') print(CloseLine) del dir except FileNotFoundError: print(OsDebug, 'Dir', dir, 'not found') except NotADirectoryError: print(OsDebug, 'File', dir, 'not dir (read.file)') elif Command == 'read.file' or Command == 'open.file': try: print('') dir = input('File: ') print('') with open(dir, 'r') as file: file.read(9999) del dir except FileNotFoundError: print(OsDebug, 'File', dir, 'not found') except NotADirectoryError: pass elif Command == 'remove': print('') print(CloseLine) print(' remove.file - delete file') print(' remove.dir - delete dir') print(CloseLine) elif Command == 'remove.dir': try: print('') dir = input('Directory: ') os.rmdir(dir) del dir except FileNotFoundError: print('') print(CloseLine) print(ErrorOS) print(CloseLine) except NotADirectoryError: print('') print(CloseLine) print(ErrorOS) print(CloseLine) except OSError: print('') print(CloseLine) print(ErrorOS) print(CloseLine) elif Command == 'remove.file': try: print('') dir = input('File: ') print('') os.remove(dir) del dir except FileNotFoundError: print('') print(CloseLine) print(ErrorOS) print(CloseLine) except NotADirectoryError: print('') print(CloseLine) print(ErrorOS) print(CloseLine) except OSError: print('') print(CloseLine) print(ErrorOS) print(CloseLine) elif Command == 'create': print('') print(CloseLine) print(' create.dir - create direcory') print(' create.file - create file ') print(CloseLine) elif Command == 'create.dir': print('') dir = input('Create directory: ') try: os.mkdir(dir) except FileNotFoundError: print('') print(CloseLine) print(ErrorOS) print(CloseLine) del dir elif Command == 'create.file': print('') dir = input('Create file: ') with open(dir, 'w') as file: pass del dir #----------------------- else: print('') print(CloseLine) print(' CMD.PyFWC: CommandError') print(CloseLine) #------------------------ HiUser() while True: CommandOS() time.sleep(1)
Файл не актуален!!: