
mikemol at gmail
Jun 7, 2012, 11:41 AM
Post #3 of 4
(240 views)
Permalink
|
On Thu, Jun 7, 2012 at 2:25 PM, Thanasis <thanasis [at] asyr> 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
|