<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Python Tip #120 (of 365):]]></title><description><![CDATA[<p>Python Tip #120 (of 365):</p><p>Optimize for CLI user experience, not just developer experience</p><p>By default in argparse, the names that end users see for arguments are coupled to the attribute names that you as a Python script maintainer see.</p><p>Decouple them when needed.</p><p>You can control the argument names that a user sees with metavar:</p><p>This uses the attribute args.path but show users FILENAME in help text:</p><p>parser.add_argument("path", type=Path, metavar="FILENAME")</p><p>🧵 (1/2)</p><p><a href="https://mastodon.social/tags/Python" rel="tag">#<span>Python</span></a> <a href="https://mastodon.social/tags/DailyPythonTip" rel="tag">#<span>DailyPythonTip</span></a></p>]]></description><link>https://board.circlewithadot.net/topic/06fdcf98-caaf-456b-a8c2-a2b3e6c83243/python-tip-120-of-365</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 00:32:38 GMT</lastBuildDate><atom:link href="https://board.circlewithadot.net/topic/06fdcf98-caaf-456b-a8c2-a2b3e6c83243.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Apr 2026 18:21:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Python Tip #120 (of 365): on Thu, 30 Apr 2026 18:21:01 GMT]]></title><description><![CDATA[<p>Also consider adding a description to describe your script and help to each argument:</p><p>parser = argparse.ArgumentParser(<br />    description="Compute emoji-hash for input text/file",<br />)<br />parser.add_argument(<br />    "path",<br />    type=Path,<br />    metavar="FILENAME",<br />    help="Input file to emoji-hash",<br />)</p><p>Developer experience DOES matter but don't forget the users.</p><p>You're welcome to leave these customizations to the finishing touches of your Python CLI, but don't forget them!</p><p>🧵 (2/2)</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/users/treyhunner/statuses/116495041264071813</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/users/treyhunner/statuses/116495041264071813</guid><dc:creator><![CDATA[treyhunner@mastodon.social]]></dc:creator><pubDate>Thu, 30 Apr 2026 18:21:01 GMT</pubDate></item></channel></rss>