Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Loading while scanning #6

Answered by darkdarcool
kokonut27 asked this question in Q&A
Mar 22, 2021 · 1 comments · 9 replies
Discussion options

You must be logged in to vote

Sure, this is just an idea:
🤔

import sys
import time
import os
print("pls wait", end ="")
loading = True  
loading_speed = 4  
loading_string = "." * 6  
sun = 0
while loading:
    if (sun > 10):
      break
      os.system("clear")
    for index, char in enumerate(loading_string):
        sun +=1
        if (sun > 10):
          break
          break
        
        sys.stdout.write(char)  
        sys.stdout.flush()  
        time.sleep(1.0 / loading_speed)  #
    index += 1  
    sys.stdout.write("\b" * index + " " * index + "\b" * index)
    sys.stdout.flush()  

You can see my repl here: https://replit.com/@darkdarcool/test#main.py

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@Tiger-The-Cat
Comment options

@Tiger-The-Cat
Comment options

@darkdarcool
Comment options

@Tiger-The-Cat
Comment options

@darkdarcool
Comment options

Answer selected by kokonut27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants