Python Forum
write new function or change the old one to work "smartter?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
write new function or change the old one to work "smartter?
#2
Hello mate,

I would recommend you look into Pandas as that can help a lot with file reading and comprehension.

You'd be best making a new function as you'd need your code to run in a specific way based on your file layout.

Can I just ask what the file looks like? Is it multiple sheets? How many columns are there? What type of database are you trying to add the data to?

cheers,
Jamie
while dad_has_cigs == True:
    happiness = True
    if dad_has_cigs == False:
    print("Dad come home!")
    happiness = not happiness
    break
Reply


Messages In This Thread
RE: write new function or change the old one to work "smartter? - by jamesaarr - Aug-09-2021, 09:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I write formatted (i.e. bold, italic, change font size, etc.) text to a file? JohnJSal 13 29,226 May-20-2025, 12:26 PM
Last Post: hanmen9527
  [SOLVED] [Linux] Write file and change owner? Winfried 6 1,853 Oct-17-2024, 01:15 AM
Last Post: Winfried
  What does .flush do? How can I change this to write to the file? Pedroski55 3 1,554 Apr-22-2024, 01:15 PM
Last Post: snippsat
  print doesnt work in a function ony 2 1,189 Mar-11-2024, 12:42 PM
Last Post: Pedroski55
  Better way to write this function SephMon 1 1,519 Feb-08-2023, 10:05 PM
Last Post: Gribouillis
  I dont know why my function won't work? MehHz2526 3 2,171 Nov-28-2022, 09:32 PM
Last Post: deanhystad
  time function does not work tester_V 4 4,930 Oct-17-2021, 05:48 PM
Last Post: tester_V
  UART Serial Read & Write to MP3 Player Doesn't Work bill_z 15 9,443 Jul-17-2021, 04:19 PM
Last Post: bill_z
  string function doesn't work in script ClockPillow 3 3,950 Jul-13-2021, 02:47 PM
Last Post: deanhystad
  How can I write a function with three parameters? MehmetAliKarabulut 1 3,142 Mar-04-2021, 10:47 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020