0

I have a better new question here

I am creating a Python program that needs a new number with 4 decimal places every 2 seconds. The number needs to change on the cloud so it can be retrieved constantly by multiple computers every time the number changes.

Note: I have not made anything yet. I want to know how to make it.

Goal: If I and a friend are on our separate computers running the same local Python program, we should both see the same 5 digit number every 2 seconds.

The code should be something like this, but it should be on the cloud running 24/7. I know how to make a new number every 2 seconds, I just don't know how to make one in the cloud run constantly and be able to be retrieved at any time.

import time
import random

while True:
    number = randint(0,100) #I can change how it gets the number, I just need this to run in the cloud constantly
    time.sleep(2)
Zer0 - Official
  • 35
  • 1
  • 2
  • 8
  • What have you tried so far? – BrokenBenchmark Mar 02 '22 at 22:41
  • @BrokenBenchmark I have tried creating an updating local token, but I realized it needs to be global and the same to all computers running it – Zer0 - Official Mar 02 '22 at 22:54
  • Show us what you've tried. You should provide debugging details. – BrokenBenchmark Mar 02 '22 at 22:55
  • @BrokenBenchmark i have not tried anything that would work yet, but I added what the code should look like in the question. I just need that code to run in the cloud 24/7 and I need to be able to retrieve the number it creates constantly – Zer0 - Official Mar 02 '22 at 23:08
  • I have a better, new post here: [https://stackoverflow.com/questions/71416759/i-want-to-run-a-python-script-on-a-server-24-7](https://stackoverflow.com/questions/71416759/i-want-to-run-a-python-script-on-a-server-24-7) – Zer0 - Official Mar 09 '22 at 22:34

0 Answers0