File: chars.py

package info (click to toggle)
python-sqt 0.8.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 824 kB
  • sloc: python: 5,964; sh: 38; makefile: 10
file content (25 lines) | stat: -rw-r--r-- 444 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3
"""
Print the number of characters in a string.
"""
from sqt import HelpfulArgumentParser

__author__ = "Marcel Martin"


def add_arguments(parser):
	arg = parser.add_argument
	arg('string', help='The string')


def main(args=None):
	if args is None:
		parser = HelpfulArgumentParser(description=__doc__)
		add_arguments(parser)
		args = parser.parse_args()

	print(len(args.string))


if __name__ == '__main__':
	main()