I have a problem redirecting a pipe output as the second argument of a python script. Basically, my code would be something like that:
sort -u inputfile.txt | python myscript.py Firstargument.txt PIPE_OUTPUT_AS_SECOND_ARGUMENT | other_bash_commands
The problem is shown capitalized above.
As I am quite unexperienced with both bash and python, here is also what my python script looks like:
script, firstargument, mypipeoutput = argv
def myfunction(a, b):
# <insert well written function here using a and b>
firstarg= open(firstargument)
secondarg=open(mypipeoutput)
myfunction(firstarg, secondarg)
In addition to not working properly, the way I wrote that seems very redundant, so if you have any additional suggestions to make it more straightforward I would be happy to hear them.