 Okay, we are going to start in two minutes. Okay. Okay. Let's start. Good afternoon. Welcome. And thank you for coming. I'm pleased to introduce the engineer, Daniel Pope, who talks about PairGain Zero. Hi. I'm Dan. I am a reliability engineer by day. But for many years my hobby has been programming games. I remember my first computer was an Atari ST and I had ST basic and stuff and I immediately put that to one side because it came with loads of games. And so my interest in programming came from my love of games and I continued to program games in my spare time, particularly during two weeks of the year, which are Pi Week. So Pi Week is a week-long games programming contest where you are challenged to write a game from scratch in Python on a topic that is given to you at the moment the contest starts. So you have exactly one week to write a game and then you have to upload it. And I've taken part in Pi Week about ten times, but I've won it twice. So that kind of background was particularly of interest to Nicholas when he set up the Python UK education track. And he kept saying, well, Dan, you have to kind of get involved with this because teachers, we love this kind of stuff. So about, is it four years ago, the first five years ago, the first Python UK education track rolled around and we were challenged, we were put into groups and challenged to groups where teachers met developers and challenged to come up with some course material that the teachers could teach. And so from my Pi Week and Pi Game background, I dashed off the simplest possible Pi Game program which is about sort of 20 lines, import Pi Game in it, and one of the teachers said, no, that's too difficult. That can't work in a classroom because the amount of code that he would have to teach for a student to be, to get something productive by the end of the lesson was too much. So the best programmers in the class, the people who got it would race away and be bored and the people who didn't get it would not have got it by the end of the lesson. So that problem sat around with me in my brain for three or four years. And then in 2014, I think the October 2014 Pi Week, I sat down to write a game and the theme was one room. I thought I'm going to write this in a kind of way that I would write it if I was creating a framework for complete beginners to Pi Game. And then last year, I turned that into a library which is Pi Game Zero. So this is a library that takes all of the boilerplate out of Pi Game. Pi Game is a library for access to graphics and sound and input. But wrapping that with a kind of thin Python layer that lets you training wheels for Pi Game as it were. So you can get up speed faster. The teachers can teach like a couple of lines at a time and make sure the class is caught up. But then it is just Pi Game underneath. So you can throw away the training wheels at some point and migrate to Pi Game proper if you want. So I'm going to show Pi Game Zero today. I've written a blank file there. It's called demo.pi. The secret of Pi Game Zero is that it doesn't run with the standard Python interpreter. You run it with PGZ Run. So PGZ Run is all the clever machinery. A blank file is a valid Pi Game Zero program. It creates a blank window. But you can quit it, which is great because you can't do that with a blank file. So that proves you've got things installed. Then you can say def, draw, fill, move. So two lines of code. And I've got a blue screen. So let's write a little game. I'm going to... So that's a couple more lines. But that is using Pi Game Zero magic. This mouth refers to an image. I've got a directory called images. And that's where my image files are. So I don't need to do any faffing to load those, path manipulation. They are just available as strings. You can access them as objects in order to get the width and height, if you want. But the actor there has a width and height. It's a Pi Game rectangle, which is why I can position it by mid-bottom. It's got all of the Pi Game attributes, like left, right, X and Y. So I'm going to have another thing. It's going to be very topical. So I've got a pincho. These were drawn in Inkscape, by the way. And then exported as Pings. And Pi Game Zero can load Pings or JPEGs. So whatever file format you could... You should just be able to save something off the Internet, maybe, and use it immediately in the game. And then I draw a function called Update. So a couple more lines. So two lines at a time. That's what we're aiming for. So if I say if keyboard.left, I should have chosen a word that's easier to spell. And then I said these actors are... I'll just ret, so I could do if... So I think that program is easy enough to grasp. I think by moving all of the complexity out of the Pi Game program that you would write into Pi Game Zero, we've created something that is much simpler to get started on. Just at that level where you're transitioning from something like Scratch. So kids will do Scratch up to the age of 10, 9, like some subtle nods. And then in the UK curriculum, they have to transition to a textual programming language. But Scratch has the ability to create characters and move them around out of the box. So that stuff is very accessible. For Python programming, I think we're in a situation where the out-of-the-box experience is worse. I think if your basic programs are... What is your name? Hello name. That's a big gap from where you just were in Scratch to where you are in Python. So Pi Game Zero sort of fills that niche for getting up to speed, getting something graphical on the screen to keep kids engaged as their programming career continues. This was written in Python 3. I think that's important as well. So the background for Pi Game and Python 3 is sort of a bit incomplete. Teachers told me that they wanted just Python 3 stuff. They wanted to be able to teach one language. So the Python 2.3 split was a big problem. When this was written... I think this is still the case. There is no official release of Pi Game for Python 3. So part of this was actually finding ways to install Pi Game and Python 3. And that is all in the documentation. So there are ways of doing it. It works. But Pi Game is catching up actually. So there are now binary wills on Pi PI, but I think are for the pre-release tag. So you have to say pip, minus, minus pre or something. But you can install Pi Game. So I was going to show you some of the other things that Pi Game 0 can do. So draw and update are your basic bread and butter for creating games for animation. So draw will draw the screen. That will be called whenever Pi Game 0 wants to update. Draw the screen, refresh the screen. Update is called 60 times a second anyway. So if you don't define update, you can create games that are available. I will show you the click API. So all I needed to do was create a function on mouse down. And Pi Game 0 will call that function. If I wanted to know what button, what button was clicked, I could go button. I can do anything with a button. So you see I have got Pi Game 0 is adapting to the call back that I define. And I was demoing this to, I was sharing this around the internet with some of the teachers who have been involved in the Pi Game UK education track. And Dave had said it doesn't work. It's just not working. He had written that. And I was dismayed that the very first experience he had with this tool was something that just didn't work and didn't give me any feedback on why. So if you misspell a function, it's got a spell checker and will tell you that you might have misspelled things. I think that's the kind of philosophy of Pi Game 0 is that we've done a lot of work actually in sort of catching errors, re-raising them with better messages. Because that kind of feedback about if something breaks and it doesn't give you any information as to why, that is an obstacle to continuing your learning. So every time we could take something that the underlying Pi Game was doing and make it more explicit, we've done that. I think I will stop there and invite questions because the questions have been very good in the previous times I've taken this talk. And I'd rather sort of, I want to know what you want out of this tool. So any questions? Do you want a... Yeah, so I just wanted to ask if there is an included way for easy publishing of your game, especially for kids. Yeah, so because they won't go into different Python installation stuff. No, but Pi Game 0 was created with an understanding of the kind of portability problems that show up when you distribute games. So having done Pi Week a lot of times, every time you use OpenGL, for example, it will work perfectly on all of the machines that you develop on, and then somebody will run it and there's a driver problem. So Pi Game is ideal for the distribution of games because it just works. If it's there, it just works. It's CPU rendering, which is slow, but it's incredibly reliable. Also Pi Game 0 will catch problems with file names, for example. So if I rename, then it will give me an error that my game could possibly not be exchanged with somebody with a different file system that was case insensitive. So that kind of problem is to the best of my ability sort of dealt with by Pi Game 0. The actual sort of packaging of games and distributing them, I think, is a future problem, but something I think we would like to solve. Why, sorry. Yeah, it's a problem for everybody. Yes, so packaging. Yes, and distribution. Yes, I think that comes later. I think that's something that we should build. The Pi Game 0 distribution is just like a directory, really. So if you have Pi Game 0 installed, zipping up a directory and just sharing the images directory and the sounds directory and the files, and generally it's assumed there is one script. This is for programs that are simple enough to be in one module. Then that can be run on any computer with Pi Game 0. There is another project. I've got internet. I've been working on something called the Edu Bundle, which is an attempt to provide a redistributable sort of bundle for Python, for education, that has Pi Game 0, Pi Game, Pi QT, Nicholas's Mew editor available. So I think by pursuing all of these avenues, we can make games easier for, well, and Python easier for kids to use at school and at home. Yeah, what about networking? Because in games it's also interesting if you're, I don't know, your colleague from school can play your latest game. Yes, sorry. Nicholas is putting his hand up. So there's network 0 for that. We're going to answer more for that. So inspired by Dan's awesome work with Pi Game 0. As I mentioned in my keynote, other people have been doing something, something, zero libraries, following the same philosophy that Dan has. And Tim Golden, who's a Python core developer based in London, has created network 0. He tried out at the London Python Code Ojo, and we had an awful lot of fun breaking it. The important thing is that Tim has also been trying it out with teachers as well, and getting their feedback. And just to echo what Dan was saying, getting teachers involved in this is essential because they're the experts in dealing with children as developers. We can think what kids might want to do, but it's teachers who actually deal with them every day. But there's network 0. I can't see why network 0 couldn't work with Pi Game 0. Ben Nuttall of the Raspberry Pi Foundation created GPIO 0. And also the hashtag 0 all the things. So what you need to do is create a Pi Game 0 project that uses GPIO 0 on a Pi 0, Raspberry Pi 0, with network 0 as well. And then you've zeroed all the things, and you can legitimately use that hashtag. Hey, so we talked yesterday evening, and I just want to repeat this suggestion. You can actually bundle this thing with Pi 2 X to have a single executable file that doesn't need installation. I think that would be a good thing to have, but I have not written that yet. Yeah, of course, but I'm just saying that maybe that's a good thing to look into. And also, you could run the zip files directly, right? Yes, like zip app, yeah. Okay. Oh, thank you. Sorry, that wasn't really a question. Yeah, so I guess, as you suggest, speakers, I should mention that this is on Bitbucket G0, and so pull requests are accepted, and this is a community. Are you pointing? Okay, thumbs up, right, okay, yes. It's a community project, and it sort of relies on the feedback. I'm not a teacher. I am going on feedback from teachers, but I need the feedback of people who have tried teaching kids with this to improve it. And any time that you see an error message that is opaque or something doesn't work and doesn't give a trace back or doesn't give any indication as to why it's not working, that could be considered a bug. So please report it if nothing else. Okay, I know the question. So since arriving in Bilbao... Where am I looking? Sorry. Ah, right, right at the back, okay, underneath the light. Since arriving at Bilbao, I've discovered that my Spanish is exactly zero, and a lot of Spanish people's English is also zero. What options are there for internationalising so that an 11-year-old Spanish kid, for example, doesn't have to learn English to do on Mouse Down, et cetera? Yeah, I think it's probably difficult to conceive of a way that you could internationalise this without making incompatibility problems. I think also that English is the language of programming, and the Python libraries are... and the Python keywords are English. On the other hand, I think it's very reasonable that the documentation should be translated. So if anybody would like to contribute a translation for the documentation, or contribute any kind of tutorial or blog post, that would be appreciated. Okay, the last question. Thanks very much. This looks like it would be quite a nice way of building not just games but generic interfaces. For interaction with all kinds of things. How suited is it to playing the role of a kind of generic graphical interface builder? You can write full graphical interfaces in PyGame, and people have done it, but I think at that point you're probably best if you want to attack that kind of problem using PyGame itself. And there are libraries that do the GUI widgets for embedding in a PyGame game that sort of mimic the kind of platform widgets. But I think it's not... That kind of programming becomes more complicated than I think PyGame Zero is targeting. So I think if you want to do that... I certainly could see that if PyGame Zero was to include some GUI tools to share games, for example, to bundle them up to enter some details and an icon or something, then that could be done with a GUI that was written in PyGame but may not use PyGame Zero to do it. Okay, thank you Daniel for your interest, conference. And thank you very much. Okay, we are going to start in one minute. Okay, let's continue. I'm pleased to introduce the engineer Liana Bagratzi who talks about Learn Python the Fun Way. Hello everyone. Thank you all for coming to my talk this evening. Today I'm going to talk about one interesting type of tools that can be used in education. And I guess some of you definitely came here today to find out how to learn Python the Fun Way. Okay, let me get started then. First of all, a little bit about myself. My name is Liana Bagratzi. I am a software developer from a beautiful Russian city called St. Petersburg. I work for JetBrains. And as part of my work, I am involved in development of PyCharm ADU which is educational edition of PyCharm IDE specially designed for Python learners and educators. Because of my work in PyCharm ADU project, I am in constant search for interesting tools and ideas for learning and teaching programming languages. And I'd like to say that Python community does awesome job trying to make Python available for anyone and providing resources for those who want to learn it. Please raise your hands. Those who somehow involved in Python in education. So that's you who do this awesome job. But no offence, but going through these resources could be a rather boring process for some people, especially for kids. But what if we could forget that we're actually trying to learn something new and just have fun instead? What if we could continue improving our skills while doing something fun? And we could do this. Playing games has been proven to be one of the most effective ways for us to learn. First of all, it decreases the fear of failure. I'm sure that all of you have met people who thought that they were too stupid for programming. But I have never actually met anyone who thought that they were too stupid for Counter-Strike or Pokemon Go. And also, if you fail a test, it might have serious consequences and it might be rather disappointing. But if you fail a level in a game, there is nothing scary about it. You can just start again. In a game, we often get an instant reward. Once you have completed a level, you get an achievement. And it's nice to have a lot of achievements, isn't it? When we play a game, we usually try to win. And competition is the moving force of progress. And at last, games often provide good visualization, which makes it easier for us to master hard concepts. At this point, playing games seems to be a very good way for us to learn something new. And of course, I'm not the first person who had an idea to apply to programming. And today, I'm going to show you three projects that are my personal favorites, just to give you an idea of how it works. And I'm also going to tell you how you can help these projects other than donating. The first project is called Code Combat. In this game, you help a hero to achieve some goals on each level. It is insanely cool for children and people with no little programming experience. They say on their website that if you want to learn programming, you need to write a lot of code. And that's definitely true. But their job is to make sure that you're doing this with a smile on your face. I like these words, but let's take a look how they do that. So this is one of the levels in Code Combat. Our hero is stuck in a room with fireballs, and we need to survive. How can we accomplish it? Well, we have some equipment. It provides commands that our hero can do. For example, simple boots allow us to move to different directions. And later in the game, we will get some sort of advanced boots that will allow us to move to the specific coordinates. We also have a sword, but that's not a very good sword, actually, because you need to hit an enemy twice to kill it. When you first see some level, they already provide you with a code sample, and your job is to modify it. Sometimes you need to add some lines, and sometimes you need to modify conditions or something else. You can also run it and see what goes wrong. Let me show how it works. At first, we see that our hero dies because he moves only to the right. Then we fix our code and run it again. This time everything is okay. And yay, we get some XP and gems that can be spent to buy better equipment. I also like that they can in some way analyze your code. For example, in this case, I misspelled the name of one of my enemies, and they told me that I made a typo, as I don't get frustrated because I can't find such a stupid mistake in my code. If you are interested in this project, you're very likely, because there are plenty of ways for you to help it. This is by far the best contribution guide I've ever seen. It's a screenshot from Code Combat's GitHub Wiki, and they represent their contributors as game characters. For example, they call coders arch majors. The project is 100% open source, but it's written in CoffeeScript, so it's not that easy for Python developers to contribute with code. But you can actually complete all the levels with CoffeeScript too, so you can learn CoffeeScript with the Code Combat's help and then pay back to it by contributing your code. But you can also help in other ways. First of all, you can help with translation. Code Combat has translation to many languages, and this fact is pretty impressive because we don't have so many programming games that are translated into languages other than English. This fact... Okay. So there is still a lot of work for you to do. A lot of levels hasn't been translated yet. But the best part is that you can actually create new levels yourself. It's not as easy as I'd like it to be. They still have special editor for creating levels, and you can express your creativity and add some bonuses to your karma. The next project is called Coding Game, and it is known for contests that they organize. In these contests, you can compete with other developers in some sort of turn-based games where you need to write a successful strategy. If you manage to do this, the chance is high that you will get a good prize or even will be invited to a job interview. If anybody is interested, the next contest will be held in September, so you have enough time to prepare and sign up. But let's now take a look into their onboarding puzzle that explains to new players how the whole project works. Each puzzle has a goal. Sometimes they also give you nice synopsis with spaceships or something like that, and we also can see what our code actually does in this visualization window. The editor is prefueled with the code that retrieves all the needed information from the standard input, so you can concentrate on the code that really matters. Once you've done with the code, you can run provided test cases and see if your code works good or not. For these test cases, they show you all the input and the expected output, and you can also see what exactly goes on on visualization. I'd like now to show you how it works, but at first I want to explain what you need to do in this puzzle. You need to retrieve coordinates of your enemies from the standard input, and on each turn you decide what enemy you are going to shoot, but they actually already tell you that you need to select the closest enemy to survive. Okay, I've already wrote the correct solution, and let's run the provided test case. Yeah, it looks like we survived. Let's now spoil our code, and let's select the furthest enemy instead. Run it again, and we are dead because the very first spaceship got to us and we died. This project wouldn't be so cool if there were no community around it. It's really nice that you can view other people's solutions and learn from them, but they also have so-called community puzzles that you can find in the community puzzles category, and you can write your own puzzles. Maybe you can come up with the idea how to introduce the algorithm for finding the array maximum for people with some interesting story. Okay, the last project is called Check.io. It doesn't have that impressive visualization, but it still has the huge content base and the friendly community. The tasks here are divided into islands, and each task actually is called a mission. Each mission has three different states. Once you've done with solution, you can publish your code and see what other people think about it. And maybe you will be even lucky enough to get your code reviewed. Let's now dive into the mission called Medium. Your job here is to write a function called Check.io that returns the median of a list of numbers. Once we realized what we need to do, we can try to solve this task. Why not? And again, we see yet another version of text editor. This time the editor is rather limited. It has no code completion and instant error highlighting, which would be helpful. They also have little task description to window, but they can provide you nice hints. Check.io provides hints in the form of an actual conversation between two people where you ask questions and more experienced developer answers you. In some tasks, they also have nice visualization feature for you to test your code on the actual data. For example, in this case, you can change the data directly on this picture and they will show you with the orange line what median is and you can see if your code works. Let's now see how this visualization works. At first, we will try to check the solution that always returns the first element of a list. Then we magically type the correct solution and try it on different input data. Okay, let's change the data. Yes, it seems like it works. As I've already said, Check.io's text editor is rather limited, but the good news is that there is a plugin for PyCharm that allows you to complete Check.io missions. In addition to the ability to write solutions in PyCharm and post them directly to Check.io without copy pasting it back to the browser, you can view other people's solutions directly in PyCharm, change them and play with them. At first, all the missions available at Check.io were created by the team, but now anyone can create their own missions. In order to do that, you need to clone a GitHub repository, write your mission there and suggest it back to the Check.io team. To view your mission might become accepted and might become available for anyone. There is also initiative to translate Check.io to languages other than English. You can also propose your solution, your translation in form of full request. In conclusion, I'd like to say that even though there are a lot of great resources for learning Python, there is one interesting direction in educational tools that can actually change the way we learn. You've just seen three great projects that attempt to do that and I encourage you to try them and maybe to contribute to them. But I also want to know that it has been plenty of time since I proposed this talk and no great games have gained my attention since then. It means that there is a lot of space for creativity and for you to invent something cool in this area. For example, I definitely would enjoy playing a game that teaches me Django or Flask or NumPy. That's all. Thank you again for coming and don't hesitate to find me at PyCharmBoost. Okay. Someone wants to have a question. Can you talk about your idea because I was not aware about it. I think you better come to me at PyCharmBoost and I can make a demo for you. Okay, great. Thank you. With this, anything that you haven't talked about? You mean according to PyCharm, are you in gamification or just... Anything that's in line with your aims that you talked about about making this more fun and more accessible, more easy to learn especially? I think that I should do what I can do and I should implement these ideas into a PyCharm idea and I intend to do that. Okay, thank you for your answers and for your interest in this conference. Thank you again. Thank you. Beautiful is better than ugly. To be the first speaker, you don't have to, but I would like to start with you. We still have time. You are? Yeah? You're here? Very good. Thank you.