Coverage for cmds/calc.py: 43%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2calc.py
4contains calc
5"""
7import urllib.parse
8import error
10async def calc(*args):
11 """
12 calc
14 "calculates" the given arguments
15 """
17 # fix args
18 args = args[1:]
20 # check if there are any arguments
21 if not args:
22 raise error.ArgumentRequiredError
24 # return output
25 return f"https://www.google.com.au/search?q={urllib.parse.quote(' '.join(args))}"