python program update (quick update) (5 stars)

Job ID: 34757943

Budget: $2 – $8 USD

Have a program; can give you the source and just need a slight update?
The program is below; it counts the number of data rows in excel files in the folder passed

CURRENT OUTPUT
python3 count_records.py /Users/myfolder/
b1trt.xlsx
/Users/ej/pandas-output/b1trt.xlsx
b1trt.xlsx: 6 records.
example.xlsx
/Users/ej/pandas-output/example.xlsx
example.xlsx: 165 records.
example_croped.xlsx
/Users/ej/pandas-output/example_croped.xlsx
example_croped.xlsx: 139 records.

DESIRED OUTPUT
python3 count_records.py /Users/myfolder/
/Users/ej/pandas-output/b1trt.xlsx....................................6 records.
/Users/ej/pandas-output/example.xlsx..........................165 records.
/Users/ej/pandas-output/example_croped.xlsx.............139 records.

is there a way you can see my desktop sand fix it ? CODE IS BELOW

let me know your thoughts and any questions

While this is hourly; there is a max of $12 that I can pay, as being a cancer patient is tuff and been out of work. Hourly will give you more $ as there is less money taken between us from freelancer

There is hope you can give your “best” price; unemployed, and have cancer with bills backing up, $12 possible? Glowing paragraph of feedback 5 stars

My funds are low but will pay quick and leave 5 stars. Please give your best possible for your bid ? (something reasonable?) Please note there is hope we can mutually complete this task; we can leave each other nice comments and 5 stars for each? Look at feedback on my profile, feedback I left for many others. Here is the project:

SINCERELY WOULD BE NICE TO MEET YOU PLEASE

ANY THOUGHTS ? Please note project is due in two hours as this projects deadline, as this is needed if we can get some done - then we can talk about next steps and 5 stars and another job also. If this is a good one and we are "successful"; would need a couple others setup, but will handle one at a time? Can you do this for something reasonable in a couple hours? thoughts ?

HERE IS THE CODE TO MODIFY

import sys
import os
sys.path.append("/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages")
import pandas as pd

def main():
if len(sys.argv) < 2:
print("Please provide directory")
sys.exit(0)
if not os.path.isdir(sys.argv[1]):
print("Please provide existing directory")
sys.exit(0)
for filename in os.listdir(sys.argv[1]):
if filename.endswith('.xlsx'):
print(filename)
file_path = os.path.join(sys.argv[1], filename)
print(file_path)
df = pd.read_excel(file_path)
#df = pd.read_excel(filename, engine='xlsxwriter')
print(filename + ": " + str(len(df.index)) + " records.")

if __name__ == '__main__':
Related categories: Python Pandas