I am creating a sort of “Command line” in Python. I already added a few functions, such as changing login/password, executing, etc., But is it possible to browse files in the directory that the main file is in with a command/module, or will I have to make the module myself and use the import command? Same thing with changing directories to view, too.
Share
Browsing files is as easy as using the standard
osmodule. If you want to do something with those files, that’s entirely different.To change directories you can issue
os.chdir('path/to/change/to'). In fact there are plenty of useful functions found in theosmodule that facilitate the things you’re asking about. Making them pretty and user-friendly, however, is up to you!