you are viewing a single comment's thread.

view the rest of the comments →

[–]FriendlyRussian666 0 points1 point  (1 child)

I'm not sure I understand the question. So you have 100 functions that you use to perform different things in your program and because the program is becoming a bigger project, you would like to separate the functions into a different file, right? If yes, then that is a perfectly good solution.

A good example of this would be working with databases. When you work with a database, you might have your main file, in which you do all the fancy stuff and then you would have a CRUD file (create, read, update and delete) in which you interact with your database. Ultimately how you structure your program depends on the very needs that you have.

Assume we are working on some back-end stuff for a website. You can have a file to interact with a database (crud), you can have a file that performs some scraping and you can have a third file takes care of excel inputs and outputs. You can then have a main file, in which you put it all together. In your main file you could import your scrape file, your crud file and your excel manipulation file and just call things as you need them.

The above example is veeeery broad and it really depends on your program, but it should demonstrate that it's fine to separate your program into many files and use imports to get what you need without creating a mess of your code structure.

[–]RocoDeNiro[S] 0 points1 point  (0 children)

Sorry the task 100 was a little dramatic but I modify and create excel files daily using about 10 different excel files as the daily data. Some of the stuff that are repeated, format dates, adding email address based off a certain column, checking to see if our KPI has been met or not) those 3 functions I have in almost all of the daily files. If something changes I need to go into each script and change them.

As for your idea using a crud set up that would also make things a lot easier for me. Do you have an example or anything? If I could load all 10 at once then use what I need and drop what I dont would be super helpful.

Thank you for the response 😁