Тёмный

Python Call a System Command! 

DevOps Journey
Подписаться 72 тыс.
Просмотров 25 тыс.
50% 1

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@darkc0de275
@darkc0de275 2 года назад
Dude thank you so much THIS IS A GREAT HELP because I am trying to build a program for networking
@LuvxJacqu4li8e
@LuvxJacqu4li8e Год назад
Very nice ty. I have never seen you with all my python search until today. TG! Keep making great videos. Appreciated.
@jolanta8855
@jolanta8855 2 года назад
Great video, excellent explanation, thanks a million!
@DevOpsJourney
@DevOpsJourney 2 года назад
Thank you!
@therealq10
@therealq10 2 года назад
I discovered os.system commands structure but I couldn’t figure out a way to keep it “alive” long enough for the SCP transfer to complete before moving on to the next steps. As a Python noob, I was having difficulty making sense of the documentation for Subprocess. This video was very useful in helping me to create a Python Script to update Rommon and iOS via SCP on my Cisco network devices. Thank you so much!
@DevOpsJourney
@DevOpsJourney 2 года назад
So glad it was helpful!
@pittixixitosilveira3876
@pittixixitosilveira3876 2 года назад
Sometimes RU-vid's algorithm make very good recommendation, surely ur channel is one of the bests
@aymanmoneim9342
@aymanmoneim9342 3 года назад
Very clear explanation Thanks a lot ♥
@wesg01
@wesg01 2 года назад
Awesome! Thank you
@cralx2k
@cralx2k 2 года назад
Very Nice...thanks a lot
@ethanking123
@ethanking123 Год назад
"Thank you very much for your tutorial! By the way, I was wondering if you are from Canada?"
@josephridge3646
@josephridge3646 2 года назад
Hi sir, is it possible to input automatically to a query returned from running a command using subprocess : eg When pushing code to gihub it prompts one to input his credentials.. how can i autopupulate the response ? Thank you.
@certificationpreparation5821
@certificationpreparation5821 2 года назад
You showed Ls -L command... what if I need 50-60 commands to run... Just giving , in the middle of every commands? will it work?
@1PartiZzan
@1PartiZzan Год назад
But... how can I create "while True" infinite loop and communicate with a pipe continuously??
@DevOpsJourney
@DevOpsJourney Год назад
Hey. I'm not sure what you mean.. Do you want the diagram to draw/update on live changes?
@pamj3521
@pamj3521 2 года назад
Great Video that explains subprocess module very clearly ! I have an issue where , I need to have direct interaction with a child's stdin and stdout, I should be able to capture the output of my 1st stdout , and pass it as my input to the next stdin. Below is a simple example, but I need to do this on some complex commands where the output of one command is the input to the next command. When I assign the stdout to a variable( # below), then it enters deadlock. I can issue multiple stdin's and get them working, but I need to be able to capture stdout ( manipulate) and pass it to subsequent stdin, which is where I have the issue. Any help is much appreciated. proc = subprocess.Popen(['python', '-i'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc.stdin.write(b'2+2 ') proc.stdin.flush() print(proc.stdout.readline()) #out=proc.stdout.readline() proc.stdin.write(b'out+2 ') proc.stdin.flush() print(proc.stdout.readline()) proc.stdin.close() proc.terminate() proc.wait(timeout=0.2)
@kevinyu9934
@kevinyu9934 3 года назад
very helpful!
@bennguyen1313
@bennguyen1313 10 месяцев назад
I have a Python / Operating system question.. In windows, I can plot a file using type logfile | cantools plot inputfile.dbc I'd like to do the same using Python. I understand everyone uses Popen, but I have not been able to get it to Pipe the contents of logfile over to cantools (while also passing the Plot and filename arguments). The following did not work: args = ["plot inputfile.dbc"] p = Popen(['cantools'] + args, stdout=PIPE) Any suggestions?
@TheRancherr
@TheRancherr Год назад
How would you start gitbash window and run a comman Therese (feks ssh user@server) ?
@metinkoc
@metinkoc 3 года назад
Thanks, it's very informative video but result.poll() returns 0 even destination host unreachable
@here_is_pacific
@here_is_pacific 3 года назад
First
Далее
If __name__ == "__main__" for Python Developers
8:47
Просмотров 405 тыс.
7 Essential Command Line Tools (2022)
9:12
Просмотров 215 тыс.
How to design a modern CI/CD Pipeline
9:59
Просмотров 137 тыс.
Please Master These 10 Python Functions…
22:17
Просмотров 170 тыс.
Improving Python Console Output With Rich
19:37
Просмотров 9 тыс.
Modern Python logging
21:32
Просмотров 190 тыс.
5 Useful F-String Tricks In Python
10:02
Просмотров 311 тыс.
Use Arc Instead of Vec
15:21
Просмотров 147 тыс.