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 |
Size | 438 |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:56 |
Last modified | 04-Jan-2014 22:32 |
Last accessed | 06-Jul-2025 23:32 |
Actions | edit | rename | delete | download (gzip) |
View | text | 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)
# -*- 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)