Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36545 > unrolled thread

How to call wget by python ?

Started byiMath <redstone-cold@163.com>
First post2013-01-09 18:11 -0800
Last post2013-01-09 21:01 -0800
Articles 8 — 6 participants

Back to article view | Back to comp.lang.python


Contents

  How to call wget by python ? iMath <redstone-cold@163.com> - 2013-01-09 18:11 -0800
    Re: How to call wget by python ? Chris Angelico <rosuav@gmail.com> - 2013-01-10 13:36 +1100
    Re: How to call wget by python ? Michael Torrie <torriem@gmail.com> - 2013-01-09 20:04 -0700
      Re: How to call wget by python ? 88888 Dihedral <dihedral88888@googlemail.com> - 2013-01-09 19:21 -0800
        Re: How to call wget by python ? Chris Angelico <rosuav@gmail.com> - 2013-01-10 14:38 +1100
      Re: How to call wget by python ? 88888 Dihedral <dihedral88888@googlemail.com> - 2013-01-09 19:21 -0800
    Re: How to call wget by python ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-01-10 03:55 +0000
    Re: How to call wget by python ? rurpy@yahoo.com - 2013-01-09 21:01 -0800

#36545 — How to call wget by python ?

FromiMath <redstone-cold@163.com>
Date2013-01-09 18:11 -0800
SubjectHow to call wget by python ?
Message-ID<49ca3718-159f-40cd-96bf-983ddb96202b@googlegroups.com>
can you  give me an example code ?

[toc] | [next] | [standalone]


#36548

FromChris Angelico <rosuav@gmail.com>
Date2013-01-10 13:36 +1100
Message-ID<mailman.354.1357785386.2939.python-list@python.org>
In reply to#36545
On Thu, Jan 10, 2013 at 1:11 PM, iMath <redstone-cold@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

[toc] | [prev] | [next] | [standalone]


#36553

FromMichael Torrie <torriem@gmail.com>
Date2013-01-09 20:04 -0700
Message-ID<mailman.358.1357787077.2939.python-list@python.org>
In reply to#36545
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."

[toc] | [prev] | [next] | [standalone]


#36555

From88888 Dihedral <dihedral88888@googlemail.com>
Date2013-01-09 19:21 -0800
Message-ID<8aa23734-0ef9-4104-aacf-1c1dd817edb0@googlegroups.com>
In reply to#36553
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.

[toc] | [prev] | [next] | [standalone]


#36557

FromChris Angelico <rosuav@gmail.com>
Date2013-01-10 14:38 +1100
Message-ID<mailman.361.1357789098.2939.python-list@python.org>
In reply to#36555
On Thu, Jan 10, 2013 at 2:21 PM, 88888 Dihedral
<dihedral88888@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

[toc] | [prev] | [next] | [standalone]


#36556

From88888 Dihedral <dihedral88888@googlemail.com>
Date2013-01-09 19:21 -0800
Message-ID<mailman.360.1357788645.2939.python-list@python.org>
In reply to#36553
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.

[toc] | [prev] | [next] | [standalone]


#36558

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-01-10 03:55 +0000
Message-ID<50ee3ba1$0$29898$c3e8da3$5496439d@news.astraweb.com>
In reply to#36545
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

[toc] | [prev] | [next] | [standalone]


#36560

Fromrurpy@yahoo.com
Date2013-01-09 21:01 -0800
Message-ID<d72fcdb0-0748-4400-9595-02d1057da957@googlegroups.com>
In reply to#36545
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'])

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web