Python Forum
the uncompleteness of the text string - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: the uncompleteness of the text string (/thread-24584.html)



the uncompleteness of the text string - Cava - Feb-20-2020

Confused
Hello everyone.
I downloaded Python a few hours ago and, to start programming, I also downloaded PyCharm Community Edition 2019. Once I entered I learned to write basic things like: -print -create a calculator -have user input etc. I tried to create a text containing many of these things but once I exit PyCharm and launch the text string with Python the last part of it does not appear on the screen and disappears immediately. Can I know how not to make the program disappear once I have finished writing? I am attaching two recordings: one of the prject runned in PyCharm while the second is the project runned on Python: can someone help me understand why if i use the Python project at a certain point the program crashes and do not end the string of text? I am also carrying the string of text that i wrote... maybe that is the problem!



from math import *
print(" Benvenuto in MC\nCon questo programma puoi svolgere diverse funzioni!\nPer esempio: ")
name = input("Inserisci il tuo nome: ")
print("Il piacere è tutto mio " + name)
print("Prima di poseguire è necessario specificare la propria età: ")
age = input("Inserici di seguito la tua età: ")
print("Perfetto! " + name + "Ora possiamo proseguire")
print("Dato che hai " + age + " saprai sicuramente fare le addizioni e le sottrazioni")
num1 =input("Inserisci un numero: ")
num2 =input("Inserisci un numero che vuoi sommare al primo: ")
risul = float(num1) + float(num2)
print(risul)
print("Come puoi notare non sbaglio mai!")
print("Un'altra cosa che posso fare è creare una fiaba solo per te: ")
title =input("Inserisci il titolo della tua fiaba: ")
prot =input("Inserisci il nome del protagonista della tua fiaba: ")
ant =input("Inserisci il nome dell'antagonisata della tua fiaba: ")
gun =input("Inserisci il nome di un oggetto: ")
author =input("Inserisci il nome dell'autore della fiaba: ")
print("Grazie " + name + " per aver inserito le informazioni; aspetta un minuto\nStiamo processando la tua fiaba")
print("1% completato")
print("50% completato")
print("99% completato")
inf =input(" Sei sicuro di voler processare la tua fiaba " + name + " ?")
print(" Eccoti allora " + title + " scritta da " + author + " !")
print("Signore e signori vi presentiamo " + title + " una fiaba di " + author)
print("C'era una volta " + prot + " che camminava da sola nel bosco")
print("Ad un certo punto " + prot + " incontra " + ant)
print(prot + " tira fuori " + gun + " e massacra "  + ant)
print("Queste sono solo alcune delle funzioni che posso svolgere " + name)
print("E' stato bello conoscerti...\nMagari ci rivediamo quando avrai più di " + age + " anni!\nCosì ti mostrerò moltissime nuove funzioni!")
print(" Premi invio se hai terminato")



RE: the uncompleteness of the text string - ibreeden - Feb-21-2020

Hello Cava, that is a nice program you wrote. I am trying to learn Italian so I enjoyed it. I am not sure I understand what your problem is. You say the program crashes. It does not with me. I think it vanishes from your screen because it is just finished. Try to change the last line to:
input(" Premi invio se hai terminato")
Is that what you mean?


RE: the uncompleteness of the text string - Cava - Feb-21-2020

(Feb-21-2020, 10:02 AM)ibreeden Wrote: input(" Premi invio se hai terminato"
Thank you so much now i have learnt why it was going away! thank u so much!