Python Bytes - #323 AI search wars have begun
Episode Date: February 14, 2023Topics covered in this episode: camply hatch-fancy-pypi-readme EU hates open source? So, Single (‘) or Double (“) Quotes in Python? Extras Joke See the full show notes for this episode on th...e website at pythonbytes.fm/323
Transcript
Discussion (0)
Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds.
This is episode 323, recorded Valentine's Day, February 14th, 2023.
And I am Brian Ocken.
I'm Michael Kennedy.
Hi, I'm Pamela Fox.
So thanks, Pamela, for joining us today.
So for people that don't know who you are, can you introduce yourself?
I'm Pamela, and I currently work at Microsoft, where I am a cloud advocate in Python, which means that I figure out how to get stuff working on Azure while using Python and make sure that our code samples are nice and Pythonic and that we're doing things the Python way and just trying to streamline the experience.
And yeah, that's really fun because it just means I get to write Python all day.
And actually it just means I deploy all day.
I'm pretty much always to be playing something,
which I guess is appropriate.
I once had an ex-boyfriend
who named our Wi-Fi network, Don't Stop Deploying.
And the password was, I like to ship it.
And I guess it was because I deployed so much back then.
So I guess I've always been a deployer. So it works. But yeah, that's what I do now. Before this, I was
at UC Berkeley teaching Python. And then before that was at Khan Academy and Coursera and all
sorts of places, programming in Python and JavaScript.
Ooh, neat. That sounds like such a fun job. I've always thought that developer advocate would be
really cool because you get to do all
the cool coding tech stuff. You don't have to run so much production software, so you're not on
pager duty and you get to travel and talk to a lot of people. Like what else could you want,
you know? Yeah. I think for you too, it probably would be a really good job too. It's always just
a really nice combination of programming and using the other parts of your brain too.
Yeah. Excellent. Excellent. Well, we're happy to have you on the show. So thanks for being here.
And unrelated to Pamela being here and working for Microsoft, this episode is also brought to
you by Microsoft for Startups, but we'll talk more about that later. Brian, should we kick it off?
Yeah.
While we all love to be in this tech space and we're all big fans and that's why we're here.
Sometimes you just want to get away, right?
And especially in the American West, there's a lot of places that you could get away to.
The camping sites around here are magnificent.
There's one that I really like that has free roaming peacocks that just cruise through your camp while you're camping.
It's really nuts.
And eagles flying around. However, that and all the other places are super hard to find for this exact same reason.
Okay.
So one of our listeners, gosh, I don't see his name here, but Justin is the name here.
Justin Flannery from Denver, also a place with great camping, put together this cool CLI, this terminal app called Camply.
So Camply is the campsite finder.
It's a tool to find campgrounds and campsites that are typically sold out
through recreation.gov and Yellowstone and other sites.
Okay?
Okay.
So, you know, it's all python so the idea is basically
you it talks to all these different apis you can either run it in docker or just run it in python
i believe pipx install camply which i love it pipx is exactly how cli tools that are not part
of your programming story should be installed coming from Python. And so you would say like Camply recreation areas dash.
You could do a search like dash dash search Glacier National Park.
Or have you ever wanted to stay in a fire lookout tower in California?
How cool would that be?
That'd be pretty neat.
Depends if there's a fire or not.
Yes, exactly.
Well, if there's no fire.
So maybe not September. I don't know. Yeah, you. Well, if there's no fire. So maybe not September.
I don't know.
Yeah, you got a glacier and a fire.
So maybe you just use this to counter each other.
Exactly.
Have you ever wanted to go down a really long ladder to use the restroom?
Oh, you're so practical, Brian.
So practical.
Anyway, these things are not super easy to find potentially.
So you can say I'm looking for campsites in some area, start date, end date, and search forever.
And it'll just sit there and just wait and hang out.
So it'll search at recreation.gov, Yellowstone, going to camp, Reserve California, some other places.
And yeah, it'll just sit there and pull that data for you.
And I think it's just a really cool app it's a cool use
of python and you know people if they're interested in okay going camping the bit about this that i
like is it has configurable notifications for if it finds something so if it finds if you're looking
for a particular campground and you just got it running in the background you can have it hooked
up to give you a Slack notification or an email
or even a text message through Twilio.
And that's pretty darn cool to be able to just have it text you
when you find something.
Yeah, just kick it off, let it run, let it keep watching.
Is it a cron job?
How does the search forever work?
I think you leave it.
I don't know for sure, but I think you just leave your terminal running.
It must have a sleep or something.
I don't know.
Yeah, yeah, yeah.
You would hope otherwise it's going to get banned pretty soon.
But no, I would think it just pulls every so often.
I think it's doing, I think there's some APIs in here.
If you look through, it talks about where the data is coming from.
You know, there's a recreational information database from recreation.gov.
And, you know, it's pulling some of that data.
And, yeah, I do think it's really cool that it also does those different notifications.
I've just learned about push bullet and push over and realized I should probably figure out what those are.
Those sound cool.
I know what Twilio is um and the one of the things i like to like about this uh is this could be like a sas app or
something like that and yes but i'm glad that somebody but you don't have to if you have like
a cool need that works for you and you think somebody else might have a need for a similar
thing so build something like this and share it um you don't necessarily have to make money off
the back of it.
There's a lot of, it's one of the things I've tried to be pushing more is software developers
have these skills that we can build things like this, but a lot of people don't.
And being able to build things and share things is one of the great pleasures of doing
what we do.
So kudos to Justin.
Yeah, yeah.
Well done, Justin.
Thanks for sending that in. And one of our listeners, Kim, also been on the show before, points out that, you know,
he's from South Africa. You should try camping in some places in South Africa. Free roaming rhinos
and elephants are slightly more concerning than peacocks. Yeah. I'm impressed with people that
live in places that have, you know, free roaming rhin, or pretty much all of Australia, all of it.
Very impressive.
It's a lovely place, but I'm always a little nervous to be out of the city there.
All of nature wants to kill you in Australia.
Exactly, and it's good at it.
All right, off to you, Brian.
Okay, wow, I'm not sharing anything yet.
Just one moment, share screen.
Sorry, all of the people were listening and waiting for this.
Okay, we've got fancy readmes.
So everybody loves,
Henik points out that your fancy project
needs a fancy PyPI readme.
Of course it does.
It's very nice.
There's lots of stuff.
So what sort of fancy stuff would you like?
So one example is the Black readme. so black is one of the ones that uses
the same project that we're going to talk about but um so what's fancy about it it's just got
it's the normal standard readme stuff but one of the stuff it has things at the bottom is it's got
a changelog listed here and the authors and some other stuff, the highlights from different
versions. How do you do that within a readme without copy and pasting? So that's where this
comes in. So the, uh, this, this is a project called hatch fancy pipe. Yeah. Read me. And,
uh, Hinnick has used, uh, apparently in the past, uh, set up that pie for generating for packaging. And with that was the ability to do some code while
you're running setup.py. But pyproject.tomlbase stuff is different, right? So if you just have
a flit thing, and you point it to readme, it'll just point to a static readme, or you'd have
generators outside of this. But what this what this tool does
is it has um apparently there's a hook system within hatch that allowed allowed this functionality
so um there's configuration that you can do things like and there's configuration on this readme to
tell you how to use it and everything but the things you want to use with it is these little
fragments so you can add a text fragment, of course,
but that doesn't really help you much
because you already have,
you can write it down in your README.
But this is, actually what this is,
is this will be part of your,
it's in conjunction with pyproject.toml
and your README to work together, which is cool.
So you can define some of the text fragments
in your pipe project at Toml and have them show up in your readme. You can also do files, you can
say, hey, I want actually want the author's file in there also. And the files have a start after
and start before and stuff. So some of the files that you include in there might have some boring
stuff that you don't want to include in there. you can cut that out so this is really exciting to be able to um because i've switched
like all my project to pyproject.toml based projects but i i do want some neat stuff in my
readme so i'll start using this as well okay so you have files um you also have pattern matching
which is neat uh with files but then down below, substitutions.
So you've got like search and replace patterns
that use regular expression substitutions.
And then I think that's all.
I'm not missing anything,
but some pretty neat things that you can do within your readme.
Yeah, and you've got a CLI interface.
It's lovely.
It's almost like Jinja, Chameleon,
some templating language for your
your readme so here's the thing that i am always confused about is do you you know there's the
readme and then there's the read the docs right and sometimes when i go to a package i'm like
which one should i go like should i start in the readme and then see if there are more read the
docs like so this blurs the line even more it's like should should it just all be in the readme and then see if there are more read the docs? Like, so this blurs the line even more.
It's like, should, should it just all be in the readme?
When, when, when do you go to, you know, the external docs?
Well, okay.
So I've struggled with this on a couple of things and I've got one that's like on the
line, it's got a ton of functionality.
And so maybe it ought to be a read the docs thing, but some people have really big read
me's.
So which should you go to?
So are you talking about the package maintainer
or the person learning about the package?
Where should they go?
Well, I think you have both those questions, right?
Because one thing is I can't decide
where should I link to.
Should I link to the PyPy page
or should I link to their read the docs page, right?
It's just what is the canonical documentation?
And right now I think as both a creator and a user of packages it's not clear where to go well as a user i always try to
start at the pipey i uh page and whatever hopefully there's either a home page it's got like black as
homepage and changelog you can include a documentation link too. So if it's just got a homepage,
it's just probably the readme.
But the documentation,
I think it's nice if people leave the homepage
to go to their GitHub repo
and add a documentation link
if they've got a read the docs thing.
I think so.
I do like to see a lot of stuff in the readme because it's if you're
already there it's you don't have to go track it down the the time that i would see brian maybe is
if there's like a lot a lot of different scenarios here's this api function and here's a tutorial and
here you know maybe there's a lot of navigation i guess maybe it makes sense for read the docs
or if it fits on one one file then maybe make a copy i don't know and i've got a lot of navigation i guess maybe it makes sense for read the docs or if it fits on one one file
then maybe make a copy i don't know and i've got a lot of like tiny little pytest plugins that i'm
just not gonna do a read the docs documentation tree it's just a little tool so small tools it's
easy it's the in-between part that it's difficult so yeah yeah for sure all right i love our audience i'll have great things to add here
henry schreiner uh says get up dependency graphs now support pep 621 as of yesterday so how's that
for keeping on top of things so perfect time to switch uh if you haven't yet nice read me's too
and then soro says docs um the docs link should always be at the top of the readme.
So, excellent.
Yeah, I like that too.
Yep.
And one more piece of real-time follow-up.
Justin, author of Camply, is in the audience, says, yes.
Wait, no, wrong one.
I got out of sync there.
Thanks for featuring this.
You can leave it running in the background.
That's where the accompanying Docker image is from.
So, you can just push it over to a Raspberry Pi and just let it cruise there, which is kind of cool.
So just to make sure I understand this, if you close your laptop while a Docker image is running, is it going to keep?
It's probably going to stop.
Okay.
It depends on your sleep.
So that's why you want the Raspberry Pi?
Yeah.
Yeah.
Something you can just leave on.
Or, you know, something something i guess you could set your
laptop to still running if the clamshell bit is closed but generally it would it would close you
could even put it on to one of those little tiny uh adafruit things i would imagine i doubt that
there's anything that um platform specific probably just requests and stuff so or you can have a mac
mini running yes you could definitely have a Mac mini running,
like the one I'm using right now.
All right, before we move on,
let me tell you about our sponsor this week.
So as I said before,
this episode is brought to you by Microsoft for Startups,
Founders Hub.
I'm here to tell you all about a fantastic opportunity
for startup founders, especially those interested in AI.
With over six figures
in benefits, this program is a game changer for startups. You'll get $150,000 in Azure credits,
so you can work with Pamela a lot to deploy many, many things, which is the richest credit
offering from any cloud provider. Founders Hub is offering a unique chance to access open AIs,
APIs, as well as the new Azure Open AI service,
so you can easily infuse generative AI capabilities into your applications. The team at Microsoft will
also provide you with one-on-one technical advice to help you with architectural plans, scalability,
implementation best practices, and security. Plus, you'll have access to the network of mentors
plugged into the startup world, which we've talked about a lot. A huge asset for building your network.
The best part is the program is open to everyone
and has no funding requirements,
whether you're in idea phase or further along.
It just takes five minutes to apply
and you'll get all these benefits.
So harness the power of AI in your startup.
Sign up for Microsoft for Startups Founders Hub
today at pythonbytes.fm slash foundershub2022.
Link is in your show notes.
No brainer opportunity for
startup founders, so don't miss out. And Brian, one more thing, just to make the point about how
awesome some of these open AI APIs and different things that they're offering here is, I asked that
same AI to write this ad for us. So how cool is that? I mean, if you want to do, I don't know if you've played with these things yet, but OpenAI is really incredible.
And if you want all these credits to be able to work with it, access to different APIs that maybe people don't all have, sign up at our link in the show notes.
So thanks to Microsoft for supporting the show.
Nice.
And thanks to OpenAI for writing a cool ad for us.
Wow.
I still don't have access to OpenAI and I work for Microsoft.
So I guess I just need to apply for that program.
Exactly.
I've been waiting.
Where's your startup idea?
Get in the game.
All right.
This next one comes to us from Pamphil.
Well, wait.
Oh, go ahead.
Don't we have one from Pamela?
How did I skip that?
Yes, we absolutely have one from Pamela.
Sorry.
All right, sweet.
So I'm going to talk about something new in PyDyde.
I know PyDyde has been on this show before.
PyDyde is Python for the browser based on WebAssembly,
a port of CPython to WebAssembly.
Now, the really cool thing,
I've been using PyDyde for various projects for a while.
But the very cool thing that happened recently
is that there's now 3.11 support in the latest.
So in main, there's 3.11 support.
This was the PR for it.
And so it's not in stable yet.
It's in latest.
But that means you can actually try it out
in their little REPL here. I can't break up 3.11 code off of that,
but you can see this is 3.11.
And what they're working on right now is,
let's see, they're working on some benchmarks.
So they did some benchmarks here to show,
because 3.11 has a lot of speed up improvements.
So they did a bunch of benchmark here,
but it looks like they're also interested
in other benchmarks as well.
Yeah, it looks like some are getting faster though,
which is really cool.
Yeah, and I also, so I did my own benchmark.
I mean, I wrote a function called benchmark,
so it must be a benchmark, right?
So one thing that I use PyDyte for
is recursionvisualizer.com.
This is something I built
when I was teaching Python at Berkeley and we taughtde for is recursionvisualizer.com. This is something I built when I was
teaching Python at Berkeley and we taught a lot of recursion in Python, which I know is a weird
thing to teach in Python, but this is academia. So we teach recursion in Python. So this is a tool
that uses PyDyde in order to visualize the call graphs. And so, you know, when you're doing
recursive functions, they can take actually a
long time. Superstripped 10 is actually going to take a while. Here we go. We got it. That wasn't
that bad. Oh my gosh. It's a bit long. It's amazing. So I enabled 3.11 for this yesterday in my local branch and did my own little benchmarking.
And it's like 15% faster, which is actually relevant for recursive functions because some of the recursive functions that you run here can actually take a long time.
All you have to do is increase this parameter a little bit more and it really takes a while.
So it is definitely faster for at least this use case here.
So that's cool.
It's not yet in the stable.
So you can see what they're working on here.
It should be in the next release of Pyodide 2.23.
They're working on that.
So I also tried it out in my other tool that uses Pyodide.
So this is disthis.com.
So this is a way to disassemble Python code in the browser
because I love the dis module
and I want everybody else to love it too.
So disthis.com.
And the thing that I was able to do with this
because of 3.11 is that 3.11
has the specializing adaptive interpreter,
which actually replaces certain opcodes
with other opcodes when it sees that it's hot code.
So some code has been run at least eight times.
And it's doing some particular operation that it can optimize.
It actually replaces a bytecode.
So we can compare this to this.
And you see that when we have the adaptive interpreter,
it's using different opcodes than it used before.
And it's also got this cache here.
So this is cool that now you can actually see 3.11
and see the difference in how 3.11 can work versus 3.10.
So yeah, I thought this was really fun.
This is amazing.
And your visualizer for the recursion is really cool.
Yeah, that's really cool.
So this one, this dis this,
and props for good naming there.
That's funny.
But wow, you even get the adaptive interpreter in Pyodide.
Yeah.
Yeah, that's really cool. So, so in order to do this,
so I put this together yesterday
since I wanted something cool to show.
So to do, if you want to have the latest Pydide,
if you want to try it out,
if you're like me and for some reason
have a huge number of Pydide projects,
I'm sure you all are,
you just have to do slash dev, right?
So instead of a hard version number,
and of course, you shouldn't do this
if you're using Pyodide for something production,
but I don't know who's using Pyodide for something
production.
Because to me, Pyodide is all about a great way
for building educational tools in the browser.
I have no desire to replace JavaScript with Python.
I think you should use JavaScript if that's
you're just trying to make an interactive site.
But for making educational Python tools in the browser,
PyDyte is not.
It's so good, right?
We don't have to run a sandbox server.
So if you want to try out 3.11, you just
do slash dev instead of a hard version number.
MARK MANDELMANN- Nice.
MARK BLYTHEUSHCHYSENVILLEHRENVILLEHRENVILLEH.
This is very exciting stuff.
What are your thoughts on PyScript? Have you played with that any? MELANIE with that any? Right. So I think PyScript is exactly what I don't want,
which is trying to replace JavaScript, right? As far as I'm interested, I haven't played with it.
Yeah. I think it might be. Although I think also it may offer some interesting alternatives,
right? Like for example, if you've got a progressive web app, or you've got an ElectronJS thing, and you want to write Python more locally,
I think some of these are kind of interesting options.
Yeah. So for educational tools, for dev tools, but we really need, I mean, we already,
even with JavaScript, we're making websites that are not very performant, even with JavaScript.
And when you bring in these Pyodide, Pyodide is huge.
It's a big old bundle.
You shouldn't be like this YOLO downloading Python,
downloading CPython into your webpage, right?
It's definitely too big for that.
That's for sure.
All right.
Also, I'm super impressed.
A lot of our guests will say,
I found this cool thing and it was really neat.
But you're like, oh, I wanted to create this amazing website
to demonstrate some stuff of a new feature.
So well done on thisqus and other things.
That's awesome.
Cool examples.
All right.
Yeah, very cool.
We'll definitely put those links in the show notes for people to go check out.
All right, Brian.
Now, should I go?
Now it's your turn.
I can't believe I almost skipped Pamela's amazing stuff.
All right.
So going from really fun to slightly less fun, how about we talk about European law?
Is that good?
Sure.
That sounds exciting.
Yeah.
There's this, what is it called?
Let me pull up my notes here.
There's the Cyber Resilience Act, the CRA, which is a proposal to hold, I think the most important part is to hold
companies that write and ship software liable for knowingly being really negligent about shipping
vulnerable software. So for example, you sell a router. It's like some cheap knockoff router.
You support it with updates, maybe once, maybe never.
It has some huge vulnerability
that people take over your home network
if they run it, you know,
RCE, remote code execution,
really, really bad.
You just don't bother to fix it
because it's not worth it, right?
We don't want to worry about that.
And I think that's the idea of this
is to say companies that do that,
no, they can't sell us a device
we put in our house
or we put software systems that
we put into our hospitals and just don't care about fixing them from a security perspective,
right? Not from a not working so well perspective. However, the concern that Pamphil Roy pointed out
and sent this over, and that's why I'm talking about it, is there's a concern that that also
applies to open source. So if I made some open source project,
somebody adopted it,
there was some vulnerability in it.
Am I now facing fines and punishment
from the European Union
because I didn't patch my silly little program?
So there's this organization
called the Open Source Initiative.
And the, let me pull up my little heights here.
It says, this Cyber Resiliency Act is an interesting and important proposal initiative and they let me pull up my little heights here it says this uh this cyber resiliency
act is an interesting important proposal for european law that tries to drive safety and
integrity for software it proposes the proposal includes a requirement for self-certification
of suppliers of software to attest that they conform to it for security privacy and the lack
of cves critical vulnerability events.
However, the European Commission has framed an exception for open source, but they say we've been doing this for a long time, drawing on two decades of experience.
We can clearly see the current text will cause extensive problems for open source.
Since the goal is to avoid harming open source software, we really need to make sure
that certain wording of this basically gets replaced. So the thing I'm linking to is the
feedback from the open source initiative around this project submitted by Simon Phillips. So
people can check it out and see what they think, but there's a lot of things out there that are well-intentioned that have unintended consequences. And I'd hate to see open source get squashed
because people are afraid of the security liability of it, basically.
Is this related to that lawsuit against the crypto open source authors where they're trying to get lots of money from them claiming that they should be able to recover their tokens.
Interesting.
It might have been inspired.
I think it's more of a general kind of like the GDPR, a general law proposed in the EU.
Yeah.
Pretty interesting.
There's a lot of stuff up in the air. We've got,
you know, the GitHub co-pilot lawsuit and, and we've got the stable diffusion lawsuit with Getty.
You've got this kind of stuff in the U S everyone seems bent on destroying section two 30, which is
the protection to allow people to post their own stuff. If you moderate it, it's we'll see where it goes.
I have no idea what's going to happen when these things,
but they're kind of a lot, a lot of stuff's up in the air.
And here's one more bit.
Yeah.
Right.
Brian over to you.
Okay.
So that was deep.
So I know.
So I told you we were coming from a really fun thing that Pamela did
like, Oh, here's some law.
Well, let's go to something really simple.
Single quotes or double quotes on your strings?
Good.
So let's do a quick poll here.
Pamela, you got a preference?
I had to figure this out a couple days ago
because I've been trying to make the Azure samples
more phytonic and by running black,
but black changes all the, what does it change?
I don't even know. Single to double. I'm not totally sure. It changes all the, what does it change? I don't even know.
Single to double, okay.
I'm not totally sure.
It changes all the single to double,
but it's such a big change.
And I'm like, it's so arbitrary.
It doesn't matter.
So I undid that change.
Luckily, there's a black option that you can do,
which is like ignore string normalization.
So I now run it with that because I don't have,
I think the only reason I would tend to do single quotes is that in case I was
embedding HTML, I really want double quotes in HTML.
Of course that means I'm a bad person that's embedding HTML in my Python.
There's other reasons too.
Well, a similar, okay. Michael, do you have a preference?
I think I prefer single quotes because it's one fewer keys to press on the keyboard.
Yeah.
Oh, yeah.
You don't have to do shift.
Given that I have RSI issues and I got to be careful of and I have my super cool Microsoft
ergonomic keyboard that makes a massive difference.
But I still always am thinking about what can I do to type less, be less with my hands
and accomplish the same thing.
But I have an exception and it's similar to Pamela's,
but not exactly the same
is if I'm doing anything
where I want to put a quote.
So if I have to say,
it's the second day of the week,
then I want to put an apostrophe
for the it's
and I don't want to backslash that.
So I put double quotes for the string
so that I don't have to escape
the single quote.
But if I was using double quotes
in the string,
then I would put single quotes. So if I'm using double quotes in the string, then I would put single quotes.
So if I'm using one, then I'll use the inside the string.
I'll use the other so I don't have to use escape characters.
So that's the argument that Black has
for why they chose the double quotes, I think,
is because of the apostrophes.
But I'm not really writing a lot of prose within.
If I'm writing a lot of pros,
it's usually, it's a triple quoted swing string and it doesn't matter.
Um, usually cause I'm, I'm doing a block thing.
Uh, but so this article is a, so single or double quotes in Python.
And this is coming from somebody that came from R and came to Python and similarly wanted
to make sure they were doing things pythonic like and they ran across
people using black um and you know what to do about that so they looked into it a little bit more
and like you know what is um what's pep8 say well pep8 say that doesn't say anything about this
and i don't think this article goes into it but the other thing not just pep8, but if you try out Python itself, the REPL, if you define a string in the REPL and then like x equals hi there, and then say, what's the value of x?
The REPL uses single quotes.
So that seems Pythonic to me, unless we're saying the REPL is non-Pythonic.
So the real answer in this article is it's up to you.
But it kind of isn't because people use black in their projects. The real answer in this article is it's up to you.
But it kind of isn't because people use black in their projects.
And there's a lot of people that are black fanatics and nothing against them.
I'm kind of one of them as well.
So me personally, I am kind of a mix.
So I use black on almost all projects.
And I use, but I just type it in as single quotes and just let black fix it for me.
And so the RSI is solved and black's happy.
But mostly it's just I don't want to make that decision on a lot of projects. But there are some projects that there's a lot of quotes in there and it really or the tradition or there there's a ton of code
already there and so i wanted to point out that this i guess is a public service announcement
if you're not really into black or just this part of it just uh i black is a great idea but i just
don't want to go with double quoted strings there's blue so everybody just remember there's
blues around uh blue is just like black, but there's
three primary differences. The single quote, it's defaults to single quotes instead of double quotes.
So for projects where it really makes sense to use most of the time single quotes, and there's a,
I have several that we're sending strings to other APIs, and it's just tradition to use.
There's other parameters inside that use double quotes and they can't be
single quotes inside.
So they have to be,
it's the anyway.
So there's projects I use blue on that for that.
The other thing is black defaults to the line,
a line length of 88 characters,
I think,
which is a little weird.
I know there's logic around it,
but it's still a little weird. And if there's logic around it, but it's still a
little weird. And if you're going with pet baits, or the traditional 79, I don't think pet specifies
79. But a lot of people use 79. So blue defaults to 79. And the other thing that I like is it
preserves white space around hash marks. So if you've got comments along the right side of your
code, like in multi lines, and they're lined up by the hash marks, black will strip that out and says, ah, you only need two spaces there.
And blue says, you can align over there.
That's fine.
So those are the three differences.
So blue is pretty cool.
I like it.
Yeah.
Pamela, use blue, black.
Yeah.
Gosh, there's too many options.
I am waiting for Ruff to implement formatting,
and then I will have only one tool that I need to use for everything.
Because Ruff now supports eyesore and PyUpgrade.
So we're just waiting.
And Charlie says he's working on formatting,
so I'll just do whatever Ruff does.
Ruff is awesome.
Yeah, Ruff is really cool.
Some interesting angles from the audience
I think are worth throwing out here.
However, if you want to fix this,
if you think Black should use single quotes,
just do a PR.
I'm sure they'll accept it.
Here.
The thing like, no, we've decided.
Kim says, if you write both C and Python,
you'll learn to stick with double quotes
or you'll wonder why C doesn't work
and yeah so basically
David Poole says the same thing
if you're working in a language
that treats or doesn't support
single quotes for strings
you might want to
it's not the only thing I keep trying to write printfs
in my Python code
you do? you're so old school.
I use cout less than less than.
For my C++ style there.
All right.
All right.
So who we got next?
Pamela.
Pamela.
This weekend, I decided that my personal website is overengineered.
So my personal website is pamelafox. So my personal website is pamlethox.org
and it's super over-engineered.
So right now it is a Docker,
so it's containerized.
It's a Flask app running inside a Docker container
on Azure container apps with a CDN in front.
And it pulls the data from a Google spreadsheet,
an authenticated Google spreadsheet.
So all this data is actually from a Google spreadsheet.
That's cool.
So it's a little over-engineered. And part of the reason it's over-engineered is because I ported it from App Engine, Python 2.7.
So like old school App Engine.
And I was trying to port it to Azure.
And so I was using Mencache 4.
So that's why I put a CDN in front.
So anyway, I realized, you know,
it's not that fancy of a website
and the data only updates
like once a month or something, right?
So why do I have this whole Flask app
that's just running all the time
using up cloud resources?
So I wanted to be less wasteful
and I also wanted to try out static web apps
because I feel like everybody's talking about that
all the time, at least around me.
So I was like, OK, how could I make this into a static web
app?
And people have recommended various things in Python,
like Pelicun and Lector.
But I already had this Flask app.
So I was like, there has to be an easy way
to do this for Flask.
So I found this frozen Flask.
And it takes a Flask application and turns into a set of static files. So you just
put in this code here and then you just run this and it'll create a folder and put the HTML files
in there. And it just does it by looking at the routes and then looking at all the URL for,
and then recursively following URL fours until it thinks it gets it all. And then you can deploy it.
So you could deploy to
whatever static web app. So I
deployed to Azure, but you could also probably deploy
to Netlify or wherever
the cool kids deploy their static web apps.
GitHub Pages, Netlify. Yeah, so if you do
GitHub Pages, then you do have to check it in.
Right? So that's the only thing is if you did GitHub
Pages, you'd have to check it in. So now I see one of the
advantages of using something other than
GitHub Pages, because I usually use like Recion, Visualizer, Dish, this.
They're all GitHub pages.
But I wanted to see, oh, what's it like when you're actually
not just using GitHub pages for everything?
So I thought this was cool.
And it's not a recent thing, but the thing that's relevant
is that it recently lost its maintainer.
So in December, there was this pull request where the current maintainer, the most recent maintainer, stepped down.
So it currently has no maintainers.
So that makes me sad.
And maybe somebody here would like to maintain it.
Because to me, it was a very useful project because I was able to,
here's the pull request, right? And the pull request does way more than I actually had to
change. But I was able to do this freeze and then set up some infrastructure and boom,
I've got a static website and I didn't have to do a big old port to mark down and Pelican and
all sorts of things. So I think it's a cool project.
It could use a little love today on Valentine's Day, some maintenance love. So that's what I
wanted to show it. So I like Kim's comment saying, surely personal websites are supposed to be
over-engineered. It's how you learn what not to do in your employer's production environment.
Yeah. No, I know. And I'm glad I over-engineered it, but then I saw the bill. I was like,
I really do not need to be paying this much for my personal website. So I did learn. Yeah. Thank
you, Kim. Yeah. So my personal stuff's on Netlify. It's a Hugo, running Hugo as a generator,
and then running on Netlify.
And it's all free, so I like that.
But I like the work.
It's mostly the workflow.
So the workflow of like, I want to write something new.
What does that workflow look like?
And right now it's write a markdown file and commit it
and push it, and that's it.
So I like that.
Yeah, for me, it update my Google Spreadsheet.
I'm debating I might move it to a JSON file,
because then I could have a CI that just makes sure
the JSON is well formatted, maybe something like that.
But I'm kind of a freak for spreadsheets,
so I've been using a Google Spreadsheet for 15 years.
Spreadsheets for website content?
Actually, I love it.
It's so amazing. You've got to have overflow wrap, though, on some of those columns, I'd imagine.
In the spreadsheet, right?
Yeah.
Yeah, I know.
This looks like a really cool offering or a cool library for people who, for whatever reason, have a website written in Flask.
And it doesn't have to just be for a blog or a personal site.
It could be someone's built a flask site that for
like an e-commerce type of thing or some marketing type of thing and they realize you know we don't
really change this we haven't changed this in a year and a half why do we need to maintain
servers and patch things right no you could just but and this is a this is kind of a neat project
that somebody for somebody to take on as a new maintainer. Yeah, looking to level up your open source game.
How about extras?
We got all of our main stuff done.
Pamela, do you have extras?
The extra that I was going to mention
was already brought up in the chat
was the fact that GitHub dependency graph
now supports pyproject.toml.
And I think maybe Henry brought that up.
Yeah, Henry brought that up in the chat.
But I was going to show, wait, where's my, okay.
So I found this Python package template from Microsoft for somebody in Microsoft.
So if you're starting a new Python project, this has like everything in it that's done the proper way, including the pyproject.toml.
Or, okay, maybe not proper, the way that they think
it could be done. So if you use this, then, you know, then the GitHub dependency graph should
pick up on your dependencies. So that was my extra thing was just to talk about the
pyproject.tomcom with the dependency support now
that's that's big news very good one brian i'll have to go take a look at that and see what all
i disagree with um uh i was just the hemisphorus structure you're halfway there to liken it um
that's good so uh well i just was curious everybody thought. I don't know if this is new, but I just saw it.
The pricing structure for GitHub.
Is this a new thing?
I don't know.
So 40,
like the individual user gets extra stuff for $48 a year,
essentially.
40.
It's not per month.
It's per year.
So that doesn't seem terrible,
but what do we get?
I don't know.
So this is basically the free tiers.
Just always,
you still get everything for free. But the copilot is what? I don't know. So this is basically the free tier is just always, you still get everything for free.
But the copilot is what?
10 bucks a month or something.
So there's some extras that you can add on to other things.
I wasn't when,
before the transition or whatever,
a couple of years ago,
I was paying for get a pro so that I could have private repos.
Now you can have a private repos with the free one so i
switch to the free is there what do you guys uh michael do you have an opinion on this or uh i
guess i have an opinion since i pay github every month for the talk python organization because if
you have an organization and you want to have people in your organization like talk python
authors then you have to pay to have them, which
is different than an individual having private repos and things
like that.
One of the things that looks interesting from the team
perspective is the Codespaces, which is basically a server
to run your code on, right?
Is that right, Pamela?
PAMELA TORRES- Yeah, but why are they?
This is what I actually just opened it up
to look at that particular point and expanded it.
Because I use GitHub Codespaces constantly on free, Yeah, but why are they? This is what I actually just opened it up to look at that particular point and expanded it. Because you can,
I use GitHub Codespaces constantly on free
and you can use it on free as well.
So I'm trying to understand
what the distinction between the free
and the team is for Codespaces.
Because I'm also a Codespaces freak.
Looks like on free,
you've got 15 gigabytes max.
So, I don't know.
You can just pay for a little bit more.
I just pay because i go over and more cicd i mean i guess i i'm getting to the point where a lot of these extra things like uh
github actions and more complex github actions and uh basically i'm doing more if i ever hit
some of these limits i think i'd be happy with paying yeah so 48 a year is not the worst subscription that i pay yearly yeah there's stuff i use way
less less and pay more for so oh yeah anyway okay that was just my extra i was just curious about
that okay i've got a couple as well for us okay our transcripts are way better over here now so
if people are interested in you know using the transcripts which way better over here now. So if people are interested in using the transcripts,
which we have for every episode,
not entirely unrelated to OpenAI stuff,
we have way better transcripts.
Like, for example, even when Brian said pyproject.toml,
it got that perfectly right, which is amazing.
And that means our search, we have search that doesn't just search, you know, some people's
search on their site, like for podcasts and stuff, just searches the show notes.
Our search is every spoken word, right?
So if you looked for chat GPT and Pi project, something like that, then check it out.
We're also live stream, by the way.
But there it is, right?
That one, which neither of those, I believe,
were listed in the show notes whatsoever.
So because we're getting much better tech words in our search,
in our transcripts,
that means our search should be way better for people who try that out.
Anyway.
So how did you make the transcripts?
What did you use?
Some of the OpenAI API stuff over there.
I got a cool Mac app that like plugs into that.
Yeah.
If you need something that will make your,
your Apple Silicon Mac that normally is cold to the touch and you put it on
your lap,
you're like,
Oh,
that thing's a cold laptop.
You wouldn't like a heater.
You can,
you can try to generate one of these transcripts.
It'll,
it'll be warm for about half an hour.
All right.
And similar, not the same thing, but somewhat related,
is the AI chat wars, I think, are really taking off.
And I watched an interview with Satya Nadella, CEO of Microsoft.
He was just relishing.
He was just completely sitting back and smiling and rubbing his hands like, oh,
this is going to be good because Microsoft and OpenAI have that partnership. I'll leave it at
that. I guess it's probably a little more complicated with partial owners and credit
anyway, but they're working very closely together. And so Microsoft announces that
Bing is going to have chat GDP integration as part of its results, and you can actually talk to it.
And GDP4, I believe, not just the one that's out. And you can actually talk to it and GDP for,
I believe not just the one that's out. And so as a result of that, like that day,
Microsoft Bing rockets to the top of the app store after announcing chat GPD integration,
like when was the last time you're like, Oh my God, where is Bing? I've got to get it.
You know, this is just not something that has been happening lately. Right. And like, boom,
overnight it switches. The converse is the same day maybe the next day
i think that's the same day google shares drop 100 billion dollars after the company's ai chatbot
flops in the dough so contrast those two things and it's going to be an interesting next year or
so in the the big tech space yeah so anyway those that's's just put that out there as something interesting to check out. Also,
I worked with the folks at JetBrains to get our students at TalkPython Training a free copy of
PyCharm Pro. So for folks who want that, this only works for new users. It doesn't work for renewals,
but if you don't have a PyCharm Pro account already, then just visit the link
and you must be a customer at TalkFightOnTraining.
That's part of the deal with JetBrains, again, just to hand them out randomly.
Anyway, if you are, there's like a little statement of what it needs, but for many people,
they can just check that out and get a free copy of PyCharm Pro, which is fun.
And if you're not already a member, just go ahead and purchase the PyTest course.
Yeah, exactly.
I think the PyTest course, this, exactly. I think the PyTest
course, this guy named Aachen wrote it. It's pretty good. People should check that out.
The mobile apps last time or time before last, I mentioned I was looking for someone to help me
rewrite that. The flutterification of our mobile app story is well underway. And that's, so thanks
to the audience for helping get that going.
Yeah.
And then very last thing,
Brian is,
I did a talk Python episode in the behind the scenes at the Lawrence Livermore national laboratory with the folks,
how Python was used to do the fusion ignition breakthrough that we all
heard about like a month and a half ago.
Wow.
That was a big deal.
So Python is super important.
Part of that turns out.
And I interviewed Jay Solomonson. He's down at the bottom because of responsiveness, but great story. Look inside
that whole thing. So people should check that out. I think it's kind of a unique story that
this was in the news a lot, but not this aspect of it. Cool. All right. That's all my extras.
So we usually do a joke, but we forgot our joke last week.
Was the Bing story the joke?
No, the Bing story is real.
We have a couple of good jokes, I believe.
Yeah, okay.
Let me pull them up here.
I think you've got one as well, but let me put my stuff back on the screen.
I didn't know we were supposed to have jokes.
Oh, no.
Normally, we just have one.
We just screwed up last time, so we only had a – we somehow skipped it.
So this is one of those – you know, you go to the fast food restaurants,
and you'll see they've got these digital menus up on the screen.
Yeah.
So here we've got – there's a McChicken, all rights reserved, little circle meal.
There's a Big Mac, all rights reserved meal.
There's a Chicken McNuggets 10-piece meal. But do you Big Mac all rights reserved meal. There's a
Chicken McNuggets 10 piece meal. But do you see what's in the middle there, Brian?
Yeah. The dollar bracket title bracket. It's $13.50.
What is it? The dollar bracket title. It's so amazing that it's up there. I don't know if
they're supposed to be curly braces and they missed the shift or something, but the comments folks, the comments are nonstop. Some of them I can't read
because, because it's, uh, you know, not actually safe for work, but it's like, you know, what the
McBlank is happening to my menu. And Oh my gosh, it's so good. So yeah. Also the pricing is really high i don't know who pays you know what is that
thirteen dollars for a mcnugget meal or ten dollars for a cheeseburger but that's a pricey
burger i guess it's a meal includes a drink but still whatever that's a lot yeah that's funny
okay well i have something that i was laughing like hard at, and I'm not going to go through all of it,
but it's 59 hilariously infuriating examples of user interfaces.
And I couldn't stop laughing.
The first one right off the bat, please enter your phone number.
It's just got a plus sign.
You just walk up.
And then the second one's actually my favorite is uh you gotta press it like seven
million times yeah yeah the um angry birds version of a volume control um so you just like
pull it back and then shoot the ball to what volume you want oh i love it i want that actually
that would be fun um but there's 59 of these that are just terrible.
Please enter your phone number with a dial wheel.
That sounds kind of fun, though.
It's been so long since I...
I kind of want to go out and just get an old phone just to do that.
Yeah.
A volume slider that's just like...
You have to make it level. Yeah, it's like a level. It you have to like make it level.
Yeah, it's like a level.
It slides the volume to like balance it out.
Yeah.
So is this your phone?
It's a phone number entry that just guesses your phone number and you have to say if it's
right or not.
Anyway, we won't go through all 59 but um this is these are worth a good laugh
don't it's probably not safe for work unless it's okay for you to be laughing at work
um there's nothing illicit there it's just you know
you're not allowed to laugh at work well this is work this is not for fun you're at work remember
that uh i had a manager once that like right across from me a long time ago.
That sat right across from me.
And every time I glanced over, he was playing Solitaire on his computer.
And like six hours out of the day, every time I looked over, it was Solitaire.
I want his job.
But anyway.
All right.
Brian, thanks a lot lot you just ruined the next
hour of productivity for me with this
article
anyway I guess that wraps up all of our
items thanks everybody
on the live stream for watching
and everybody that watches it later super
thanks to Pamela for showing up today
and thanks Michael yeah thank you
great to have you on the show Pamela
thank you