D
Dekaritae
I have a script that I've written in Perl that retrieves files generated
from a template. It works decently enough, but I'd like to rewrite it in
Python (Perl was just a detour; it was originally Sed).
Was wondering what the closest thing to what I'm using now in Perl
(LWP::UserAgent and HTTP::Request:Common) is in Python. The main bit of
my code is fairly simple.
my($ua) = LWP::UserAgent->new;
my $req = GET "$uri";
$req->header(Referer => "$referer");
$ua->proxy('http', 'http://localhost:8080/'); # Proxomitron
$response = $ua->request($req);
$respcode = $response->code;
from a template. It works decently enough, but I'd like to rewrite it in
Python (Perl was just a detour; it was originally Sed).
Was wondering what the closest thing to what I'm using now in Perl
(LWP::UserAgent and HTTP::Request:Common) is in Python. The main bit of
my code is fairly simple.
my($ua) = LWP::UserAgent->new;
my $req = GET "$uri";
$req->header(Referer => "$referer");
$ua->proxy('http', 'http://localhost:8080/'); # Proxomitron
$response = $ua->request($req);
$respcode = $response->code;