Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ni_sh_a.char IDE for Python #169

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 2 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,2 @@
# Code-Collection-hacktoberfest2022
This repository is for everyone who wants to participate in Hacktoberfest 2022.
<br>
<h1>Hacktober Fest 2022 For Everyone!👋👋</h1>
<br>
<img src = "https://github.com/AnanyaDas162/LGMVIP-WEBDEV/blob/main/Images/download.jfif" alt= "Its time to contribute!!" height = "100%" width = "100%">
<h1>🎖️🎖️Rewards ::🎖️🎖️</h1>
<h6>You can get awesome goodies like T-Shirt and some stickers for FREE!!!🤩🤩</h6>
<h1>👨‍💻👩‍💻Upload your Projects or DSA related Programs in any Language👨‍💻👩‍💻</h1>
<h6>Use this project to make your first contribution to an open source project on GitHub!!</h6>
<br>
<h1>What is Hacktoberfest?</h1>
<h6>Hacktoberfest is a month-long celebration of open-source software by DigitalOcean that encourages participation in giving back to the open-source community. Developers get involved by completing pull requests, participating in events, and donating to open source projects.</h6>
<br>
<img src="https://github.com/AnanyaDas162/LGMVIP-WEBDEV/blob/main/Images/github-logo-octocat-.gif" style="display:flex; justify-content:center;">
<br>
<h1>Why should you contribute for Hacktoberfest??🤔🤔</h1>
<h6>It encourages developers and also beginners to contribute to open source projects and practice programming by participating in solving problems across projects.</h6>
<br>
<img src="https://github.com/AnanyaDas162/LGMVIP-WEBDEV/blob/main/Images/why-contribute.gif">
<br>
<h1>How to participate??🤔🤔</h1>
<h3>👇👇Steps to follow:👇👇</h3>
<h3>1. Register for Hacktoberfest</h3>
<a href="https://hacktoberfest.com/">Register Here</a>
<h3>2. Add Project/Program in any Language you like:</h3>
<h6>Add any of your simple or complex Project/Program in any language you like in this repository by clicking "Add File -> Create new File".</h6>

<h3>4. Create Pull Request:</h3>
<h6>Once you have completed these steps, you are ready to start contributing by clicking on Create Pull Request.</h6>
<h3>5. Give this Project a Star:</h3>
<h6>If you liked working on this project, please share this project as much as you can and star this project to help as many people in opensource as you can.</h6>
<h1>📝📝Notes :: 📝📝</h1>
<h6>1. Don't Create Pull Request to update "readme.md" File.</h6>
<h6>2. Upload or Create File in Specified Folders.</h6>
<h6>3. If Specified Folder not Found then Create Folder and then Upload or Create File.</h6>
<h6>4. In case you need to add an external package, install it by using npm. Don't push the complete package file here.</h6>
<h3>
5. If you are uploading a Leetcode / GFG problem, then please mention it and upload it in the corresponding folder. And also give the file name same as the problem name.
</h3>
<h6></h6>
<h6></h6>
<h6></h6>
<h6></h6>
<h1>Contributors :: </h1>
<br>
<a href="https://github.com/AnanyaDas162/Data-Structures-Algorithms-And-any-other-project-Hacktoberfest2022/graphs/contributors">
<img src="https://contrib.rocks/image?repo=AnanyaDas162/Data-Structures-Algorithms-And-any-other-project-Hacktoberfest2022" />
</a>
<h6>Thanks for contributing. It's an amazing experience to collaborate with you all!</h6>
<br>
<img src = "https://github.com/AnanyaDas162/LGMVIP-WEBDEV/blob/main/Images/code.avif" >
# ni_sh_a.char-IDE
A simple IDE to execute Python codes
39 changes: 39 additions & 0 deletions github.sh/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Git-Automation
Script to automate Git from project working directory with a menu to choose from, you just have configure once and the script can be used for the following operations.

```
Which Git operations you want to perform ?
(0) Configure
(1) Clone
(2) Pull
(3) Push
(4) Exit
Enter your choice [0-4]:
```

# About

* Use the script **"github.sh"** file inside your project working directory to automate git procedures by **just configuring the script once and use it any number of times.**
* You just have to use the configure option once and if you wish to change the working directory you just have to use the configure option to start working with the new project.

* Just give the file write access and use the script by running:

```
$./github.sh
```

# How prepare the file

Use the file as super user or admin acces and provide the file with write access by :
```
$ chmod +x github.sh
```
inside the terminal, in the project working directory.

# How to use the script

Keep working on project files and run :
```
$ ./github.sh
```
in the project working directory's terminal, while the **"github.sh"** file is present and provided with **write access** and you will be able to handle your project files with git operations using a simple menu driven approach.
136 changes: 136 additions & 0 deletions github.sh/github.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#! /bin/bash

