If you really need to use unicode symbols in the code, you can fix the
non-ascii char problem by adding this to the top of the file::
# -*- encoding: utf-8 -*-
...and then just copy&paste the ⨂ symbol directly into the code.
Or you could use::
>>> print repr("⨂")
'\xe2\xa8\x82'
>>> print '\xe2\xa8\x82'
⨂
Felix
On 04/20/2011 06:14 PM, [email protected] wrote:
The problem is that I am not able to create the u""" """ string in an
automatic manner (and if I just copy-paste from the isympy terminal I
get SyntaxError: Non-ASCII character)
for example pretty(pr) gives
J ⨂ J ⋅❘z:1,0⟩⨂ ❘y:1,1⟩
z x
Now to write a test I must search for ⨂ in a unicode table or in the
source. Is there an automatic way to get the \uXXX representation for
those characters.
I tried some stuff from
http://stackoverflow.com/questions/1207457/convert-unicode-to-string-in-python-containing-extra-symbols
and
http://docs.python.org/howto/unicode.html
but nothing very useful.
The branch is https://github.com/sympy/sympy/pull/186
Regards
Stefan
On 20 April 2011 17:25, Alexey U. Gudchenko <[email protected]
<mailto:[email protected]>> wrote:
20.04.2011 15:08, [email protected]
<mailto:[email protected]> пишет:
> Hi,
>
> I have a branch that is ready for review (and hopefully
inclusion) but I
> have left a few assert tests commented with a TODO tag. Those
tests deal
> with pretty printing and it would be nice to finish them, but
reconstructing
> unicode strings with escape characters is not very amusing.
>
> Is there any convenience function that will give me not only the
unicode
> string of a pretty print representation, but it will also
translate the
> non-ascii characters to \uXXXX substring?
>
> Regards
> Stefan
>
Hi,
What is the pull request number or the branch and repository or
the example?
I suppose that you can quite the contrary use u""" """ syntax (or
unicode() ) applying to expected etalon to compare it with resulted
unicode string.
--
Alexey U.
--
You received this message because you are subscribed to the Google
Groups "sympy" group.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
To unsubscribe from this group, send email to
[email protected]
<mailto:sympy%[email protected]>.
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.
--
You received this message because you are subscribed to the Google
Groups "sympy" group.
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/sympy?hl=en.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
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/sympy?hl=en.