Search the Community
Showing results for tags 'python3'.
Found 2 results
Alfred-Workflow installs with pip for python3, but on usage it calls modules that don't exist in python3. Is there a way around this, or do scripts need to be run with python 2? Will this change in the future? Very new to this, trying to setup my own simple workflow.
Hello. I try to write my first script filter plugin, but I've encountered a unexpected trouble with Unicode (non-ASCII) characters. This is a simplest example I could invent: xmloutput = """ <?xml version="1.0" encoding="utf-8" ?> <items> <item arg="testitem"> <title>FooBar</title> <subtitle>foo bar is a test item</subtitle> <icon>icon.png</icon> </item> </items> """ print(xmloutput) (I call it from script filter as /usr/local/bin/python3 outputtest.py.) It works fine until I want to add some non-ASCII characters: xmloutput = """ <?xml version="1.0" encoding="utf-8" ?> <items> <item arg="testitem"> <title>FooBær</title> <subtitle>foo bær is a «test item»</subtitle> <icon>icon.png</icon> </item> </items> """ print(xmloutput) Then it fails: [ERROR: alfred.workflow.input.scriptfilter] Code 1: Traceback (most recent call last): File "outputtest.py", line 12, in <module> print(xmloutput) UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 88: ordinal not in range(128) Why it happens? I can't believe that Alfred do not use Unicode in input/output. I think the root of problem in something else, but I can't find out where is it.