Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Tags: Python,initialize, Created At: 10/24/2016 8:06:58 PMViews:

HTML view:
Copy Source | Copy HTML
  1. def initialize(self):
  2.     connection = httplib.HTTPConnection('www.yandex.ru')
  3.     connection.request('GET', '/')
  4.  
  5.     response = connection.getresponse()
  6.     cookies = response.getheader('set-cookie', None)
  7.     response.close()
  8.  
  9.     match = re.search('(?<=yandexuid=)[^;]*', cookies)
  10.     self._yandexuid = match.group( 0)
  11.     print 'yandexuid =', self._yandexuid

Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2018