Python Forum
i need a module for more involved command line parsing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i need a module for more involved command line parsing
#4
Essentially, a decorator allows you to put extra behaviour around a function (i.e. before/after it). They do this by returning a new function that does what the original one does but between that extra behaviour (and hence, a decorator is a higher order function).

In Flask, a decorator (Flask.route is used to associate request handling functions with URL paths. The extra behaviour in this case is to basically store that association in a dictionary, so that when a request for a particular path comes in, the correct function can be called. In my codebase at work (albeit in Scala, not Python), we're using the decorator idea to record metrics on the response times in our application.
Reply


Messages In This Thread
RE: i need a module for more involved command line parsing - by ndc85430 - Aug-25-2019, 05:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  module either imported by a command or itself run as a command Skaperen 2 718 Dec-04-2023, 03:15 AM
Last Post: Skaperen
  review of command line parsers Skaperen 2 2,162 Mar-11-2021, 07:39 PM
Last Post: Skaperen
  command line options Skaperen 5 2,784 Aug-14-2020, 08:48 AM
Last Post: DeaD_EyE
  opening python from the command line takes a long time to load? abdulkaderanwar 4 3,178 Jun-22-2020, 03:42 AM
Last Post: abdulkaderanwar
  f-string in command line arguments Skaperen 0 1,695 May-05-2020, 11:49 PM
Last Post: Skaperen
  my own command line option parser Skaperen 0 1,714 Mar-27-2020, 04:14 AM
Last Post: Skaperen
  want suggested module for e-mail parsing Skaperen 0 1,596 Jul-26-2019, 08:52 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020