Not without changing how parse_expr works. It uses the syntax of the
Python it runs in, and Python 2 doesn't allow non-ASCII identifiers.
You can make it work with Symbol(u'γ') (i.e., manually wrap it with
Symbol). Or set
Gamma = Symbol(u'γ')
and use Gamma in the code. You can also just use "gamma", but you'll
have to remove it from the default locals ('gamma' defaults to the
gamma function).
Aaron Meurer
On Mon, Apr 4, 2016 at 12:39 AM, Jason Moore <[email protected]> wrote:
> Python 2 does not support unicode variable names:
>
> http://stackoverflow.com/questions/2649544/unicode-identifiers-in-python
>
> Can you paste the code you are trying to execute so we can see what you are
> trying to do?
>
>
> Jason
> moorepants.info
> +01 530-601-9791
>
> On Sun, Apr 3, 2016 at 6:05 PM, Diego Mundo <[email protected]> wrote:
>>
>> Trying to use 'γ' as a custom variable in parse_expr with python 2. ...Is
>> this at all possible? I was able to do it with python 3, but my particular
>> project requires python 2.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/sympy.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/834a1f6a-2df9-4084-a833-a7fecb644159%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAP7f1AjMuOb0iwy6KgxSH%2BnOBsUOZ0WqHxmC3xmNDz5J1-txoQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CAKgW%3D6%2Bg_SPzMt53tAvusiktrcbrxCuV1hODCtoFgry%3DyFJG%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.