Python Forum
how to save to multiple locations during save
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to save to multiple locations during save
#1
I have a script with currently outputs a csv for a report.. But now multiple departments want access to the raw data.

I currently have this to_csv line in my script, but would like to be able to save the results to multiple locations for each department that wants the raw data

merged_results.to_csv(parts[0] + '_ip_output_' + dtstring +'.csv',header=False, index=False, quoting=None)
I was thinking of building a list of departments and pathes and then have a for loop for each one in the list, run the above line with the appropriate path.
Is that the most optimal way to handle this.. I mean right now its only 3 different paths along with the original path that its currently saving to, So 4 total places.
Reply
#2
Learn to say "No". Put the files in a shared folder and send them a link to the folder. Not only is it easier for you, but it is also a better solution for everyone. If you make a list of departments and directories it is something you'll need to maintain and modify as your user's needs change. If you put the information on a share, your users are free to copy the files anywhere they want, or just use the (readonly) file in the share.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Correct/proper way to create save files snakes 0 437 Mar-11-2025, 06:58 PM
Last Post: snakes
  what is solution to save and reload a object? eue 4 1,786 Nov-23-2024, 02:15 PM
Last Post: DeaD_EyE
  print/save on pdf starwhale 3 849 Nov-08-2024, 10:59 PM
Last Post: Gribouillis
  Read TXT file in Pandas and save to Parquet zinho 2 1,206 Sep-15-2024, 06:14 PM
Last Post: zinho
  Compare 2 files for duplicates and save the differences cubangt 2 922 Sep-12-2024, 03:55 PM
Last Post: cubangt
  RimWorld Save Game Manager- Help! LastStopDEVS 2 1,265 Jul-29-2024, 03:36 AM
Last Post: LastStopDEVS
  How to change a tkinter label with scale and how to save that new value for later? bkeith 3 1,846 Jun-28-2024, 01:35 AM
Last Post: deanhystad
  Python editor that will SFTP automatically on save sawtooth500 1 991 Apr-30-2024, 05:13 AM
Last Post: Gribouillis
  Copy xml content from webpage and save to locally without special characters Nik1811 14 4,982 Mar-26-2024, 09:28 AM
Last Post: Nik1811
  Open/save file on Android frohr 0 1,089 Jan-24-2024, 06:28 PM
Last Post: frohr

Forum Jump:

User Panel Messages

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