Help Creating a Function - Python Discussions
Sep 3, 2024 ... You are on the right track, but a few things are missing: You try to append something to a variable name that does not yet exist.
Sep 3, 2024 ... You are on the right track, but a few things are missing: You try to append something to a variable name that does not yet exist.
Python is not a purely functional programming language, and though it pains me sometimes, I will prefer an imperative style over a functional one in places where it just fits the language better. A good example are the built-in collection types (list, set, dict).
Feb 5, 2023 ... So, radius = float() what? You need to give it a number. Then call your function from within the print() function call. Here is a very simple ...
For my real use case (create an app and an msi installer for Mercurial) it would be great that pip install would be available within the Python used for the app in order to manage Mercurial extensions. For this, you’ll want to treat pip as one of your application dependencies.
May 23, 2022 ... Consider a Module as a code library file containing a set of functions you want to include in your application. Using your example, random ...
Mar 30, 2025 ... It's a fantastic language to learn and super beginner-friendly. Here's a quick guide to help you get started: First, you'll need to install ...
How do I write async file list/download? I can’t think of a way to get around the double-await (ie awaiting on a list of awaitables). Here’s a synchronous version of my logicMy full example (which is hidden in a collapsible) has all the functions needed to have a running program.
Sep 20, 2024 ... Do a tutorial on Youtube. I like the Indently tutorials. I just like his style. I like that he starts with 1 concept at a time and only adds ...
Minimal example. Code: # main.py import cmd import asyncio. class MyShell(cmd.Cmd): async def do_myaction(self, arg): # this async task is not executed anymore, program immediately #. exited, as do_myaction is not blocking. await asyncio.sleep(5).
Jul 4, 2023 ... ... code which does processing and why. I like to know this when I add new function to the application - what goes in what sub folder.
Apr 30, 2024 ... inspect.getsource(foo) doesn't work for me… I'm not sure why the difference, but would suggest printing source ; does it contain the body of ...