-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
62 lines (42 loc) · 1.25 KB
/
Copy pathmain.py
File metadata and controls
62 lines (42 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Professional-URL-Shortener-Python
# Main File
#Developer : Huma Fatima
from utils import print_header, print_error
from url_manager import (
create_short_url,
open_original_url,
view_all_urls,
delete_url,
show_statistics
)
def display_menu():
print_header("PROFESSIONAL URL SHORTENER")
print("1. Shorten New URL")
print("2. Open Original URL")
print("3. View All URLs")
print("4. Delete URL")
print("5. Statistics")
print("6. Exit")
def main():
while True:
display_menu()
choice = input("\nEnter your choice (1-6): ").strip()
if choice == "1":
create_short_url()
elif choice == "2":
open_original_url()
elif choice == "3":
view_all_urls()
elif choice == "4":
delete_url()
elif choice == "5":
show_statistics()
elif choice == "6":
print("\nThank you for using Professional URL Shortener.")
print("Goodbye!\n")
break
else:
print_error("Invalid choice. Please try again.")
input("\nPress Enter to continue...")
if __name__ == "__main__":
main()