What do you want to save?
Add Code snippet
New code examples
-
Other 2021-10-06 03:22:03
github python gitignore
#official python gitignore # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ share/p... Add solution -
Python 2021-10-05 02:32:04
python mock assert called n times
assert_has_calls is another approach to this problem. From the docs: assert_has_calls (calls, any_order=False) assert the mock has been called with the specified calls. The mock_calls list is checked for the calls. If any_order is False (the default) ... Add solution -
Shell/Bash 2021-10-04 08:03:02
how to host a discord bot on a raspberry pi
#how to create and host a Discord Bot on a rasberry pi 1. Navigate to the Discord Developer Console 2. Click "New App" 3. Give it a name, and then click "Create App" 4. Click "Create a Bot User" 5. Keep note of the Token, as... Add solution -
Python 2021-10-02 23:22:03
python split by newline
# Using str.splitlines() method, you can split a string by new lines # Example 1 string = "Line 1\nLine 2\nLine 3\nLine4" string = string.splitlines() print(string) # OUTPUT ['Line 1', 'Line 2', 'Line 3', 'Line4'] # Example 2 string = "&q... Add solution -
Python 2021-10-01 09:06:02
python cherrypy
# install cherrypy (basic, if path is not set yet) py -m pip install cherrypy # or set PATH to use pip: setx PATH "%PATH%;C:\<path\to\python\directory\>\Scripts" pip install cherrypy # or pip3 install cherrypy --upgrade # if "connecti... Add solution -
Python 2021-10-01 03:42:06
github python project
How to install Python package from GitHub? I want to use a new feature of httpie. This feature is in the github repo https://github.com/jkbr/httpie but not in the release on the python package index https://pypi.python.org/pypi/httpie How can I install ... Add solution -
Python 2021-09-30 17:42:04
python bottle install
# install bottle (basic, if path is not set yet) py -m pip install bottle # or set PATH to use pip: setx PATH "%PATH%;C:\<path\to\python\directory\>\Scripts" pip install bottle # or pip3 install bottle --upgrade # if "connection error... Add solution -
Python 2021-09-30 13:08:04
macos youtube-dl unable to get local issuer certificate _ssl.c:1131
# If you're using macOS go to # Macintosh HD > Applications > Python3.6 folder (or whatever version of python you're using) # > double click on "Install Certificates.command" file. :D # If you installed python using homebrew, run the ... Add solution -
Python 2021-09-29 19:45:04
hide password in python
#https://docs.python.org/3/library/base64.html >>> import base64 >>> print(base64.b64encode("password".encode("utf-8"))) cGFzc3dvcmQ= >>> print(base64.b64decode("cGFzc3dvcmQ=").decode("utf-8&... Add solution -
Python 2021-09-28 20:40:03
get external ip python
# This example requires the requests library be installed. You can learn more # about the Requests library here: http://docs.python-requests.org/en/latest/ from requests import get ip = get('https://api.ipify.org').text print 'My public IP address is:'... Add solution