Re: SyntaxError on progress module

2015-05-27 Thread Chris Angelico
On Wed, May 27, 2015 at 5:30 PM, alb al.bas...@gmail.com wrote:
 But here I have another question, as a python novice is there really any
 reason for me to use any particular version of Python?

 Should I start directly with the newest? What about 2.7?


Start with the newest that's conveniently available. With Debian
Jessie, Python 3.4.2 is a simple apt-get away, so that's pretty
convenient.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread Cecil Westerhof
Op Wednesday 27 May 2015 09:30 CEST schreef alb:

 But here I have another question, as a python novice is there really
 any reason for me to use any particular version of Python?

 Should I start directly with the newest? What about 2.7?

In principal you should use the ‘latest’ 3. The only problem is that a
lot of libraries are not converted to 3 yet. If you need one of those,
then you have ‘no choice’ and have to use 2.7. But I would recommend
to use ‘from __future__' to make the 2.7 code as much as possible 3
compliant.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread Mark Lawrence

On 27/05/2015 09:42, Cecil Westerhof wrote:

Op Wednesday 27 May 2015 09:30 CEST schreef alb:


But here I have another question, as a python novice is there really
any reason for me to use any particular version of Python?

Should I start directly with the newest? What about 2.7?


In principal you should use the ‘latest’ 3. The only problem is that a
lot of libraries are not converted to 3 yet. If you need one of those,
then you have ‘no choice’ and have to use 2.7. But I would recommend
to use ‘from __future__' to make the 2.7 code as much as possible 3
compliant.



Please define a lot whilst bearing in mind green against red here 
https://python3wos.appspot.com/


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread Cecil Westerhof
Op Wednesday 27 May 2015 16:51 CEST schreef Mark Lawrence:

 On 27/05/2015 15:11, Cecil Westerhof wrote:
 Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence:

 On 27/05/2015 09:42, Cecil Westerhof wrote:
 Op Wednesday 27 May 2015 09:30 CEST schreef alb:

 But here I have another question, as a python novice is there
 really any reason for me to use any particular version of
 Python?

 Should I start directly with the newest? What about 2.7?

 In principal you should use the ‘latest’ 3. The only problem is
 that a lot of libraries are not converted to 3 yet. If you need
 one of those, then you have ‘no choice’ and have to use 2.7. But
 I would recommend to use ‘from __future__' to make the 2.7 code
 as much as possible 3 compliant.


 Please define a lot whilst bearing in mind green against red
 here https://python3wos.appspot.com/

 I just started using Python again and the first ‘real’ program I
 wrote I had to write with Python 2 because the needed library
 (libturpial, that is not listed on your link) works only with
 Python 2. A short search about which of the two to use gives
 similar answers to mine. And as far as I can see in my
 neighbourhood Python 2 is almost exclusively used because used
 libraries are only available in Python 2.

 This is not a scientifically substantiated argument, but for me
 good enough to use a lot.


 Have you actaully tried running libturpial with Python 3 or have you
 simply taken somebody or something's word for it? I've taken code in
 the past that was only Python 2, run it thought the 2to3 fixer and
 job done. Perhaps you could do the same. Perhaps you've already
 tried. Again, you're the only person who actually knows.

Of-course I tried: that is why I used “had to”. The library itself and
libraries it depends on are only existing in a 2 version (at the
moment). I write code that should work in 2 and 3 both as long as 2 is
still a significant part. I call programs with python3 (even while it
is 10 to 20 percent slower) and only when that is not possible I use
Python 2. (Except to test if code also works with Python 2.)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread Cecil Westerhof
Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence:

 On 27/05/2015 09:42, Cecil Westerhof wrote:
 Op Wednesday 27 May 2015 09:30 CEST schreef alb:

 But here I have another question, as a python novice is there
 really any reason for me to use any particular version of Python?

 Should I start directly with the newest? What about 2.7?

 In principal you should use the ‘latest’ 3. The only problem is
 that a lot of libraries are not converted to 3 yet. If you need one
 of those, then you have ‘no choice’ and have to use 2.7. But I
 would recommend to use ‘from __future__' to make the 2.7 code as
 much as possible 3 compliant.


 Please define a lot whilst bearing in mind green against red here
 https://python3wos.appspot.com/

I just started using Python again and the first ‘real’ program I wrote
I had to write with Python 2 because the needed library (libturpial,
that is not listed on your link) works only with Python 2. A short
search about which of the two to use gives similar answers to mine.
And as far as I can see in my neighbourhood Python 2 is almost
exclusively used because used libraries are only available in Python
2.

This is not a scientifically substantiated argument, but for me good
enough to use a lot.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread Mark Lawrence

On 27/05/2015 15:11, Cecil Westerhof wrote:

Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence:


On 27/05/2015 09:42, Cecil Westerhof wrote:

Op Wednesday 27 May 2015 09:30 CEST schreef alb:


But here I have another question, as a python novice is there
really any reason for me to use any particular version of Python?

Should I start directly with the newest? What about 2.7?


In principal you should use the ‘latest’ 3. The only problem is
that a lot of libraries are not converted to 3 yet. If you need one
of those, then you have ‘no choice’ and have to use 2.7. But I
would recommend to use ‘from __future__' to make the 2.7 code as
much as possible 3 compliant.



Please define a lot whilst bearing in mind green against red here
https://python3wos.appspot.com/


I just started using Python again and the first ‘real’ program I wrote
I had to write with Python 2 because the needed library (libturpial,
that is not listed on your link) works only with Python 2. A short
search about which of the two to use gives similar answers to mine.
And as far as I can see in my neighbourhood Python 2 is almost
exclusively used because used libraries are only available in Python
2.

This is not a scientifically substantiated argument, but for me good
enough to use a lot.



Have you actaully tried running libturpial with Python 3 or have you 
simply taken somebody or something's word for it?  I've taken code in 
the past that was only Python 2, run it thought the 2to3 fixer and job 
done.  Perhaps you could do the same.  Perhaps you've already tried. 
Again, you're the only person who actually knows.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread Mark Lawrence

On 27/05/2015 16:18, Cecil Westerhof wrote:

Op Wednesday 27 May 2015 16:51 CEST schreef Mark Lawrence:


On 27/05/2015 15:11, Cecil Westerhof wrote:

Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence:


On 27/05/2015 09:42, Cecil Westerhof wrote:

Op Wednesday 27 May 2015 09:30 CEST schreef alb:


But here I have another question, as a python novice is there
really any reason for me to use any particular version of
Python?

Should I start directly with the newest? What about 2.7?


In principal you should use the ‘latest’ 3. The only problem is
that a lot of libraries are not converted to 3 yet. If you need
one of those, then you have ‘no choice’ and have to use 2.7. But
I would recommend to use ‘from __future__' to make the 2.7 code
as much as possible 3 compliant.



Please define a lot whilst bearing in mind green against red
here https://python3wos.appspot.com/


I just started using Python again and the first ‘real’ program I
wrote I had to write with Python 2 because the needed library
(libturpial, that is not listed on your link) works only with
Python 2. A short search about which of the two to use gives
similar answers to mine. And as far as I can see in my
neighbourhood Python 2 is almost exclusively used because used
libraries are only available in Python 2.

This is not a scientifically substantiated argument, but for me
good enough to use a lot.



Have you actaully tried running libturpial with Python 3 or have you
simply taken somebody or something's word for it? I've taken code in
the past that was only Python 2, run it thought the 2to3 fixer and
job done. Perhaps you could do the same. Perhaps you've already
tried. Again, you're the only person who actually knows.


Of-course I tried: that is why I used “had to”. The library itself and
libraries it depends on are only existing in a 2 version (at the
moment). I write code that should work in 2 and 3 both as long as 2 is
still a significant part. I call programs with python3 (even while it
is 10 to 20 percent slower) and only when that is not possible I use
Python 2. (Except to test if code also works with Python 2.)



Did you, noting that you didn't actually answer my question, and also 
noting that you do ask a lot of questions yourself?  So let's try again, 
did you or did you not run libturpial through 2to3?  If yes what went 
wrong that stopped you porting it to Python 3?


You make the statement regarding Python3 even while it is 10 to 20 
percent slower. Where is your evidence to support this statement?


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread Steven D'Aprano
On Thu, 28 May 2015 06:03 am, Mark Lawrence wrote:

 You make the statement regarding Python3 even while it is 10 to 20
 percent slower. Where is your evidence to support this statement?


Its well known that Python 3 is generally slower than Python 2. Cecil's
claim shouldn't be controversial, any more than Python is generally about
10 to 100 times slower than C should be controversial.


But for what it's worth:

[steve@ando ~]$ python2.7 -m timeit i=1; L=sorted([30,20,50,10,40]);
L[i+1]
100 loops, best of 3: 1.54 usec per loop

[steve@ando ~]$ python3.3 -m timeit i=1; L=sorted([30,20,50,10,40]);
L[i+1]
100 loops, best of 3: 1.62 usec per loop

which is an 8% slowdown.

On the other hand:

[steve@ando ~]$ python2.7 -m timeit i='1'; L=sorted([30,20,50,10,40]);
L[int(i)+1]
10 loops, best of 3: 2.6 usec per loop

[steve@ando ~]$ python3.3 -m timeit i='1'; L=sorted([30,20,50,10,40]);
L[int(i)+1]
10 loops, best of 3: 2.29 usec per loop

which is a 12% speed up. So the lesson is, micro-benchmarks are not a good
guide to whole-application benchmarks.





-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread alb
Hi Chris,

Chris Angelico ros...@gmail.com wrote:
[]
 Python 3.0 removed the 'u' for unicode in front of strings but due to
 popular demand to ease porting it was reinstated in 3.3.  Strip it away and
 you should be fine to go.
 
 Or upgrade to 3.3 or better; is there anything holding you on 3.2?
 Building CPython from source is pretty easy on Debian, and of course
 upgrading to Jessie will correspondingly upgrade you to a more recent
 Python (3.4, to be precise).

I moved recently from squeeze to wheezy in my production environment, 
I've nothing really holding me back on my current configuration...

I'll give it a try in the coming days.
Thanks for the prompt answer,

Al

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread alb
Hi Mark,
Mark Lawrence breamore...@yahoo.co.uk wrote:
[]
File 
 /home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py,
  line 48
  empty_fill = u'∙'
^
 SyntaxError: invalid syntax

[]
 
 Python 3.0 removed the 'u' for unicode in front of strings but due to 
 popular demand to ease porting it was reinstated in 3.3.  Strip it away 
 and you should be fine to go.

I'm not particularly comfortable in fiddling with the library source, 
even if the change seems really minor, therefore I guess that I'll 
upgrade to a more recent version of Python/Debian. 

But here I have another question, as a python novice is there really any 
reason for me to use any particular version of Python?

Should I start directly with the newest? What about 2.7?

Al
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-27 Thread David Palao
2015-05-27 9:30 GMT+02:00 alb al.bas...@gmail.com:
 Hi Mark,
 Mark Lawrence breamore...@yahoo.co.uk wrote:
 []
File 
 /home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py,
  line 48
  empty_fill = u'∙'
^
 SyntaxError: invalid syntax

 []

 Python 3.0 removed the 'u' for unicode in front of strings but due to
 popular demand to ease porting it was reinstated in 3.3.  Strip it away
 and you should be fine to go.

 I'm not particularly comfortable in fiddling with the library source,
 even if the change seems really minor, therefore I guess that I'll
 upgrade to a more recent version of Python/Debian.

 But here I have another question, as a python novice is there really any
 reason for me to use any particular version of Python?

 Should I start directly with the newest? What about 2.7?

 Al
 --
 https://mail.python.org/mailman/listinfo/python-list

Hi,
I would recommend to start with a 3.x Python. Perhaps 3.3 or 3.4? If
the version provided by your OS is older, you can always use a virtual
environment. Ask if you don't know about it.

Best
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-26 Thread Chris Angelico
On Wed, May 27, 2015 at 1:59 AM, Mark Lawrence breamore...@yahoo.co.uk wrote:
 On 26/05/2015 16:48, alb wrote:

 Hi everyone,

 I've installed the 'progress' module (ver 1.2) and I have the following
 error when used:

File
 /home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py,
 line 48
  empty_fill = u'∙'
^
 SyntaxError: invalid syntax

 I'm running in a virtual environment with python3.2

 Python 3.0 removed the 'u' for unicode in front of strings but due to
 popular demand to ease porting it was reinstated in 3.3.  Strip it away and
 you should be fine to go.

Or upgrade to 3.3 or better; is there anything holding you on 3.2?
Building CPython from source is pretty easy on Debian, and of course
upgrading to Jessie will correspondingly upgrade you to a more recent
Python (3.4, to be precise).

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


SyntaxError on progress module

2015-05-26 Thread alb
Hi everyone,

I've installed the 'progress' module (ver 1.2) and I have the following 
error when used:

  File 
/home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py,
 line 48
empty_fill = u'∙'
  ^
SyntaxError: invalid syntax

I believe I have some problems with unicode handling but it's just a 
rough guess.

I'm running in a virtual environment with python3.2 with the following 
configuration:

(venv)debian@debian:tex_tool$ pip list
pip (7.0.1)
progress (1.2)
pypandoc (0.9.7)
setuptools (15.0)

Any suggestions/comments/pointer is appreciated.

Al

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SyntaxError on progress module

2015-05-26 Thread Mark Lawrence

On 26/05/2015 16:48, alb wrote:

Hi everyone,

I've installed the 'progress' module (ver 1.2) and I have the following
error when used:

   File 
/home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py,
 line 48
 empty_fill = u'∙'
   ^
SyntaxError: invalid syntax

I believe I have some problems with unicode handling but it's just a
rough guess.

I'm running in a virtual environment with python3.2 with the following
configuration:

(venv)debian@debian:tex_tool$ pip list
pip (7.0.1)
progress (1.2)
pypandoc (0.9.7)
setuptools (15.0)

Any suggestions/comments/pointer is appreciated.

Al



Python 3.0 removed the 'u' for unicode in front of strings but due to 
popular demand to ease porting it was reinstated in 3.3.  Strip it away 
and you should be fine to go.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list