create your own widgets
Author means "make your own widget types"
create your own widgets
Author means "make your own widget types"
application_window
This needs to be defined!
See the previous example.
To that end, it is necessary to mention that many of the modules available in standard Python will not work in the activecode environment. In fact, only turtle, math, and random have been completely ported at this point. If you wish to explore any additional modules, you will need to also explore using a more robust development environment.
Like PyCharm!
In lines 4-6, we instruct the object alex to move and to turn. We do this by invoking or activating alex’s methods — these are the instructions that all turtles know how to respond to. Here the dot indicates that the methods invoked belong to and refer to the object alex.
The "dot" between turtle . Screen() and alex . forward() is called a "selector operator" - it's actually an operator on a particular value. The operator works on values of type "object" and gives back the part of that object of the given name.
For example elex.forward gives back the thing called "forward" inside the "alex" object.
That thing happens to be a function, and the (150) after the forward calls the function, and passes in 150 as the argument to the function.
We will need to convert both current_time and wait_time to int
The problem when debugging is that you may not know or be aware that this is what you need to do.
How do you know what to do if you don't know what's wrong?
Investigate, think, experiment.
But don't HACK by randomly changing things without thinking. "What if I .... print the type of things? That might be useful to confirm. I think they should be numbers."
If you did that, then you'd notice they were strings, then you'd clue in "Oh, I need to convert them to numbers!"
And then you would need to ask "how do I convert to a number? What kind of number?"
So far so good
Note that the above program WORKS
That's the point - develop in small steps.
by convention we don’t.
I prefer camelCase Variables startWithLowerCase it makesLonger jointNames easierToRead
:)
The assignment token
When you read assignment, such as n = 4 DO NOT SAY "n equals 4" That misrepresents what's happening. n will now refer to 4 or n now gets to refer to 4 or for short instead... say "n gets 4"
and semantic errors
Semantic errors are by far the hardest to deal with.
The program runs, it just doesn't work.
To find a semantic error, you have to run the program in your head, line by line, maybe using a piece of paper, and note where the program does something differently than what you intended it to.
But that's the hard part - since YOU wrote the code, how do you see where this difference is?
Codelens (and the visualizer) can help.
firstprogram.py
A Python program is JUST a text file - (not a Word file, but strictly text, like made with notepad on a PC or textedit on a mac).
In fact you can use a text editor like those listed to write python programs. You don't even have to use the .py file extension for them.
Java
Note that Javascript is much more popular than Java these days - Java and Javascript, despite the similarity in name, are not at all similar.
Javascript is probably a more important language than any of the others currently, because it is used so much in web browsers and in server application code (with a technology called "node.js").