|
|

|
|
|

|
|
|
|
|
|
# Session 1: Tools-I
|
|
|
|
... | ... | @@ -12,29 +12,29 @@ |
|
|
|
|
|
# Contents
|
|
|
|
|
|
* [Introduction](#introduction)
|
|
|
* [Introduction to Github](#introduction-to-github)
|
|
|
* [Our Github's account](#our-githubs-account)
|
|
|
* [Playing with repositories](#playing-with-repositories)
|
|
|
* [Wikis](#wikis)
|
|
|
* [Downloading all the files in a repo](#downloading-all-the-files-in-a-repo)
|
|
|
* [Creating a working repo](#creating-our-working-repo)
|
|
|
* [Working with PyCharm and Github](#working-with-pycharm-and-github)
|
|
|
* [Opening Pycharm](#opening-pycharm)
|
|
|
* [Cloning our working repo](#cloning-our-working-repo)
|
|
|
* [Our first commit to the repo](#our-first-commit-to-the-repo)
|
|
|
* [Introduction](#introduction)
|
|
|
* [Introduction to Github](#introduction-to-github)
|
|
|
* [Our Github's account](#our-githubs-account)
|
|
|
* [Playing with repositories](#playing-with-repositories)
|
|
|
* [Wikis](#wikis)
|
|
|
* [Downloading all the files in a repo](#downloading-all-the-files-in-a-repo)
|
|
|
* [Creating a working repo](#creating-our-working-repo)
|
|
|
* [Working with PyCharm and Github](#working-with-pycharm-and-github)
|
|
|
* [Opening Pycharm](#opening-pycharm)
|
|
|
* [Cloning our working repo](#cloning-our-working-repo)
|
|
|
* [Our first commit to the repo](#our-first-commit-to-the-repo)
|
|
|
* [Hello world with Pycharm!](#hello-world-with-pycharm)
|
|
|
* [Configuring the python environment](#configuring-the-python-environment)
|
|
|
* [Writting the Hello world program](#writing-the-hello-world-program)
|
|
|
* [Configuring the python environment](#configuring-the-python-environment)
|
|
|
* [Writting the Hello world program](#writing-the-hello-world-program)
|
|
|
* [Creating the hello folder](#creating-the-hello-folder)
|
|
|
* [Creating a python file](#creating-a-python-file)
|
|
|
* [Writing the code](#writing-the-code)
|
|
|
* [Running the program](#running-the-program)
|
|
|
* [Adding the program to the Github Repo](#adding-the-program-to-the-github-repo)
|
|
|
* [Creating a python file](#creating-a-python-file)
|
|
|
* [Writing the code](#writing-the-code)
|
|
|
* [Running the program](#running-the-program)
|
|
|
* [Adding the program to the Github Repo](#adding-the-program-to-the-github-repo)
|
|
|
* [Exercises](#exercises)
|
|
|
* [Ex-1: hello.py](#ex-1-hellopy)
|
|
|
* [Ex-2: count.py](#ex-2-countpy)
|
|
|
* [Ex-3: sum20.py](#ex-3-sum20py)
|
|
|
* [Ex-2: count.py](#ex-2-countpy)
|
|
|
* [Ex-3: sum20.py](#ex-3-sum20py)
|
|
|
* [End of the session](#end-of-the-session)
|
|
|
* [Credits](#credits)
|
|
|
* [License](#license)
|
... | ... | @@ -43,19 +43,17 @@ |
|
|
|
|
|
In the **Programming in Network Environment** subject we will learn how to create programs capable of **communicating** one to other through Internet
|
|
|
|
|
|

|
|
|

|
|
|
|
|
|
But first, we need to learn about the tools we are going to use: [Github](https://github.com/), [Python](https://www.python.org/), [Firefox](https://www.mozilla.org/es-ES/firefox/new/) and [Pycharm](https://www.jetbrains.com/es-es/pycharm/download) (Community Edition)
|
|
|
|
|
|
|
|
|
## Introduction to Github
|
|
|
|
|
|
Modern **programming projects** have thousand of lines of code and hundred of **developers** working on them. It is necessary to use **powerful tools** to manage it: [The revision control systems](https://en.wikipedia.org/wiki/Repository_(version_control)). The projects are located into a what we call a **repository**
|
|
|
|
|
|
Modern **programming projects** have thousand of lines of code and hundred of **developers** working on them. It is necessary to use **powerful tools** to manage it: [The revision control systems](https://en.wikipedia.org/wiki/Repository\_(version_control)). The projects are located into a what we call a **repository**
|
|
|
|
|
|
Currently, the two most used controls systems are [Github](https://github.com/) and [GitLab](https://gitlab.com/). Both are based on the **opensource** engine called [git](https://es.wikipedia.org/wiki/Git), developed in 2005 by [Linux Torvalds](https://es.wikipedia.org/wiki/Linus_Torvalds), the creator of the [Linux Kernel](https://en.wikipedia.org/wiki/Linux_kernel)
|
|
|
|
|
|

|
|
|
\
|
|
|

|
|
|
|
|
|
In this **subject** we will focus on the use of **Github**
|
... | ... | @@ -63,14 +61,12 @@ In this **subject** we will focus on the use of **Github** |
|
|
### Our Github's account
|
|
|
|
|
|
* Create your account on [Github](https://github.com/). Do not forget to send your **real name** and your **username** in the post in Aula Virtual
|
|
|
|
|
|
* Once you have your account, Github will enable a link to your profile. This is my link (username: Obijuan):
|
|
|
|
|
|
* **Link**: [https://github.com/obijuan](https://github.com/obijuan)
|
|
|
* **Link**: https://github.com/obijuan
|
|
|
|
|
|

|
|
|
|
|
|
You can find a repository tap in the top. It will show you all your current repos. In your profile page Github places the most popular repos
|
|
|
You can find a repository tap in the top. It will show you all your current repos. In your profile page Github places the most popular repos
|
|
|
|
|
|
### Playing with repositories
|
|
|
|
... | ... | @@ -80,7 +76,7 @@ Just to get familiar with Github, Let's see some of my repositories. Click on th |
|
|
|
|
|
The designs are stored in their own **folders**. We can organize every repository **as we want**, using all the folder we need. In the bottom part you will see images and texts. They are the contents of the **README.md** file, that we can add optionally in every folder or repo
|
|
|
|
|
|
Let's continue our journey through the repos!. Let's enter into this folder: [2017-10-09-urjc-logo](https://github.com/Obijuan/3D-parts/tree/master/2017-10-09-urjc-logo)
|
|
|
Let's continue our journey through the repos!. Let's enter into this folder: [2017-10-09-urjc-logo](https://github.com/Obijuan/3D-parts/tree/master/2017-10-09-urjc-logo)
|
|
|
|
|
|

|
|
|
|
... | ... | @@ -96,7 +92,7 @@ Let's see now this other file: [logo-urjc.svg](https://github.com/Obijuan/3D-par |
|
|
|
|
|

|
|
|
|
|
|
As this is a **text file** (the SVG files are written in plain text), instead of the Download button there is a **RAW Button**. If we want to download it, just click with the **right mouse button** and select the *save link as* option
|
|
|
As this is a **text file** (the SVG files are written in plain text), instead of the Download button there is a **RAW Button**. If we want to download it, just click with the **right mouse button** and select the _save link as_ option
|
|
|
|
|
|
If we enter the **STL** folder and click on the file [urjc-coin.stl](https://github.com/Obijuan/3D-parts/blob/master/2017-10-09-urjc-logo/stl/urjc-coin.stl), as it is a 3D design, Github will render it and allow us to **rotate** it and **change the point of view**
|
|
|
|
... | ... | @@ -114,11 +110,11 @@ If you want to **access the wiki**, just click on the **wiki tab** |
|
|
|
|
|

|
|
|
|
|
|
The wiki's link is also available: [https://github.com/Obijuan/3D-parts/wiki](https://github.com/Obijuan/3D-parts/wiki). It allows us to access it as if a standar. It looks like this:
|
|
|
The wiki's link is also available: https://github.com/Obijuan/3D-parts/wiki. It allows us to access it as if a standar. It looks like this:
|
|
|
|
|
|

|
|
|
|
|
|
Now we can browse normally. The documentation that you are reading now, from the Programming in Network Environment subject, is located **its own wiki page** at Github 🙂
|
|
|
|
|
|
Now we can browse normally. The documentation that you are reading now, from the Programming in Network Environment subject, is located **its own wiki page** at Github :slight_smile:
|
|
|
|
|
|
From the [3D parts wiki](https://github.com/Obijuan/3D-parts/wiki), enter to the this design: [URJC Keyring/coin](https://github.com/Obijuan/3D-parts/wiki/Llavero-moneda-URJC). It is located on the same folder we saw before, but now you are looking at the wiki, that is easier for the users
|
|
|
|
... | ... | @@ -164,13 +160,13 @@ This is the repository. Click on the link to enter: [2019-2020-PNE-Practices](ht |
|
|
|
|
|
You can see al the folders were you should store all your practices and work, as well as the **README.md** file. The firs step is to create a copy of this template repo in your Github's account. Press the green button: **Use this template**
|
|
|
|
|
|
Now we should chose a new for the repo. In the upper left part you will see your **username** (in the pictures you will see mine (obijuan) but you should see yours) Use the same name of the template repo: **2019-2020-PNE-Practices**
|
|
|
Now we should chose a new for the repo. In the upper left part you will see your **username** (in the pictures you will see mine (obijuan) but you should see yours) Use the same name of the template repo: **2019-2020-PNE-Practices**
|
|
|
|
|
|

|
|
|
|
|
|
Write an optional description for the repo and click on the **Create repository from Template** button.
|
|
|
|
|
|
You will see a this screen:
|
|
|
You will see a this screen:
|
|
|
|
|
|

|
|
|
|
... | ... | @@ -250,7 +246,7 @@ Click on the **Close** button. **We are ready to work on our projects!** |
|
|
|
|
|
In this **animation** the whole process is shown
|
|
|
|
|
|

|
|
|

|
|
|
|
|
|
### Our first commit to the repo
|
|
|
|
... | ... | @@ -268,11 +264,11 @@ Let's **commit** that change. Click on the **green tick** in the upper right cor |
|
|
|
|
|

|
|
|
|
|
|
Everytime you commit a change, you should write a comment. In this case we can write *my first change*. Then click on the **commit** button
|
|
|
Everytime you commit a change, you should write a comment. In this case we can write _my first change_. Then click on the **commit** button
|
|
|
|
|
|

|
|
|
|
|
|
Congrats! You've done your first commit!
|
|
|
Congrats! You've done your first commit!
|
|
|
|
|
|

|
|
|
|
... | ... | @@ -334,7 +330,7 @@ Let's write our first Hello world program in Pycharm. First we create a **new fo |
|
|
|
|
|
#### Creating the Hello Folder
|
|
|
|
|
|
In the the Pycharm project windows select the **2019-2020-PNE-Practices** project
|
|
|
In the the Pycharm project windows select the **2019-2020-PNE-Practices** project
|
|
|
|
|
|

|
|
|
|
... | ... | @@ -364,7 +360,7 @@ Let's create our first python file. Make sure the **Hello folder is selected**, |
|
|
|
|
|

|
|
|
|
|
|
**Type in** the **filename**. For example **hello**. It is not necessary to introduce the extesion (.py)
|
|
|
**Type in** the **filename**. For example **hello**. It is not necessary to introduce the extesion (.py)
|
|
|
|
|
|

|
|
|
|
... | ... | @@ -395,7 +391,7 @@ print("Hello world!!") |
|
|
|
|
|
In the **hello.py tab** type start typing in the **code**
|
|
|
|
|
|
When the editor detects you have written the first letters, *pr*, it shows below some of the functions that matches. You can continue typing or pressing the **TAB key** for accepting the first choice
|
|
|
When the editor detects you have written the first letters, _pr_, it shows below some of the functions that matches. You can continue typing or pressing the **TAB key** for accepting the first choice
|
|
|
|
|
|

|
|
|
|
... | ... | @@ -441,7 +437,7 @@ In this **animation** some **errors** are forced and corrected |
|
|
|
|
|
### Running the program
|
|
|
|
|
|
The first time a file is created, cannot be executed directly. The buttons for running and debugging cannot be pressed. Also there is an option that says: **add configuration**
|
|
|
The first time a file is created, cannot be executed directly. The buttons for running and debugging cannot be pressed. Also there is an option that says: **add configuration**
|
|
|
|
|
|

|
|
|
|
... | ... | @@ -457,13 +453,13 @@ The program will **run**. A **new run** tab is open in the bottom. There you wil |
|
|
|
|
|

|
|
|
|
|
|
Once the configuration has been created, **running the program is straightforward**. Just click on the green run button in the toolbar
|
|
|
Once the configuration has been created, **running the program is straightforward**. Just click on the green run button in the toolbar
|
|
|
|
|
|

|
|
|
|
|
|
### Adding the program to the github repo
|
|
|
|
|
|
Now that the program is working, it is time to **add** it to our **repo**. First we have lo add it to our **local repo** (commit) and then **pushing** it to the **remote repo** at Github
|
|
|
Now that the program is working, it is time to **add** it to our **repo**. First we have lo add it to our **local repo** (commit) and then **pushing** it to the **remote repo** at Github
|
|
|
|
|
|
* Click on the **commit button**
|
|
|
|
... | ... | @@ -501,13 +497,13 @@ The only way of **mastering** something is practicing, practicing and practicing |
|
|
|
|
|
### Ex-1: hello.py
|
|
|
|
|
|
* Add another **print()** statement to the *hello.py* program
|
|
|
* Add another **print()** statement to the _hello.py_ program
|
|
|
* Add some **comments**
|
|
|
* Make sure you get a **green tick**
|
|
|
* **Run** the program
|
|
|
* **Upload** the changes to your github repo
|
|
|
|
|
|
### Ex-2: count.py
|
|
|
### Ex-2: count.py
|
|
|
|
|
|
* In the **2019-2020-PNE-Practice** project create a **new folder** called: **Session-01**
|
|
|
* Inside the **Session-01 folder**, write a python the **count.py** program that prints the number from 1 to 20 in the console
|
... | ... | @@ -531,8 +527,8 @@ The session is finished. Make sure, during this week, that everything in this li |
|
|
* [ ] Exercise 2 done!
|
|
|
* [ ] Exercise 3 done!
|
|
|
|
|
|
|
|
|
# Credits
|
|
|
|
|
|
* [Juan González-Gómez](https://github.com/Obijuan) (Obijuan)
|
|
|
* [Alvaro del Castillo](https://github.com/acs). He designed and created the original content of this subject. Thanks a lot :-)
|
|
|
|
... | ... | |