0
 def startdataprocessing (self, widget):
    text_file = open("SRAIdFromPythonInput.txt", "w")
for item in text_file:
    execute('bash ./oneclickdataprocessor.sh')
text_file.close()

I have error text_file is not defined. How to fix that? Is it correct to call .sh script over every item in .txt file or I should use Linux shell embedded for loops?

martineau
  • 119,623
  • 25
  • 170
  • 301
Mat29
  • 7
  • 1
  • 3

1 Answers1

0

In terms of your script

text_file = open("SRAIdFromPythonInput.txt", "w")
for item in text_file:
    execute('bash ./oneclickdataprocessor.sh')
text_file.close()

For calling external shell files consider the subprocess module. More in this question

Community
  • 1
  • 1
jmk
  • 466
  • 1
  • 4
  • 21