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
  Python editor that will SFTP automatically on save sawtooth500 1 274 Apr-30-2024, 05:13 AM
Last Post: Gribouillis
  Copy xml content from webpage and save to locally without special characters Nik1811 14 1,066 Mar-26-2024, 09:28 AM
Last Post: Nik1811
  Open/save file on Android frohr 0 356 Jan-24-2024, 06:28 PM
Last Post: frohr
  save a session in idle akbarza 5 811 Nov-06-2023, 08:36 AM
Last Post: snippsat
  change directory of save of python files akbarza 3 964 Jul-23-2023, 08:30 AM
Last Post: Gribouillis
  save values permanently in python (perhaps not in a text file)? flash77 8 1,280 Jul-07-2023, 05:44 PM
Last Post: flash77
  does not save in other path than opened files before icode 3 950 Jun-23-2023, 07:25 PM
Last Post: snippsat
  Save image from outlook email cubangt 1 730 Jun-07-2023, 06:52 PM
Last Post: cubangt
  Pymodbus read and save to database stewietopg 3 1,908 Mar-02-2023, 09:32 AM
Last Post: stewietopg
  Save and Close Excel File avd88 0 3,145 Feb-20-2023, 07:19 PM
Last Post: avd88

Forum Jump:

User Panel Messages

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