Programming with Python
Microsoft Video Courses · 14 lecciones · Gratis en YouTube
Sobre este curso
and andr live yes hi there good morning good afternoon good evening wherever it is that you happen to be in the world
thank you for taking part of your day out to join us this is introduction introduction even to programming using Python today we're very pleased very thrilled actually to be joined by Susan
hi back I am Christopher Harrison what we're gonna do is introduce ourselves we'll go ahead talk about what we're gonna talk about and then roll on into a multiple one where we'll start digging
in a little bit into the concept of of becoming a developer and in using Python for that so Susan if you want to go ahead and introduce yourself sure yeah my name is Susan I Beck and I
am a Technical Evangelist at Microsoft Canada and I've been coding for more years than I care to admit as I like to put it I it's remarkable of a number given the fact that I'm 29 the
fact that I have over 40 years of coding experience that's that's that's pretty interesting I'm no math major but that doesn't seem to work out quite right maybe I'm mixing decimal and hexadecimal
numbers okay there we go anyway so yeah so I'm from Microsoft and I've been coding for years and I spent a lot of time showing people how to code and teaching people how to code so really in
this course what we're gonna be doing is really taking people through the basics so they can get comfortable with the world programming absolutely absolutely and as for me I am Christopher Harrison
I'm a longtime MCT and I recently took a job here actually just over three months ago which now it's it's flown by it it's pretty crazy it seems like I just went through through orientation like
about two weeks ago but in any event they hired me in to do content development I'd done a good handful of MBAs I've been programming since my father brought home a victory and
Commodore 64 you know I had a trs-80 you had a trs-80 64k expanded memory whoa oh yeah I ran out of memory on my program but basically said you are entering a hallway yo you turn right or
left yep you know you turn right you see the monster and turn left you found the treasure and I actually ran out of memory with
that program that's great there was a day I remember punching in one little basic program where the shortcut for print was question mark which you still see in a certain places and you had to
use question mark because otherwise again you would run out of memory yep no yeah pretty pretty crazy but with that level of experience that we have between the two of us this is why we're
so excited to to try and bring more people into into the world of programming I would also mention just kind of as a real quick aside and you'll notice it down at the bottom
periodically is that Susan's twitter handle is a hockey geek girl and my twitter handle is geek trainer you can actually see that right there we go yeah yeah right down there yep so there may
or may not be okay can I do pensions oh it's not yeah yeah it's not connected by connect way yeah yeah in any event so but but yeah so what do you say we kind of roll on into it I think we've sort of
introduced ourselves and our personality a fair amount there so let's go ahead and talk about what we're going to talk about so if we yeah take a look at our course topics here multiple one getting
started so one of the big things that we'll talk about this in module one is the experience level that we're going for is none no experience and so we want to talk about kind of why you should get
into programming why Python etc and then we're gonna start off with the with the basics and module 2 of displaying and manipulating text which is probably the biggest thing you're gonna be doing on a
day to day basis it comes up all the time and the other thing I really want to show is as we do each one of these modules you'll be able to do something you couldn't do before mm-hmm and we
want you to have fun as we're going I mentioned that first program I wrote was it sort of choose-your-own-adventure yep where you know you're going down a hallway do you turn right or left
I enjoy the code because I was having fun with it so we don't really do wanna have some fun along the way but have you literally feel but at the end of every module you go ah okay wait I can I can
do something more with my code but I just do before so we I mean if you're starting from complete scratch at the end of each module you gonna go Wow okay I couldn't do that before and you'll see
yourself progressing as we go exactly exactly yeah take that next step take that next step take that next step and so speaking of taking that next step then
step after displaying text is starting to work and manipulate string values and and and variable so we'll introduce how you can actually store a string and also how you can manipulate it work it tweak
it and make it do kind of what you want it to do right and then we'll jump into numbers because exactly a lot of the things we need to do with code when we're trying to solve problems and
things do recall it require some number crunching so we'll get into numbers after that yep and then from there since we've done numbers dates is sort of the the next logical one so we'll take a
look at how to get in and play around with and deal with dates and deal with how to enter yeah well let's worry about that okay yeah we'll worry about that you'll learn why all programmers have a
love/hate relationship with dates decisions with code that little choose-your-own-adventure program I wrote all those years ago you are in a hallway do you turn right or left if
they choose right then don't go battle a monster if they choose left and show them the incredible treasure they found that's decision-making with your code so we're gonna cover a module it give me
you an understanding of how you can branch off and follow different paths in your code based on decisions you need to make you realize at some point here today I'm gonna wind up downloading new
Zork oh yeah we may need to do that go north go north in any event the last module that we're gonna cover today and this a very big point here is that this is gonna be a two-day event so we've got
14 modules seven a day across two days so you've got us for two days of Python goodness here the last module that we're gonna finish out with is what we're calling complex decisions with with code
which is really just taking your if statements kind of to the next level adding and well if they did this okay well maybe I want to do something but if they did something else then maybe I
want to do something different so we can go in and see how to do that with our complex decisions in encode and that will close off day one yeah exactly and then day two we'll keep digging in
so when day two we'll take a look at a repeating event aka loops yep that'll take a look at the different types of of loops that are available and again just like with our our if statements our
conditional code we broke that across two modules we're gonna break our loops across two different modules and and how to go through a through a list which will actually lead us perfectly
yeah because module 10 absolutely because module 10 is where we're going to talk about sometimes we need to deal with a lot of date a lot of information and you don't just need to keep track of
one thing you need to keep trap of a I think a bit like a shopping list you know exactly the ghost or you don't make you don't carry ten pieces of paper each which has written on it one thing you
need to buy at the go store you make a list we do this exact little writing code so we're going to talk about that and then we're going to talk about you know and again coming back to the
shopping list analogy shopping list is only useful if you can you know write it down and bring it with you to the grocery store so we're gonna talk about how do you save information so you can
look it up later in module 11 yep and in module 12 we'll talk about once you've saved that information how do I look it up again when I need it yeah which is sort of perfect and again kind of going
back to the point that Susan made earlier that we really do want to build this in a way that you can feel like you're making the next step making the next step make in the next step you'll
notice that we're gonna start with hey this is how you write to a file yep so that way you've learned how to do that and then we'll come back with reading from that exact same file so that way
you can see both sides of that and build that build into that the next module after working with files is going to be module 13 which is functions which is basically how you're gonna take blocks
of code and give it a name and be able to call it over and over and over again which is going to help simplify your code and really simplify your life so that way you're not just constantly copy
paste copy paste copy paste though having said that let's be honest as a programmer I promise you will do a lot of copy paste copy paste because if you are going to be a true coder you need to
be lazy and we'll teach you how to be lazy me well we're going to show you all our favorite lazy coder absolutely absolutely you're dealing with two lazy people here we're gonna
teach you how to be lazy yeah and then last but not least now granted Susan maybe maybe you're a little bit different than I am I know I never never make mistakes oh no no I might i p–
everything exactly every time oh yeah yeah never exactly you know but on that rare rare time I'm just moving Bob lightnings yeah exactly but on that rare moment when something does happen we'll
talk about how you can deal with that and how you can handle those errors yeah and then we'll actually have we probably we won't get detail over here but we're gonna have
sort of one of the most important things about coding as you get into it it's tracked isn't to try and to try and solve different problems so we're gonna give you a little challenges to do after
each of our modules and then when the whole course is over we're gonna throw you a doozy here's one for you to go try and we're not gonna go through the whole thing here and show you step by step
that last final challenge but we did give you a copy of the solution and yeah later so if you get stuck you have somewhere to look at so we're gonna give you a homework as we go through this and
when the course is over so you can keep practicing and trying things out because that really makes a difference you cannot do it unless great it's like learning a spoken language exactly
Italian or German or Chinese if you don't practice it you lose that ability exactly yep yeah I always like to say that I took four years of French in in high school and not that I would expect
to be fluent after four years of high school French but I'd like to think I could at least carry on a broken conversation and I can basically you know my grammar marry flambe allasong
she just about who you're a PA yes yes yeah my grandmother Sunfire and the monkeyest disappeared there you bitch yes doesn't get you very far and the reason that all of that went away is
because of the fact that I didn't use it I didn't practice it so that's gonna be one big thing that we're gonna talk about throughout all of this is you have to get in you have to play with it you
have to practice it you have to you have to get your hands dirty no that's that's that's that's really really the key absolutely yeah so with that let's start a little bit about you I mean we've
talked an awful lot about us we've talked it awful lot about what we're gonna be talking about let's talk a little bit about about you about expectations and kind of who this course
is is geared towards so if you take a look at this slide what you're gonna notice and I want to highlight that first little part there if you're new to programming you're in the right place
yes if you're a student sure who's maybe kind of looking around and going you know I'm trying to figure out what I want to do with my life alright made lots of business students
yeah you know they're not taking programming courses but they have an interest in getting into code exactly or you know people in the computer science program they're gonna get lots of this
material but there's a lot of people who aren't in a computer science type program but still have an interest in yeah getting into coding you know they learn how to be better in Excel I mean
yes you need up tricks in that absolutely you know or maybe you're kind of going hey I want to start figuring out what all of this this coding stuff is all about and I'm looking for a new
career yep you know or maybe you're an IT pro this is true this is one of those ones where you know there was a time where the people who are administrating our
systems they would be you know managing things and they never touch code that that line has really blurred it really has yeah you powershell and scripting exactly fitting into things and even I
was looking at some new tools in Visual Studio for release management to help you manage releasing code remotely to another and I've had this discussion with developers is who writes the
scripts to migrate code from place a to place B is that the developer cuz its code or is that the administrator cuz they know of all the servers and where things are moving around right so that
line between who's an administrator news a coder is really blurring it really is it really is that that basically everybody if you're gonna be in in some form of a tech field you need to be able
to write some level of code and Python is a great place to to start and which sort of closes it all off with anyone that has an interest in learning to code yeah so you'll notice here is we're
setting our our target audience there's a one consistent theme throughout all of this no experience required that is what our who this course is built for so if you've never written a line of code
you're in the exact right spot yes so I do want to point out if you've got someone who's looked at the course and said oh well I've done some programming in another language and I'm fairly
comfortable coding and I came to this course to learn Python specifically yeah one of the things you can do is all the challenges we created and all the slides are up on the github yep and we'll show
off how to get to that in a couple absolutely I'll show you don't get there so one of the things you can do if you want you feel free to stick around fall along you know review some of the basic
concepts review that you'll see all the syntax but if you find yourself going oh wow I know all the concepts in this module I just kind of want to jump ahead hey you know what we're being nice we've
thrown all the slides all the challenges we've even created a word document which is just sort of summarizes every command we're gonna cover exactly so you can take an accelerated version at home if
you prefer because you find the paces too much reviewing what you already know yeah but by all means feel free to stick around to review some of your basic concepts and option as well yeah now if
you are looking to follow along because of course if you're gonna do code you've got to you know do Co rectus yes this practice how do you get to what is it karna practice practice yep yeah you got
to get in into it so if you are wanting to follow along you're gonna need some form of a tool with which to create and work with your your Python code and and then Thea I suppose you could fire up
visual notepad bring back VI and and do it that way but the the tool that we're going to be using is is Visual Studio and the Python tools in Visual Studio so you will want to go off and install
those we will be talking a bit about how to do that in an upcoming slide and I would also mention again on this mystical magical github that we're gonna talk about in a few minutes that there
is a word document that Susan put together that will walk you through where to go to download and install everything so that way if you are hopefully wanting to follow along then
you can go off and and grab those those tools absolutely yep Piko flexkom is where you find out you can also find a number of instructions and information about the python tools for visual studio
which we'll be using inside this session exactly yep which leads us into a little bit of kind of interacting so two big things that I want to mention number one of course the MVA community over two
million registered users which is pretty amazing you can get 50 points for watching this event you'll notice the little link there akms Mme ash day MVA did you – god I just want I swear I've
you know I probably need a bit more coffee okay but in any event and then you'll notice the little code there and then the expiration date it expires on the 27th of October and again you know
that hold dates and oh well we'll talk to that alright and yeah then the last thing that I do want to mention here is you are going to notice that there is the live Q&A window Susan and I are here
I just want to mention that that this is live live live so it is the 23rd of September it is presently 919 Pacific time so again this is live live live being recorded live so that Q&A window
we're gonna try our best to answer as many questions at it's awesome but it's answer exactly all right you see us talking and we can't be answering so exactly check on some breaks and things
like that yeah and come back but please do be patient yeah if we don't answer questions right away yeah we're sort of outnumbered here on the Q&A there's a couple more people out
there watching then then are here so just be be be cognizant of that but we will answer questions we will periodically incorporate questions and we really want that that dialogue oh
yeah absolutely cool well um hey Susan yes what do you say we uh we get started let's get started I like that sounds like a good plan alright alright I'm driving
solenoids alright let me take over via slides menhir so let's get talking a bit about why you would get into coding and how you get started coding with Python and specifically since that's what we're
doing here mm-hmm so I mean why does someone learn to code really it's because of what you can do with code it's not that I have a complete and utter fascination with this weird syntax
well maybe a little it's what I can do with the commands but makes it powerful yep and really what it is it's problem-solving coding is just problem-solving that's the basic print
of what we're trying to do so really it comes down to what do you want to do mm-hmm whatever you want to do whatever field you're entering or working in coding can
affect and help it I've seen it in healthcare I've seen it in physiotherapy I have seen it in entertainment industry it sports everything there's a lot of field out there but isn't touched on by
technology so whether you want to build a phone app to help you find directions to the nearest coffee shop if you need that coffee customer you're gonna notice a caffeine yes here today whether you
want to calculate how much money you need to buy a car you know what how much would a payment be if I you know a twenty thousand dollar car or a five thousand dollar car over five years or
maybe you have a small business and you're trying to figure out what people are saying about your business on social media you could your own code that would go out there
and sort of collect tweets and get summaries and things for you it's incredible how much you can do with code or I've actually seen applications where somebody accused of these new wearable
devices that are out there now this Internet of Things so you could like program some sort of wearable device so it tweets you when it's time to reapply your sunscreen yes that's all doable
yeah I've actually seen premises of yeah devices it'll tell you when to put your sunscreen on exactly yeah you know automatically pick up the fact that you went for a run and automatically upload
that to Facebook all those things comes back to problem solving with code yeah now why Python in particular the reason we chose Python for this particular session is there because there are a lot
of programming languages out there and it's it's funny like I'm looking through the QA right here and there's like three questions about why Python why yeah I'm so glad you asked buddy you should
mention that one of the reasons is Python is one of the easier programming languages to learn it's actually becoming very popular if you look at introduction to programming courses all
over the place you're seeing Python popping up more and more often some programming languages are extremely picky about syntax and when you're just trying to learn the concepts and the
basics of programming you know you've got enough to deal with without having to worry about every single space and comma that you put into the code so Python is a little more forgiving than
some of the other languages the other advantage lots of free tools out there you can use to code or learn Python we're gonna use Visual Studio with the Python tools for Visual Studio
specifically Visual Studio Express 2013 will work so you can absolutely do it for free with the same tools we have here but said if the fact that it's free right because you don't have to make an
investment you can start learning coding with Python without any cash investment I said lots of tools out there to do it and a lot of different ways you can use Python code it's got a lot of different
applications yeah I was really quite amazed I actually turned doing a little bit of research and had poked around with the Python stuff but I hadn't really appreciated how much you could do
with it and the other thing I want to make clear is even though we're focusing on Python here once you learn the basics of coding you'll be able to reapply those concepts in all programming
language exactly whether it's c-sharp or JavaScript or C++ or Perl any programming language you learn in the future those funds we're just gonna reappear over and over
and over again exactly every single programming language has variables every single programming language has an if statement and and that could be something like PowerShell that could be
something like Perl that could be something like JavaScript it could be you know they all have the same thing and so once you learn those concepts then it's just a matter of oh okay here
I have a curly brace or here I have an end for whatever it is that it happens to be for the language but now all you're doing is you're just picking up a few key words you already understand the
the concepts so that's really one of our main focus is going to be on those on those concepts exactly yep now I do want to make it clear though I'm teaching you Python doesn't mean
you're not learning a language of its useful unto itself right into a lot with Python itself I don't said I was actually doing a little bit of research and discovered Industrial Light and
Magic who made the you know the Star Wars movies and so on yeah they actually use Python to help with their image processing when they're adding lighting and special effects right so that's
actually done using Python code nice forecast watch comm uses Python on the back end to collect the information and to provide the information to provide a weather forecast hmm so that's done with
Python dev net is one of those new sites and they actually use Python to go out and collect different news information from different locations yep aggregate that information together I
can provide it to somebody through Python yeah and this one I thought was the most amazing one if it was actually a student in England who was having some fun there was a class of high school
students they were learning how to code using Python and they set up a dinosaur and installed a little speaker in this plastic dinosaur and set up a Python program so every time you tweeted a
certain word the little dinosaur would light up and roar yeah you gotta have fun with code absolutely you've got to have a good damien if you do download the deck and you click on that link you
can see a video of the little dinosaur roaring and actually one little thing to kind of keep going with all of this and go back to the you know why Python and you touched on it real briefly is you
know Python it one of the nice things about Python is there's a lot of things that it can do for you very simply and there's a lot that you don't have to worry about that there was a
the questions in the chat window about dealing with things like memory management you know and you know yes there's going to be a day at a time where you'll have to go in and start
worrying about all of that today is not that day right now it's not that time and the great thing is with Python we really don't have to worry about that or at least not for what we're gonna be
doing not so we're really trying to keep this as as as simple as possible and and kind of lower you know eliminate barriers yeah you know or the barrier barrier
yeah lowering the barrier to entry that's that's really our big goal here yeah so I do want to make one thing very clear if we can just go back to the slide for a second mm-hmm you aren't
gonna learn enough in this two-day course to start adding special effects to the next is make a superhero movie no you told me yeah I'm sorry but you will learn enough to be able to start solving
real-world problems with code so that you will do mm-hmm um and hopefully you'll start having fun because that's why we go yeah I chose it as a career because I like coding it's
actually kind of fun once you get into it yes there are moments you kind of want to bang your head against a wall because you can't figure out you're a little big but you know you step away
you come back go find a coffee if you need to yes so let's get into some straight logistics yes how do I actually get started y'all we're gonna do is path on tools
news video first you are going to need to install some software on your PC or laptop there are a lot of different tools out there you can use to write Python code I saw a couple of comments
in the window of people running on operating systems where they couldn't install Visual Studio 2012 2013 yes you can go find there's you know all kinds of tools out there we're doing it with
Visual Studio you can by all means download another tool if that's not gonna install on the operating system that you have in front of you right it just means your interface is gonna be a
little different than ours but what we're gonna be doing is the concepts will be the same concept be the same the code will be the same just difference in terms of what button you press to make
it run what exam you press to create a new program yep but what we're gonna do is we're gonna use Visual Studio and an add-on that was built by Microsoft called the Python tools for Visual
Studio which is a really sweet set of tools and the nice thing about using Visual Studio for this is if you do aside to learn other programming languages you're not gonna have to
necessarily learn another tool if you decide to learn C sharp or C++ or you want to start building websites with HTML you can do all of that inside Visual Studio so that way you don't have
to install six different tools on your desktop you don't have to learn all these different interfaces you can keep working in the same tool so that's the other nice thing about using Visual
Studio is once you've got that up and running you can use it for a lot of different programming languages yeah so how do you install it and there is a word document on the github and I'm
hoping we've got a site or something I can actually I could actually show right now why don't you show the github now because that'll useful yeah so if we came over to my screen here up there on
the under notepad and I'll throw this into the chat window as well momentarily you'll notice that it's gonna be on the break slides is this little shortcut URL so aka MS first lash intro Python code
okay so aka dot ms slash intro Python code intro Python code yep and I again will put that into the Q&A window here momentarily and if you follow that that will take you over to the github which
is where we've uploaded all of our all of our files and the one thing that I would mention here is github for those of you who are not familiar is a code repository and this is where a lot of
developers will go ahead and upload code for either sharing with other developers that they're actively working with or for sharing with the general public which is exactly what what we're doing
so if you haven't necessarily played around or worked a whole lot with with github don't worry too much about that this is certainly a tool that you're gonna be using in the future if not
necessarily right now but this is just a very easy way for us to go ahead and share everything out now if we kick back to the to the screen here what you're gonna notice right there I've got my
little download zip and so if I just click that it will say hey do you want to open or save and I'm just gonna go ahead and click open give that a second and sure enough
there's the zip file with everything now the couple of things that I want to highlight inside of here number one is the solutions and this is and actually I'll kind of go back
and I didn't launch zoom it those are the solutions to the various there's gonna be different challenges and yes tryout to be individual chapters yep so in that solutions directory you'll get
actually gonna find the solution files for each one so if you do get stuck on one you can go take a look and see how we solved it and then what I but I if you cheat and look at the solution it's
not really cheating many of us do it yeah what I would suggest is look at the solution then minimize it and then try and write the code yourself exactly yep yeah so that's where all of those are
gonna be and then inside of office Docs this is where two big items are number one is all of the slides that that we're using now keep in mind we're just like typical presenters these things may
change as we go through today and tomorrow it happens so you know they they may change a little bit but we were in the world why did you not sync ha that's funny
of course there are yeah it's probably a mind I haven't synced it but what will be up there momentarily I can just show that right now is the how to install Python tools yeah that's it I just
didn't sink yeah and this has the links that that Susan was highlighting in the slide so a visual studio for desktop and update 3 and the big thing here is you do want the desktop apps version for
visual studio so make sure you grab that again you want update 3 install the Python tools that you can grab from there and then the interpreter and then away you go from there so you will need
all of those if you're going to be doing Visual Studio if you do want to use another product you're of course free to do that we're gonna be doing everything with Visual Studio yeah I saw a couple
of questions in the Q&A window about Visual Studio 2012 or earlier versions of Visual Studio so this to be clear you can use Visual Studio 2013 Express that's the one we actually have a look
to in the PowerPoint slide if you do are using Express you have to have the most recent visual studio update supplied otherwise you're not gonna be able use the Python tools for Visual Studio you
can run if you happen to a visual studio 2012 professional one of the actual full versions of Visual Studio yes you can install Python tools for Visual Studio with Visual Studio 2012 it will not work
with 2010 and those earlier editions so if you are running 2010 professional you're going to want to download 2013 Express for desktop so and the updates for that to make sure that you
can use the Python tools for visual studio so hopefully that helps with a few of you who are having some problems so first thing to check is make sure you have the updates to Visual Studio you're
running at least two thousand twelve and if it's expressed it has to be two thousand thirteen then you install the Python tools for Visual Studio and then after that when you try to you will also
need to install an interpreter because python is a language that has to be converted to machine language by an actual interpreter so when you're writing python code the computer doesn't
understand python code the interpreter basically translates the python code into a language the computer speaks and that's what the interpreter is doing exactly yep um all right now I did want
to throw him one little less you don't one of the fun things about being a coder well okay maybe this says something to our personality we learned to speak geek so you can understand the
conversations people are having so when you start exploring more of Python you're gonna start seeing stuff about see Python and ironpython and pi PI and JSON and so on there's actually a lot of
different variations on Python the basic syntax concepts we cover here apply to all of them there might be some slight differences in syntax but really everything we cover here is going to
apply so we're going to be using for the record so you can impress your friends while I was learning C Python with the Python 3.4 interpreter so that's the version work okay all right yeah if
anybody was to ask you you're living ironpython or pi pi you're learning c python specifically and why that's significant and why that's going to affect you is let's say you're a lazy
programmer like certain people you might meet today nobody at this desk though no no no nobody here oh no so if you are a lazy programmer like I am one of the things you find yourself doing is you'll
discover that chances are whatever you want to do someone's already written the code to do it the best code in the world is the code that's already written you know there's a friend of mine that likes
to say we're not launching Rockets here and what what he means when he says that is that whatever it is that we're doing somebody else is already done feel free to take advantage of that yeah
and programmers are actually incredible generous incredibly generous about during the code they've written there'll be blog posts with examples of how exactly do I
do the following and so you'll go and you'll start searching around for how do I send a message to this wearable device to make my dinosaur roar you and you'll go search it and you'll find the result
and somebody look posted a sample of code that does what you want to do now it's possible when you take that code and you try it you're going it's giving me errors now it may be that the code
they post it has mistakes in it that's been known to happen but it might be they're working with I am Python and you were doing C Python so you might find some slight syntax differences when
you're looking at Python code examples because of all the different variations it's not gonna be huge differences exactly if it a method name is different yeah but just a heads up if you're
copying and pasting someone else's code and it doesn't work wait a second year using C Python what were they using yeah you might find some differences exactly so then you get to
search for what's miss command in the day Python ironpython what's the equivalent in c python exactly Bing is your friend Stack Overflow is your friend by the way one real quick thing I
just want to kick back to my screen again just because I want to highlight this just one last time again you know the URL and and it is in the chat window and I'll throw it in there a couple more
times and it is gonna be on the break slides as well but I do now want to highlight that I did do my last sync so if I go back in remember it's a download zip and I'll kind of zoom in on that
yeah download zip that's going to give you all the files inside of there and if I click open and now if I go into the office Doc's there are the ones that that I was talking about so I just
needed to sync those up and I'll also mention that this is gonna be the repository where Susan and I will be uploading all of our sample code so that as we do our demonstrations and by the
way we are going to be doing our demonstrations live here's our apology something's gonna break there I said it yeah just get it out of the way but as we go through this periodically we'll be
uploading to to github and make it all available up there yeah so any code you see us doing here we'll try to make sure that's all available to you later so if you want to go back and look at and go
wait a second I know they that yep exactly yeah so now Christopher yes I have I believe I have everything set up on my computer okay I've installed Visual Studio yep
2013 no I've installed the most recent updates okay I have installed Python tools for Visual Studio okay and I've installed the interpreter okay now you've learned the occasional pro game
and language in the past yep how do I make sure I've installed everything right and it's gonna work you write hello world you make your computer display hello world now while Susan's
getting Visual Studio up here I'll just kind of mention for those of you who are new to developers this is sort of the the initiation that the first program that you ever write in any language or
in any environment is by tradition hello world and actually if you head on out to to Bing you'll notice that there are websites that will show you how to do hello world in basically any programming
language this is just sort of this is this is the way we get people in it is it is like an initiation but it's also but it's also actually really in it's sort of silly and we kind of it's almost
a running joke among programmers oh we're gonna write hello world but it really serves an important purpose because it's a way of just making sure of it yeah you have got the tools
installed correctly and you can write a line of code and it will run because if hello world doesn't work and you start trying to write a really big complicated program and it doesn't work you won't
know is the error coming up and because your code was wrong or because things aren't installed correctly so by once you see that hello world up and running you get to give a little you know yes
victory moment absolutely okay now I get to start having fun because now I can start writing cool code yep so how do we do hello world so what we can do is go to my my machine over here I have Visual
Studio up and running on my computer and when you're doing this at home you are going to go to file new project and when this pops up you're going to see a number of different project types you
can create you know Visual Basic projects c-sharp projects as I mentioned Visual Studio one of the cool things about it is you can actually do a lot of different programming languages but
we're focusing in on Python today so if I select Python then on the right hand side you see a number of different types of projects mm-hmm as I also mentioned earlier Python can be
used for a lot of different things so you can actually do ironpython instead of C Python if you want to in Visual Studio you can use it for web applications you can use it for windows
forms applications so it's a lot of different ways you can use it the project type we're gonna use on this particular MBA is Python application so that's the project type you're gonna
want to select and then what becomes important is you're gonna want to go in and type in a name for your application got a suggestion for a name Christopher oh let's see we're gonna have this
screen display hello world let's go with hello world hello world all right so let's go with hello world as our project name and then you pick a location where you want your file to be stored well
you'll notice mine seems to this little repository that's because it's saving everything I'm doing to github so you guys can access it later so you save it anywhere you want on your
machine so you can locate it when you want it and once you have that done you can go ahead and say okay and Visual Studio will go off and it'll actually create a project and on the right hand
side over here it's going to zoom in a little bit over here and show you a bit around the solution Explorer and what you're gonna see inside there what is it ctrl shift to uh I gotta
remember how to do this Chris fruit better with zoom it than I am there we go there you go so one of the things you'll be able to see in there is this Python file called hello world hi the
files with the dot py extension are the files that contain your Python code so that's the most important file for you to work with and that file there is actually just get back is actually the
file I can see open over here this is my code editor window where I write and modify my code and I think the guys who created the Python tools for Visual Studio had a sense of humor because by
default when you create a brand new project in Python for Visual Studio it actually gives you the code for hello world so I don't even need to type they must be the easy program exactly yes
they realize that you're going to do the demo and decided you know what we're just gonna make Susan's life easier just here have some code Susan exactly so print HelloWorld is the command that
will print the message hello world on the screen so all I need to do is figure out how to run it so if we go back to visual studio there's two different ways but I can run this code if you are a
keyboard person and if a more you get into coding the more you're gonna get fond of keyboard shortcuts there is this debug start debugging will launch your program and started executing or you can
say start without debugging so the f5 key or control and the f5 key will launch a program so if I just hit the f5 key up pops a window saying hello world press any key to continue I have
successfully run a hello world program Mazel Tov woo now if on the other hand I don't if you're a mouse person not a keyboard person there is a little button at the top of the screen up here and if
you take a look there you can actually see there we go there's our little Start button so you can also click on that Start button to launch your program as well just depends what you prefer just
pick the method that you find easier you may find I wait switch back and forth I'm not necessarily consistent sometimes I'll use a function key sometimes I'll press Start button once you do launch it
it's up and running now you need to know how to shut it down again and once again there's a few different ways you can do it I love the fact it gives you a hint right on the screen press the impressa
key oh look it's shut down the program the other option is you can close the window just like if you were in Word or Excel right close the window when you're done the other way of shutting it down
is inside Visual Studio if I go over here you'll take a look and once again you can see a little button there the stop button think of it like a VCR play to start playing your program stop to
stop your program VCR oh yeah DVD players I'm dating myself again so you can hit that stop button to stop executing as well now this is actually little visual studio coding world tip
when it helps you out is once in a while you might have this window open and then you do something like go checking your email and you forget that the program is still running
done this so many times so you start going here and making changes and maybe something's not acting because it will actually let you modify the coke that's actually one of the neat features of
Visual Studio is you can actually make modifications while your code is still running which is kind of freaky when you think about it but it's really actually you'll learn to love that feature mm-hmm
but every now and then there might be certain changes you're making and it'll say well what are you trying to do the codes still running and you'll be going why am I getting that error message ah
now here's the thing there's a queue that can help you remember your code is still running so if you return to visual studio one last time look in the top right corner up here and see how that
stop button appears that only shows up in red if your code is actively running once you hit that button it's gone so once you stop executing the code AHA I know that my code is not running right
now right you see that stop button if something weird is happening take a glance see if you see that little stop and go oh my code still running hit the stop button we'll probably do it at some
point during this MVA yep yeah so don't panic just check and see if your codes still running exactly and we now have our hello world yes so we've basically created our first application we have
well done yeah and I think that just brings us to maybe you want to mention we should mention a couple of best practices because I think it's really important to get into good habits right
away when you're coding you know whenever I'm doing any form of an intro to fill in language here and this could be sequel c-sharp Python anything like that I probably spend a good third of
the time just talking about best practices that that to go with thumb with a golf analogy that if you're ever gonna go learn to golf and basically don't do what most people do including
myself would just decide hey I'm gonna take up golf and just head out and you know just start whacking on some balls the problem is is that you're learning bad habits right from the get-go and so
when you're under stress what's gonna happen is you're gonna revert back to those bad habits and the exact same thing holds true here that this is the perfect time to start to develop those
good habit because the habits that you develop now are the ones that are gonna follow you throughout the rest of your the rest your career yeah yeah so one of the food
habits we want to pick up is the idea of commenting your code yes have you ever had a situation Christopher where you wrote a program and then you had to come back to it maybe three months later to
make a change and you found yourself going what was I doing three minutes later I always like to say I have a great memory it's just really short the number of times or I'll written
something out and then go back to it later and I start to go why in the world or the other one that gets me is I'll go and I'll look at my code and I'll go you know why did I do it that way it would
have been much easier if I would have done it this way and I'll go back in and I'll start recoding it and I'll get about halfway through and all of a sudden I realize oh that's why because
you know whatever the reason was and so if you throw in those little comments those kind of messages in a bottle it makes it that much easier to remember later on exactly what it was you were
doing on top of that I would also say this for those of you that are brand new to Python this is a great way to take notes so that you go ahead you write out a little bit of Python that does
whatever it is that it does and then right on top of it you put in a comment that explains what that code is about to do yep that'll help you reinforce things yeah
and the other advantage to it is one of the other things will happen the more you get into coding is you may find yourself coding and someone else is coding and you're looking at someone
else's code or someone else yep looking at your code and I'll I can tell you I have yet to meet a program that somebody handed me but had too many comments when I'm trying to understand enough but I
have trouble reading my own codes I'm sure understand someone else's code that can be really remarkably difficult trying to speed and follow through what someone's done you're going to notice
it's very quickly you're gonna appreciate those code examples which have comments so yes let's let's let's try and create another generation of people with the who do put comments in
their code you'll hear about the principles of self-documenting code people who argue you don't need comments I like comments please put them in there for me I appreciate it yep so yeah so
you can put in information about what your program does why what a command does you might have written a little note saying hey I used this command instead of that command because I
discovered the following yeah that's the big one yeah and also said anything that would help someone understand why you did something the way you did and the syntax in Python for
using comments is the pound symbol or a hash tag mm-hm so anything in Python where the line starts with that pound or hash tag is going to be completely ignored when the code is executed it's
basically to say oh those are just notes for you okay fine I'll ignore those so if I go back to let me go to visual studio again and let's just a little example so we go here and I can add a
nice little comment here saying this is a comment color oops and I can add lots of comments and you brought up a point of the color that's a really good point
there Christopher one of the other nice things about visual studio is it actually uses color coding mm-hmm to help us keep track of what we've typed in so when you look at this code here
inside visual studio you'll notice that the comments are all in green and some of the other sort of neat things that you've got going here is you've got if we take a look here and
go try this sort of now touch doesn't work for me let's do it this way to do so you can actually see that the string no uh string of text so it's gonna be displayed shows up in red that's Visual
Studio is way of saying hey I recognize that's a string of text the print the word print here actually shows up in black that's a way of saying oh that's one of your commands but you're using
your that color coding you'll find useful it helping you find those occasional mistakes easily aunt Katie yeah occasional so so you'll find that really useful that different sort of
color coding now here is a cool little geek tip because we got to have some fun show you some neat little things so you don't impress your other geek friends if you don't like the colors I actually
find that green sometimes a little bit hard to read for the comments yeah that's a little light in the very top right corner of Visual Studio there is a little box and it's called the quick
launch and if you go there and you type the word font it'll actually bring up a pop-up menu what this does is actually searches the tool itself and tells you where in the tool you can change a
setting so I can go here to find out how do I change information about the fonts and the colors of my code editor yep so I go oh look at this under options I can change environment fonts and colors
if we click on that I'm going to zoom back out again here you'll see that I can change things like my font size so if you want the text to be bigger I've got it set to 16 a little bit large but
that's because we're doing a presentation you've probably have it something smaller at home and I can do things like I can go down and I can say you know what for my comments I would
like the default color to maybe be purple instead of green because maybe that's a darker color and easier for me to see and distinguish and you can make it bold if you want to and you can give
it a lovely yellow background and that would be quite hideous by the way not do that yeah let's not do that but really and it gives you a sample of how it would
appear here but it's wonderful that you do have that ability to customize it and I'm gonna leave it set it back to the default for now which is green guess because I don't want to mess you up I
want to match what's on the slides but you can change its anything that you like so you really can customize that look and feel inside visual studio one of the nice features of the product and
I think as we do that so we've talked about the colors yep you know what I think you know you have got that working you are now a coder Wednesday right that HelloWorld appearing on the screen add a
comment you are now a coder and I do want to just real quickly here first of all let's let's not downplay this number one congratulations if you get something to print out on the screen you're a
coder yes you know it's like Susan and I both run and you know sometimes people say oh I'm not really a runner because I haven't done fill-in distance here if you run you're a runner yes if you write
code you're a coder it's very simple there is no you know nobody's like you know asking you to bring in a portfolio – you know confirm that you are not a coder I mean if you're going for a job
but that's something completely oh but as far as whether or not you're a coder hey you're a coder yes the other thing I do want to mention real quickly here just because there's still been a fair
amount of questions in the chat window I just want to throw it up one more time there's again the URL and again the big button here that I want to highlight is this button right here download zip
that's the easy way to get that's the easy way to get everything yeah so like I said periodically this is gonna be we're gonna go in and update all of this all that you have to do when
you want to go get the latest files that we've played with just click download zip and that will go get everything for you in fact I actually did make one little change there was one mistake in
the word document the link to download Visual Studio so I just went in and updated that so again that's the easiest thing to do don't worry about syncing or anything like that
if you are curious I have to do this okay we do have an MBA on using git and Visual Studio that you can go check out but that's so far beyond what we're gonna be doing this really is it is just
simply hit download zip down there at the very bottom and and that will give you everything that you need alright so I think we are we have come to an end of module one yeah we have coders yes yes
grass folks yeah all right so what do you say we take ten minutes we'll come on back and then we'll we'll start to take that first step beyond hello world now we'll start solving problems with
her yes excellent we'll see you guys in ten minutes
SIEMPRE HAY ALGO MÁS