<div dir="ltr">Ha, glad to hear it!  f-strings are for *everything*.  They're really wonderful... and also a little bit terrifying.  f-strings and all their evolutionary ancestors in the string templating world would be a good dojo topic, now that I think about it.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 26, 2021 at 2:39 PM Bryan Harris <<a href="mailto:brywilharris@gmail.com">brywilharris@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Every single time I see some of your code, you're using some new<br>
feature of Python I've never seen before. I had to look up what the<br>
f-strings were for.<br>
<br>
Bryan Harris<br>
<a href="mailto:brywilharris@gmail.com" target="_blank">brywilharris@gmail.com</a><br>
<br>
On Thu, Feb 25, 2021 at 8:19 PM Catherine Devlin<br>
<<a href="mailto:catherine.devlin@gmail.com" target="_blank">catherine.devlin@gmail.com</a>> wrote:<br>
><br>
> Hi, folks!  I did a little demo at Thursday's dojo of using requests to get JSON data from a RESTful API, so here's the code:<br>
><br>
> import requests<br>
> BASE_URL = '<a href="https://ghibliapi.herokuapp.com" rel="noreferrer" target="_blank">https://ghibliapi.herokuapp.com</a>'<br>
> url = f"{BASE_URL}/people"<br>
> people = requests.get(url).json()<br>
> for person in people:<br>
>     print(person['name'])<br>
>     for film in person['films']:<br>
>         film_response = requests.get(film)<br>
>         print(f"    {film_response.json()['title']}")<br>
><br>
> Of course, you'll need to `pip install requests` first...<br>
><br>
> --<br>
> - Catherine<br>
> <a href="http://catherinedevlin.blogspot.com" rel="noreferrer" target="_blank">http://catherinedevlin.blogspot.com</a><br>
> _______________________________________________<br>
> CentralOH mailing list<br>
> <a href="mailto:CentralOH@python.org" target="_blank">CentralOH@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/centraloh" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/centraloh</a><br>
_______________________________________________<br>
CentralOH mailing list<br>
<a href="mailto:CentralOH@python.org" target="_blank">CentralOH@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/centraloh" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/centraloh</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">- Catherine<br><a href="http://catherinedevlin.blogspot.com" target="_blank">http://catherinedevlin.blogspot.com</a><br></div>