Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > How to call wget by python ?

Reply
Thread Tools

How to call wget by python ?

 
 
iMath
Guest
Posts: n/a
 
      01-10-2013
can you give me an example code ?
 
Reply With Quote
 
 
 
 
Chris Angelico
Guest
Posts: n/a
 
      01-10-2013
On Thu, Jan 10, 2013 at 1:11 PM, iMath <(E-Mail Removed)> wrote:
> can you give me an example code ?
> --
> http://mail.python.org/mailman/listinfo/python-list


You've asked several very vague questions. I would strongly recommend
that you read this:

http://www.catb.org/esr/faqs/smart-questions.html

Invoking wget can be done, but you may want to consider alternatives
such as doing the network request (HTTP, FTP, or whatever) directly in
Python. A one-line request that we do heaps of work for you is not the
best way to get results.

ChrisA
 
Reply With Quote
 
 
 
 
Michael Torrie
Guest
Posts: n/a
 
      01-10-2013
On 01/09/2013 07:11 PM, iMath wrote:
> can you give me an example code ?


No but I can suggest some alternative ideas, such as using httplib
(built into python), or libcurl. Or if you have to use wget, you run it
the same way you run any external command from python. If it were my
I'd plunk a few search terms in google, such as "python run external
process."

 
Reply With Quote
 
88888 Dihedral
Guest
Posts: n/a
 
      01-10-2013
Michael Torrie於 2013年1月10日星期四UTC+8上午11時04分31 寫道:
> On 01/09/2013 07:11 PM, iMath wrote:
>
> > can you give me an example code ?

>
>
>
> No but I can suggest some alternative ideas, such as using httplib
>
> (built into python), or libcurl. Or if you have to use wget, you run it
>
> the same way you run any external command from python. If it were my
>
> I'd plunk a few search terms in google, such as "python run external
>
> process."


Inherantly the python interpreter has a GC builtin
to use pacakages like DLL by reference counting.
 
Reply With Quote
 
88888 Dihedral
Guest
Posts: n/a
 
      01-10-2013
Michael Torrie於 2013年1月10日星期四UTC+8上午11時04分31 寫道:
> On 01/09/2013 07:11 PM, iMath wrote:
>
> > can you give me an example code ?

>
>
>
> No but I can suggest some alternative ideas, such as using httplib
>
> (built into python), or libcurl. Or if you have to use wget, you run it
>
> the same way you run any external command from python. If it were my
>
> I'd plunk a few search terms in google, such as "python run external
>
> process."


Inherantly the python interpreter has a GC builtin
to use pacakages like DLL by reference counting.
 
Reply With Quote
 
Chris Angelico
Guest
Posts: n/a
 
      01-10-2013
On Thu, Jan 10, 2013 at 2:21 PM, 88888 Dihedral
<(E-Mail Removed)> wrote:
> Inherantly the python interpreter has a GC builtin
> to use pacakages like DLL by reference counting.


That almost makes sense. And it's almost profound, too.

ChrisA
 
Reply With Quote
 
Steven D'Aprano
Guest
Posts: n/a
 
      01-10-2013
On Wed, 09 Jan 2013 18:11:34 -0800, iMath wrote:

> can you give me an example code ?


Is the web broken where you are? If you google for "python wget", you
will find example of how to call wget as an external process, as well as
examples of downloading files from the web like wget would do but using
only Python.

https://duckduckgo.com/?q=python%20wget


Or you could search for "python call external command" and then use wget
as that external command.

https://duckduckgo.com/?q=python%20c...rnal%20command



--
Steven
 
Reply With Quote
 
rurpy@yahoo.com
Guest
Posts: n/a
 
      01-10-2013
On Wednesday, January 9, 2013 7:11:34 PM UTC-7, iMath wrote:
> can you give me an example code ?


For running any system command from Python, you can use the
subprocess module:
http://docs.python.org/3/library/sub...ule-subprocess

To run "wget -p -k http://python.org" from Python you could
do something like this:

import subprocess
subprocess.call (['wget', '-p', '-k', 'http://python.org'])


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Equivalent of 'wget' for python? Robert Dailey Python 5 12-11-2008 07:44 PM
Re: Equivalent of 'wget' for python? hrishy Python 3 12-11-2008 10:41 AM
looking for wget-like module for getching software Robert P. J. Day Python 2 12-16-2004 04:43 PM
WGET Henry Computer Security 1 08-11-2004 06:15 AM



Advertisments