You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the following code from the examples on the docs page,
import schemdraw
from schemdraw import logic
with schemdraw.Drawing() as d:
d.config(unit=0.5)
d += (S := logic.Xor().label('S', 'right'))
d += logic.Line().left(d.unit*2).at(S.in1).idot().label('A', 'left')
d += (B := logic.Line().left().at(S.in2).dot())
d += logic.Line().left().label('B', 'left')
d += logic.Line().down(d.unit*3).at(S.in1)
d += (C := logic.And().right().anchor('in1').label('C', 'right'))
d += logic.Wire('|-').at(B.end).to(C.in2)
This throws the folloiwng error,
File "D:\Python codes\temp.py", line 11
d += (S := logic.Xor().label('S', 'right'))
^
SyntaxError: invalid syntax
Any idea why this is happening?
The text was updated successfully, but these errors were encountered:
I just tested it (Python 3.9.4, win 10, schemdraw 0.14) and works perfectly fine.
Seem's like you have issues with the walrus operator.
Are you sure you are using Python>3.8 (FYI https://docs.python.org/3/whatsnew/3.8.html)
Anyway, you can circumvent the issue by explicitly declaring de variables before adding it to the drawing :
S = logic.Xor().label('S', 'right')
d += S
On Wed, May 11, 2022 at 1:44 PM MehdiAitIghil ***@***.***> wrote:
I just tested it (Python 3.9.4, win 10, schemdraw 0.14) and works
perfectly fine.
Seem's like you have issues with the walrus operator.
Are you sure you are using Python>3.8 (FYI
https://docs.python.org/3/whatsnew/3.8.html)
Anyway, you can circumvent the issue by explicitly declaring de variables
before adding it to the drawing :
S = logic.Xor().label('S', 'right')
d += S
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFL3DLUYC6NVL6YBNKMCKB3VJOTRXANCNFSM5VUKJV5A>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
Pthyon 3.8
I'm using the following code from the examples on the docs page,
This throws the folloiwng error,
Any idea why this is happening?
The text was updated successfully, but these errors were encountered: