Skip to content
15 changes: 15 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

github: # [Rpnit049, ronitraj74]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
16 changes: 16 additions & 0 deletions Digital CLock by python/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import tkinter as tk
from time import strftime

root = tk.Tk()
root.title("Digital Clock")

def time():
string = strftime('%H:%M:%S %p \n %D')
label.config(text=string)
label.after(1000,time)
label = tk.Label(root, font=('calibri',50,'bold'), background='yellow',foreground='black')
label.pack(anchor='center')

time()

root.mainloop()
90 changes: 90 additions & 0 deletions File Management App/app1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import os

def create_file(filename):
try:
with open(filename, 'x') as f:
print(f"File name {filename}: Created successfully!")
except FileExistsError:
print(f'File name {filename} already exists!')
except Exception as e:
print('An error occurred!')

def view_all_file():
files = os.listdir()
if not files:
print('No file found!')
else:
print('Files in directory:')
for file in files:
print(file)

def delete_file(filename):
try:
os.remove(filename)
print(f'{filename} has been deleted successfully!')
except FileNotFoundError:
print('File not found!')
except Exception as e:
print('An error occurred!')

def read_file(filename):
try:
with open(filename, 'r') as f:
content = f.read()
print(f"Content of '{filename}':\n{content}")
except FileNotFoundError:
print(f"{filename} doesn't exist!")
except Exception as e:
print('An error occurred!')

def edit_file(filename):
try:
with open(filename,'a') as f:
content = input("Enter data to add = ")
f.write(content + "\n")
print(f'Content added to {filename} Successfully!')
except FileNotFoundError:
print(f"{filename} doesn't exist!")
except Exception as e:
print('An error occurred!')

def main():
while True:
print("\nFILE MANAGEMENT APP")
print('1: Create file')
print('2: View all files')
print('3: Delete file')
print('4: Read file')
print('5: Edit file')
print('6: Exit')

choice = input('Enter your choice (1-6) = ')

if choice == '1':
filename = input("Enter file name to create = ")
create_file(filename)

elif choice == '2':
view_all_file()

elif choice == '3':
filename = input("Enter file name you want to delete = ")
delete_file(filename)

elif choice =='4':
filename = input("Enter file name to read = ")
read_file(filename)

elif choice == '5':
filename = input("Enter file name to edit = ")
edit_file(filename)

elif choice == '6':
print('Closing the app....')
break

else:
print('Invalid choice!')

if __name__ == "__main__":
main()
Empty file added File Management App/sample.txt
Empty file.
18 changes: 18 additions & 0 deletions FizzBuzz/fizzbuzz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'''number divisible by 3 and 5 both is fizzbuz;
number divisible by 3 is fizz;
number divisible by 5 is buzz;
'''

def fizzbuzz():
n = int(input("Enter the number to print fizz buzz:"))
for i in range (1 , n+1):
if i % 3 == 0 and i % 5 ==0:
print("fizzbuzz")
elif i % 3 == 0 :
print("fizz")
elif i % 5 ==0:
print("buzz")
else:
print(i)

fizzbuzz()
9 changes: 9 additions & 0 deletions PROJECT_1_FIBONACCI_GENERATOR.PY
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)

n = int(input("Enter number of terms :"))

for i in range (n):
print(fibonacci(i), end=" ")
67 changes: 67 additions & 0 deletions PROJECT_2_VOICE_ASSISTANT.PY
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import speech_recognition as sr
import pyttsx3
import webbrowser
import datetime
import wikipedia

# initialize
engine = pyttsx3.init()
recognizer = sr.Recognizer()

def speak(text):
engine.say(text)
engine.runAndWait()

def listen():
with sr.Microphone() as source:
print("Listening...")
audio = recognizer.listen(source)
try:
command = recognizer.recognize_google(audio)
print("You said:", command)
return command.lower()
except:
speak("Sorry, I didn't catch that")
return ""

def process_command(command):
if "hello" in command:
speak("Hello Ronit! How can I help you?")

elif "time" in command:
time = datetime.datetime.now().strftime("%H:%M")
speak(f"The time is {time}")

elif "open youtube" in command:
webbrowser.open("https://www.youtube.com")
speak("Opening YouTube")

elif "open my github profile" in command:
webbrowser.open("https://www.github.com/Ronit049")
speak("Opening Your github profile Ronit")

elif "open my Twitter profile" in command:
webbrowser.open("https://x.com/its_rsr04")
speak("Opening your twitter profile")

elif "search" in command:
speak("What should I search?")
query = listen()
webbrowser.open(f"https://www.google.com/search?q={query}")

elif "wikipedia" in command:
speak("Searching Wikipedia...")
query = command.replace("wikipedia", "")
result = wikipedia.summary(query, sentences=2)
speak(result)

elif "exit" in command:
speak("Goodbye!")
exit()

# main loop
speak("Voice assistant started")

while True:
command = listen()
process_command(command)
56 changes: 56 additions & 0 deletions PROJECT_3_Game_of_Tic-Tac-Toe.PY
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import tkinter as tk
from tkinter import messagebox

def check_winner():
global winner
for combo in [[0,1,2],[3,4,5],[6,7,8],
[0,3,6],[1,4,7],[2,5,8],
[0,4,8],[2,4,6]]:

if buttons[combo[0]]["text"] == buttons[combo[1]]["text"] == buttons[combo[2]]["text"] != "":

# highlight winner
for i in combo:
buttons[i].config(bg="green")

messagebox.showinfo("Tic-Tac-Toe", f"Player {buttons[combo[0]]['text']} wins!")
winner = True

# disable all buttons
for b in buttons:
b.config(state="disabled")

def button_click(index):
if buttons[index]["text"] == "" and not winner:
buttons[index]["text"] = current_player
check_winner()
if not winner:
toggle_player()

def toggle_player():
global current_player
current_player = "X" if current_player == "O" else "O"
label.config(text=f"Player {current_player}'s turn")

# main window
root = tk.Tk()
root.title("Tic-Tac-Toe")

buttons = [
tk.Button(root, text="", font=("normal",25),
width=6, height=2,
command=lambda i=i: button_click(i))
for i in range(9)
]

# grid layout
for i, button in enumerate(buttons):
button.grid(row=i // 3, column=i % 3)

current_player = "X"
winner = False

label = tk.Label(root, text=f"Player {current_player}'s turn", font=("normal",16))
label.grid(row=3, column=0, columnspan=3)

root.mainloop()
12 changes: 12 additions & 0 deletions Python QRCode project/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import qrcode

url = input("Enter the URL here: ").strip()
file_path = "C:\\Users\\iamro\\OneDrive\\Documents\\Desktop\\qrcode.png"

qr = qrcode.QRCode()
qr.add_data(url)

img = qr.make_image()
img.save(file_path)

print("QR Code was generated!")
Loading