1
00:00:02,810 --> 00:00:11,300
Another mass use tool for any Python program or a Python anywhere, Python anywhere is a service and

2
00:00:11,300 --> 00:00:16,129
only service which gives you access to their servers for free.

3
00:00:16,520 --> 00:00:22,850
So having access to a server means having access to a computer which runs 24-7.

4
00:00:23,840 --> 00:00:31,460
And if you have access to a computer which runs constantly, you can do wonderful things in that computer

5
00:00:31,460 --> 00:00:32,240
with Python.

6
00:00:33,300 --> 00:00:36,690
So what exactly can you do on Python anywhere?

7
00:00:37,020 --> 00:00:42,660
Well, you can ride and run Python codes on Python anywhere.

8
00:00:42,960 --> 00:00:47,220
So through their computers, you can write programs.

9
00:00:47,610 --> 00:00:48,810
I'll show you how to do that.

10
00:00:49,440 --> 00:00:54,660
Then you can install Python libraries on their servers or third party packages.

11
00:00:54,960 --> 00:00:58,140
And you can also install Linux apps.

12
00:00:58,350 --> 00:01:06,450
So Python Anywhere uses servers, and these servers run on a Linux operating system so you can install

13
00:01:06,450 --> 00:01:09,540
programs on that Linux computer.

14
00:01:10,110 --> 00:01:16,410
Python is already installed so you don't have to install Python, but you can install Python libraries

15
00:01:16,410 --> 00:01:17,010
with that.

16
00:01:17,880 --> 00:01:25,440
You can also deploy web apps, so if you develop a web app locally on your computer, you want to make

17
00:01:25,440 --> 00:01:28,230
that website and that web app for life.

18
00:01:28,620 --> 00:01:37,070
So for that, you need a server which runs 24-7 so that people can access your website in any time of

19
00:01:37,070 --> 00:01:37,530
the day.

20
00:01:38,310 --> 00:01:42,570
So you can upload your web on Python anywhere and make it public.

21
00:01:43,350 --> 00:01:49,430
And lastly, on Python Anywhere, which is the focus of this lecture on Python anywhere you can schedule

22
00:01:49,440 --> 00:01:50,910
tasks you can.

23
00:01:51,210 --> 00:01:59,280
In other words, you can schedule a Python scripts for execution at a particular time every day.

24
00:01:59,820 --> 00:02:01,470
So why is this useful?

25
00:02:02,250 --> 00:02:05,730
Well, I can mention some cases when you need to do that.

26
00:02:05,940 --> 00:02:12,180
For example, you want to send an email to particular time every day, so you write the scripts that

27
00:02:12,180 --> 00:02:13,050
sends an email.

28
00:02:13,470 --> 00:02:20,340
The script simply sends one single email, and you can just schedule that script to be executed at a

29
00:02:20,340 --> 00:02:22,800
particular timestamp every day.

30
00:02:22,800 --> 00:02:28,980
And Python Anywhere will execute that script, and the email will be sent according to the instructions

31
00:02:28,980 --> 00:02:30,030
in your Python code.

32
00:02:30,720 --> 00:02:36,270
Another use case of this scheduling functionality of Python anywhere it would be.

33
00:02:36,270 --> 00:02:43,200
If you want to scrape data, you want to scrape of value every day at the particular time and maybe

34
00:02:43,200 --> 00:02:45,520
save that value.

35
00:02:45,540 --> 00:02:52,380
For example, a stock price or the weather temperature, and you can save that in a text file.

36
00:02:52,890 --> 00:02:57,420
So you write a script that does those actions and then you schedule that script.

37
00:02:57,960 --> 00:03:00,570
So let me give you a quick overview of Python anywhere.

38
00:03:01,080 --> 00:03:06,420
Once you create a free account, you can see the dashboard, the councils, the files, the web task

39
00:03:06,420 --> 00:03:07,320
and databases.

40
00:03:08,730 --> 00:03:12,540
Here on the dashboard, you have some shortcuts of these other menus.

41
00:03:12,540 --> 00:03:19,470
For example, if you want to create a console, you either go here in this area here or you go to consoles.

42
00:03:20,340 --> 00:03:24,450
And then you create, for example, a Python console.

43
00:03:24,720 --> 00:03:30,870
So press on Python three point eight or another version of Python, and that will immediately launch

44
00:03:31,830 --> 00:03:34,140
a Python interactive shell where you can.

45
00:03:37,600 --> 00:03:38,500
Rights codes.

46
00:03:38,530 --> 00:03:41,470
Some libraries are already sold like pandas.

47
00:03:42,400 --> 00:03:48,430
Some other ones are not installed, but you can install them by first opening a Bash Council here.

