On Tue, 3 May 2016 01:56 pm, DFS wrote:
> On 5/2/2016 11:27 PM, jf...@ms4.hinet.net wrote:
>> DFS at 2016/5/3 9:12:24AM wrote:
>>> try
>>>
>>> from urllib.request import urlretrieve
>>>
>>>
http://stackoverflow.com/questions/21171718/urllib-urlretrieve-file-python-3-3
>>>
>>>
>>> I'm running pytho
On Mon, May 2, 2016, at 08:57 PM, jf...@ms4.hinet.net wrote:
> Stephen Hansen at 2016/5/3 11:49:22AM wrote:
> > On Mon, May 2, 2016, at 08:27 PM, jf...@ms4.hinet.net wrote:
> > > But when I try to get this forum page, it does get a html file but can't
> > > be viewed normally.
> >
> > What does th
Stephen Hansen at 2016/5/3 11:49:22AM wrote:
> On Mon, May 2, 2016, at 08:27 PM, jf...@ms4.hinet.net wrote:
> > But when I try to get this forum page, it does get a html file but can't
> > be viewed normally.
>
> What does that mean?
>
> --
> Stephen Hansen
> m e @ i x o k a i . i o
The page
On 5/2/2016 11:27 PM, jf...@ms4.hinet.net wrote:
DFS at 2016/5/3 9:12:24AM wrote:
try
from urllib.request import urlretrieve
http://stackoverflow.com/questions/21171718/urllib-urlretrieve-file-python-3-3
I'm running python 2.7.11 (32-bit)
Alright, it works...someway.
I try to get a zip fi
On Mon, May 2, 2016, at 08:27 PM, jf...@ms4.hinet.net wrote:
> But when I try to get this forum page, it does get a html file but can't
> be viewed normally.
What does that mean?
--
Stephen Hansen
m e @ i x o k a i . i o
--
https://mail.python.org/mailman/listinfo/python-list
DFS at 2016/5/3 9:12:24AM wrote:
> try
>
> from urllib.request import urlretrieve
>
> http://stackoverflow.com/questions/21171718/urllib-urlretrieve-file-python-3-3
>
>
> I'm running python 2.7.11 (32-bit)
Alright, it works...someway.
I try to get a zip file. It works, the file can be unzippe
On 5/2/2016 8:45 PM, jf...@ms4.hinet.net wrote:
DFS at 2016/5/2 UTC+8 11:39:33AM wrote:
To save a webpage to a file:
-
1. import urllib
2. urllib.urlretrieve("http://econpy.pythonanywhere.com
/ex/001.html","D:\file.html")
-
DFS at 2016/5/2 UTC+8 11:39:33AM wrote:
> To save a webpage to a file:
> -
> 1. import urllib
> 2. urllib.urlretrieve("http://econpy.pythonanywhere.com
> /ex/001.html","D:\file.html")
> -
>
> That's it!
Why my system can
On 05/02/16 at 11:24am, Larry Martell wrote:
> That reminds me of something I heard many years ago.
>
> Every non-trivial program can be simplified by at least one line of code.
> Every non trivial program has at least one bug.
>
> Therefore every non-trivial program can be reduced to one line of
On Mon, May 2, 2016 at 11:15 AM, DFS wrote:
> Of course. Taken to its extreme, I could eventually replace you with one
> line of code :)
That reminds me of something I heard many years ago.
Every non-trivial program can be simplified by at least one line of code.
Every non trivial program has a
On 5/2/2016 5:26 AM, BartC wrote:
On 02/05/2016 04:39, DFS wrote:
To save a webpage to a file:
-
1. import urllib
2. urllib.urlretrieve("http://econpy.pythonanywhere.com
/ex/001.html","D:\file.html")
-
That's it!
Comin
On Mon, 2 May 2016 08:12 pm, Marko Rauhamaa wrote:
> For example, the urlretrieve() function above blocks. You can't use it
> with the asyncio or select modules.
The urlretrieve function is one of the oldest functions in the std library.
It literally only exists because Guido was working on a co
BartC :
> On 02/05/2016 04:39, DFS wrote:
>> 2. urllib.urlretrieve("http://econpy.pythonanywhere.com
>> /ex/001.html","D:\file.html")
> [...]
>
> It seems Python provides a higher level solution compared with VBS.
> Python presumably also has to do those Opens and Sends, but they are
> hidden
On 02/05/2016 04:39, DFS wrote:
To save a webpage to a file:
-
1. import urllib
2. urllib.urlretrieve("http://econpy.pythonanywhere.com
/ex/001.html","D:\file.html")
-
That's it!
Coming from VB/A background, some of the
On 5/2/2016 12:31 AM, Stephen Hansen wrote:
On Sun, May 1, 2016, at 08:39 PM, DFS wrote:
To save a webpage to a file:
-
1. import urllib
2. urllib.urlretrieve("http://econpy.pythonanywhere.com
/ex/001.html","D:\file.html")
On 5/2/2016 1:37 AM, Stephen Hansen wrote:
On Sun, May 1, 2016, at 10:23 PM, DFS wrote:
Trying the rawstring thing (say it fast 3x):
webpage = "http://econpy.pythonanywhere.com/ex/001.html";
webfile = "D:\\econpy001.html"
urllib.urlretrieve(
On Monday 02 May 2016 15:21, Stephen Hansen wrote:
> On Sun, May 1, 2016, at 10:08 PM, DFS wrote:
>> On 5/2/2016 1:02 AM, Stephen Hansen wrote:
>> >> I actually use "D:\\file.html" in my code.
>> >
>> > Or you can do that. But the whole point of raw strings is not having to
>> > escape slashes :)
On Sun, May 1, 2016, at 10:23 PM, DFS wrote:
> Trying the rawstring thing (say it fast 3x):
>
> webpage = "http://econpy.pythonanywhere.com/ex/001.html";
>
>
> webfile = "D:\\econpy001.html"
> urllib.urlretrieve(webpage,webfile) WORKS
> ---
On 5/2/2016 1:02 AM, Stephen Hansen wrote:
On Sun, May 1, 2016, at 09:51 PM, DFS wrote:
On 5/2/2016 12:31 AM, Stephen Hansen wrote:
On Sun, May 1, 2016, at 08:39 PM, DFS wrote:
To save a webpage to a file:
-
1. import urllib
2. urllib.urlretrieve("http://eco
On Sun, May 1, 2016, at 10:08 PM, DFS wrote:
> On 5/2/2016 1:02 AM, Stephen Hansen wrote:
> >> I actually use "D:\\file.html" in my code.
> >
> > Or you can do that. But the whole point of raw strings is not having to
> > escape slashes :)
>
>
> Nice. Where/how else is 'r' used?
Raw strings are
On 5/2/2016 1:02 AM, Stephen Hansen wrote:
On Sun, May 1, 2016, at 09:51 PM, DFS wrote:
On 5/2/2016 12:31 AM, Stephen Hansen wrote:
On Sun, May 1, 2016, at 08:39 PM, DFS wrote:
To save a webpage to a file:
-
1. import urllib
2. urllib.urlretrieve("http://eco
On Sun, May 1, 2016, at 09:51 PM, DFS wrote:
> On 5/2/2016 12:31 AM, Stephen Hansen wrote:
> > On Sun, May 1, 2016, at 08:39 PM, DFS wrote:
> >> To save a webpage to a file:
> >> -
> >> 1. import urllib
> >> 2. urllib.urlretrieve("http://econpy.pythonanywhere.com
On 5/2/2016 12:31 AM, Stephen Hansen wrote:
On Sun, May 1, 2016, at 08:39 PM, DFS wrote:
To save a webpage to a file:
-
1. import urllib
2. urllib.urlretrieve("http://econpy.pythonanywhere.com
/ex/001.html","D:\file.html")
On Sun, May 1, 2016, at 08:39 PM, DFS wrote:
> To save a webpage to a file:
> -
> 1. import urllib
> 2. urllib.urlretrieve("http://econpy.pythonanywhere.com
> /ex/001.html","D:\file.html")
> -
Note, for paths on windows y
To save a webpage to a file:
-
1. import urllib
2. urllib.urlretrieve("http://econpy.pythonanywhere.com
/ex/001.html","D:\file.html")
-
That's it!
Coming from VB/A background, some of the stuff you can do with python -
25 matches
Mail list logo