Understanding stdin, stdout, stderr in Python

  Рет қаралды 13,026

NeuralNine

NeuralNine

Күн бұрын

Today we learn about the standard streams stdin, stdout and stderr as well as how to use them in Python.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine...
💻 The Algorithm Bible Book: www.neuralnine...
👕 Programming Merch: www.neuralnine...
💼 Services 💼
💻 Freelancing & Tutoring: www.neuralnine...
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine...
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/Neu...
🎙 Discord: / discord

Пікірлер: 18
@paulthomas1052
@paulthomas1052 Жыл бұрын
250K Subs - congratulations - this has always been a great channel - always informative and interesting. All the best 🤗
@user-uk7ul9ym1e
@user-uk7ul9ym1e 2 ай бұрын
A lot of information, very good to watch after some previous videos about theory if in out and error streams in any OS.
@JorgeEscobarMX
@JorgeEscobarMX Жыл бұрын
0:00 I'm wondering if I need this, let's see.
@elenakusevska6266
@elenakusevska6266 6 ай бұрын
Useful video :) I learned something today :)
@JorgeEscobarMX
@JorgeEscobarMX Жыл бұрын
11:00 print has a flush parameter and I can avoid the printing the new line on print function calls.
@rantalbott6963
@rantalbott6963 11 ай бұрын
I like to include a function function for printing to stderr so I don't need to keep typing the "file=": def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) Most of the time when you're reading from stdin, you'll want to process one line at a time. If you don't need a context manager for some other reason, you can just treat sys.stdin as an iterable: for line in sys.stdin: if len(line) == 0: # End of file. Do final stuff here sys.exit(0) line = line.rstrip() Notice the rstrip(): reading includes the terminating (CR and) LF, and you usually don't want them as part of the data.
@harshavardhanlakhinana5280
@harshavardhanlakhinana5280 6 ай бұрын
Really useful
@sergiuoanes4635
@sergiuoanes4635 Жыл бұрын
very helpful! thank you
@FOXFHEX1
@FOXFHEX1 Жыл бұрын
Good job ❤
@richardboreiko
@richardboreiko Жыл бұрын
I wonder if that works with logging....
@andiglazkov4915
@andiglazkov4915 Жыл бұрын
Thanks 😊
@juggerfps2402
@juggerfps2402 6 ай бұрын
thanks
@user-td4pf6rr2t
@user-td4pf6rr2t 18 күн бұрын
echo 'i learned' | python3 -c "print(sys.stdin.read(),end='this')"
@Little-bird-told-me
@Little-bird-told-me Жыл бұрын
POPos is no longer my fav distro. nvim is still running on version 6.1. You should try a WM in Arch. May be Hyprland or sway
@ConsumedKing
@ConsumedKing Жыл бұрын
Thanks 🤍
@philtoa334
@philtoa334 Жыл бұрын
Thx_.
@smartcat5989
@smartcat5989 Жыл бұрын
information , ℹ️
@abdulwaleedjulaid5491
@abdulwaleedjulaid5491 Жыл бұрын
Zoom your video blurry
Linux Crash Course - Data Streams (stdin, stdout & stderr)
17:13
Learn Linux TV
Рет қаралды 53 М.
Garbage Collection in Python: Speed Up Your Code
16:41
NeuralNine
Рет қаралды 16 М.
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 16 МЛН
小丑在游泳池做什么#short #angel #clown
00:13
Super Beauty team
Рет қаралды 33 МЛН
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 194 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 387 М.
shutil: The Ultimate Python File Management Toolkit
14:32
NeuralNine
Рет қаралды 11 М.
stdin / stdout / stderr (beginner - intermediate) anthony explains #050
8:19
How to Capture What Is Written to stdout in Python
6:03
Florian Dahlitz
Рет қаралды 5 М.
PLEASE Use These 5 Python Decorators
20:12
Tech With Tim
Рет қаралды 111 М.
5 Tips To Write Better Python Functions
15:59
Indently
Рет қаралды 104 М.
Bytes and Bytearray tutorial in Python 3
7:25
DevDungeon
Рет қаралды 64 М.
5 Useful Dunder Methods In Python
16:10
Indently
Рет қаралды 59 М.
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 16 МЛН