Skip to content

This advanced code converter translates Python to Shell. It is capable of handling most translations. Please note that this translates from Python to Shell, and does not support Shell to Python translations.

License

Notifications You must be signed in to change notification settings

The3DP/Code-Translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Code converter

This advanced code converter translates Python to Shell. It is capable of handling most translations. Please note that this translates from Python to Shell, and does not support Shell to Python translations.

Example input (in Python)

# Greet a user multiple times
name = input("Enter your name: ")
count = 3

for i in range(count):
    print("Hello", name, i)

if name == "Alice":
    print("Welcome back!")
elif name == "Bob":
    print("Hey Bob!")
else:
    print("Who are you?")

Example output (in Shell)

# Greet a user multiple times
read -p "Enter your name: " name
count=3

for i in $(seq 0 $((count - 1))); do
  echo "Hello $name $i"
done

if [ "$name" = "Alice" ]; then
  echo "Welcome back!"
elif [ "$name" = "Bob" ]; then
  echo "Hey Bob!"
else
  echo "Who are you?"
fi

Using the translator is easy and fun. Simply copy and paste Translator.py into a Python file

,then run it in IDLE.

This repo was made with partial assistance from ChatGPT.

About

This advanced code converter translates Python to Shell. It is capable of handling most translations. Please note that this translates from Python to Shell, and does not support Shell to Python translations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages