Learn to Code via Tutorials on Repl.it!

← Back to all posts
Pausing Your Repl In Python
CodingElf66

Pausing Your Repl In Python

Intro

Hello, guys! Today I'll be teaching you how to pause your repl in Python. It is actually pretty simple, if you just get the hang of it!

Why

Well, you may be thinking: Why should I do this? Well, this is actually quite useful! For long games written in Python (output screen), instead of printing text all at once, we can slowly render each text onto the screen, so the user has time to read them! It is actually quite useful!

How

First, you import the time module in Python.

Then, you can now do time.sleep(t), such that t is in seconds. For example, if we wanted to pause it for 3 seconds, we can do:

Now, we're done!

time.sleep() Parameters

time.sleep() holds only one parameter, and it is 't'. It is basically the number of seconds it will sleep.

Closing

Thanks for reading this tutorial, and good luck and have fun using it!

Voters
UltimatePython
365DaysOfCode
SwiftOwl
CodingElf66
Comments
hotnewtop
SwiftOwl

Oh wow that's how you do it!

Thanks, it helped!

CodingElf66

@SwiftOwl No problem!

blahthingy

nice

CodingElf66
RayhanADev

Hey dude, just letting you know your tutorials are great and everything they just seem a bit... small. Maybe collect all your ideas into a big Python tutorial and post that to the Tutorial board?

CodingElf66

@RayhanADev Ok, sure! Thanks for the suggestion!