Skip to content
/ PyShell Public

PyShell is a simple, beginner-friendly shell for both shell and Python programming. This README file provides an overview of the PyShell code and how to use it effectively. It is designed to help beginners get started with shell and Python scripting in a user-friendly environment.

License

Notifications You must be signed in to change notification settings

cMardc/PyShell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

PyShell - A Beginner-Friendly Shell for Python Programming

Static Badge GitHub GitHub all releases GitHub repo size

PyShell is a simple, beginner-friendly shell for both shell and Python programming. This README file provides an overview of the PyShell code and how to use it effectively. It is designed to help beginners get started with shell and Python scripting in a user-friendly environment.

Table of Contents

  1. Introduction
  2. Features
  3. Usage
  4. Commands
  5. Getting Help
  6. Exiting PyShell
  7. Contributing
  8. License

Introduction

PyShell is a Python script that provides a command-line interface for executing shell commands and Python scripts. It allows you to navigate directories, view files, and run shell commands or Python scripts in a simple and interactive manner. It is designed with beginners in mind, making it an excellent tool for learning shell and Python programming.

Features

  • Simple and Interactive: PyShell provides a user-friendly interface for running shell commands and Python scripts, making it accessible to beginners.
  • Directory Navigation: You can navigate directories using the goto command.
  • View Files: Use the view command to list files in the current directory.
  • Display File Contents: You can view the contents of a file using the display command.
  • Execute Shell Commands: Run shell commands directly from PyShell by entering the command.
  • Execute Python Scripts: You can also run Python scripts from PyShell.
  • Help: Get help with PyShell commands by using the __help__ command.

Usage

To use PyShell, follow these steps:

  1. Ensure you have Python 3 installed on your system.
  2. Save the PyShell code to a Python file, e.g., pyshell.py.
  3. Open a terminal or command prompt.
  4. Navigate to the directory containing pyshell.py.
  5. Run PyShell by executing python pyshell.py.

You should see the PyShell prompt, which looks like this:

$

You can now start using PyShell to run commands and scripts.

Commands

PyShell supports the following commands:

  • view: List visible files and folders in the current directory.
  • goto <directory>: Change the current directory.
  • display <file_path>: View the contents of a file.
  • current: Display the current working directory.
  • show_current: Show current directory on start.
  • hide_current: Hide current directory on start.
  • create_file <file_name>: Create a new file
  • create_folder <folder_name>: Create a new folder
  • edit <filename>: Edit a file using basic text editor.
  • view_all: List all files and folders in the current directory.
  • copy <source_file> <new_file>: Copy a file/folder
  • move <source_file> <new_file>: Move a file/folder
  • delete <source>: Delete a file/folder
  • delete_folder <source>: Delete a folder
  • __help__: Get help about PyShell.
  • __exit__: Exit PyShell.
  • version: Check version.
  • <shell_command>: Execute a shell command.

Getting Help

If you need help with PyShell commands, you can use the __help__ command to display the help text.

Example:

$ __help__

Exiting PyShell

To exit PyShell, use the __exit__ command:

$ __exit__

Examples

Here's an example of commands in PyShell:

$ goto /
$ current
/
$ show_current
/$ hide_current
$ view
'snap' 'srv' 'var' 'lib64' 'lib' 'tmp' 'bin' 'libx32' 'root' 'cdrom' 'run' 'sys' 'sbin' 'dev' 'opt' 'boot' 'lost+found' 'media' 'swapfile' 'lib32' 'etc' 'home' 'mnt' 'proc' 'usr' 
$ goto home
$ view
'root' 'cmard' 
$ goto cmard
$ create_folder test
$ goto test
$ view

$ create_file test.sh
$ edit test.sh
$ # wrote -> echo 'Hello, World!'   
Invalid command: # wrote -> echo 'Hello, World!'
$ bash test.sh
$ Hello, World!

$ __exit__

You can also use PyShell as a module and create your own python script with it:

python_code

Contributing

If you'd like to contribute to PyShell or report issues, please feel free to create an issue or submit a pull request. Your contributions are welcome and appreciated.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

PyShell is a simple, beginner-friendly shell for both shell and Python programming. This README file provides an overview of the PyShell code and how to use it effectively. It is designed to help beginners get started with shell and Python scripting in a user-friendly environment.

Topics

Resources

License

Stars

Watchers

Forks