48
00:03:52,420 --> 00:03:59,160
And then doing PIP three point eight, if Python three point eight is what you're using, so people

49
00:03:59,160 --> 00:04:09,090
sort point eight inches tall, let's say speech recognition, that's a library for converting old you

50
00:04:09,720 --> 00:04:10,440
to text.

51
00:04:11,310 --> 00:04:16,740
So I have an already install this and you can go back and then.

52
00:04:17,820 --> 00:04:24,840
Go to the Python Council and import speech recognition.

53
00:04:26,990 --> 00:04:33,340
So that is the interactive shell, but you can also create Python files by going to the files menu and

54
00:04:33,360 --> 00:04:36,410
then going here down to files and you can create.

55
00:04:37,770 --> 00:04:42,480
A fire, for example, hello, don't p wine and press on new file.

56
00:04:43,780 --> 00:04:47,830
So that's the file we have just created here, you can also write Python codes.

57
00:04:51,560 --> 00:04:58,370
And executed to using this wrong button, you might get this message if you have too many councils open.

58
00:04:58,520 --> 00:05:01,850
So I have these two councils, I have to close one of them.

59
00:05:02,360 --> 00:05:05,840
Then go too far because I am on a free plan.

60
00:05:05,840 --> 00:05:09,230
So there are limitations with a free plan.

61
00:05:10,820 --> 00:05:14,960
And the limitations don't let you use too many consoles.

62
00:05:15,080 --> 00:05:22,460
So not a big deal on the web menu, you can deploy web apps.

63
00:05:22,470 --> 00:05:29,960
So for example, I have uploaded this web app and since I'm on a free version, this expires every three

64
00:05:29,960 --> 00:05:34,400
months, so I have to to press this button every three months in here.

65
00:05:34,580 --> 00:05:38,540
So that's an inconvenience, but for the free plan is fine.

66
00:05:38,990 --> 00:05:40,490
Then you go to Tusk's.

67
00:05:41,390 --> 00:05:44,100
Here you can create a task.

68
00:05:44,120 --> 00:05:49,580
For example, I have created this task, but I'm going to delete it and show you how to create a new

69
00:05:49,580 --> 00:05:49,850
one.

70
00:05:50,180 --> 00:05:55,340
So this is the interface, basically, you see, that's when you want the task to be executed.

71
00:05:55,340 --> 00:06:05,600
So the script, for example, at 10 00 UTC, so the time system is in UTC, you should be aware of that

72
00:06:05,600 --> 00:06:11,850
and calculate what your local time is related to UTC so you find the correct time.

73
00:06:12,440 --> 00:06:20,960
Here now, you should put the path to the Python file, so you upload the Python file in here in files.

74
00:06:21,320 --> 00:06:26,720
For example, you upload it with this and then you find the Python scripts in your local system.

75
00:06:27,170 --> 00:06:30,560
And so the file will be uploaded in this directory.

76
00:06:30,770 --> 00:06:34,370
For example, let's say we uploaded this how dots p y.

77
00:06:34,790 --> 00:06:39,050
You should know the path to this hallowed dots p y file.

78
00:06:39,500 --> 00:06:43,430
The path actually is this is slash home.

79
00:06:43,430 --> 00:06:45,590
Slash your username.

80
00:06:45,800 --> 00:06:47,870
In my case, it's already to answer three.

81
00:06:48,350 --> 00:06:50,630
Then slash halo dots p y.

82
00:06:51,530 --> 00:07:01,910
So remember that and go to tasks again, so it will slash home slash audits one two three slash halo

83
00:07:01,910 --> 00:07:02,800
dot p y.

84
00:07:02,810 --> 00:07:08,420
That's the path to the file you want to execute at this particular time of the day.

85
00:07:08,840 --> 00:07:11,750
You can give a description if you like and then press create.

86
00:07:13,100 --> 00:07:17,150
That script will be executed at this time every day.

87
00:07:18,150 --> 00:07:24,300
So you can notice that the UTC time is this, but this time here was converted to my local time.

88
00:07:25,020 --> 00:07:26,250
So keep that in mind.

89
00:07:27,030 --> 00:07:35,370
There's also an option to create my askyou, other databases and PostgreSQL, although PostgreSQL requires

90
00:07:35,370 --> 00:07:38,700
a paid plan, but my school is free.

91
00:07:40,150 --> 00:07:42,730
So that's it's a boat python, anyway.

92
00:07:42,760 --> 00:07:50,350
I hope you find this useful and keep that in mind whenever you need to do some automation, that's you

93
00:07:50,350 --> 00:07:52,660
can rely on Python anywhere.

94
00:07:52,930 --> 00:07:54,670
So would really suggest this service?

95
00:07:55,030 --> 00:07:56,400
I'll talk to you in the next videos.

