[Python] How to call a function using the Visual Studio Code terminal

Discussão em 'Python' iniciado por Stack, Junho 30, 2025.

  1. Stack

    Stack Membro Participativo

    I have created a python script with a single function in it. Is there a way to call the function from the python terminal to test some arguments?

    import time
    import random

    def string_teletyper(string):
    '''Prints out each character in a string with time delay'''
    for chr in string:
    print(chr, end='', flush=True)
    time.sleep(random.randint(1,2)/20)


    If I want to test an argument for the function, I would have to add string_teletyper(argument) inside the script itself and run it, is there a faster way?

    Continue reading...

Compartilhe esta Página