I subclassed StrPrinter to define my own printing of some of my
classes, and I can't seem to make xsym("*") work. I keep getting a
UnicodeDecodeError. Here is a code snippet of what I'm doing:
else:
if i == 0:
if isinstance(e.dict[
Well,
print xsym("*")
works, i.e. it prings a nice small *, i.e., when you do x*y in isympy,
this is the default behavior.
but when I put
xsym("*")
into a string that is used in the _print_Vector(self, e) function in
my subclass of StrPrinter, it doesn't print, instead it generates the
UnicodeDeco
The match function is the most important part of dsolve. It relies on
it heavily to determine what type an ODE is to see if it can solve it
and if so how. Unfortunately, it currently has some issues:
1) Issue 1429 (http://code.google.com/p/sympy/issues/detail?
id=1429&q=match). The following re
Luke wrote:
> Ok, thanks.
>
> Any ideas regarding the xsym("*") error?
Not really, I don't even know where this xsym comes from and what it
does, but maybe you are printing unicode to a non-unicode terminal?
Sebastian
--~--~-~--~~~---~--~~
You received this mes
Ok, thanks.
Any ideas regarding the xsym("*") error?
Thanks,
~Luke
On May 28, 6:26 pm, Sebastian wrote:
> Luke wrote:
> > Sebastian,
> > Thanks again for the responses, I really appreciate it. I was a
> > little confused in your second example, see below.
>
> > On May 28, 5:17 pm, Sebastian
Luke wrote:
> Sebastian,
> Thanks again for the responses, I really appreciate it. I was a
> little confused in your second example, see below.
>
> On May 28, 5:17 pm, Sebastian wrote:
>> Luke wrote:
>>> Sebastian,
>>> Thanks for the reply. I have read printer.py, str.py, and repr.py,
>>>
Sebastian,
Thanks again for the responses, I really appreciate it. I was a
little confused in your second example, see below.
On May 28, 5:17 pm, Sebastian wrote:
> Luke wrote:
> > Sebastian,
> > Thanks for the reply. I have read printer.py, str.py, and repr.py,
> > and am still confused a
Also, how can I get the xsym("*") character to display correctly?
When I do
print xsym("*")
it works fine, i.e., I get the small dot that looks nice. But in my
printing methods where I build the string for the outputs, and I do
something like:
s += print_pydy(e.dict[k]) + xsym('*') + k.__str__()
Luke wrote:
> Sebastian,
> Thanks for the reply. I have read printer.py, str.py, and repr.py,
> and am still confused as to how to properly customize Sympy's printing
> system.
>
> Suppose I want to put the _print_myclass(self, e) code into my
> subclass of StrPrinter. What methods should I k
Sebastian,
Thanks for the reply. I have read printer.py, str.py, and repr.py,
and am still confused as to how to properly customize Sympy's printing
system.
Suppose I want to put the _print_myclass(self, e) code into my
subclass of StrPrinter. What methods should I keep in the classes
themsel
Hi Luke,
I think all your questions are answered in the docstring of
printing/printer.py. There it tells you in which order it is tried to
print an object.
1) Let the object print itself if it has the method defined as printmethod.
2) Use the method defined in the Printer if available.
3) Use so
One thing I forgot to ask: I'm getting weird error messages when I
try to use the xsym("*") character. I had put it in my _sympystr_
method of one of my classes, and I keep getting the following error:
File "t.py", line 53, in
print 'print A[1]', Vector(sin(q1)*A[1] + cos(q1)*A[1])
File
Sorry, I accidentally clicked send before I had finished. A few
questions:
So here is part of my PyDyPrinter class:
class PyDyPrinter(StrPrinter):
printmethod = "_pydystr_"
...
def _print_sin(self, e):
name = str(e.args[0])
if name[0] == "q":
index = name[
I'm a little unclear about a few things with regards to how to
properly subclass StrPrinter.
On May 27, 5:08 pm, Ondrej Certik wrote:
> On Wed, May 27, 2009 at 6:05 PM, Luke wrote:
>
> > I like the first way for the fact that it just has 'x' instead of 'x
> > (t)', but I like the second way b
14 matches
Mail list logo