-
Notifications
You must be signed in to change notification settings - Fork 129
Feat/resume builder internships #117
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
base: main
Are you sure you want to change the base?
Changes from all commits
15f2d8d
db19bc8
0173fc9
026b56e
0a32153
392a9e6
672129d
d4f80b8
56dff0e
8dc8667
2b0e978
d43108c
fd67603
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,50 @@ | ||
from time import strftime | ||
from tkinter import Label, Tk | ||
from tkinter import Label, Tk , Button | ||
Comment on lines
1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra space before comma in the import statement. Should be Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
|
||
window = Tk() | ||
window.title("Digital Clock") | ||
window.geometry("300x100") | ||
window.configure(bg="green") | ||
window.resizable(False, False) | ||
|
||
use_24h = True | ||
|
||
clock_label = Label( | ||
window, bg="black", fg="green", font=("Arial", 30, "bold"), relief="flat" | ||
) | ||
clock_label.place(x=50, y=50) | ||
|
||
|
||
date_label = Label( | ||
window, bg="black", fg="white", font=("Arial", 14) | ||
) | ||
date_label.pack(pady=(0, 10), anchor="center") | ||
|
||
|
||
|
||
def toggle_format(_evt=None): | ||
global use_24h | ||
use_24h = not use_24h | ||
fmt_btn.config(text="Switch to 24-hour" if not use_24h else "Switch to 12-hour") | ||
|
||
fmt_btn = Button(window, text="Switch to 12-hour", command=toggle_format) | ||
fmt_btn.pack(pady=(0, 8)) | ||
window.bind("<f>", toggle_format) # press 'f' to toggle | ||
|
||
|
||
|
||
def update_label(): | ||
current_time = strftime("%H: %M: %S\n %d-%m-%Y ") | ||
clock_label.configure(text=current_time) | ||
clock_label.after(80, update_label) | ||
clock_label.pack(anchor="center") | ||
|
||
if use_24h: | ||
time_text = strftime("%H:%M:%S") | ||
else: | ||
# strip leading zero in 12h mode for a cleaner look | ||
time_text = strftime("%I:%M:%S %p").lstrip("0") | ||
clock_label.configure(text=time_text) | ||
date_label.configure(text=strftime("%A, %b %d, %Y")) | ||
window.after(1000, update_label) | ||
|
||
update_label() | ||
window.mainloop() | ||
window.mainloop() | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,9 @@ def clear_screen(): | |
"skills": [], | ||
"projects": [], | ||
"certifications": [], | ||
"achievements": [] | ||
"achievements": [], | ||
"internships":[] | ||
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing space after the colon. Should be Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
|
||
} | ||
|
||
# Function to navigate back to the main menu | ||
|
@@ -54,6 +56,9 @@ def add_experience(): | |
break | ||
back_to_menu() | ||
|
||
|
||
|
||
|
||
# Add education details | ||
def add_education(): | ||
while True: | ||
|
@@ -127,6 +132,29 @@ def add_achievements(): | |
if more == "no": | ||
break | ||
back_to_menu() | ||
|
||
# Add internships | ||
def add_internships(): | ||
while True: | ||
clear_screen() | ||
print("Enter Internship Information") | ||
internship = { | ||
"role": prompt("Role/Title: "), | ||
"company": prompt("Company: "), | ||
"location": prompt("Location (optional): "), | ||
"start_date": prompt("Start Date (e.g., Jun 2024): "), | ||
"end_date": prompt("End Date (e.g., Aug 2024 or 'Present'): "), | ||
"details": [s.strip() for s in prompt("Highlights (comma-separated): ").split(",") if s.strip()] | ||
} | ||
resume_data["internships"].append(internship) | ||
|
||
more = prompt("Add another internship? (yes/no): ").strip().lower() | ||
if more == "no": | ||
break | ||
back_to_menu() | ||
|
||
|
||
|
||
|
||
# PDF Generation class | ||
class ResumePDF(FPDF): | ||
|
@@ -186,7 +214,21 @@ def generate_pdf(): | |
pdf.cell(0, 10, proj["name"], 0, 1) | ||
pdf.multi_cell(0, 10, proj["description"]) | ||
pdf.cell(0, 10, f"Technologies Used: {proj['technologies']}", 0, 1) | ||
# Internships | ||
if resume_data["internships"]: | ||
pdf.set_font('Arial', 'B', 12) | ||
pdf.cell(0, 10, "Internships", 0, 1) | ||
pdf.set_font('Arial', '', 11) | ||
for it in resume_data["internships"]: | ||
hdr = f"{it['role']} at {it['company']}" | ||
if it.get("location"): | ||
hdr += f" — {it['location']}" | ||
pdf.cell(0, 10, f"{hdr} ({it['start_date']} - {it['end_date']})", 0, 1) | ||
if it.get("details"): | ||
pdf.multi_cell(0, 10, "Highlights: " + ", ".join(it["details"])) | ||
|
||
|
||
|
||
# Certifications | ||
pdf.set_font('Arial', 'B', 12) | ||
pdf.cell(0, 10, "Certifications", 0, 1) | ||
|
@@ -209,6 +251,8 @@ def generate_pdf(): | |
os.system(f"start {pdf_output_path}" if os.name == "nt" else f"open {pdf_output_path}") | ||
print(f"Resume generated: {pdf_output_path}") | ||
|
||
|
||
|
||
# Main Menu using button_dialog from prompt_toolkit | ||
def interactive_menu(): | ||
while True: | ||
|
@@ -222,10 +266,11 @@ def interactive_menu(): | |
("Education", 3), | ||
("Skills", 4), | ||
("Projects", 5), | ||
("Certifications", 6), | ||
("Achievements", 7), | ||
("Generate PDF", 8), | ||
("Exit", 9) | ||
("Internships", 6), | ||
("Certifications", 7), | ||
("Achievements", 8), | ||
("Generate PDF", 9), | ||
("Exit", 10) | ||
] | ||
).run() | ||
|
||
|
@@ -240,12 +285,14 @@ def interactive_menu(): | |
elif choice == 5: | ||
add_projects() | ||
elif choice == 6: | ||
add_certifications() | ||
add_internships() | ||
elif choice == 7: | ||
add_achievements() | ||
add_certifications() | ||
elif choice == 8: | ||
generate_pdf() | ||
add_achievements() | ||
elif choice == 9: | ||
generate_pdf() | ||
elif choice == 10: | ||
break | ||
|
||
# Start the program | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant conversion:
age
is already converted to int on line 21, soyear = int(age)
on line 25 is unnecessary. Useyear = age
instead.Copilot uses AI. Check for mistakes.