• 0 Posts
  • 30 Comments
Joined 1 year ago
cake
Cake day: August 25th, 2023

help-circle



  • The add function in the example above probably traverses the call stack to see what line of the script is currently being executed by the interpreter, then reads in that line in the original script, parses the comment, and subs in the values in the function call.

    This functionality exists so when you get a traceback you can see what line of code triggered it in the error message







  • There are like 10,000 different solutions, but I would just recommend using what’s built in to python

    If you have multiple versions installed you should be able to call python3.12 to use 3.12, etc

    Best practice is to use a different virtual environment for every project, which is basically a copy of an existing installed python version with its own packages folder. Calling pip with the system python installs it for the entire OS. Calling it with sudo puts the packages in a separate package directory reserved for the operating system and can create conflicts and break stuff (as far as I remember, this could have changed in recent versions)

    Make a virtual environment with python3.13 -m venv venv the 2nd one is the directory name. Instead of calling the system python, call the executable at venv/bin/python3

    If you do source venv/bin/activate it will temporarily replace all your bash commands to point to the executables in your venv instead of the system python install (for pip, etc). deactivate to revert. IDEs should detect the virtual environment in your project folder and automatically activate it









  • bjorney@lemmy.catoMemes@lemmy.mlEveryone loves snaps
    link
    fedilink
    arrow-up
    1
    arrow-down
    2
    ·
    1 year ago

    Disable automatic updates then. snap --help

    IMO snaps were prematurely pushed but that’s about it - they were a worse experience like two years ago when canonical started pushing them and almost every app had some quirk due to the sandboxing, but they have improved to the point that I literally can’t remember the last time I encountered an issue with the snap version of a program (granted I only really use snaps when something isn’t available as a .deb or there is a conflict)


  • It’s a package format that bundles all required libraries, that way you don’t run into the issue with program A requiring library version <1.1 and program B requiring library >1.3.

    It leads to larger binaries because these dependencies are bundled, but it solves the issue with old/minimally maintained software not working on new OS versions because they depend on an ancient version of libssl or something.


  • bjorney@lemmy.catoMemes@lemmy.mlEveryone loves snaps
    link
    fedilink
    arrow-up
    8
    arrow-down
    2
    ·
    edit-2
    1 year ago

    The webserver that canonical uses to distribute other people’s snaps is, and that’s it. APKs aren’t proprietary just because Google runs the Play store.

    If you don’t want to interact with canonical’s servers you can download the snap files from literally anywhere else and install them manually so you don’t have to touch a single line of non open source code.