Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Matthew Feickert
    @matthewfeickert

    Hey all. If you're like me and you like using python3 -m venv for virtual environments but also want some fast venv switching at the command line (Linux/MacOS) then might try this dead simple Bash script of mine — venv-activate— for venv creation and tab complete assisted venv switching. :wave:

    https://github.com/matthewfeickert/venv-activate

    Michael Kennedy
    @mkennedy_twitter

    Hi @matthewfeickert That’s cool! I definitely recommend using something like this. I have this aliased in my shell:

    ```

    venv => python3 -m venv venv && . venv/bin/activate && pip install -U pip setuptools &> /dev/null
    create, activate, and freshen up pip all in one shot.
    Matthew Feickert
    @matthewfeickert

    @mkennedy_twitter Indeed. Hard to get more lightweight than that. :) You make a good point though that there isn't really a clear use case to not upgrade and install pip, setuptools, and wheel — so I've fixed it. :+1:

    The main reason I do a Bash functions rather than something like the above is just because I want to use (some) virtual environments in more ways then just being bound to a single project, and being able to know that if I want physics and stats libraries that I can just tab complete my way there is worth it to avoid interruption at times. :)

    Rick Yentzer
    @ryentzer
    I'm having trouble with the refactoring views with Flask blueprints section. I'm not using requests like it's used in the videos, I'm returning render_template(...) I've created a gist so that you can see my code. app-mod.py is how I got it to work after reading Flask docs. app.py is close to what is used in the course video. https://gist.github.com/ryentzer/c67af920790d750cc2ac1a1223ab501b
    Michael Kennedy
    @mkennedy_twitter
    Hi @_ChrisMay_twitter Agree on your 10 years, 3 framework options. :)

    @ryentzer The problem with blueprints is that Flask does not run your main method. If you start your app as flask run rather than python app.py, it won’t work as is. Also, PyCharm can sometimes detect Flask projects and implicitly use flask run. The fix is to add an else to the main invocation:

    ```

    if __name__ == '__main__':
        main()
    else:
        register_blueprints()
       # and stuff like setup DB that would have been done in main
    Rick Yentzer
    @ryentzer
    That's very helpful. Thanks!
    Michael Kennedy
    @mkennedy_twitter
    @DaddyOh That’s pretty interesting! I bet you’re happy to be moving from PHP to modern Python. :) I’ve heard good things about FastAPI.
    Roger Ying
    @rogerying
    Does anyone get problems with ‘ReferenceError: weakly-referenced object no longer exists” from time to time... and how to solve it?
    def __record_purchase_and_transaction(user, order, charge, amount_paid: float, description: str, payment_type: str,
                                          payment_method: str):
        mongosetup.init_db()
    
        payment = Purchase(payment_type=payment_type,
                           payment_method=payment_method,
                           description=description,
                           paid=True,
                           amount_paid=amount_paid,
                           date_initiated=datetime.datetime.now(),
                           currency_paid=charge.currency,
                           stripe_charge_id=charge.id,
                           item_fee_amount=order.item_total_cost,
                           service_fee_amount=order.service_cost)
    
        order.status = 3  # just for sake of saying that order has been paid + received
        order.purchase_details = payment
        order.save()
    That’s the code that’s causing me trouble... is it because the Order object has been referenced somewhere else? Do I need to recall it from the mongodb?
    Jaren A. Edwards
    @XonViegand_RBLX_twitter
    Hello.
    Can anyone review my text adventure game?
    Its still in its first versions.
    I want someone to tell me what I can do to extend the gameplay without simply doing the same tedious things.
    Like stories, plots, something.
    'code'
    Do you want a portion of code for an example?
    Roger Ying
    @rogerying
    Another question I had was: combining python for entrepreneurs and mongodb; how do you refer to the unique mongodb object from html? Objectid is a bson object and I’m trying to refer to objects passing through as links using {id} in the links
    Thanks
    Jacqueline Wilson
    @jaclynn1_twitter
    Pycon registration now open
    Daniel Söderling
    @dsod
    Would love to see some course&/episode about graphql
    Any future plans of covering that? 🙂 Also... Thank you for all ur awesome content @mkennedy_twitter
    Michael Kennedy
    @mkennedy_twitter
    Thanks @jaclynn1_twitter ! Exciting. Hope to see you there.
    Hi @dsod Ok, thanks for the ideas. Nothing yet planned but will keep it in mind.
    Hi @rogerying "how do you refer to the unique mongodb object from html? Objectid is a bson object and I’m trying to refer to objects passing through as links using {id} in the links".
    You just need to come up with some sort of unique identifier. It could be the id itself, but often it's some other thing. Like for example, here is the HTML part from the course listing page that links to the courses:
    <a href="/courses/details/python-language-jumpstart-building-10-apps">

    This part is just the routing to a certain view: /courses/details/ and this part is that unique ID: python-language-jumpstart-building-10-apps.

    When the view is loaded, just do a query in MongoEngine: Course.objects(url=url_part).first()

    Alexander Hultnér
    @Hultner
    @dsod @mkennedy_twitter I've worked extensibly with GraphQL for a 50 000 employee company as part of small team with 8 engineers building their new flagship product, I can not talk about specifics about that particular customers internal codebase but I do have some experience of working with GraphQL
    We also had external companies consuming our API
    The software is running behind the scenes at places such as some of the largest airports in the world, world renowned universities, hospitals and large international enterprises
    Pax
    @paxcodes
    Hello, everyone! After ~1 year of listening to the podcast and hearing Linode ads, I finally have a personal project and decided to go with Linode. I tried using the coupon code PYTHON17 but it "is either expired or invalid." Help?
    Michael Kennedy
    @mkennedy_twitter
    Hi @paxcodes Thanks! I think they have a new one now. Over at talkpython.fm/linode it’s PYTHON2020 :)
    Pax
    @paxcodes
    Thanks, @mkennedy_twitter !
    parity3
    @parity3
    I'm trying to find the name of that library that is a wrapper around temp file that renames on close to the final file name. It may have been mentioned in python bytes, not sure. Pretty sure it was mentioned within the last 12 months. Anyone recall?
    parity3
    @parity3
    hmm. I think I'll just go with the code here (thanks @mitsuhiko)
    Pax
    @paxcodes

    Hello fellow TPTM listeners, I'm looking for a coding buddy --- someone to code with on Saturdays (or every other Saturday) for 4 hours. I want to be more consistent working on my personal projects so I’m looking for someone to be accountable to while also helping each other: having someone to bounce ideas off, share learning resources with, help in research, etc.

    What I Can Help You With
    I’ve finished AppBrewery's Complete Flutter (App Development) Bootcamp [with Dart]. I’ve done projects in Python and also a full-stack web developer in a previous life so I know my way with front-end tech. You can find my code in GitHub (/paxcodes). I also have Python / Full-Stack projects I've completed for work but not available in GitHub: A lot of creating automation tools: backend API and CLI apps in Python, Vue for frontend, and a tiny bit of Docker.

    What You Can Help Me With
    I have a personal app/hobby project in Flutter with FastAPI as the backend API. I’m using the pattern in tiangolo’s cookiecutter full-fastapi-postgres… (+ dockerswam.rocks) for deployment, deploying in Linode.

    If you feel like I can help you with your personal project, and you can help me in mine, please give me a shout...or maybe you're a senior interested in mentoring a beginner-intermediate person like me, that's cool, too! 😅

    (This message is quite long. Feel free to delete @mkennedy_twitter if not appropriate. 😊 )

    davidberglund
    @davidberglund
    @mkennedy_twitter: wanted to drop by and thank you for an awesome podcast! Never thought to check if there was a related chat thingy, cool!
    I'm a Python dev in Sweden since a couple of years. I'm actually very keen on getting in touch with other more experience devs out there since I don't have any dev colleagues on the job (not in previous jobs either, well, a few front end coders but nobody using Python). So while I really enjoy the job it can be hard to know if I'm following good practices or if I'm doing something completely bonkers from time to time :P I think I'm mainly concerned about the day to day dev and deploy flow and how "real devs" set up their environments. Sebastian Witowski's developers toolkit video is definitely on the list to watch. I'd love to learn about other similar resources on workflow related things!
    Michael Kennedy
    @mkennedy_twitter

    I'm trying to find the name of that library that is a wrapper around temp file that renames on close to the final file name. It may have been mentioned in python bytes, not sure. Pretty sure it was mentioned within the last 12 months. Anyone recall?

    It was on https://pythonbytes.fm/episodes/show/180/transactional-file-io-with-python-and-safer

    Called safer I think. :) It’s a great idea.
    <— @parity3
    Hi @davidberglund You’re most welcome. It’s great to provide this community for folks who work in semi isolation (really by themselves or just the only python dev). :)
    parity3
    @parity3
    awesome thanks! better late than never!
    Alexander Hultnér
    @Hultner
    @davidberglund I’m also a Swedish Python Developer, we have a Facebook-group for us Nordic Python users: https://facebook.com/groups/151726878977681/?ref=group_browse
    And there’s PyCon Sweden every year (remote this time) https://www.pycon.se
    Torwag
    @torwag
    @mkennedy_twitter Hey, would it be possible / or is it possible, that the community could ask questions to your next guest. That is, if you announce your next guest early enough, people might write you questions they have and within your interview you could have a section "Questions of the community" and read them to get them answered.
    Philipp Gerhard
    @pgerhard
    Hello everyone. I am currently mainly developing in Java using the Spring Framework. However i would like to get more into Python among other languages. One of the things I like to most about Spring Framework/Spring Boot is the whole ecosystem it provides (it covers most things from core techniques, implementing enterprise integration patterns such as messaging, monitoring applications and cloud patterns such as service discovery). Is there something similar in Python?