[MUSIC]. Hi, I'm Scott Rixner and today we're
going to be talking about the environment that we're going to using for this class.
I think really think you're going to like.
However, my opinion might be a little bit biased.
Why? Well, this is what I spend my summer
vacation doing. I built this environment especially for
this class. And this is going to allow us to build
interactive applications directly in the web browser.
I think this is pretty exciting and you're not going to find this in any
other introductory program in class. So, this is going to make this class
something special, all right. You can also save and share your files
really easily. We basically are storing everything out
on the network so that you can easily find it from any machine.
You can send it to other people, people and they can see it as well.
So you're going to be able to share the excitement that you're having throughout
this class. Okay?
Now, to make all this work we had to use some relatively new web technologies.
This means that you have to have a recent version of Chrome, Firefox, or Safari on
just about any operating system. Sorry, no Internet Explorer.
Why? Well, like I said, these new web
technologies are not implemented exactly the same across all browsers and Internet
Explorer is really lagging behind. Hopefully, in the future, it will work,
but for now, we have to stick to one of those three browsers, 'kay?
Now, if you're like one of my wa, my Rice students, you'll listen to that.
You immediately ignored me, you grabbed your phone and you said, hey, does it
work? Well, I have no idea if it works on your
phone, but it does work on mine. Okay?
Now, you're not going to enjoy editing your code on that small screen, so I do
suggest you get one of those browsers so that you can get ready to go, and we'll
take a look at our environment. The environment we're going to use in
this class is called CodeSkulptor. Now why do we call it CodeSkulptor?
Well, because you're going to be sculpting code.
All right, what is CodeSkulptor? Well it's a Python development
environment. Why Python?
Well, Python is a programming language that is relatively easy to use and learn,
but it's still quite powerful. And for that reason you find it in use in
a lot of introductory programming courses, 'Kay?
CodeSculptor also allows us to build interactive programs.
Why? Well, we think this is more fun,
basically. Most introductory program classes you're
going to build text based programs and it's just boring, 'Kay?
Here, we're going to build interactive games that you can use and play with.
All right, and I think that you're going to find this really adds to the
experience and you'll let us know, I'm sure, by the time we're done.
But I'm pretty positive you're going to agree with us.
And finally, CodeSculptor runs in the browser.
And this has a lot of advantages. This basically means that you don't have
to install any software. You don't have to worry about it, you can
move from computer to computer really easily.
Your friends can use CodeSkulptor. You don't have to worry about having a
different version, or a slightly different version than anybody else, we
all have the same exact version. We're all running, I can, we can have
changes and updates applied immediately to everybody.
Okay, so I think this is going to make it a, a simple, fun experience.
Right. We also because were in the browser, we
have an easy way of storing and sharing files.
Now were going to put these out in the cloud.
What is the cloud. Well, cloud is sort of a nebulous term
but the way were going to use that term is.
There's a bunch of data centers around the world and these data centers have
plenty of storage. When you save your file in Codeskulptor
it goes out to one or more of these data centers.
Now its available on the network from anywhere.
You can move computers and get it back. You can move send it in an email and get
it back. All right basically you stored saved your
files and you refer to them by a url. And as long as you have that URL you can
get at your stuff anywhere and you can start editing and running it anywhere,
okay? Alright.
We think that this is a unique combination and you're just not going to
find this in any other introductory class.
You're probably not going to find it in any other class, quite frankly, and I
think this is going to make this class unique, special and fun.
And I really hope you're going to agree. So CodeSkulpter has now been in use
across several classes and we've had great success with it.
So I really don't anticipate you seeing many problems, hey, however there are a
few things that I'd like to call your attention too.
And the first is not there are some very minor differences between the
implementation of Python in Code Sculptor.
And the implementation of Python that you would download and install directly on
your computer. 'Kay, these differences are really not
that big, they're not a big deal when we encounter them, we'll talk about them
clearly. And they're not going to cause you any
trouble and they're really probably not even going to cause you any trouble when
you tranisition over from using the CodeSculpter implementation to any other
implementation of Python. Okay, so I just want to call your
attention to that. There are also some differences in terms
of the libraries that are available. Alright.
In Python, there is the language itself. And then there are a whole bunch of
libraries that implement additional features beyond the core of the language,
okay? In CodeSculptor, we only implemented a
few of these libraries. We implemented the libraries that you
actually need, we didn't implement everything else.
And the main impact of this will be if you're trying to solve a particular
problem and you use Google to find out, how do I do something in Python?
You may find an answer that says, hey, just use this library, and it does it for
you. And in CodeSculptor, you're not going to
be able to do that. Now, this also should have relatively
small impact because we've implemented all the libraries that you're actually
going to need for this class. So here we are at CodeSculptor, right?
www.codesculptor.org. You're going to be using that a lot, so
you may as well just bookmark it right now.
Alright? Let me walk you through the main elements
of the application. You'll see in the upper left, we have the
control area, where we have the buttons that allow us to actually control the
application. In the lower left, we have the editor,
this is where we actually write our Python programs and build them up, as we
make our exciting interactive applications.
In the lower right,we have the consul area, this is where the textual output of
your program will go if you have any. And, then last but not least we have in
the upper right the documentation area and you can see that you can get to the
documents, documentation. You can get to some demonstration
programs, and you can get some, get to some videos.
Now you can get to some of this from the corsair website, but it's convenient to
have it available directly right here. And one last thing that I want to draw
your attention to, is this slider bar here in the middle.
You can change the amount of area that you allocate to the editor and the
console. So you can when you're editing, give more
space over there, and when you're looking at your output you can give more space
over there if you'd like. And that's codeSculptor.
The first program that any computer scientist runs in a new environment is
called Hello World. All right, and the point of Hello World
is not to actually do anything useful. It's simply to get you familiar with the
environment and make sure you can actually run a program.
So here we have it, and if we go up into the control area and push the run button.
You'll notice that, when I push it, there is a tool tip that says Run, telling me
it's the Run button. And you'll see, that what happens out
here, in the console area, is it prints hello world, and that's what hello world
is supposed to do. Okay, so let's take a look at this
program. Alright, there are three elements to it,
and the first, is this first line here. Is a comment.
Comments start with a hashtag, right? So we got a hashtag and then it says
whatever you want. So I can type anything I want after a
comment. This is another comment.
I can add blank lines, I can do anything I want basiaclly.
'Kay? So a comment is a line that gets ignored,
so nothing happens in response to a comment.
So if its ignored, then why do we do it? Well comments are there to make your
program easier to read and easier to understand for both you and other people
reading it. So I would like to see, in every program
that you write for the course, and pretty much for the rest of your life as a
programmer. That you write clear and useful comments
that help people understand what's going on in your program.
'Kay? Right, the second thing in this program
is this print command here. What does print say?
Print means take the thing that you have after it and send it over here to the
console, okay? For what do we have after it?
Well, what we have after it is a string, Hello, world.
And a string is just basically a piece of text, and to get a string in Python, you
enclose it in co-, quotes. So, you can see here.
That we have single quotes surrounding this hello world that says this is a
string and it just means take the text inside of it and use it.
So, print hello world and you can see that there it goes, and it prints.
Right?. In Python, it's a little bit curious, I
could use either single or double quotes, all right.
But you have to be consistent, you can't have one single and one double quote and
nothing is changed right, this is still a string.
So I hit run and hey everything's the same.
Wait a minute here ok, it didn't look like anything changed, alright, that's
where the reset button here comes in, alright.
If I hit reset, it clears the console. Now I can run this again and I can see
that it actually did print Hello World correctly.
Right, now you don't need the Reset button.
When I hit the Run button, it implicitly resets, but you just can't see it,
because it happens so fast, but let me show you.
'Kay, so if I an, I were to add, print hi.
'Kay, and I just hit Run, you'll see it did in fact reset the console, it printer
hi first, and then hello world, 'kay, so everything is actually running over here.
'Kay. So you have the option, option of hitting
reset if you like, or you can just hit Run, alright.
Hey, we've run our first program. Congratulations.