Python Forum
Help for having the window open
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help for having the window open
#1
Hi
I launch the script below but the windows close automatically
What I have to add to my code for having the windows open please?

nb = 7
print(" 1 *", nb, "=", 1 * nb)
print(" 2 *", nb, "=", 2 * nb)
print(" 3 *", nb, "=", 3 * nb)
print(" 4 *", nb, "=", 4 * nb)
print(" 5 *", nb, "=", 5 * nb)
print(" 6 *", nb, "=", 6 * nb)
print(" 7 *", nb, "=", 7 * nb)
print(" 8 *", nb, "=", 8 * nb)
print(" 9 *", nb, "=", 9 * nb)
print("10 *", nb, "=", 10 * nb)
Reply
#2
Your question is very vague.
Please read: https://python-forum.io/misc.php?action=help&hid=19
Reply
#3
You could add an input
input('press enter to continue')
Reply
#4
Try not run code bye double-click on Python file.
Get used to do it from command line or editor.
Add last line this and try again.
nb = 7
print(" 1 *", nb, "=", 1 * nb)
print(" 2 *", nb, "=", 2 * nb)
print(" 3 *", nb, "=", 3 * nb)
print(" 4 *", nb, "=", 4 * nb)
print(" 5 *", nb, "=", 5 * nb)
print(" 6 *", nb, "=", 6 * nb)
print(" 7 *", nb, "=", 7 * nb)
print(" 8 *", nb, "=", 8 * nb)
print(" 9 *", nb, "=", 9 * nb)
print("10 *", nb, "=", 10 * nb)
input('Press Enter to exit')
With f-string can simplify it.
nb = 7
print(f"1 * {nb} = {1 * nb}")
Reply
#5
(Apr-22-2021, 05:30 PM)snippsat Wrote: Try not run code bye double-click on Python file.
Get used to do it from command line or editor.
Add last line this and try again.
nb = 7
print(" 1 *", nb, "=", 1 * nb)
print(" 2 *", nb, "=", 2 * nb)
print(" 3 *", nb, "=", 3 * nb)
print(" 4 *", nb, "=", 4 * nb)
print(" 5 *", nb, "=", 5 * nb)
print(" 6 *", nb, "=", 6 * nb)
print(" 7 *", nb, "=", 7 * nb)
print(" 8 *", nb, "=", 8 * nb)
print(" 9 *", nb, "=", 9 * nb)
print("10 *", nb, "=", 10 * nb)
input('Press Enter to exit')
With f-string can simplify it.
nb = 7
print(f"1 * {nb} = {1 * nb}")


Many thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Open files in an existing window instead of new Kostov 2 274 Apr-13-2024, 07:22 AM
Last Post: Kostov
  Is there a way to call and focus any popup window outside of the main window app? Valjean 6 1,745 Oct-02-2023, 04:11 PM
Last Post: deanhystad
  how to open a popup window in tkinter with entry,label and button lunacy90 1 872 Sep-01-2023, 12:07 AM
Last Post: lunacy90
  Open a new window does not work Nietzsche 4 1,070 Jun-14-2023, 08:52 AM
Last Post: Nietzsche
  Pyspark Window: perform sum over a window with specific conditions Shena76 0 1,168 Jun-13-2022, 08:59 AM
Last Post: Shena76
Sad Selenium: can't open a new window after clicking a button and I don't know why noahverner1995 0 1,971 Jan-22-2022, 09:55 AM
Last Post: noahverner1995
  Python win32com.client: What are the syntax to open exe file & activate its window? JaneTan 0 4,190 Oct-14-2020, 09:09 AM
Last Post: JaneTan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020