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
#11
i've done so much programming in assembly and C, where nothing to very little was available as tools (i did write a lot of my own) that doing things myself, without such tools, is just "second nature" to me. without argument parsing tools, i just wrote loops in a few hundred projects. with C there was getopt() and i started in C using it. but it could not do what i had already decided doing based on my experience with commands. even today, i write commands that "figure out" arguments and configuration "in context" rather than depend on lots of specific options, where i can. for example, in cloud programming, i have a big script that understands dozens of possible meanings of argument strings. if the string matches one of the region names, then i know a region was named. it does not need a "--region" option or need to be in a specific position. command line and config file parsing is something i have handled a lot and now can do very well. for Python, though, i have changed how i do config files: i read in the whole file, pass it to exec() with an empty dictionary, and use whatever it put in there.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
RE: i need a module for more involved command line parsing - by Skaperen - Aug-28-2019, 07:09 PM

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