With r/python out for the next 48 hours, here’s a post to promote continuing discussion a language we all love. Python.

  • csm10495 ( csm10495@sh.itjust.works ) 
    link
    fedilink
    English
    arrow-up
    10
    ·
    3 years ago

    I just made a PR to fix an issue with yt-dlp where Chrome now locks its Cookies file while running.

    Learned about a thing called “Shadow Copies”. Basically Windows allows you to sort-of snapshot files in a volume even while in use.

  • kakes ( kakes@sh.itjust.works ) 
    link
    fedilink
    English
    arrow-up
    7
    ·
    3 years ago

    I’ve been having fun making Discord bots that use ChatGPT to generate various things. Stuff like giving tarot readings, creating custom MtG cards and whatnot. Nothing too crazy, but it’s been fun to play around with.

      • 0jcis ( 0jcis@sh.itjust.works ) 
        link
        fedilink
        English
        arrow-up
        3
        ·
        3 years ago

        I tried Django at the beginning, it is very nice and I will most likely use it if I need to build a professional website, I wanted to understand and learn better how it all works and for my personal not serious website it was a perfect opportunity, so I started messing around and testing without a framework. Coding my own back-end is very fun for me and I’m learning a ton this way. Currently I am making an authentication system where if a client is not authenticated, it will get redirected to a login page where a code is displayed and a user has to send that code to my server’s whatsapp. Once the server validates the matching code from whatsapp, it will authorise the client and redirect back to the original requested page. This system will be perfect for me and my friends to access my website!

        • zeldis ( zeldis@sh.itjust.works ) 
          link
          fedilink
          English
          arrow-up
          3
          ·
          3 years ago

          Oh of course lol, I didn’t even realize where I was. And right on, sounds like a fun experience. I haven’t messed with async python too much myself but it seems like a powerful way to run a webserver

          • 0jcis ( 0jcis@sh.itjust.works ) 
            link
            fedilink
            English
            arrow-up
            3
            ·
            3 years ago

            Yes! Coding it is a blast! I started it just to better understand how all the HTTP communications work and I love customising my own personalised back-end, implementing new features and improving. I’m so hooked I can’t even sleep at nights, thinking about it.

  • neomis ( neomis@sh.itjust.works ) 
    link
    fedilink
    English
    arrow-up
    6
    ·
    3 years ago

    Switched jobs recently. So I’m building templates before I get bogged down. I took the opportunity to switch to poetry and pyproject.toml instead of setup.py which I’m liking. I got my file loader ETL template complete. Right now I’m trying to get a fastapi webbackend template. I’m used to nodejs & express for this and I’m finding fastapi is pretty similar. I got oauth2 working with the companies LDAP but right now I’m struggling to find good documentation for jwt with refresh tokens.

  • x2Zero7 ( x2Zero7@sh.itjust.works ) 
    link
    fedilink
    English
    arrow-up
    6
    ·
    3 years ago

    I’ve been making a simple 8-bit game with the pygamer board from adafruit/digikey and CircuitPython. It’s incredible to be able to run python on microcontrollers and it’s a really simple workflow, though customizing your environment can be a little difficult when working on a constrained platform.

    • TheDude ( TheDude@sh.itjust.works ) OP
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 years ago

      This is really cool! Do you have you code on github? How are you handling pictures? I noticed that the way obsidian and hugo do it are different (obsidian adds it in the same working folder while hugo has a specific folder to store images)

  • dirtyrig ( dirtyrig@lemmy.sdf.org ) 
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 years ago

    I am scheduled to present at Python Frederick in August. It is a Practical Business Python styled talk showing the utility of automating complex reporting with Jinja2 and docx templates. This annual report is a real world example using Jinja2.

    • SleepyHarry ( SleepyHarry@sh.itjust.works ) 
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 years ago

      While I love Python, it’s not the easiest language to do high freq low latency work on as I imagine algotrading would demand.

      How have you worked around this, if at all?

      I can’t find a way to word this that doesn’t sound really aggressive, the question is in good faith!

      • Bluetreefrog ( Bluetreefrog@lemmy.world ) 
        link
        fedilink
        English
        arrow-up
        4
        ·
        3 years ago

        Liberal use of libraries written in c (e.g. pandas, pytorch, numpy), some use of cython (not in the current version, but I have done so), and relying on time frames and strategies which have some tolerance for latency. If you trade five minutes after the start of a 1 day candle on the basis of where you expect it to be at close, it’s not such a big problem.

        It’s a losing game to try and out-pace the big end of town.

  • Barbarian ( Barbarian@sh.itjust.works ) 
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 years ago

    I write a lot of Python code for work. Mainly small utility scripts to link different APIs together, or trigger something to happen via API when a database table entry has certain columns with certain values.

    Not terribly complex work, but it pays well and takes very little time.

  • True Blue ( true_blue@sh.itjust.works ) 
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 years ago

    I haven’t decided if I’ll actually go through with it, but as a learning experience, I’ve been thinking about making little rewrites of some command line utilities (and maybe some original ones if I get any ideas) that output NestedText, instead of normal unstructured text. NestedText looks like a really cool data format. It’s basically exactly what I wished Yaml was, and the reference implementation is in Python so maybe it could be fun. Plus it’d give me a reason to try out the really cool looking Typer library.

  • Word of Mouth ( notroot@lemmy.sdf.org ) 
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 years ago

    Lots and lots at work…

    But my only real side project right now is a scheduler and supervisor… “If cron and supervisord had a super-powered love child”.

    I’m very close to releasing v1 so I’m not gonna jinx it by revealing too much, but it’s already in production use by two companies, one of which is enterprise-level, using it to process MASSIVE data somewhere in the entertainment industry… and yes, it’s gonna be FOSS, with MIT license.

    It emphasizes a declarative approach to reproducing clusters of orchestrated job-runners on low-cost cloud infrastructure. Makes it easy to scale and even map-reduce.

    Includes 3 interfaces: CLI (for everything), API (for most things), and UI (for most things).

    It’s gonna be sick heheh. I’ll be sure to come back here once you can pip install it.

  • bngo ( bngo@sh.itjust.works ) 
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 years ago

    I’ve been using scanpy in my biomedical engineering research! Basically allows me to analyze the RNA expressed in single cells and see things like what functional phenotype these cells can be, how they have developed, in addition to spatial information on their arrangement.

  • frostprophet ( frostprophet@infosec.pub ) 
    link
    fedilink
    English
    arrow-up
    3
    ·
    3 years ago

    I’m doing a python introduction course, I’ve made a hangman game and caeser cypher builder so far. It’s just started getting into dictionaries so it would probably have something to do with that