### Git automation script for automating git clone, push and pull ###
### Created by PIYUSH-MISHRA-00 ###

while :
do
echo
echo "Which Git operation you want to perform ?"
echo
echo "GitHub username: $username"
echo "Local repository name: $local_repo"
echo "Remote repository name: $remote"
echo "The default branch you want to work with: $branch"
echo "GPG key value: $GPG"
echo
echo -e "\t(0) Configure (configures the script for continuous uses)"
echo -e "\t(1) Clone"
echo -e "\t(2) Pull"
echo -e "\t(3) Push"
echo -e "\t(4) Exit"
echo -n "Enter your choice [0-4]: "

read choice

case $choice in

0) echo "Enter the values for future use of the script..."
echo
echo "Enter GitHub username: "
read username
export username
echo "Your username is: $username"
echo
echo "Local repository name: "
read local_repo
export local_repo
echo "Your local repository name is: $local_repo"
echo
echo "Remote repository name: "
read remote
export remote
echo "Remote repository name is: $remote"
echo
echo "The default branch you want to work with: "
read branch
export branch
echo "The default branch you want to work with: $branch"
echo
echo "GPG key value is: $GPG"
echo
echo "GPG key id for signed commits(leave blank if you don't want signed commits)"
read GPG
export GPG
echo "GPG key value is: $GPG"
echo
;;

1) echo "Cloning from GitHub"
echo
echo "Enter the repository https url: "
read clone_url
git clone $echo $clone_url;;

2) echo "Pulling from GitHub"
echo
echo "Enter the repository https url: "
read pull_url
echo
echo $pull_url
echo
while :
do
echo "Which type of Git Pull you want ?"
echo -e "\t(1) Merge (the default strategy)"
echo -e "\t(2) Rebase"
echo -e "\t(3) Fast-forward only"
echo -e "\t(4) Return to main menu"
echo -n "Enter your choice [1-4]: "
read pull_choice
case $pull_choice in
1)
git config pull.rebase false
git pull $echo "$pull_url";;
2)
git config pull.rebase true
git pull $echo "$pull_url";;
3)
git config pull.ff only
git pull $echo "$pull_url";;
4)
break
;;
*)
echo "Invalid operation"
;;
esac
done
;;

3) echo "Pushing to GitHub"
declare -A map

map[$echo"$local_repo"] = $echo"$remote"

git config --global user.name $echo"$username"
git config --global user.signingkey $echo$GPG
git init
git add .
echo "Enter Commit message: "
read message
git commit -m $echo "$message"
echo "Enter Tag name: (Press enter if you want to skip the tag name)"
read tag
echo "Enter Tag message: (Press enter if you want to skip the tag message)"
read tag_message
git tag -a $echo$tag -m "$echo$tag_message"
git tag -n

for i in "${!map[@]}"
do
git remote add $i https://github.com/$echo$username/${map[$i]}.git
git push -u $i $echo$branch
done

git push;;

4) echo "Quitting..."
exit
;;

*) echo "Invalid operation"
;;

esac
done
69 changes: 69 additions & 0 deletions ni_sh_a.char/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from tkinter import *
from tkinter.filedialog import asksaveasfilename, askopenfilename
import subprocess

compiler = Tk()
compiler.title('ni_sh_a.char IDE')
file_path = ''


def set_file_path(path):
global file_path
file_path = path


def open_file():
path = askopenfilename(filetypes=[('Python Files', '*.py')])
with open(path, 'r') as file:
code = file.read()
editor.delete('1.0', END)
editor.insert('1.0', code)
set_file_path(path)


def save_as():
if file_path == '':
path = asksaveasfilename(filetypes=[('Python Files', '*.py')])
else:
path = file_path
with open(path, 'w') as file:
code = editor.get('1.0', END)
file.write(code)
set_file_path(path)


def run():
if file_path == '':
save_prompt = Toplevel()
text = Label(save_prompt, text='Please save your code')
text.pack()
return
command = f'python {file_path}'
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
output, error = process.communicate()
code_output.insert('1.0', output)
code_output.insert('1.0', error)


menu_bar = Menu(compiler)

file_menu = Menu(menu_bar, tearoff=0)
file_menu.add_command(label='Open', command=open_file)
file_menu.add_command(label='Save', command=save_as)
file_menu.add_command(label='Save As', command=save_as)
file_menu.add_command(label='Exit', command=exit)
menu_bar.add_cascade(label='File', menu=file_menu)

run_bar = Menu(menu_bar, tearoff=0)
run_bar.add_command(label='Run', command=run)
menu_bar.add_cascade(label='Run', menu=run_bar)

compiler.config(menu=menu_bar)

editor = Text()
editor.pack()

code_output = Text(height=10)
code_output.pack()

compiler.mainloop()