Writing new python for weewx - python 2.7 or 3.X

69 views
Skip to first unread message

p q

unread,
Oct 5, 2019, 12:18:42 PM10/5/19
to weewx-user
Hi,

I'm starting a project to add earthquake data to my site. I know others have done so in the Belchertown skin and others. I want to roll my own because programming is fun.

Anyway, I'm going to start by writing the code and then figure out how to integrate it into Weewx. I mostly use Python 3.6. Weewx is on 2.7. If I write my code in 3.6, will I be able to call it from Weewx? I know it's not a straightforward question because I haven't decided how it will connect - it might be via Cheetah, it might be via loading in a graphic that I create elsewhere. I just don't know yet.

Thoughts?

vince

unread,
Oct 5, 2019, 12:34:40 PM10/5/19
to weewx-user
On Saturday, October 5, 2019 at 9:18:42 AM UTC-7, p q wrote:
Anyway, I'm going to start by writing the code and then figure out how to integrate it into Weewx. I mostly use Python 3.6. Weewx is on 2.7. If I write my code in 3.6, will I be able to call it from Weewx? I know it's not a straightforward question because I haven't decided how it will connect - it might be via Cheetah, it might be via loading in a graphic that I create elsewhere. I just don't know yet.


weewx 3.x requires python 2

weewx 4.x supports python2 and python3
(available as an alpha release at http://weewx.com/downloads/development_versions/ -  quite a few folks are running it under python3 now)

In many cases it's not too hard to support both versions of python but I guess it's your call whether you want to spend the time to do so.   You might want to look into which other extensions etc. you need on the weewx side and whether they're python3-compliant yet before you go too far down the road.


Reply all
Reply to author
Forward
0 new messages