Code Monkey home page Code Monkey logo

Comments (4)

linusg avatar linusg commented on May 23, 2024

The behavior you describe is not always true. In Python 3 for example, 2/3 returns the expected 0.6666666666666666, and using a __future__ import we can achieve the same in Python 2:

>>> 2/3
0
>>> from __future__ import division
>>> 2/3
0.6666666666666666
>>> 

So aac5208 will fix it. Thanks for reporting this, though!

BTW I would encourage everyone to finally give up using Python 2. IMHO it has too much annoying behavior and its final EOL in less than two and a half years: https://pythonclock.org/.

from rpi-backlight.

linusg avatar linusg commented on May 23, 2024

Alright it's on PyPI now. Please test and report back if it works for you!

from rpi-backlight.

pkscout avatar pkscout commented on May 23, 2024

Thanks. That did it. And I'll look at migrating this project to Python 3.x. '-)

I mostly do Kodi addons, and their internal python interpreter is 2.7.x, so I haven't really had a need to look at 3 much.

from rpi-backlight.

linusg avatar linusg commented on May 23, 2024

Glad I could help!
This may be off-topic, but I want to mention: folks need to hurry. Two years is not as much time, and as you've noticed, many popular software uses still Python 2 internally. I was not aware that Kodi is, but I know parts of Debian and its forks do. Luckily, Python has much less critical security issues than let's say PHP 😉

from rpi-backlight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.