The enumerate() function have a parameter called "start" to tell the function where it should start the counting. So instead using idx + 1 we can use enumerate(categories, start = 1) and the idx will start from 1.
@rabibasukala7816 Жыл бұрын
adding ui and graphs will be great .Thanks
@nicholasnguyen8584 Жыл бұрын
Are we able to keep all of this data somewhere in a txt file or something?
@xylosfroxy3526 Жыл бұрын
We can even use CSV file for saving expenses instead of database and can get visual presentation of our expenses category wise using matplotlib library
@valentines92Ай бұрын
after creating this program and want to put in web app or mobile you need to learn another language? or python have it aswell?
@akrit.ghimire Жыл бұрын
That was so fun to do!
@MichaelDeBusk Жыл бұрын
One easily-implemented but huge improvement would be to add a "payee" field that works the same as "category". I think I'd create separate tables for payee and category, too, but then it'd be more of a tutorial for sqlite than for python.
@BrandonHurt Жыл бұрын
I did everything right and because I use Gentoo with systemd not rc the db packages for some reason don't work unless you have rc style init system, so all of your great toots about sql won't work for me, but I utilize db's on other servers where I run email servers and such, so I still get the benefit, thanks
@xl0pate0lx Жыл бұрын
How do you open your db file in pycharm? If I click on it literally nothing happens.
@LukasFromLummerland Жыл бұрын
Very nice. Thank you! I will adapt this for a project hours tracker.
@keeskkool10 ай бұрын
How to build GUI for this?
@FRANKWHITE1996 Жыл бұрын
Thanks For Sharing ❤
@thunderskull258 Жыл бұрын
This is the basic thing you can add tkinter and modern gui to it or html pyscript thing
@paulthomas1052 Жыл бұрын
Great tutorial as usual. Thanks :)
@kevinrovik2480 Жыл бұрын
I dont know why, but it will not allow me to do these codes, can someone help?
@andresbonelli Жыл бұрын
SQL integration into Pycharm seems to be a paid option, isn't any free option out there for educational purpose?
@distant6606 Жыл бұрын
if u are a student you can get pycharm professional for free
@mjxwarrior2898 Жыл бұрын
C:\Users\memobe\PycharmProjects\demo4\venv\Scripts\python.exe C:\Users\memobe\PycharmProjects\demo4\venv\create_db.py Select any option below: 1. Input a new expense 2. View expenses summary 1 Enter the date of the expense (YYYY-MM-DD): 2023-01-17 Enter the description of the expense: food Traceback (most recent call last): File "C:\Users ey\PycharmProjects\demo4\venv\create_db.py", line 18, in cur.execute("SELECT DISTINCT category FROM expenses") sqlite3.OperationalError: no such table: expenses how come it wont work? heres what I copied: import sqlite3 conn = sqlite3.connect("expenses.db") cur = conn.cursor() while True: print("Select any option below:") print("1. Input a new expense") print("2. View expenses summary") choice = int(input()) if choice == 1: date = input("Enter the date of the expense (YYYY-MM-DD): ") description = input("Enter the description of the expense: ") cur.execute("SELECT DISTINCT category FROM expenses") categories = cur.fetchall() print("Select a category by number:") for idx, cetegory in enumerate(categories): print(f"{idx + 1}. {category[0]}") print(f"{len(categories) + 1}. Create a new category") category_choice = input() if category_choice == len(categories) + 1: category = input("Enter the new category name:") else: category = categories[category_choice -1][0] price = input("Enter the price of the expense: ") cur.execute("INSERT INTO expenses (Date, description, category, price) VALUES (?, ?, ?, ?,)", (date, description, category, price)) conn.commit() elif choice == 2: print("Select an option:") print("1. View all expenses") print("2. View monthly expenses by category") view_choice = int(input) if view_choice == 1: cur.execute("SELECT * FROM expenses") expenses = cur.fetchall() for expense in expenses: print(expense) pass elif view_choice == 2: month = input ("Enther the month (MM): ") year = input("Enter the year (YYYY): ") cur.execute("""SELECT category, SUM(price) FROM expenses WHERE strftime('%m', Data) = ? AND strftime('%Y', Date) = ? GROUP BY category""", (month, year)) expenses = cur.fetchall() for expense in expenses: print(f"Category: {expense[0]}, Total: {expense[1]}") else: exit() else: exit() repeat = input("Would you like to do something else more interesting (y/n)? ") if repeat.lower() !="y": break conn.close() please help anyone I really want to learn for my career
@ayushsharaf153111 ай бұрын
bro create_db.py should be a different file and this code should be in an different file named main.py create a file create_db.py and paste this import sqlite3 conn = sqlite3.connect("expenses.db") cur = conn.cursor() cur.execute("""CREATE TABLE IF NOT EXISTS expenses (id INTEGER PRIMARY KEY, Date DATE, description TEXT, category TEXT, price REAL)""") conn.commit() conn.close()
@Deadlious Жыл бұрын
nice one, just remove 'Professional' from the title. This is not a professional expense manager by no means. I know you need to keep it short and it is a nice example how to build a tracker of some sort with a bit of python and SQL. It's a good start for sure, but not a professional one.
@ozkanozdemir6255 Жыл бұрын
Thank you bro..
@agape_99 Жыл бұрын
super cool
@laodefefliyarlin939 Жыл бұрын
hello, try to talk about reinforcement learning for chabot bro
@hellobro1461 Жыл бұрын
Please make 🙏🙏🙏🙏 a video on Python Wireless Thermal Printer using Bluetooth from Android mobile
@ya3ni_irqi303 Жыл бұрын
Lol this guy can't code
@jerryogbonna3373 Жыл бұрын
I tried the SELECT * FROM expenses in the expense.db that was created but it gave me this error(File "/Users/jerry/Desktop/Expense Tracker/expenses.db", line 1 SQLite format 3) what can i do, im not getting the results you are at the end.
@jerryogbonna3373 Жыл бұрын
Im using VScode not pycham
@hellobro1461 Жыл бұрын
Please make 🙏🙏🙏🙏 a video on Python Wireless Thermal Printer using Bluetooth from Android mobile
@hellobro1461 Жыл бұрын
Please make 🙏🙏🙏🙏 a video on Python Wireless Thermal Printer using Bluetooth from Android mobile