GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — example-code/python/python-binary-memcached/example.py at master · memcachier/example-code

Expand file tree

/

example.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
17 lines (12 loc) · 490 Bytes
/

example.py

Copy path

File metadata and controls

executable file
·
17 lines (12 loc) · 490 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/python3
import bmemcached
import os
servers = os.environ.get('MEMCACHIER_SERVERS', '').split(',')
user = os.environ.get('MEMCACHIER_USERNAME', '')
passw = os.environ.get('MEMCACHIER_PASSWORD', '')
mc = bmemcached.Client(servers,
username=user, password=passw,
socket_timeout=3) # 3s is the default socket timeout
mc.enable_retry_delay(True) # Enabled by default. Sets retry delay to 5s.
mc.set("foo", "bar")
print(mc.get("foo"))
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.