You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding notes about exiting Python command, making sure that you are in the right directory to generate the requirement.txt file, and a few other editorial changes
After the installation is finished, run this command:
17
+
After the installation is finished, go to the `mysite` directory and run this command:
18
18
19
19
(myvenv) $ pip freeze > requirements.txt
20
20
21
21
This will create a file called `requirements.txt` with a list of your installed packages (i.e. Python libraries that you are using, for example Django :)).
22
22
23
23
Open this file and add the following line at the bottom:
24
-
24
+
25
25
pyscopg2==2.5.3
26
26
27
27
This line is needed for your application to work on Heroku.
@@ -73,7 +73,7 @@ Another thing we need to do is modify our website's `settings.py` file. Open `my
73
73
ALLOWED_HOSTS = ['*']
74
74
75
75
STATIC_ROOT = 'staticfiles'
76
-
76
+
77
77
DEBUG = False
78
78
79
79
At the end of the `mysite/settings.py`, copy and paste this:
@@ -90,7 +90,7 @@ Then save the file.
90
90
## mysite/wsgi.py
91
91
92
92
Open the `mysite/wsgi.py` file and add these lines at the end:
Copy file name to clipboardExpand all lines: python_installation/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Huh, it's exciting, right?! You'll write your first line of code in just minutes
4
4
5
5
But first, let us tell you what Python is. Python is a very popular programming language that can be used for creating websites, games, science, graphics and much, much more.
6
6
7
-
Python was conceived in the late 1980s and its main goal is to be readable by human beings (not only machines!), which is why it looks much simpler than other programming languages. That makes it easy to learn, but don't worry, Python is also really powerful!
7
+
Python originated in the late 1980s and its main goal is to be readable by human beings (not only machines!), which is why it looks much simpler than other programming languages. That makes it easy to learn, but don't worry, Python is also really powerful!
8
8
9
9
# Python installation
10
10
@@ -18,7 +18,7 @@ You can download Python for Windows from the website https://www.python.org/down
18
18
19
19
### Linux
20
20
21
-
It is very likely that you already have Python installed out of the box. To check if you have it installed (and which version it is), you type in a console:
21
+
It is very likely that you already have Python installed out of the box. To check if you have it installed (and which version it is), open a console and type:
Copy file name to clipboardExpand all lines: python_introduction/README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Let's write some code!
6
6
7
7
## Python prompt
8
8
9
-
To start tinkering with Python, we need to open up a *prompt* on your computer. How you get there depends on the operating system but once it's open, everything is equal.
9
+
To start playing with Python, we need to open up a *prompt* on your computer. How you get there depends on the operating system but once it's open, everything is equal.
10
10
11
11
### Windows
12
12
@@ -34,7 +34,9 @@ A window should pop up on your screen. This window is a prompt, waiting for comm
34
34
35
35
After running the Python command, the prompt changed to `>>>`. For us it means that for now we may only use commands in the Python language. You don't have to type in `>>>` - Python will do that for you.
36
36
37
-
Let's start with something really simple. For example, try typing some math, like `2 + 3` and hit Enter.
37
+
If you want to exit the Python console at any point, just type `exit()` or hit `Ctrl + D`. You won't see `>>>` any longer.
38
+
39
+
But now, we don't want to exit the Python console. We want to learn more about it. Let's start with something really simple. For example, try typing some math, like `2 + 3` and hit Enter.
38
40
39
41
>>> 2 + 3
40
42
5
@@ -83,7 +85,7 @@ Wonder why sometimes you call functions by adding `.` at the end of the string (
83
85
84
86
### Summary
85
87
86
-
Ok, enough of strings. So far you've learned about:
88
+
OK, enough of strings. So far you've learned about:
87
89
88
90
-__the prompt__ - typing commands (code) into prompt give you Python answers
89
91
-__numbers and strings__ - in Python it's math and text objects
@@ -114,7 +116,7 @@ It worked! We used `str` function inside of `len` function. `str` is converting
114
116
115
117
## Variables
116
118
117
-
An important concept in programming is variables. A variable is nothing more than a name for something so you can use it later. Programmers use these variables to store data, make their code more readable and to not help them remember what things are.
119
+
An important concept in programming is variables. A variable is nothing more than a name for something so you can use it later. Programmers use these variables to store data, make their code more readable and to help them remember what things are.
118
120
119
121
Let's say we want to create a new variable called `name`:
0 commit comments