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
#5
(Aug-25-2019, 03:04 AM)Skaperen Wrote: now i really need to understand decorators and what they do.
Not really,there is no problem teaching someone Click that don't know what a decorator is.
It's make the interface a lot cleaner eg using @click.command() than have all code make it up in the interface.

It' really the same for most libraries with or without decorator requests.get('https://python-forum.io/').
I do not all need to see the eg 50 lines of code of requests.get() to use it.

A decorator is easy in it's core.
def make_bold(fn):
    '''Do not need to see me'''
    def new_func():
        return f"<b>{fn()}</b>"
    return new_func
User only need to add @make_bold,the name give a hint what it dos or make documentation for it.
@make_bold
def foo():
    return 'python-forum'

print(foo())
Output:
<b>python-forum</b>
Reply


Messages In This Thread
RE: i need a module for more involved command line parsing - by snippsat - Aug-25-2019, 08:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  module either imported by a command or itself run as a command Skaperen 2 648 Dec-04-2023, 03:15 AM
Last Post: Skaperen
  review of command line parsers Skaperen 2 2,120 Mar-11-2021, 07:39 PM
Last Post: Skaperen
  command line options Skaperen 5 2,733 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,090 Jun-22-2020, 03:42 AM
Last Post: abdulkaderanwar
  f-string in command line arguments Skaperen 0 1,640 May-05-2020, 11:49 PM
Last Post: Skaperen
  my own command line option parser Skaperen 0 1,690 Mar-27-2020, 04:14 AM
Last Post: Skaperen
  want suggested module for e-mail parsing Skaperen 0 1,567 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