Skip to content

Conditional Prompt #1845

Answered by willmcgugan
lpinilla asked this question in Ideas
Jan 17, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Not as such, but this doesn't need to be a part of the core library as you could implement it while a loop.

while True:
    filename = Prompt.ask("Enter a filename")
    if not os.path.exists(filename):
        print("file must exist")
    else:
        break

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lpinilla
Comment options

Answer selected by lpinilla
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants