RE: Leo 4.8 rc1 released

2010-11-15 Thread Mikael B



> From: edream...@gmail.com
> Subject: Leo 4.8 rc1 released
> Date: Mon, 15 Nov 2010 09:06:01 -0800
> To: python-list@python.org
> 
> Leo 4.8 release candidate 1 is now available at:
> http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106
> 
> Leo is a text editor, data organizer, project manager and much more.
> See:
> http://webpages.charter.net/edreamleo/intro.html

I tried to install Leo  on ubuntu 10.10 with python 2.6.6

p...@prax-ms-7327:~/Hämtningar/Leo-4.8-rc1/leo/scripts$ sudo python 
LinixInstall.py 
* Installing Leo to /usr/lib/leo...
* Creating Leo startup script -> /usr/bin/leo
* Leo installed successfully - type 'leo filename.leo' to use it.


p...@prax-ms-7327:~$ leo  test.leo
python: can't open file '/usr/lib/leo/leo.py': [Errno 2] No such file or 
directory

What to do now?

/Mikael



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


try to use unicode

2010-11-19 Thread Mikael B

Hi.

I'm learning python. python 2.6.6 on ubuntu 10.10 I'm swedish so I try to use
unicode to get swedish characters. I've checked wikipedia.
utf-8 is said to be an unicode encoding..

this is the test program:

# -*- coding: utf-8 -*-

import readline

s=raw_input(u'Månadslön:')

and this is the output:

Traceback (most recent call last):
  File "test_uni.py", line 5, in 
s=raw_input(u'Månadslön:')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in position 1: 
ordinal not in range(128)

I'm doing something wrong...

Mikael

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


RE: try to use unicode

2010-11-19 Thread Mikael B



Date: Sat, 20 Nov 2010 08:47:18 +0100
From: stefan.sonnenb...@pythonmeister.com
To: mba...@live.se
CC: python-list@python.org
Subject: Re: try to use unicode



  



Meddelandetext
  
  
Am 20.11.2010 06:53, schrieb Mikael B:

  
  Hi.

  

  I'm learning python. python 2.6.6 on ubuntu 10.10 I'm swedish so I
  try to use

  unicode to get swedish characters. I've checked wikipedia.

  utf-8 is said to be an unicode encoding..

  

  this is the test program:

  

  # -*- coding: utf-8 -*-

  

  import readline

  

  s=raw_input(u'Månadslön:')

  

  and this is the output:

  

  Traceback (most recent call last):

File "test_uni.py", line 5, in 

  s=raw_input(u'Månadslön:')

  UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5'
  in position 1: ordinal not in range(128)

  

  I'm doing something wrong...

  

  Mikael

  


Your console is not unicode ready.

Please take a look at the locale command and vars like

LC_ALL, LC_LANG etc.



Aha...  Ok,thank you


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


RE: try to use unicode

2010-11-20 Thread Mikael B



From: mba...@live.se
To: python-list@python.org
Subject: RE: try to use unicode
Date: Sat, 20 Nov 2010 08:49:59 +0100










Date: Sat, 20 Nov 2010 08:47:18 +0100
From: stefan.sonnenb...@pythonmeister.com
To: mba...@live.se
CC: python-list@python.org
Subject: Re: try to use unicode



  



Meddelandetext
  
  
Am 20.11.2010 06:53, schrieb Mikael B:

  
  Hi.

  

  I'm learning python. python 2.6.6 on ubuntu 10.10 I'm swedish so I
  try to use

  unicode to get swedish characters. I've checked wikipedia.

  utf-8 is said to be an unicode encoding..

  

  this is the test program:

  

  # -*- coding: utf-8 -*-

  

  import readline

  

  s=raw_input(u'Månadslön:')

  

  and this is the output:

  

  Traceback (most recent call last):

File "test_uni.py", line 5, in 

  s=raw_input(u'Månadslön:')

  UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5'
  in position 1: ordinal not in range(128)

  

  I'm doing something wrong...

  

  Mikael

  


Your console is not unicode ready.

Please take a look at the locale command and vars like

LC_ALL, LC_LANG etc.



Aha...  Ok,thank you



But  I checked this out.. Gnome terminal is set to 'unicode utf-8 encoding'  
and locale command  returns

LANG=sv_SE.utf8
LC_CTYPE="sv_SE.utf8"
LC_NUMERIC="sv_SE.utf8"
LC_TIME="sv_SE.utf8"
LC_COLLATE="sv_SE.utf8"
LC_MONETARY="sv_SE.utf8"
LC_MESSAGES="sv_SE.utf8"
LC_PAPER="sv_SE.utf8"
LC_NAME="sv_SE.utf8"
LC_ADDRESS="sv_SE.utf8"
LC_TELEPHONE="sv_SE.utf8"
LC_MEASUREMENT="sv_SE.utf8"
LC_IDENTIFICATION="sv_SE.utf8"
LC_ALL=

if I remove the u before strings its works..  it must be a 8-bit subset 
of utf-8?

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


NZEC what is it?

2010-08-15 Thread Mikael B

Hi
 I use, among other things,  a site,  http://www.codechef.com  to learn python. 
I don't know what platform they use. I use  linux.

When I submit this little piece of  code to them:

import sys
import math

#main

s=sys.stdin.read()

int_list=s.split()

for a in int_list[1:]:
print math.factorial(int(a))


they generate a runtime error :NZEC   but I don't  (python 2.6)

What is NZEC  and what could cause it in these few lines of code?


Regards Mikael
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: NZEC what is it?

2010-08-15 Thread Mikael B



From: mba...@live.se
To: pyt...@mrabarnett.plus.com
Subject: RE: NZEC  what is it?
Date: Sun, 15 Aug 2010 19:58:44 +0200










> Date: Sun, 15 Aug 2010 18:22:54 +0100
> From: pyt...@mrabarnett.plus.com
> To: python-list@python.org
> Subject: Re: NZEC  what is it?
> 
> Mikael B wrote:
> > Hi
> >  I use, among other things,  a site,  http://www.codechef.com  to learn 
> > python.
> > I don't know what platform they use. I use  linux.
> > 
> > When I submit this little piece of  code to them:
> > 
> > import sys
> > import math
> > 
> > #main
> > 
> > s=sys.stdin.read()
> > 
> > int_list=s.split()
> > 
> > for a in int_list[1:]:
> > print math.factorial(int(a))
> > 
> > 
> > they generate a runtime error :NZEC   but I don't  (python 2.6)
> > 
> > What is NZEC  and what could cause it in these few lines of code?
> > 
> I googled for it and found that it means "non-zero exit code", perhaps
> due to an exception. Not a helpful message! :-)
> 
> What happens if you deliberately raise an exception, eg:
> 
>  raise ValueError

If I add to the end I just get 'ValueError'  I tried to add '1/0' but got 
'ZeroDivisionError'  Maybe I should try to add 'sys.exit(0)'  and see what 
happens if I submit again...
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: NZEC what is it?

2010-08-15 Thread Mikael B



> From: ian.g.ke...@gmail.com
> Date: Sun, 15 Aug 2010 17:39:57 -0400
> Subject: Re: NZEC what is it?
> To: python-list@python.org
> 
> On Sun, Aug 15, 2010 at 12:56 PM, Mikael B  wrote:
> > Hi
> >  I use, among other things,  a site,  http://www.codechef.com  to learn
> > python.
> > I don't know what platform they use. I use  linux.
> >
> > When I submit this little piece of  code to them:
> >
> > import sys
> > import math
> >
> > #main
> >
> > s=sys.stdin.read()
> >
> > int_list=s.split()
> >
> > for a in int_list[1:]:
> > print math.factorial(int(a))
> >
> >
> > they generate a runtime error :NZEC   but I don't  (python 2.6)
> >
> > What is NZEC  and what could cause it in these few lines of code?
> 
> Non-zero exit code.  Unless you're calling sys.exit, this normally
> means your program raised an uncaught exception.
> 
> In the case of your program, I believe that codechef currently uses
> Python 2.5.  The math.factorial function was added in Python 2.6, so
> it would not be available.
> 
> Cheers,
> Ian

Ahaa!Thank you.

regards Mikael




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


RE: is list comprehension necessary?

2010-10-26 Thread Mikael B




> 
> That's from the functional programming crowd.
> 
> Python isn't a functional language.  


A noob question: what is a functional language?  What does it meen?
  -- 
http://mail.python.org/mailman/listinfo/python-list