What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-15 22:35:02
python print in color
def colored(r, g, b, text): return "\033[38;2;{};{};{}m{} \033[38;2;255;255;255m".format(r, g, b, text) text = 'Hello, World' colored_text = colored(255, 0, 0, text) print(colored_text) #or print(colored(255, 0, 0, 'Hello, World')) Add solution -
Python 2021-09-15 22:08:03
python openstreetmap multiple latitude
# ... coordinates = [] for result in results: coordinates.append((result[5], result[6])) lat_center = sum([coordinate[0] for coordinate in coordinates]) / len( coordinates ) lng_center = sum([coordinate[1] for coordinate in coordinates]) / len( ... Add solution -
Other 2021-09-15 12:45:03
pynput detect mouse click
from pynput.mouse import Button, Controller mouse = Controller() # Read pointer position print('The current pointer position is {0}'.format( mouse.position)) # Set pointer position mouse.position = (10, 20) print('Now we have moved it to {0}'.forma... Add solution -
Python 2021-09-15 12:19:04
python multiprocessing terminate
You might run the child processes as daemons in the background. process.daemon = True Any errors and hangs (or an infinite loop) in a daemon process will not affect the main process, and it will only be terminated once the main process exits. This will ... Add solution -
Python 2021-09-15 06:24:03
simple calculator in python
#Store number variables for the two numbers num1 = input('Enter first number: ') num2 = input('Enter second number: ') #the sum of the two numbers variable sum = float(num1) + float(num2) sum2 = float(num1) - float(num2) sum3 = float(num1) * float(num2)... Add solution -
Html 2021-09-14 19:10:02
allintitle:uploadbutton html
1<!doctype html> 2<html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>Upload Button Examples</title> 6 <link rel="stylesheet" href="../themes/default/default.css" /> 7 <... Add solution -
Other 2021-09-14 17:19:01
local variable 'distro_name' referenced before assignment
// Solution for Python 3.8, procedure for other version might be a little different. Edit the file: .../anaconda3/lib/python3.8/site-packages/anaconda_navigator/api/external_apps/vscode.py" Add "DISTRO_NAME = None" at line 159 in the func... Add solution