Python3 Advanced Tutorial 2 - Templates

preview_player
Показать описание
This is a tutorial covering what, how and why to use templates in python3. All Links and Slides will be in the description. Subscribe for more cool stuff!

If you like what you see be sure to subscribe and thumbs up!
Рекомендации по теме
Комментарии
Автор

Unable to run the program on macbook. It does not even give any error but also it does not give correct output. Simply throws Process finished with exit code 0. Any Help is appreciated.

rajeevrahi
Автор

Thank you for doing this man, i am glad i found your channel!

Narainprakash
Автор

fstring > % > format > template in my opinion

kaipeng
Автор

I still don't see where Template would be more useful or easier to use than .format(). It also much slower than format.

python -m timeit "from string import Template" "t = Template('$x')" "t.substitute({'x':3})"
loops, best of 3: 3.32 usec per loop

python -m timeit "'{x}'.format(x=3)"
loops, best of 3: 0.293 usec per loop

deepspace
Автор

I think this video should be called Python3 Advanced Tutorial 2 - Template Strings. Thanks for sharing your knowledge

adriangg
Автор

Can u do calculus inside the substitution string? right now it only prints the price of a single item and the total is wrong, too.

selbstjustizable
Автор

is not more easy use f-string? or % or format?

marcelangulo
Автор

Brother this stuff all from frame work( like Django flask like that)isn't it??? Pls give me answer. I want to know I am confused anyone pls...

krishk
Автор

I really can't understand what is substitute

sharabugnanesh
Автор

good video started using python a few weeks ago and i wanted to challenge myself ive been watching the whole playlist thanks:)

BFPro
Автор

Maybe I came across this video too late. But why would I use this over formatted strings?

GamingCentralTV
Автор

Sir I want to start my career in python from starting which institute is good for learning in Bangalore

zaheeruddin
Автор

hello sir thanks for the turorials . i am having a trouble in running cgi scripts as a window user please solve my problem if you can make a turoials on how to run cgi scripts in window it will be great full sir a am having xampp server and python installed in my system but when i am running cgi commands its showing errror like
Error message:
couldn't create child process: 720005: login.py

If you think this is a server error, please contact the webmaster.

Error 500

please help me sir hope you will help ....waiting for the answer....

kamalsingh-ibtp
Автор

How does this work with punctuation?
For example:

```
import string as st
tpl = st.Template("$Meet $name, who is a $job.)"
adam = dict(name="Adam", job="teacher")
print(tpl.substitute(adam))
```

I would expect a `KeyError: 'name, '`, but Python correctly understands that the coma is not part of the key.

And yes, I am just going to pretend that YouTube has markdown. Which it _actually_ has, but *not* for code, as far as I know.

_adaldo
Автор

Guys before watching this video it is crucial that you know good Object-Oriented Programming

MichaelKopanaslike
Автор

Please explain the 'if' statement in your code !

tarunbirsingh
Автор

Thanks for the tutorials. You speak slow and clear and don't have extraneous chatter. I admire you using the VIM editor but wouldn't sublime text or pycharm be easier? They are for me...

guyblanco
Автор

Your accent is little hard to understand but your tutorials are what I was looking for.

kshitijkumar
Автор

Tuts (Python) are great, but the usage of Vim text editor is horrible.

myportfoliomax
Автор

dude can you provide that python script to rename all the files a folder ? plzz

cpm