Schedule a Python Script on PythonAnywhere Last Updated : 23 Jan, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Keeping the computer on 24/7 is not practical, so if you want to execute a Python script at a particular time every day, you probably need a computer that is ON all the time. To make this possible, a website PythonAnywhere gives you access to such a 24/7 computer. You can upload a Python script and schedule it to run at a certain time every day. This availability can be useful, for example, when you want to extract some values (e.g., weather data) from a website and generate a text file with the value or other reports every day. To schedule, a Python script for execution on PythonAnywhere, follow these simple steps: Sign up on here the account for Beginners is free with some T&C. Go to your Dashboard, Files, Upload a File and upload the Python file you want to schedule for execution. Go to Tasks and set the time of the day you want your script to be executed and type in the name of the Python file you uploaded (e.g., myfirstpyscript.py). Note: The time entered should be in UTC. Click "create" and you are done. The Python file will now be executed every day at your specified time. Example: Below is a very simple Python script you can use to schedule for execution. Python3 1== from datetime import datetime # Saves a .txt file with file name # as 2020-01-11-10-20-23.txt with open(datetime.now().strftime("%Y-%m-%d-%H-%M-%S"), "w")as myfile: # Content of the file myfile.write("Hello World !") The above code creates a text file and writes the string “Hello World!” in that text file. The name of the text file will be the current date and time. For example one file name example would be 2020-01-11-10-20-23.txt. That name is generated by datetime.now() indicating the date and time the script was executed. Every time the script is executed, the script generates a new text file with a different name. You will have a new text file created every day. Comment More infoAdvertise with us Next Article Schedule a Python Script on PythonAnywhere V VineetLoyer Follow Improve Article Tags : Python Python Programs Python-Miscellaneous Practice Tags : python Similar Reads How to Schedule a Task in Python? We will see what is task scheduling in Python and how to schedule a task in Python with examples. In this article, we will see how we can schedule a task in Python. What is Task Scheduling in Python?Task scheduling involves automating processes by defining tasks to be executed at predetermined times 3 min read Create a Countdown Timer for New Year Using Python Many of us eagerly wait the arrival of the New Year. A countdown timer is a way to keep track of the remaining time until midnight. To achieve this, we'll utilize Python's datetime and time modules. The datetime module allows us to work with dates and times, while the time module helps in creating d 3 min read Creating Digital Clock Using Date Shower in Python Python is a versatile language used for a wide range of applications, including Graphical User Interfaces (GUI) using Tkinter. However, sometimes for simplicity, a command line can be used to create simple applications. Building a Digital Clock with a Date Shower in Python is a perfect example. This 3 min read Python | Whatsapp birthday bot Have you ever wished to automatically wish your friends on their birthdays, or send a set of messages to your friend ( or any Whastapp contact! ) automatically at a pre-set time, or send your friends by sending thousands of random text on whatsapp! Using Browser Automation you can do all of it and m 10 min read How To Install Pytz In Python? In this article, we will explain how to install Pytz in Python, explore its features, and provide visual guidance with images. After installation, we will execute a code snippet to show its successful functionality. What is Pytz In Python?Pytz is a Python library that provides support for working wi 3 min read Like