K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / share / doc / python3-pycurl / examples /
server ip : 172.67.156.115

your ip : 172.69.130.141

H O M E


Filename/usr/share/doc/python3-pycurl/examples/basicfirst.py
Size438
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified04-Jan-2014 22:32
Last accessed06-Jul-2025 23:32
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et

import sys
import pycurl

class Test:
def __init__(self):
self.contents = ''

def body_callback(self, buf):
self.contents = self.contents + buf

sys.stderr.write("Testing %s\n" % pycurl.version)

t = Test()
c = pycurl.Curl()
c.setopt(c.URL, 'http://curl.haxx.se/dev/')
c.setopt(c.WRITEFUNCTION, t.body_callback)
c.perform()
c.close()

print(t.contents)