You can find my video here:
]]>
Here is the link to my video:
]]>
The first step is open our text editor, I’m using Atom
Before start typing I recommend save your file on your local directory (Ctrl + N) on windows, make sure to add .py at the end of file name, this is very important to run it in a perfect way. For example “myfirst.py” I think it’s a good name.
Make sure to save the file every time you make a change on it.
Then you can start with your code. Type type and type.
When you finish your program, open Cygwin to run it. You need to write python and the name of your program just like this… Your program should run it.
It’s very easy
]]>
Here an image of the program running:
Here the code: https://github.com/hrglez/TC1017/blob/master/HarmonicSum
Thanks! Have a nice life.
]]>Here an image of the program running:
Here the code: https://github.com/hrglez/TC1017/blob/master/HarmonicSum
Thanks! Have a nice life.
]]>In this first post we will be seeing how to create a Python file and how to run it from the terminal, for this I’m going to use the famous phrase “Hello World!” and we will learn the basic output in Python, print().
The first step to begin with Python 3 is download Python 3 for its official website www.python.org , I recommend you to use the latest version.
The next step is download Cygwin a really nice terminal that will help you a lot
To download Cygwin, go to this website http://www.cygwin.com at the left side in the Install button, and then select the version you need.
It is important for the installation of Cygwin, select the Python option, because the other way it won’t work
Prevent errors and just install what you need in this case just Python 3 and Cygwin.
In Python we have something called Built-in Functions, these are the functions that Python has for default and always are available, within this 68 functions, there is the print()
Print() is a powerful and easy function, this function literally print the value you assign to it.
For example let’s say you want to print “Hello World”
Just open Notepad in Windows and type:
**Notice that print(), the value is inside the parentheses.
And after this save your file as hello.py, as you can see python uses .py as extension, then open cygwin and look for the folder you save the python file (I recommend desktop) after that type: python3 hello.py, to run your script
]]>In this first post we will be seeing how to create a Python file and how to run it from the terminal, for this I’m going to use the famous phrase “Hello World!” and we will learn the basic output in Python, print().
The first step to begin with Python 3 is download Python 3 for its official website www.python.org , I recommend you to use the latest version.
The next step is download Cygwin a really nice terminal that will help you a lot
To download Cygwin, go to this website http://www.cygwin.com at the left side in the Install button, and then select the version you need.
It is important for the installation of Cygwin, select the Python option, because the other way it won’t work
Prevent errors and just install what you need in this case just Python 3 and Cygwin.
In Python we have something called Built-in Functions, these are the functions that Python has for default and always are available, within this 68 functions, there is the print()
Print() is a powerful and easy function, this function literally print the value you assign to it.
For example let’s say you want to print “Hello World”
Just open Notepad in Windows and type:
**Notice that print(), the value is inside the parentheses.
And after this save your file as hello.py, as you can see python uses .py as extension, then open cygwin and look for the folder you save the python file (I recommend desktop) after that type: python3 hello.py, to run your script
]]>To accomplish this Mastery you will need to have Python, Atom and Cygwin installed (if you are a Windows user like me).
When you open Atom you will have something like this:
Click where it says Plain Text.
Search for the coding language you will use (in this case Python) and click on it:
Lets write a simple line of code to make an example:
Save it anywhere easy to find, don’t forget to add .py after the name of your file.
Pro Tip: Avoid any complicated names.
Now time to run your program! Lets open Cygwin. We need to open the directory in which our file is. For this you can use cd (change directory) and then specify the location of your file, press Enter. When you do that then you call python and the name of your file so it can run, press Enter.
Your program should run smoothly.
Mastery 2 – Ability to create Python project in IDE and run inside the IDE
Python’s IDE is called IDLE, after you installed Python you can search for it on the start search bar as such. IDLE has two main window types, Shell and Editor. When you first open IDLE you will see something like this:
To go to the Editor Window, click on File and New File. You should get a window like this:
Notice how the menu options are different.
Now on your editor window write a simple line of code:
To run it you have to save first, remember to use simple names! When you are done saving your program click on Run on the menu, and then click on Run Module. The shell window should pop up with your program running:
And you are done!
]]>To accomplish this Mastery you will need to have Python, Atom and Cygwin installed (if you are a Windows user like me).
When you open Atom you will have something like this:
Click where it says Plain Text.
Search for the coding language you will use (in this case Python) and click on it:
Lets write a simple line of code to make an example:
Save it anywhere easy to find, don’t forget to add .py after the name of your file.
Pro Tip: Avoid any complicated names.
Now time to run your program! Lets open Cygwin. We need to open the directory in which our file is. For this you can use cd (change directory) and then specify the location of your file, press Enter. When you do that then you call python and the name of your file so it can run, press Enter.
Your program should run smoothly.
Mastery 2 – Ability to create Python project in IDE and run inside the IDE
Python’s IDE is called IDLE, after you installed Python you can search for it on the start search bar as such. IDLE has two main window types, Shell and Editor. When you first open IDLE you will see something like this:
To go to the Editor Window, click on File and New File. You should get a window like this:
Notice how the menu options are different.
Now on your editor window write a simple line of code:
To run it you have to save first, remember to use simple names! When you are done saving your program click on Run on the menu, and then click on Run Module. The shell window should pop up with your program running:
And you are done!
]]>