Skip to content

Instantly share code, notes, and snippets.

View petitchamp's full-sized avatar

SONG Ke petitchamp

  • DASSAULT SYSTEMES
  • Paris,France
View GitHub Profile
@christianroman
christianroman / test.py
Created May 30, 2013 16:02
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
@ericzhang-cn
ericzhang-cn / coursera-prob-w5p10.py
Last active December 24, 2015 06:59
Coursera几率课程,第五周第十题,模拟程序
# -*- coding: utf-8 -*-
from math import *
from random import *
### 一次测试 ###
def test():
speed = 4.0 #初速度
distance = 0 #已经走过的距离
threshold = log(50) / 100 #每秒中枪的概率
@vinovator
vinovator / imapMailboxMiner.py
Last active November 23, 2021 10:07
Python script to mine IMAP Mail servers, such as yahoo, gmail etc. Edit the IMAP server name to mine a particular mail service.
# imapMailboxMiner.py
# Python 2.7.6
"""
Connect to IMAP4 server and fetch mails
http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
"""
import imaplib # Library to interact with IMPAP server
import sys
@nickoala
nickoala / 0_python_email.md
Last active October 16, 2024 18:32
Use Python to send and receive emails

Use Python to:

  • send a plain text email
  • send an email with attachment
  • receive and filter emails according to some criteria
@ecovictoriano
ecovictoriano / python-gcp-stt.md
Created December 28, 2017 00:46
Transcribe audio file to text (speech-to-text) using Google Cloud Platform's Speech API

Transcribe audio file to text (speech-to-text) using Google Cloud Platform's Speech API

Convert audio to text using GCP Speech API

Requirements

pip install --upgrade google-cloud-speech

Export the GCP credential env and execute the request

#!/bin/bash