Created
June 17, 2015 13:19
-
-
Save squarefrog/04b256891499f42c6473 to your computer and use it in GitHub Desktop.
Workaround for multiline Alfred input in a Python workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Pasting in multiline text, eg: | |
This is | |
some text | |
fails when using the following, Alfred provided starting point. | |
''' | |
# Breaks ALL the things.. | |
query = '{query}' | |
''' | |
As the query is dynamically replaced it raises an exception as python strings | |
are not permitted to wrap over multiple lines (unless escaped) | |
This can be solved however, using a triple quote: | |
''' | |
# Oh neat! | |
query = '''{query}''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment