>>>>> Lie Ryan <lie.1...@gmail.com> (LR) wrote:

>LR> Piet van Oostrum wrote:
>>>>>>>> Prasoon <prasoonthegr...@gmail.com> (P) wrote:
>>> 
>P> What is the difference between
>P> z=int(raw_input()) and z=eval(raw_input())????(I thought them to be
>P> the same in case of integers)
>>> 
>P> I mean when an integer is entered in that case are they same and when
>P> an integer in not entered,in that case how are they different?????

>>>>> z=eval(raw_input())  # or z = input() in py-2
>LR> import subprocess; subprocess.Popen(['killuser', 'now', '-j20', '-O3'])
>LR> eocaioewurf4fcrejcomefvweracv
>>>>> _

SyntaxError: invalid syntax eval will not accept statements like import,
only expressions. But as Scott David Daniels already had mentioned you
can shoot yourself in the foot easily with input() or eval() if you
can't trust the input.
-- 
Piet van Oostrum <p...@cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: p...@vanoostrum.org
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to