#need help with this project

9 messages · Page 1 of 1 (latest)

rain lilyBOT
#

@dreamy finch

Roba Uploaded Some Code

hello, so i need some help with thisprogram im trying to make, it is for my personal use, not hw. So a summary i have a menu with 3 option 1select an exisitng driver and 2add a driver, when addinga driver i will be asked to input their name, cnp and truck number and when i chose to chose a driver i will be asked to write 2 dates, date1 when they started working and date2 when they arrived, the output is calculated in days like 11.59 days. all this is stored in a drivers.txt file and each drivers has their one line like this name,cnp,truck number and here is the problem i cant seem to add the output days on the same line, its always on the line below, tried using chatgpt but no luck, if anyone wants to help id appreciated
here is the code

Uploaded these files to a Gist
dreamy finch
#

idk how to type the code in the chat sorry

tawdry citrus
dreamy finch
#

it works perfect, it just stores the date wrong like instead of adding it next to all the info abt the driver it just copies the driver's info on the next line and the date on the other line

#

the first line is the driver;s name,cnp and truck number and the last is how many days they've worked and i want that number of days next to the first line

tawdry citrus
dreamy finch
#

hmm, still not right, but closer to finding out the soultion, now i only have the date on a diffrent line

#

but im not gonna look any further into this, ill try a csv file instead of a txt file, thanks for your help ❤️

ashen lion
#

On line 96 you have f.write(f"{selected_driver},{diff_days:.4f}\n")