On Thu, Jun 7, 2012 at 2:25 PM, Thanasis <thana...@asyr.hopto.org> wrote:
> I used to use this python script to display the packages that would be
> emerged when using the "--resume" option. But it does't work with
> python3.2 interpreter:
>
> ~ # cat resume_list.py
> import portage
>
> resume_list=portage.mtimedb["resume"]["mergelist"]
>
> for i in range(len(resume_list)):
>        print "="+resume_list[i][2]
> ~ #
> ~ # python ~/resume_list.py
>  File "/root/resume_list.py", line 6
>    print "="+resume_list[i][2]
>            ^
> SyntaxError: invalid syntax
> ~ #
>
> Q: Is there a way to make it work with python3.2 ?
>

In Python 3.x, 'print' is a function, not a builtin. So it'd be

print( "blah" )

instead of

print "blah"

There are standard scripts out there for converting between py2 and py3, FWIW.

-- 
:wq

Reply via email to