rst and pypandoc

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Mar 2 09:43:19 EST 2015


Dave Angel wrote:

> On 03/02/2015 08:51 AM, alb wrote:
>> Hi Steven,
>>
>> Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
>> []
>>> Since \r is an escape character, that will give you carriage return
>>> followed by "ef{fig:abc".
>>>
>>> The solution to that is to either escape the backslash:
>>>
>>> i = '\\ref{fig:abc}'
>>>
>>>
>>> or use a raw string:
>>>
>>> i = r'\\ref{fig:abc}'
> 
> Actually that'd be:
>     i = r'\ref{fig:abc}'


D'oh!

I mean, you spotted my deliberate mistake to check if you were paying
attention. Well done!


> How about "in" and "out"?  Or perhaps some name that indicates what
> semantics the string represents, like   "rst_string"  and "html_string"
> or whatever they actually are?

Can't use "in", it's a keyword.




-- 
Steven




More information about the Python-list mailing list