Skip to content

Instantly share code, notes, and snippets.

View dmgl's full-sized avatar
🎯
Focusing

Galochkin D.D. dmgl

🎯
Focusing
  • Russia, Saint-Petersburg
View GitHub Profile
@dmgl
dmgl / dmgl_google_translate.py
Last active September 8, 2020 16:47
Google-translate in console (~/.local/bin/dmgl_google_translate.py)
#!/usr/bin/python3
import sys
import requests
def translate(string, from_language="auto", to_language="auto"):
headers = {"User-Agent":"Mozilla/4.0 (compatible; MSIE 6.0; \
Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; \
@dmgl
dmgl / idle.py
Last active January 30, 2020 16:16
How to launch Idle from virtualenv
#!/usr/bin/env python
from idlelib.PyShell import main
if __name__ == '__main__':
main()