Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Python input help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Lolocaust
Expert Cheater
Reputation: 0

Joined: 23 Jul 2008
Posts: 126

PostPosted: Sun Aug 24, 2008 5:18 pm    Post subject: Python input help Reply with quote

Hi, I want the user to input a sentence, then output it. The problem is, it's only accepting it if I put it in quotes, or its a number.


lulz = input(Hello there. )
print lulz

Do you know a way, the default would be to put in it quotes?

_________________
WEEEEE
Back to top
View user's profile Send private message
Dragonlor511
Cheater
Reputation: 0

Joined: 16 May 2008
Posts: 27
Location: You don't need to know

PostPosted: Tue Sep 30, 2008 6:28 pm    Post subject: Reply with quote

you have to make it a raw_input()

for example:

lulz=raw_input()
print lulz


exactly like that

input means you want them to put in a number, and raw_input is for words and letters.
Now if you want them to type it on the same line as your typing, put:

lulz=raw_input("Hello there.")
print lulz

_________________


We are everywhere. We see everything. We will come out of the shadows.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Wed Oct 01, 2008 12:44 am    Post subject: Reply with quote

Dragon is not QUITE right. input() evaluates what the user inputs. So it expects a valid python expression. raw_input() just gets the input.

"input() is equivalent to eval(raw_input())"

Also, input() is not safe, since the user can input code and it will be run. For number input, use int(raw_input());

_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites