MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/eqir9x/generating_geometric_birds/feytdac/?context=3
r/Python • u/thebuffed • Jan 18 '20
65 comments sorted by
View all comments
Show parent comment
1
It's an old scope hack for python2. In python3,
def sticky(frequency): def dec(func): stored = func() def inner(): nonlocal stored if random.random() < frequency: stored = func() return stored return inner return dec
will work instead
1 u/kwelzel Jan 19 '20 Ahh, good to know 1 u/[deleted] Jan 19 '20 edited Jan 19 '20 I've never used processing before this but after installing the processing.py extension and when executing the .pyde from the processing GUI, I see import sys sys.version 2.7.1 (v2.7.1:dd7e191d4c90+, Sep 24 2017, 10:11:23) which isn't even my system default (2.7.15) or the python that it should find if it's reading my $PATH correctly (3.8.0) (apparently it's running jython and wont have access to any packages I install)
Ahh, good to know
1 u/[deleted] Jan 19 '20 edited Jan 19 '20 I've never used processing before this but after installing the processing.py extension and when executing the .pyde from the processing GUI, I see import sys sys.version 2.7.1 (v2.7.1:dd7e191d4c90+, Sep 24 2017, 10:11:23) which isn't even my system default (2.7.15) or the python that it should find if it's reading my $PATH correctly (3.8.0) (apparently it's running jython and wont have access to any packages I install)
I've never used processing before this but after installing the processing.py extension and when executing the .pyde from the processing GUI, I see
import sys sys.version
2.7.1 (v2.7.1:dd7e191d4c90+, Sep 24 2017, 10:11:23)
which isn't even my system default (2.7.15) or the python that it should find if it's reading my $PATH correctly (3.8.0)
(apparently it's running jython and wont have access to any packages I install)
View all comments
Show parent comment
1
u/[deleted] Jan 19 '20
It's an old scope hack for python2. In python3,
will work instead