Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] resume_list.py
Date: Thu, 07 Jun 2012 18:39:57
Message-Id: CAEH5T2NvMRMSGqG=miStEP33rVwhuAEk97Y3jD2hHpWg2_HBSg@mail.gmail.com
In Reply to: [gentoo-user] resume_list.py by Thanasis
1 On Thu, Jun 7, 2012 at 1:25 PM, Thanasis <thanasis@××××××××××.org> wrote:
2 > I used to use this python script to display the packages that would be
3 > emerged when using the "--resume" option. But it does't work with
4 > python3.2 interpreter:
5 >
6 > ~ # cat resume_list.py
7 > import portage
8 >
9 > resume_list=portage.mtimedb["resume"]["mergelist"]
10 >
11 > for i in range(len(resume_list)):
12 >        print "="+resume_list[i][2]
13 > ~ #
14 > ~ # python ~/resume_list.py
15 >  File "/root/resume_list.py", line 6
16 >    print "="+resume_list[i][2]
17 >            ^
18 > SyntaxError: invalid syntax
19 > ~ #
20 >
21 > Q: Is there a way to make it work with python3.2 ?
22 >
23
24 I believe parentheses are mandatory for print function in python 3.x.
25 So try to change it to:
26 print("="+resume_list[i][2])
27
28 Disclaimer: I do not know python. :)

Replies

Subject Author
SOLVED [gentoo-user] resume_list.py Thanasis <thanasis@××××××××××.org>