mirror of
https://github.com/dragoonDorise/EmuDeck.git
synced 2025-05-05 16:02:48 +00:00
Remove main function from appID.py (#1455)
We can save some lines, plus best practice is referencing sys.argv in __main__ block only.
This commit is contained in:
parent
dfb0dd3c1e
commit
251a3974cf
@ -17,16 +17,8 @@ def get_app_id(exe, appname):
|
|||||||
return id_int
|
return id_int
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
"""Get the two arguments and send them to get_app_id"""
|
|
||||||
exe = sys.argv[1]
|
|
||||||
appname = sys.argv[2]
|
|
||||||
|
|
||||||
print(get_app_id(exe, appname))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# If there aren't the correct number of arguments, fail with error
|
# If there aren't the correct number of arguments, fail with error
|
||||||
if len(sys.argv) != 3:
|
if len(sys.argv) != 3:
|
||||||
sys.exit("Not enough arguments")
|
sys.exit("Not enough arguments")
|
||||||
main()
|
print(get_app_id(sys.argv[1], sys.argv[2]))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user