Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Some variable mess

Hi, i am new to python, and need some help.

import subprocess

direct_output = subprocess.check_output('find / -type f -name \"*.srt\"', shell=True)
print direct_output
Thats my code. I have output like this

/path/to/my/code/name.srt
/path/to/my/code/other_name.srt

But i want to list this outputs one by one. Something like:
print print direct_output[1]
.....................output....................
/path/to/my/code/other_name.srt
....................................................[/code][/size][/font]
Sorry for my bad English and thanks😉😉
Code
import subprocess
direct_output = subprocess.check_output('find / -type f -name \"*.srt\"', shell=True).splitlines()
print direct_output[0]
print direct_output[1]
Mon affection- pour toi, toujours


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Mr MeeseeksDec 16, 2018 03:33 PM 3 153 Dec 16, 2018 03:33 PM
Last Post: michalmonday
[Shell] by Hunter556Dec 26, 2016 02:45 AM 16 711 Dec 26, 2016 02:45 AM
Last Post: retramsnahtehtffats
[Java] by HarveySpecterDec 15, 2016 07:37 PM 4 230 Dec 15, 2016 07:37 PM
Last Post: -Base-