 I have the problem again because I'm too short and the mic is too high and I don't have a handheld mic today So I keep jumping and hiding behind this stand. Okay, um, so we We are going to start the licensing talk. So who wasn't here yesterday for the licensing talk. Oh There's some people. Okay. I need to explain the rules again So the licensing talk rules are if you sign up on this on the paper This morning then you can get ready and then maybe sit next to the stage And then because you will come one by one on the stage and we want to get you up and running as soon as possible So you will have five minutes to the licensing talk if you're promoting a conference I don't think we have today But yeah, you only got two minutes and then when the time is almost up I'll do this and everybody need to do the same thing to annoy the speaker So let them know that we are almost done. Please practice Yes, that's that's very annoying. Thank you very much. Um, so yeah, that's good. That's good. I mean, it's good So when the time is up, please give the speaker a big applause and remember it's only positive noises are allowed So please don't boo people. That's not very nice in a super nice conference. So, okay We shall have our first. Oh, I have a mic. I have a mic. Let me crown you I'm not good at this Yeah, I just hold it. Okay, or Okay, actually I should I'm better do it myself. Okay, cool. So, um, yes So when the time is up, please give a round of course, shall we practice now and give a round of course Thank you so much Okay So while our first speaker is setting up Can I have do you want to show your pu-pu? Sorry? What's your name? You want to show your your pu-pu device? I have some minutes before the first speaker is setting up. Do you want to show it? Oh? We don't have the camera. Oh, okay Okay, maybe you set up and then like the time between the first speaker in a second. Okay Yes Okay, you guys okay technical technical people are working. Okay. That's very good. That's very good Okay, so let me talk about my Windows 7 jokes, which I want to talk about yesterday, and I forgot so Last year who were here and remember my Windows 7 licensing talk No one something. Oh really? You still remember so yeah I last year is actually my first licensing talk and then I gave a talk about like We are not very inclusive including people who use Windows 7 and then so basically I'm whining You know like but oh it's difficult to use Windows 7 and then the story is by the time I give my first licensing talk I feel so great and I go back to my seat somebody tap on my shoulder and then my face turn white Because the person behind me and tap my shoulder is Okay, by the time at that time I didn't know who here is and he showed me his name tag and Actually, I don't even recognize his name, but his name tag say Microsoft So I was like oh god like is this a very important person in Microsoft? And I just jeopardize my my my opportunity to work for Microsoft. It's oh my god. I wrote my career. So So actually yeah, that's Steve You you may guess who here is and then I've since then we've become friends So this is how I met him, which is very funny Oh and do you like my shirt? This shirt is from Namibia. So yeah, again Are you still setting up like is it is it Windows 7? That's why it's so slow No, it's a Mac. Okay Okay, yeah, so yeah, yeah, this is from Namibia and it's it's a super cool because oh Everybody okay? Yes, no, no not yet. Okay. So yeah, like I call Namibia highly recommended because Africans actually very fashionable and We just use that cam. Okay. Oh, we have an inception camera again. Okay, so Okay, you only have one minute to present it, please So my game I made a very simple game where you avoid falling blocks, which you can't really see Anyway Yeah, there we go. So I don't know if I can lose there. I can lose I thought it would be nice to control this game by tilting the device But the accelerometer I have isn't really working so I Need to iterate on that and probably get better hardware But it's really fun to play these try to try to make a simple game It's really rewarding then A nice to you know play a game you you actually created on real hardware Thank you so much. Thank you okay now Let's our first speaker start setting up. Are you setting up or Yes, cool. Let's start. Let's give a round of applause for our first speaker yes, so I Won't talk about a neighbor. I'm a project. I've been working on the last five years So it's installed in Christiania. It's a part of Denmark. We spotted it 45 years ago Look like this. We still have it. We purchased it three years ago So it surrounds the whole area is see up there We own the place and we own the infrastructure. So It gets quite cold and Christiania the winner and people used to fire off in their furnaces with the cold and all kind of shit so there would be smock over the city and We try to try to get them to use gas, but they wouldn't pay and Old squatters don't pay bills So we created for 25 years ago cause not me This guy he created an idea about trying to do distributed production centers basically putting a central heating in the ground and We are doing it at Hux. So When we have a need for a new production center we created and then we connect a few houses and Then came the problem about billing them because we knew that they don't pay bills So what's do? We went to their houses they had they had some meters and we purchased some more recycled meters of the black market in Denmark and those meters they are They're not to be sold a second hand But we we got them anyway. They are they are proprietary. So You can't you can't get to know what they are measuring Need to have a key. So we spend a winter Really cold because we didn't build the system yet So we spend the winter reversing during all the protocols and then we went to the company and said so So we have we have created a device now that is a able to talk to your devices and It's the small ESP 8266 base solution there and you have a similar solution that you take 2000 euros for and we've created this for hundred and fifty kronor, which is about 14 euros And they were they were really angry at us So Yeah, no more communication with them, I guess The fun thing about this is that you're able to connect the valve to it. So we created prepaid solution You have your phone Going to your phone. You use a Danish payment system You send off a few euros The valve opens and you consume your heating. Of course, you can regulate it with your radio radiators But the valve will turn off after your heating has been consumed So that is pretty neat for people that don't like bills Yes, and Everything is open source. So we did all the designs for the furnaces based on old oil burners Everything is released Even the reverse engineer protocols We didn't sign no NDA We but we have the NDA at home on signs and then So we have some firmware as mostly see and a lot of pearl Of course, it's not me that are writing pearl then I wouldn't be here It's my friend. He hates python. I don't but yeah so Lot of love code there. So I don't know if I can get this to work but one of the few python projects I made in the This kind of context is to Sonica sonify all the data because It would I thought it would be pretty nice to have like a sonic overview of the whole heating infrastructure with all its 400 users and every time they would turn on their radiator. I would get another sound and that could be really fun It sounds like some avant-garde. Yes, I don't know if I can get it to work here I This is the live system. This is the sound of Christianity right now. That's about it We are very much looking for people to come visit us. We have a house and stay for free You can avoid pearl. Yeah. Yeah, that's about it speaker. So let's give him a big round of course Raise yourselves. This is gonna be a technical one So try to keep the attention. This is gonna be quite fast, but really really useful if you If you like functional programming, which you should so Runs on the title multi-threading is easy if you write functional python Writing pure function is not all nearly elegant fast and makes your code beautiful It also comes with really nice benefits for parallelism slash multi-threading So I made this really really a bad example because I'm really bad at making examples But we just want to try and greet a couple of people. I use this module faker to To just generate a couple of names and A really simple greet function that all that it does is wait a second So I can show off the parallelism and otherwise returns a greeting. So hey everyone welcome here. Great Now we want to greet everyone and a naive implementation of that can get really really ugly This is what you would do as a beginner and it works. It's fine but there's way more elegant ways of doing this in python then to Start with an empty output study loop in the loop Have an if condition that checks for several things get the greeting concatenated changing a variable in place all the time and then eventually printing it This is really not elegant. So what do we do instead? We use filter and map So first we take that list of names and I just took some arbitrary constraints here Name starting with e Ending with s which coincidentally is what happens with my first name You filter them with a lambda function. You map them over the greet function that we already had earlier And you join the output together again No special cases because there is nice functionality in Python readily available to make this nice and functional So I got completely rid of the loop and I can pass this to Python which already gives me a couple of under the hood Sort of optimizations because even if it looks like I'm doing a filter and then a map first You might think oh wait, then it does two loops through my data. No, it doesn't these are lazily evaluated functions So it's in fact at least as fast as your manual loop so and that makes it really really easy to parallelize because All I have in my map here is a greet function. So I really just taken a name spit out a greeting And that can run on any machine on any thread. It doesn't need a lot of context Which is what you always should aim for right functions that are repeatable that are simple input plus function equals output No side effects as long as you can avoid it And then all I'm doing as I'm installing this Python P map library importing it and importantly I'm Replacing the call to map with P map which magically parallelizes it now. Let's have a quick look back to here this Is way too fast Yeah, I only got one example. That's the problem with random data. Never do a demo with random data You're just gonna have to take my word for it If you're doing this parallel, I think by default it takes the number of cores you have on your machine So this is in theory four times as fast and before just because I put a P in front of the map And that is really the core of the talk because I have one more minute I'm just gonna spread the word for a coconut which is a really really great extension to Python layers on top of it compiles to Python and then Executes that and you can install that load it into Jupiter for example and get this really funky functional Syntax here where you take inputs and pipe them or thread them whatever your choice of preferred choice of word is pipe them through sort of functions The dollar sign makes it a courage function with already some value set you can use Question marks you can use lambdas with arrow syntax and there's a lot more there But essentially I'm piping the input through a filter that tosses out anyone not starting with e Through a second filter anyone not ending in an s maps that over the greed function joins it all together and prints it In a very very concise way and when you get a bit into the syntax, it's very very readable and very elegant. Thank you Thank you so much because like I have a volunteer here like showing the clock So I think that's why every speaker is like perfectly on time, which is perfect. You need a hand. Okay. Yeah, so Yeah, is it oh it's already running. Oh, I have not nothing to say between because it's so smooth Okay, let's give her a big round of applause Hi, my name is Tomoko and my Twitter ID is Como FL I'm from Japan and it took 14 hours to come here. This is my first Europe Python and I'm really enjoying Oh, thank you Thank you Now I talk how I analyzed peps with network X As you know Peps are very important documents, but there are so many so beginners Don't know what which one to read first which pep is important and What topics do peps cover? So I wanted something like a map to read the peps My idea is to use citation relationship in academia Important papers are often cited from other papers And they are also citation relationship among peps for example pep 8 refers to pep 20 and a pep 8 and 257 also refers to each other So I thought network analysis might be useful to understand the peps Network analysis is a oh, sorry Network analysis is a method to analyze relationship among elements and in Python network X makes it easy to get started This is a pep citation network drawn by network X The colors show status such as accepted rejected and others and The size shows number of other peps citing that pep This large red node is the pep most cited from other peps Okay, here is a quiz Which pep is most cited from other peps a pep one be pep 8 see pep 302 Please either hand, okay a pep one pep purpose and guidelines Thank you Next be pep 8 style guidebook Everyone's loved it Next see peps 302 you import the folks Okay Okay, the answer is pep 8 style guide for Python card Naturally pep 8 is most pep 8 is cited from 21 other peps and The second place is new import folks and but pep 484 type hints is the same By the way, pep one was the seventh Okay Next we can find many interesting things from this network For example, this small island is the pep about the sweet statement These were replaced over 10 years ago and these are isolated from other peps and Next let's look at this area In this area, there are many 8,000 series peps these peps are about the new governance of the Python language and these were created last year and These are connected to other peps be a pep one and five seven two Okay, this area seems to be a group about new governance. Then how about other area? Let's do clustering Network x data can be clustered using Python Ruben package. Let's try These are some of the result The top area seems to be a group for package These pep titles include the menu was such as package, wheel and pipe PI And this is the area for processes and document formatting pep 8,000 series, pep one, 12, to five seven and more peps This map is very exciting So I'm creating an interactive web page with network x and bokeh If you are interested in this talk, please check my desktop and in Japan, Python JP will be heard So we have our next speaker coming and then yes So I'm Robin and I will tell you how you can let monkeys annotate your Python So what kind of annotations am I talking about? Of course type annotations for it for and so type annotations 32nd summary, Python is a dynamically typed language, but sometimes it's nice to have type information So we have those optional type hints and they're not checked at runtime most of time But you can stack them, check them before runtime and they're useful for documentation So I think most big projects would have them And this is the minimal example of type hints and for function signatures All right, so how do you start using type hints? Actually, there was a talk yesterday by Vita get into a lot of depth how to actually do this and best practices So I refer to that and what I would suggest is incrementally add types and start with one sub module start adding stuff focus on public interfaces that are actually like useful to other libraries using your code and and Consider adding new types. So using this new type feature and to have like the explicit names for semantics So how to actually add types and if you have this huge code base of Python code Do you want to go through all of it and manually type stuff? It's really annoying and especially like the few files your developers will stop doing that and So what you can do is automate that and this is where monkey type comes in monkey type is a tool and published by Instagram And what it does is you can run your code with monkey type and it looks at all the variables and their types at runtime and Brights it to database and afterwards you can generate type notations from that So the first use case for that and the one that we actually use in our project Was we have very excellent test coverage integration test coverage of our code So we can just run this integration test suite with monkey type and it writes on all the types it sees and We can fill in the type notation and the code from that the other thing that One could do if you don't have as good a test coverage is actually run like in a dev setup or staging setup or even production with monkey type and record the actual types you see in reality and Some of the things so monkey type doesn't add perfect types So you manually have to go over them and check them but like 80% of the work is done So for example, if it sees none a lot or doesn't see none, but it should be there You probably have to correct for that with this this optional Annotation and depending what kind of tests you use to generate your types So don't use unit tests that use mocks because then your types that are in the code are the mock types not the real types And so be careful of that. I want to give you like a third second demo of how this works so this is My code no type annotations ever multiplication function and the test for that and what I can do now is I Do monkey type run where I do is I run pie test Just run pie test on this file and have monkey type run around it. So my tests are green. That's good And then there is a monkey type apply and I give it a module name and What I've now did I'm looking at the diff adjust edit the ties that saw so I my test hands in two ends And the function returns an end So it's adding to my function that both variables are type in and returns an end and can also do more more complex types So that's unit types and all that that stuff that you like All right, so try out monkey type. It's very useful if you want to add types to your project. Thank you One more we have one more licensing talk then we'll have a lucky draw again So make sure that you stay because if you are not in the room Then I'm afraid you can't win the prize and if you want to go to the toilet. That's too bad. So yeah Same computer. Oh, okay. Wow Okay, there's a So my name is Neo Vitae and I come from Copenhagen my background is in astrophysics and While I was working at the University. I really got into public outreach and In Copenhagen every year we have this Thing called the culture night where all the universities and museums For a whole evening open their doors and the general public come and have a look So you can see some Kind of get the idea from the pictures below there So my research was mainly into computational fluid dynamics and I was thinking, okay How can I make this interesting for young kids and teenagers and I Wanted to have something that was fun, but also though there was still an element of physics in it So this is what I came up with Okay, so This is running in the browser and what I can do is if I click to the mouse, I'll be injecting energy just like supernova explosions and it's actually Solving the fluid equations in real time on your browser That's why it Depending on the computer can work a bit better, but you have to keep the resolution quite crappy for it to work. I Can change the column up because well, let's face it nobody likes jet You can If you don't like space invaders, you can blow them up You can also blow up the death star if you want Yeah, so That's it, but I guess it's kind of I Think public outreach is really important because you're targeting not like university students But you're going even younger and to get the Passion in about science and computing into these very young children. I think is really important. Thank you Wow, this is this is art I think this is like comparable to like the keynote speakers showing that I think you should go to Seoul and show this So, yeah, we'll have the lucky draw now Machine learning, you know powered Agri-farm to pick the winner. So I'll let Alex do it. So this is These are the prices Let's see whether we can narrow you down a little bit better than yesterday. I did not improve anything. Oh Hi. Oh, no, it doesn't like it. Oh, it doesn't show Okay, oh, here we go. Okay, so with welcome back Piker Sandra Piker Sandra give us a question Stand up if you have submitted a talk to Europe iPhone 2019 only Keep standing if you the day of your birth so the day sort of is Odd how many people left is sometimes really hard to see from here. There's so many in the light. So, okay, so, okay Keep standing if you travel. Okay, that's a good question. Keep standing if you traveled more than approximately 8,300 kilometers Anyone left standing? I have no idea. Okay. Okay Stand up again. We just look we skip this part now So if you have been yeah, we reset to the last question. This is a bad one Let's see did it. So keep standing if your first name contains upper or lower case. Oh, come on X if you're still standing then like okay keep standing keep standing keep standing standing Keep standing if your birthday contains the number nine Come on. It's like everybody, but I have improved keep standing if we do this again five The birthday with a five that's okay. Who's standing? Can you raise your hands one two? I think I'm gonna fire as well Five oh my that's too many. Sorry Okay, so let's repeat the question Actually, we're expecting the decision to be much possible six Also a six and your birthday. Oh, no, nobody left. Oh, come on No, it's sometimes really hard to see there's a lot of light here, so today we simplify and give free choice So, okay It's like a library What we're gonna do for this Okay, let's try to Six people we need six people Can you six people and we ask Cassandra the next question? Let me rerun this notebook Better Cassandra that a Cassandra one actually I thought it was just like a really decision tree really narrowing down everything to like one person fast No, no, I just want here. This is what I'm looking for. So restart import the questions Stand up if this is not your first. Oh Recurring so many people yeah, thank you Cassandra stand up if the Keep standing if the day of your birth is odd It's 50% Keep standing if you traveled more Let's skip that. That's where's anyone has anyone travel more than 50,000 kilometers. Oh, okay That's okay, okay Keep standing if your first name contains upper or lower case the letter age and it looks promising Yeah, let's stop here who how many people have we raise your hands one two three four five six No, we have too many books. Sorry. We don't have enough books for you. So keep standing if your birthday has number two Okay, that looks very good. It looks promising. How many people left one two three four Six, yes The books the books are distributed now a fee for but you can maybe trade the books I want to speed up the process a bit. So come up here first. Come up here first. Oh Yeah, you have to fight you have to be I want this I want this no Yeah, okay, maybe we have another round of questions for these people who travel the furthest Ask us one more questions. Yes Come on. This will do it now. It's very exciting. I come here. I need the book if your birthday has the number three in it Somebody yeah, okay. Okay. And then the others please wait. Okay. Let's keep them. Let's Okay, yeah, okay, then you take the books, you know make the first let's speed it up. Okay. So and again So the other It's so good. We're really good at counting I can't count. Oh my god. All right. Tell my teacher. Jesus. Oh, thanks for writing for giving us these books for All set for the next week here very soon, okay, um Okay, is it binder again? Okay. I think so. Yeah, okay Hi, my name is Tim and I really like to go to tutorials and workshops and spend half the time setting up software Who of you would join me for that Okay, so for all the others we built some software called binder and What it does is it's a website you type in the link to a git repository and then we build a docker container for you and Connect you to it and all you need to have working in your workshop is a laptop or tablet with a browser and Internet and you know So I will tell you a little bit more about binder You have a Github repository in this case that contains fantastic material for your workshop and you want to start it on binder and what you do is you go to my binder org and you type in the name of the repository So in this time in in this case, it's binder examples slash requirements and you click launch and what happens if you're lucky is There's a big orange bar saying already built and launching and these are the most painful 20 seconds of Giving life demos about binder because if we're lucky it takes around 15 seconds for it to spin up And I have to fill 15 seconds if we are unlucky because lots and lots of other people at sci-fi for example are using it to Join a workshop and there's 60 people starting other binders It can take a minute or longer and then you're really using your time for your lightning torque productively but generally is very quick like this and what you get is If you're a fan of Jupiter a very well-known interface and you can now Click on the notebook and you can start running it editing it and Figuring stuff out about what you actually want to do in your workshop instead of installing software. So How does it work what does it do This is a repository. I just edited before the talk to let you see what happens when It's actually building So you see lots of repos that have these fancy badges and they will take you directly there and Well, somebody already tried out that repo in the meantime So what you see now is not a whole bunch of pip install command scrolling by but the same thing we had before We have lots of examples. So for example if requirements.txt is not your You know favorite way of installing stuff, but you prefer to use condo packages If you put a environment.yaml in your repo We will figure out that probably we should install all the stuff in it for you If and this has to be a secret amongst us you use R We've got you covered two So in this case you put a file called install.r in your repository and it contains all the commands to set up the packages that Your friends who use R need Sure, you don't want to admit to using R and the cool thing here is if you start it and The demo gods are with us then you don't see a Jupyter notebook interface because if you use R you like using RStudio and That's a nice thing about Binder is you can have notebooks or you can use RStudio or VS code Or lots of other things basically any interface that is a web page works So eventually here RStudio will load There you go. I can't show you around this because I don't know how to use it If you want to do really complicated stuff Then you can write a dockerfile by hand if that's you know like how you like spending your time And then you're free to do whatever you want. We have an example of what the minimal dockerfile looks like And there's a GitHub repo or organization called binder examples. It contains lots and lots of examples. So Nick's is a package manager We have examples of how to pull in data PIP files requirements bokeh Examples latex now if you like using latex The list continues and continues and continues so the nice thing is this is open source software That you can contribute to and it's open infrastructure. We also Run the service and we need your help or we'd appreciate your help To run it. So see you on the internet right So, um, yeah, I believe this is a conference promotion. So you have two minutes. I'm afraid So the but the picture looks really really really good already I think I think it says a lot of words already. No, the picture of the conference I would like to invite you to your sci-fi who of you has been at your sci-fi before Just a few people. You missed something. Therefore. We should go to your sci-fi your sci-fi will be in Bilbao in Spain It's a very nice chance easy to get there your sci-fi will be the first week of September and at this time we do have a Lot of things and one of them is a social event So you should try to pinch those there if you maybe you know what pinchers are Do you see them? There's a lot of them a lot of variety and you should not miss them That's your opportunity to try pinch those Bilbao is the place for where your python 2015 and 16 happened So you might know Bilbao already We have a lot of talks so we have very nice keynotes So if you want to know something about black holes, there's a keynote about really even beyond rocket science black holes Then we have a lot of talks as the conference is organized as follows They have two days of training two days of talks and one day of sprints So there's a lot of famous names as you can see to hear from the scientific community These very interesting topics in her very high-quality talks the trainings are two tracks a beginner's track and advanced track so that will be something for everybody and We also do have a special track for maintainers of open source packages maintainers discussion So if you maintain a package you can meet with like Minded people and talk about how to do this This the call for sponsors is still open If you would like to sponsor the conference, please go to this link More info so you can find on our website here your sci-fi.org and we also on Twitter and See you in Bilbao So yeah, I travel a lot and also a fun fact. I'm from Hong Kong I was born in Hong Kong before 1997 which give me something very very special I have a I have a passport while I'm telling you like something about my you know, okay So yeah, I have a British national overseas passport and this passport is super funny Because my friend have the same passport and also she is similar to me You know like we work in a UK and For us like people who was born in Hong Kong and only have these like British national overseas Passport then we have to get a visa to work in the UK So what happened is like in my passport like it looks exactly like a British passport, but inside I have a British visa so Some people know it's like kind of it's funny, right? And then these kind of sometimes give us problem when we travel aboard for example like I said I have been Namibia and then I almost miss my flight from Johannesburg back to London because the flight attendant was like Well, it's the real passport while you have a British visa in your British passport like what's happening? Then I was like don't question me like I can enter the UK They would they would question me like please let me board a plane I'm the only one on the ground and everybody was on the plane. I was like, oh, no So yeah, but at the end I go back to London safely and on time, which is very good But my friend is not that lucky. She went she tried to go to Kazakhstan for holiday Her flight was you know, she flight to Belarus and then change to fly and go to Kazakhstan, right? So it's a long journey and about a time she reached Kazakhstan and then okay. Oh, I'll tell you later Hello, thank you for coming Lightning talks are so important because there's so much great software out there. We just don't know about it For example binder. I didn't really know about it and the problem is and the best thing is if it's a bad lightning talk It's over in five minutes In Picon USA. They had four hours of lightning talks. You don't want to sit through all of those So here we have the 12 best ones and you don't even have to take an hour to watch through them This is about Python links info because you can just scan the brief description And you can see exactly what the lightning talk is about and whether it's of interest to you or not Okay, this is fine for just Picon USA, but what happens when we get to more videos? What happens when we get to say a thousand videos so at Python links info before I started doing the lightning talks I was indexing Python videos Here we have over a thousand of the best Python videos if you go to YouTube or Twitter You get an infinite list But a basic principle in human factors is there should be no more than about seven items in a category so here We have a category called data science a machine learning Parallelism multi-threading multi-processing people in communities of Python skills development a woman at Picon USA said I'd like to learn a new Python skill So I said great just go to YouTube look up the skill you want to learn and watch the video and she says I don't know what the skills are so I said what you need is a discovery engine come to Python links info and One seventh of the videos are on skills beginner intermediate advanced design testing monitoring You can see what skill you want to learn and you can watch the videos So it's structured as a tree Here we're going to jump down into the tree and in the upper left you can see where you are in the tree So taxonomy tree of life is very important for organizing if you look in the upper left You can click but I don't know about the network here You can see the entire tree and if you have a desktop you can hover over it and it'll zoom in This is all built on top of the forest wiki They were kind enough to give me a poster session on the forest wiki I invite you to come and talk talk about it The forest wiki allows you to develop and run Python in the browser Thanks a big shout-out to transcript which allows you to take some Python and transpiles it to JavaScript and even more important is pyodide Which is see Python compile to web assembly and running in the browser. It's from Mozilla. It's really great They have 37 data science libraries Which have which run in the browser and pure Python will also run with a pip install You can click on contact Python links info you can click on contact you can go to my website and Also in my few minutes remaining I will mention In Gdańsk in October of this year is the PyCode conference Probably a lot less expensive than Basel We invite you to come and call for papers is open till 17th of this month. Thank you very much Let me quickly finish my story. So, um, yeah, like she arrived Kazakhstan So Kazakhstan is like is a country that, you know, most people speak Russian So of course at the immigration people only speak Russian and I will tell you later. What happened? Sorry, okay So hi It was at Europe in 2016 that I flew the last time and Since then I've been trying to avoid flying Why? Because it's it's an extremely elight way of Being transported 90% of the world population will never have the chance in their life to set a foot in a plane and Even only 3% of the world population are regular flyers. So I decided myself to No longer be the part of that group, which I was obviously a group of regular flyers, which is an elite group. I wanted to be part of a different Elight group that changes the world with software and doesn't burn it with emissions One important thing to note here If you say something that does also make sure that your internet servers actually run on renewable energy. Otherwise, you're far from it So at Europe in 2017 I was actually very lucky. It was pretty much around the corner. I was in Italy But it didn't have time to go there anyway. So no flying for me Europe Python 2018 was an Edinburgh and I managed to go there without flying So in case you don't know Edinburgh is up there That's the continent, right British islands over there and Which you probably don't know I live down there So I looked that up in the train travel schedule and Dutch bands told me that Going from mentioned to Edinburgh takes about 15 hours straight Which is pretty okay. I mean only three changes along the way. So that's totally doable in one day, right? I didn't So that's a difference between getting there, which is totally what flying is all about, right? You get there Versus travel. So I decided to travel there And I took a route which is Still kind of the obvious route you would take there from mention to Paris To London up to Edinburgh But with a stop in Lille along the way So this is where I would arrive normally got less in Paris first stop after mention But you don't get out God list at that front. What you see is this Right because that's how you exit got less normally when you go to gardener We're just just around the corner. So for those who have never been to Paris. This is what Paris looks like when you switch That's you go up the stairs and then on the left in the end and there's got enough and that's where my journey continued this garden or Not mentioning not worth mentioning that much and then I came to lead This is a city that I really like. It's a beautiful city in the north of France If you ever have a chance to get there, it's wonderful. Just give it a try You go there for a weekend. If you want don't fly there go there by train Why is it cool? Well, it's it's right in the center between Brussels Paris in London. So there's dark train connection to each of them It's like one hour to Paris two hours to London half an hour to Brussels So if you ever have to go to any of these three cities and need a night stay in between Stay in Lille. It's much cheaper than any of those three So going on that's your style that got me to St. Pancras in London Which this station is and then I continued When crossed the streets, you know, you can't imagine these things I mean, you can't come up with them right across the street and you get to the next train station Why would anyone build something like that, right? So that's King's Cross and my trip continued along the Along the the coast through beautiful so beautiful Skies and landscapes to Edinburgh. So this is Edinburgh station and That's a picture you've probably seen at At Europe I last year took it myself Then after one full week of your Python, I went back to London This is The station Lille again estate there for night and then I saw this godless wonderful place Thank you, I think yeah people if they want to see more pictures, please feel free to find So yeah next talk is up. So let's welcome our speaker Hi everybody So I want to talk to you about How you can do hot code reloading in Python state while keeping the state of Python? So it's not something you would want to do every day, especially if you were doing web development There was a talk yesterday on how you can reload the entire app because when you're doing web development Typically, you don't care about the state. Everything is in the database. Everything has on the files But when you're playing with notebooks and you spend two hours loading your data frame and you're tweaking a library that's in a file on the disk and not in a cell on the notebook or when you're developing a video game and You took you know, you need to put your character in that position and then you to see that animation Then it's sometimes useful to be able to just reload that code While you are using the app So I'll show you how to do this So the first thing you need So I would take this as an example There is this I'm using just a library turtle from Python and just a small turtle. So if you launch it you can just Import the turtle paint painter and then you create a turtle and you can read for a few steps. So It's moving around and I made a buggy here. So it's some kind of stuff. I would like to treat And if you look at the source code, it's because it's going backward here. I should have put it forward So if I want to start Reloading this code live What I need to do is first I need to Find out where the source code is and then I need to get that source code and Reloaded so there is a very nice library called inspect in Python So we can import inspect And then you can use inspect to Get the source code of a file so you can get like the name of the source code of a file. So I have my Turtle painter and you can you know, okay, it's in this file But you can also directly get the source code of the file and what's interesting is that if you change it and you add some Thing in your code the next time you call it you can see that it's you have the new version So now just with this code we can get the new version of the source code So the next thing you need to do is away. So here I will for example fix my code So I make it forward then so I have my source code Here then I need to you know make it to reload it So first I need to create a new class from that source code To do that I can get access to the module using inspect so inspect dot get module of the turtle painter and Then I can create and I need to create a new locals where it will store a new value. So Just create a new dictionary and Then I can execute the source code in the namespace of that's module. So I can just do exact of my source code In the modules, I need to get the modules that underscore underscore dict and With the locals I just Specified here and after I did this I have this Dictionary locals that contains the new version. So the new class And the old one is still active. So my turtle still has the old code. So the last thing I need to do is Update the class on my turtle by accessing the underscore underscore class of my turtle equals locals and Then I can just use the name of the turtle painter That name and now I Told that most steps You can see that my turtle is now going forward. So I just hot Change the code and the turtle was still running everything was still running was still keeping the same position So in synthesis when you want to do this, this is the main thing you need to do get the new source code Get the module create a new Local namespace and then execute the new source code in that local namespace If you want to go further, there is a library I'll create to call reloader where you can just Use it as a decorator Because tonight we have the social event So we will have the last two talks and then I'm afraid if you don't make it to today You have to wake up super early tomorrow to sign up. Make sure you are like top five or top eight Yeah, earlier the better this morning somebody knock on the door to get in so yeah So I brought some windows 7 Hi, I'm headache. I'm an architect and usually on propering conferences This raises some confusion because I'm not an architect for software, but for a lot of buildings So since I had some chat with some friendly folks here, I thought I might share What I do at work. I enjoy as you writing Python and my title in this local office here in Basel is I'm so-called been manager. So what has been been is a basically you can think of your future building as a virtual 3d model With the database in the back Unfortunately, it's all the big proprietary software, but it has an API and that's accessible to Python. So Let me show you how this looks like So this is your virtual building or rather a little slice of it of a training model where I teach my colleagues on some basic Python cause In this big proprietary software, there's lots of terrible workflows. It takes you 20 clicks Which usually could take you like one or two lines of Python so to demonstrate this I Show two tools one is the red Python shells the repel Python repel inside this Program and then pyro bit how we deploy these little tools that we write for our colleagues So let's take the example of a door traditionally This is an element in the building that has a lot of data attached to it And what in large buildings you usually work with a dog consultant? And the first thing that guys want to know is is it a door that opens to left or to right? So the only way for an architect to update this in this model is they would go into the plans and update all these thousands of doors and See what it's still a lefty or a righty door. Of course, this is a stupid robotic task And they should rather do some creative work. So I think comes to the rescue This is a super simple. Yeah, 40 lines of Python code. We can test it in the repel and see how the data is Updated and you see within a blink of an eye. It checks all the doors. What is the standard configuration of the door? Has it been? Mirrored and when it gets that back from the database, it writes the data back to the door So this can save massive amounts of data, but the logic is super simple Of course, you're not only restricted to the to this proprietary app You can also have lots of fun with CLI apps checking thousands of doors on how they changed and what what happened to the data and so Conclusion is if you know some you have some friends that are architects Maybe you can nudge them to learn some Python because it's there's a lot of low-hanging fruits there And that's it. Thank you I Won't I won't continue my story because it's quite long and try to find me on a social event And I will tell you the rest of the story because I will be drinking so the story will be funnier Yeah, so this is our last talk. So also tomorrow morning. I don't know our volunteer up here at the 815 Something like that to open the door. Not sure Sorry eight Okay, 813 to the perfect. So I view too early. You may have to wait outside. So yeah, because they're working very hard. So, yeah Okay Hello again, since this is a lightning talk, this is gonna be lightning fast So I want to invite you all to come to Python Pizza Hamburg on the 9th of November So here are five reasons why you should come First Python is our favorite programming language. And of course we want to talk about it Pizza this one is self-explanatory share some pizza with your fellow Pythonistas Hamburg come explore the beautiful city of Hamburg We have a two-week challenge for submitting a call for proposal So this is your golden opportunity and this conference is good for first-time speakers Last but not least if all of these reasons didn't manage to convince you come for the pie ladies event co-hosted by Pie ladies Hamburg and Berlin Hope to see you there announcements by the organizers or how to go to the Social event if you're going to the social event anybody have any cruise because I'm I try to be local here But I'm not that local yet. Um, I think there is um, I think somebody post I think Martin post on telegram I think it's like number 12 and then take the s one something like that is the quickest But yeah double check if you can't find on telegram maybe ask to go So yeah, we'll see at the social event and then also if you want to join you can still pay by cash And then now you can still join our social event. So see you there