Skip to content
Merged
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
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.
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!")
3 changes: 3 additions & 0 deletions Tic Tac Toe Game in python/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import tkinter as tk
from tkinter import messagebox