LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-24-2011, 06:25 PM   #1
JAPANBOY
LQ Newbie
 
Registered: Jun 2011
Location: somewhere over the rainbow
Posts: 11

Rep: Reputation: Disabled
problem with python saving


hello,

i am having trouble saving my simple program

this is what i wrote

x=raw_input("enter name:")
print "hey" + x
raw_input("Press<enter>")

and everytime when i save this i go to

file
save
JAPANBOY.py
move to desktop
and when i open it there's the black screen and it dissapears in less than a second.
does anybody have any idea what im doing wrong?

by the way im using python 3.2
and the video that im watching it's using an different version.
 
Old 06-24-2011, 06:47 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I assume you're doing this in windows? Try running it from a command
line. I don't know how to make a desktop object in windows that will
open a shell and then run your script.



Cheers,
Tink
 
Old 06-25-2011, 06:11 AM   #3
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
It opens the script in a terminal, the script ends, and the terminal closes. Running it from a terminal will fix this (these commands are for Linux):

Code:
cd ~/Desktop
python JAPANBOY.py
 
Old 06-25-2011, 09:03 AM   #4
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
The problem is your code - raw_input is no longer in python 3. Change raw_input to input in the code and it should work. This is causing a program error which you are not seeing as you are not running the program from the command prompt. This is just quickly opening and closing a terminal session. It's best to run python from the command prompt so errors are shown. When the code is fixed this should work by just launching with a double click.

Last edited by bgeddy; 06-25-2011 at 09:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Python ConfigParser not saving comments EricTRA Programming 3 06-17-2011 03:15 AM
Saving file data using Python in an embedded system in an safe and fast way Fabio Paolini Programming 7 04-24-2011 11:07 AM
LXer: Python Python Python (aka Python 3) LXer Syndicated Linux News 0 08-05-2009 08:30 PM
python problem - compiled from source - python -V still showing old version txm123 Linux - Newbie 1 02-15-2006 11:05 AM
Problem in saving document!!!! doctor_sniff Linux - Software 0 08-15-2005 03:49 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration