Thank you for the answer, but...
i think now theres something wrong with the installation ?
I tried the new script, made a script button and get this message in the
log-pane:
exception executing script
File "C:\Dokumente und Einstellungen\******\.leo\scriptFile.py", line 13
^
SyntaxError: invalid syntax
--------------------
line 12:
When i open the scriptFile.py it looks like this:
# -*- coding: utf-8 -*-
#@+leo-ver=5
#@+node:Skript Test
#@@first
#import leo
for p in c.all_positions():
indent = '.' * p.level()
print('%s%s' % (indent,g.toUnicode(p.h))
#@-leo
The problem with "import leo" i handled with copying the sub-dir leo to the
python/lib/site-packages.
Am Dienstag, 6. November 2012 15:07:15 UTC schrieb Edward K. Ream:
>
> Note from EKR: I mistakenly banned this user, which trashed the message.
> I've unbanned the user, and here is the message:
>
> QQQ
> I started the scripting tutorial and the first lines
>
> for p in c.all_positions():
> indent = '.' * p.level()
> print('%s%s' % (indent,p.h))
>
>
> get me this error:
>
>
> "UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in position
> 3: ordinal not in range(128)"
> QQQ
>
> This script only works if no headline contains non-ascii text. Sorry
> about that. Here is a script that works, assuming your text is utf-8
> encoded::
>
> @first # -*- coding: utf-8 -*-
>
> for p in c.all_positions():
> indent = '.' * p.level()
> print('%s%s' % (indent,g.toUnicode(p.h))
>
> On Windows, this will print "byte hash" if the encoding of your character
> doesn't match the encoding of the console, but that is another matter :-)
>
> HTH. Unicode is a complex subject. Please feel free to ask more
> questions.
>
> Edward
>
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/leo-editor/-/6mR2PAL-eQ4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.