What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-10 07:20:02
hwo to except every error in python try statemen
try: print "Performing an action which may throw an exception." except Exception, error: print "An exception was thrown!" print str(error) else: print "Everything looks great!" finally: print "Finally... Add solution -
Python 2022-02-28 07:55:13
checking number of connected users hotspot ubuntu
#!/usr/bin/python3.6 import subprocess import re import requests # Store Mac address of all nodes here saved = { 'xx:xx:xx:xx:xx:xx': 'My laptop', } # Set wireless interface using ifconfig interface = "wlp4s0" mac_regex = re.compile(r'... Add solution -
-
Python 2022-02-24 14:25:01
how to find the no of user for a wifi using python for ubuntu
""" Search for a specific wifi ssid and connect to it. written by kasramvd. """ import os class Finder: def __init__(self, *args, **kwargs): self.server_name = kwargs['server_name'] self.password = kwarg... Add solution -
Python 2022-02-15 09:30:14
how to use try except in while loop in python
while True: try: num = int(input("Enter an int: ")) except Exception as e: print(e) else: print("Thank you for the integer!") break# Enter an int: a# invalid literal for int() with base 10: 'a'# Enter an int: 3# Thank yo... Add solution -
Other 2022-02-02 10:36:02
Duplicate entry Exception
import java.lang.Exception try: #Your insert statement here except Exception, e: # Catches any python errors except java.lang.Exception, e: #SQL Integrity errors come as Java errors so you need java.lang.Exception if "Duplicate entry&quo... Add solution -
Python 2022-02-01 03:56:57
except do nothing python
try: do_something() except Exception: pass Add solution