Jump to content

I recently have started programming in python. Every time i try to run the script from the .py file the console opens for less than a second then closes what is a command i can use to keep the console open till i close it manually.

import random
import sys
import os

print("Hello World")
name = "6"
print (name)

 

Link to comment
https://linustechtips.com/topic/672737-python-beginner-help/
Share on other sites

Link to post
Share on other sites

Try using an editor like spyder ;)

[GUIDE] LGA 771 Mod for Dell Vostro 220 [GUIDE] LGA 775 BSEL Mod [BUILD] The Mighty Radeon-Powered Dell [VIDEO] Evolution of Intel CPUs

Can you game on an 8-year-old i7? Is the 4-year-old GTX 660 still relevant? Upgrading the HP Pro 3500

Main Rig:

Spoiler

CPU Intel Core i7 4930k @ 4.3GHz | Motherboard ASUS P9X79 Deluxe | RAM Hynix 32GB (8x4GB) 2133MHz CL11 | GPU Gigabyte GTX 980Ti G1 Gaming | Case NZXT Phantom 410 | Storage Samsung 850EVO 500GB, Seagate Barracuda 2TB | PSU Cooler Master G650M (650W) | Monitors x1 Dell U2515H, x2 Dell 1907FP | Cooling Noctua NH-D14 w. x2 NF-F12 iPPC-2000 PWM | Keyboard Logitech G610 ORION BROWN | Mouse Logitech Performance MX | OS Microsoft Windows 10 Pro x64

Link to comment
https://linustechtips.com/topic/672737-python-beginner-help/#findComment-8668708
Share on other sites

Link to post
Share on other sites

25 minutes ago, oskarha said:

Try using an editor like spyder ;)

 

15 minutes ago, fizzlesticks said:

You can add the line


input('Press enter to exit.')

at the end of your script or just run the script from inside a console.

if you use idle then it keeps the console open for you to read the output.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/672737-python-beginner-help/#findComment-8668752
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×