Python Forum
python run multiple file paralaly
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python run multiple file paralaly
#1
Hi Team,

I have sql_table.py files, Which I use to extract sql table into csv files.
sql_table.py files requires two parameter. 1) SQL_Table name , 2) Output_Folderpath

I run py file via command line,
I Open 10 command line screen, Run .py files in different screen , only change paramater, (tblname,foldepath)

it works parallely.


How to run parally by calling single file , and it will run all files.


	
	 .PY FILES     TableName  FolderPath	
python sql_table.py   tbl_1    D:\\Out\tbl_1
python sql_table.py   tl2_2	 D:\\Out\tbl_2	
python sql_table.py   tl3_3	 D:\\Out\tbl_3	
python sql_table.py   tl3_4	 D:\\Out\tbl_4	
python sql_table.py   tl3_5	 D:\\Out\tbl_5	
python sql_table.py   tl3_6	 D:\\Out\tbl_6	
python sql_table.py   tl3_7	 D:\\Out\tbl_7	
python sql_table.py   tl3_8	 D:\\Out\tbl_8	
python sql_table.py   tl3_9	 D:\\Out\tbl_9	
python sql_table.py   tl3_10	 D:\\Out\tbl_10
Reply
#2
Use multiprocessing. Pool can use all cores simultaneously, and will start/run a group of processes. https://www.codesdope.com/blog/article/m...in-python/
Reply
#3
Why aren't you writing this as a shell script?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  python convert multiple files to multiple lists MCL169 6 1,684 Nov-25-2023, 05:31 AM
Last Post: Iqratech
  Insert a multiple constant value after header in csv file using python shantanu97 1 1,186 Apr-24-2022, 10:04 AM
Last Post: Pedroski55
  Multiple entries into a csv file SatansClaw 1 2,051 Jun-13-2019, 07:06 PM
Last Post: stullis
  Python unittest - running multiple tests from CSV file asheru93 0 4,251 Jan-21-2019, 08:26 AM
Last Post: asheru93

Forum Jump:

User Panel Messages

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