Add ‘__name__ == __main__’ guard so the file can be imported
This commit is contained in:
		
							parent
							
								
									19fd5102cb
								
							
						
					
					
						commit
						df6a0f1007
					
				
							
								
								
									
										17
									
								
								pwned.py
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								pwned.py
									
									
									
									
									
								
							| @ -17,11 +17,14 @@ def lookup_pwned_api(pwd): | |||||||
|     return password_hit |     return password_hit | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| api_return = lookup_pwned_api(sys.argv[1]) | def main(args): | ||||||
| if (api_return): |     api_return = lookup_pwned_api(args[0]) | ||||||
|     print (sys.argv[1], "was found") |     if api_return: | ||||||
|     print ("Hash {0}, {1} occurences".format(api_return[0], api_return[1])) |         print(args[0], "was found") | ||||||
| else: |         print("Hash {0}, {1} occurences".format(api_return[0], api_return[1])) | ||||||
|     print (sys.argv[1], "was not found") |     else: | ||||||
|  |         print(args[0], "was not found") | ||||||
| 
 | 
 | ||||||
| exit() | 
 | ||||||
|  | if __name__ == '__main__': | ||||||
|  |     main(sys.argv[1:]) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user