How to call wget by python ?

2013-01-09 Thread iMath
can you  give me an example code ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to call wget by python ?

2013-01-09 Thread Chris Angelico
On Thu, Jan 10, 2013 at 1:11 PM, iMath redstone-c...@163.com 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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to call wget by python ?

2013-01-09 Thread Michael Torrie
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.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to call wget by python ?

2013-01-09 Thread 88888 Dihedral
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.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to call wget by python ?

2013-01-09 Thread Chris Angelico
On Thu, Jan 10, 2013 at 2:21 PM, 8 Dihedral
dihedral88...@googlemail.com 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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to call wget by python ?

2013-01-09 Thread Steven D'Aprano
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%20call%20external%20command



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to call wget by python ?

2013-01-09 Thread rurpy
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/subprocess.html#module-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'])


-- 
http://mail.python.org/mailman/listinfo/python-list