Skip to content

Instantly share code, notes, and snippets.

@erikbern
erikbern / use_pfx_with_requests.py
Last active October 24, 2024 12:26
How to use a .pfx file with Python requests – also works with .p12 files
import contextlib
import OpenSSL.crypto
import os
import requests
import ssl
import tempfile
@contextlib.contextmanager
def pfx_to_pem(pfx_path, pfx_password):
''' Decrypts the .pfx file to be used with requests. '''
@dariosky
dariosky / ijustcode.py
Created April 14, 2015 20:22
Tribute to Stevie Wonder
#!/usr/bin/python
import collections
__author__ = "Dario Varotto"
""" This was thought while I was showering, sorry :) """
def stevie():
stack = collections.deque()
stack.append("from the bottom")