Skip to content
Advertisement

Tag: subprocess

After calling NotePad++ using subprocess, Python won’t start executing other codes until I close the Notepad program

I am trying to open a .txt file using NotePad++ in Python IDE using subprocess.call function. One issue I needed help is that once I execute below codes: subprocess.call([r”C:Program FilesNotepad++notepad++.exe”, r”C:locationmyfile.txt”]) Python won’t start executing other codes untiless I close the Notepad++ program. I have to use Ctrl+C to stop it. What I am trying to do here is to

Ping command – Check returned value

How can I evaluate the return of ping command used on subprocess.call(), by having a value of True or False like in the last “if” statement ? Here is the code: The code is working as it should, by iterating on a range of IP addresses (which it get from a XLSX file) and by pinging the single IP address

Get date using subprocess python?

I used subprocess to get information on a directory in my VM. and i get the output as How can i get just the date from the above output? Thank you Answer As an alternative, since you are already using a subprocess might as well use it all the way: should get you output in the format: Apr 25 2019

Advertisement