Article 5PX9B how to output to different streams in python ?

how to output to different streams in python ?

by
marozsas
from LinuxQuestions.org on (#5PX9B)
Hi there,

I am reading a database and output data em CSV format to a data migration job.
I have to create 3 separate outputs each one in a different format.
My first approach was creating 3 python programs, each one outputing data in the desired format, but I realize that I have to read the same data from database in each run.
So I was wondering if I can do something similar to this:

exportInventory.py > part_numbers.csv 2> exportErrors.txt 3> descriptions.csv 4> quantities.csv

How, in python, should I create those additional streams (3 and 4) and how to print to each one ?latest?d=yIl2AUoC8zA latest?i=xwcOM66OPJc:j1wWHrU3eOQ:F7zBnMy latest?i=xwcOM66OPJc:j1wWHrU3eOQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=xwcOM66OPJc:j1wWHrU3eOQ:gIN9vFwxwcOM66OPJc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments