Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Marko Rauhamaa
Gregory Ewing : > Is there some way you can get more stuff into a single > html page? For example, use inline css and image data > instead of delivering them as separate files. Better yet, is there some way you could send less stuff? There are two points of note here. 1. The top ten sit

Re: Wanted Python programmer to join team

2016-05-16 Thread Marko Rauhamaa
Steven D'Aprano : > Personally, I think that advertising a job position without saying who > you are, what you do, and offering at least an indicative salary > range, are *astonishingly* rude I don't believe they care. > (to say nothing of counter-productive). Maybe, maybe not. I bet the zebra

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Gregory Ewing
Is there some way you can get more stuff into a single html page? For example, use inline css and image data instead of delivering them as separate files. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Gene Heskett
On Monday 16 May 2016 23:02:07 Chris Angelico wrote: > On Tue, May 17, 2016 at 12:50 PM, Steven D'Aprano wrote: > > How can you not serve a web page over your LAN in 15s? > > > > I mean, you could *almost* do it by hand, copying the files onto a > > USB stick and walking them across the room in

Re: Wanted Python programmer to join team

2016-05-16 Thread Chris Angelico
On Tue, May 17, 2016 at 3:20 PM, Steven D'Aprano wrote: >> And a lot of job postings do come from that sort of really small >> business, trying to expand a bit. Plus, some of them want some >> anonymity (why, I don't know, but there are plenty of jobs posted >> without too much in the way of compa

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Steven D'Aprano
On Tuesday 17 May 2016 13:02, Chris Angelico wrote: > On Tue, May 17, 2016 at 12:50 PM, Steven D'Aprano > wrote: >> How can you not serve a web page over your LAN in 15s? >> >> I mean, you could *almost* do it by hand, copying the files onto a USB stick >> and walking them across the room in 15 s

Re: Wanted Python programmer to join team

2016-05-16 Thread Steven D'Aprano
On Tuesday 17 May 2016 12:56, Chris Angelico wrote: > On Tue, May 17, 2016 at 12:37 PM, Steven D'Aprano > wrote: >> On Tue, 17 May 2016 09:07 am, Chris Angelico wrote: >> >>> I'm not overly bothered by the use of GMail for a business address, >> >> It's 2016. Using a gmail address for your busine

Re: What should a decorator do if an attribute already exists?

2016-05-16 Thread Chris Angelico
On Tue, May 17, 2016 at 3:05 PM, Steven D'Aprano wrote: > Although the instrumentation is used inside the decorator, it is actually part > of the public API for the function. So the user can do this: > > > @decorate > def myfunction(): > ... > > > # later > myfunction.instrument.query() > > an

Re: What should a decorator do if an attribute already exists?

2016-05-16 Thread Steven D'Aprano
On Monday 16 May 2016 23:06, Kevin Conway wrote: >> I have a decorator that adds an attribute to the decorated function > > I might try to argue that this is not actually a decorator or, at least, > this is not a great decorator pattern for Python. Adding the attribute to > the function object im

Re: What should a decorator do if an attribute already exists?

2016-05-16 Thread Steven D'Aprano
On Monday 16 May 2016 22:20, jmp wrote: > On 05/10/2016 05:45 PM, Steven D'Aprano wrote: >> I have a decorator that adds an attribute to the decorated function: > [snip] >> I think 5 is clearly wrong, 4 is too difficult, and 3 seems pointless. So I >> think either 1 or 2 is the right thing to do.

Re: What should a decorator do if an attribute already exists?

2016-05-16 Thread Steven D'Aprano
On Monday 16 May 2016 18:14, Francesco Loffredo wrote: > On 10/05/2016 17:45, Steven D'Aprano wrote: >> I have a decorator that adds an attribute to the decorated function: [...] >> My question is, what should I do if the decorated function already has an >> instrument attribute? > From your exa

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Chris Angelico
On Tue, May 17, 2016 at 12:50 PM, Steven D'Aprano wrote: > How can you not serve a web page over your LAN in 15s? > > I mean, you could *almost* do it by hand, copying the files onto a USB stick > and walking them across the room in 15 seconds. Maybe 30. Don't forget to encrypt them by hand. Chr

Re: Wanted Python programmer to join team

2016-05-16 Thread Chris Angelico
On Tue, May 17, 2016 at 12:37 PM, Steven D'Aprano wrote: > On Tue, 17 May 2016 09:07 am, Chris Angelico wrote: > >> I'm not overly bothered by the use of GMail for a business address, > > It's 2016. Using a gmail address for your business (unless you're a really > small business, like a sole trade

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Steven D'Aprano
On Tue, 17 May 2016 02:52 am, Chris Angelico wrote: > On Tue, May 17, 2016 at 2:34 AM, Rob Gaddi > wrote: >>> The solution might actually be to move all your static files >>> elsewhere. Slap 'em up onto github.io or something, and then the >>> browser is free to make all the parallel connections

Re: Wanted Python programmer to join team

2016-05-16 Thread Steven D'Aprano
On Tue, 17 May 2016 09:07 am, Chris Angelico wrote: > I'm not overly bothered by the use of GMail for a business address, It's 2016. Using a gmail address for your business (unless you're a really small business, like a sole trader or something) is equivalent to a postal address of "Leave mail wi

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Steven D'Aprano
On Tue, 17 May 2016 05:33 am, Grant Edwards wrote: > The problem is that > modern browsers won't wait and send requests serially over a single > connection. They try to "optimize" page load times by opening as many > connections as they cat right away and requesting everything in > parallel. (Ev

Re: Wanted Python programmer to join team

2016-05-16 Thread Chris Angelico
On Tue, May 17, 2016 at 6:34 AM, Dan Strohl via Python-list wrote: >> My team is getting more projects that it can handle so we are looking for >> Python programers to join. You will be given tasks to complete full or part >> of >> the project. >> >> Skype: piefektas >> >> Contact me now with sho

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Steven D'Aprano wrote: > On Tue, 17 May 2016 02:06 am, Grant Edwards wrote: > >> This is not Python specific, though I'm turning to Python to do some >> experimentation and to try to prototype a solution. >> >> Is there any way to limit the number of connections a browser uses to >

Re: How to create development Python environment on Linux.

2016-05-16 Thread Michael Selik
On Mon, May 16, 2016 at 5:31 PM wrote: > After considering your guidance I think what I will do is install > virtualenv using apt-get and then use that to create a dev environment. Is > it ok to run get-pip.py in a virtual environment? > Recent versions of the virtualenv application create virtu

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Paul Rubin wrote: > Grant Edwards writes: >> I've actually got plenty of RAM. I just can't afford the CPU time >> it takes to do the public-key crypto stuff that happens each time >> an SSL connection starts up. > > I think you should only have to do that once, then use TLS sess

Re: How to create development Python environment on Linux.

2016-05-16 Thread redirect . null
Thanks Zach, that's a big help. The only reason I want to get a Python 2.7 environment working first is because I'll be working on third party code and that's the platform it uses. For any new projects I would use Python 3. After considering your guidance I think what I will do is install virtua

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Paul Rubin
Grant Edwards writes: > I've actually got plenty of RAM. I just can't afford the CPU time it > takes to do the public-key crypto stuff that happens each time an SSL > connection starts up. I think you should only have to do that once, then use TLS session resumption for additional connections.

RE: Wanted Python programmer to join team

2016-05-16 Thread Dan Strohl via Python-list
> My team is getting more projects that it can handle so we are looking for > Python programers to join. You will be given tasks to complete full or part of > the project. > > Skype: piefektas > > Contact me now with short description about yourself, your skills and > projects you have worked on.

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Rob Gaddi
Grant Edwards wrote: > On 2016-05-16, Rob Gaddi wrote: > >> Grant, the bad news is that I know this because our firware guy had >> _exactly_ this problem, with exactly your scenario, about a month ago. >> http, not https, but the problem remains the same but for some heavy >> math. After a lot of

Re: Wanted Python programmer to join team

2016-05-16 Thread Wildman via Python-list
On Mon, 16 May 2016 12:46:13 -0700, netcrime4 wrote: > My team is getting more projects that it can handle so we are looking for > Python programers to join. You will be given tasks to complete full or part > of the project. > > Majority of projects consist of data mining(scraping) so experence

Wanted Python programmer to join team

2016-05-16 Thread netcrime4
My team is getting more projects that it can handle so we are looking for Python programers to join. You will be given tasks to complete full or part of the project. Majority of projects consist of data mining(scraping) so experence in this field is advantage. But we also have various tasks s

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, jmp wrote: > Have you considered upgrading the device with a recent CPU ? Or is it > completely out of the picture ? Not an option. We have to continue to support devices that are in the field. The newer models that are coming out now run at 133MHz instead of 44MHz, and page lo

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Random832 wrote: > On Mon, May 16, 2016, at 13:57, sohcahto...@gmail.com wrote: >> On Monday, May 16, 2016 at 10:35:28 AM UTC-7, Peter Otten wrote: >> >>> I think HTTP/2 allows multiple requests over a single TCP connection. >> >> HTTP/1.1 already supports it, but most browsers hav

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Peter Otten <__pete...@web.de> wrote: > Grant Edwards wrote: > >> This is not Python specific, though I'm turning to Python to do some >> experimentation and to try to prototype a solution. >> >> Is there any way to limit the number of connections a browser uses to >> download a web

Re: A tough one: split on word length?

2016-05-16 Thread Ben Bacarisse
DFS writes: > Have: > '584323 Fri 13 May 2016 17:37:01 - (UTC) 584324 Fri 13 May 2016 > 13:44:40 -0400 584325 13 May 2016 17:45:25 GMT 584326 Fri 13 May 2016 > 13:47:28 -0400' > > Want: > [('584323', 'Fri 13 May 2016 17:37:01 - (UTC)'), > ('584324', 'Fri 13 May 2016 13:44:40 -0400'), >

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Steven D'Aprano wrote: > On Tue, 17 May 2016 02:06 am, Grant Edwards wrote: > >> This is not Python specific, though I'm turning to Python to do some >> experimentation and to try to prototype a solution. >> >> Is there any way to limit the number of connections a browser uses to >

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Rob Gaddi wrote: > Grant, the bad news is that I know this because our firware guy had > _exactly_ this problem, with exactly your scenario, about a month ago. > http, not https, but the problem remains the same but for some heavy > math. After a lot of door knocking, poking, prodd

Re: gevent

2016-05-16 Thread Daniel Bradburn
Hi Larry, I'm afraid I don't have any experience using gevent with wsgi, perhaps you could try posting directly on the Google group https://groups.google.com/forum/#!forum/gevent On Mon, 16 May 2016, 20:28 Larry Martell, wrote: > I don't see it either. I posted it twice - May 3 and May 14. I di

Re: A strange one: a commented line throws an error

2016-05-16 Thread sohcahtoa82
On Monday, May 16, 2016 at 10:25:54 AM UTC-7, DFS wrote: > print "test" > # stz source pytz.timezone() instance (for naïve local datetimes) > > $ python temp.py >File "temp.py", line 2 > SyntaxError: Non-ASCII character '\xc3' in file temp.py on line 2, but > no encoding declared; see http://

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Random832
On Mon, May 16, 2016, at 13:57, sohcahto...@gmail.com wrote: > On Monday, May 16, 2016 at 10:35:28 AM UTC-7, Peter Otten wrote: > > I think HTTP/2 allows multiple requests over a single TCP connection. > > HTTP/1.1 already supports it, but most browsers have it disabled by > default. > > https://

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Random832
On Mon, May 16, 2016, at 13:34, Peter Otten wrote: > I think HTTP/2 allows multiple requests over a single TCP connection. HTTP/1.1 allows the same just fine, the problem here is convincing the browser to actually do it. -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread sohcahtoa82
On Monday, May 16, 2016 at 10:35:28 AM UTC-7, Peter Otten wrote: > Grant Edwards wrote: > > > This is not Python specific, though I'm turning to Python to do some > > experimentation and to try to prototype a solution. > > > > Is there any way to limit the number of connections a browser uses to

gevent

2016-05-16 Thread Larry Martell
Does anyone here use gevent? I posted a question on the gevent mailing list, here, and on SO and did not get any replies on any of them. I have a client that is using it - I had never heard of it before, and now I am wondering how big the user base and community is. -- https://mail.python.org/mail

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Peter Otten
Grant Edwards wrote: > This is not Python specific, though I'm turning to Python to do some > experimentation and to try to prototype a solution. > > Is there any way to limit the number of connections a browser uses to > download a web page? Browser writers seems to assume that all https > serv

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread jmp
On 05/16/2016 06:06 PM, Grant Edwards wrote: This is not Python specific, though I'm turning to Python to do some experimentation and to try to prototype a solution. Is there any way to limit the number of connections a browser uses to download a web page? Browser writers seems to assume that a

Re: A tough one: split on word length?

2016-05-16 Thread Laurent Pointal
DFS wrote: > Have: > '584323 Fri 13 May 2016 17:37:01 - (UTC) 584324 Fri 13 May 2016 > 13:44:40 -0400 584325 13 May 2016 17:45:25 GMT 584326 Fri 13 May 2016 > 13:47:28 -0400' > > Want: > [('584323', 'Fri 13 May 2016 17:37:01 - (UTC)'), >('584324', 'Fri 13 May 2016 13:44:40 -0400'), >

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Steven D'Aprano
On Tue, 17 May 2016 02:06 am, Grant Edwards wrote: > This is not Python specific, though I'm turning to Python to do some > experimentation and to try to prototype a solution. > > Is there any way to limit the number of connections a browser uses to > download a web page? Well, you control the s

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Chris Angelico
On Tue, May 17, 2016 at 2:34 AM, Rob Gaddi wrote: >> The solution might actually be to move all your static files >> elsewhere. Slap 'em up onto github.io or something, and then the >> browser is free to make all the parallel connections it likes; your >> embedded device can just serve the stuff t

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Chris Angelico wrote: > On Tue, May 17, 2016 at 2:06 AM, Grant Edwards> > wrote: >> So, when a browser wants to load a page that has the main html file, a >> css file, a javascript library or two, and a few icons and background >> bitmaps, they browser opens up a half-dozen SSL co

Re: How to get a directory list sorted by date?

2016-05-16 Thread Random832
On Sun, May 15, 2016, at 17:52, Chris Angelico wrote: > On Mon, May 16, 2016 at 2:00 AM, Grant Edwards > wrote: > > On 2016-05-15, Michael Selik wrote: > >> On Sun, May 15, 2016, 10:37 AM Grant Edwards > >> wrote: > >>> On 2016-05-15, Tim Chase wrote: > > unless sorted() returns a la

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Rob Gaddi
Chris Angelico wrote: > On Tue, May 17, 2016 at 2:06 AM, Grant Edwards > wrote: >> So, when a browser wants to load a page that has the main html file, a >> css file, a javascript library or two, and a few icons and background >> bitmaps, they browser opens up a half-dozen SSL connections in >> p

Re: How to create development Python environment on Linux.

2016-05-16 Thread Zachary Ware
On Mon, May 16, 2016 at 6:22 AM, wrote: > I have a Linux system (Mint 17.3 based in Ubuntu 14.04) on which I wish to do > some Python development. The system has Python 2.7.6 installed already (there > is a Python 3 installation too but I won't be needing to use that to start > with). Not wha

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Chris Angelico
On Tue, May 17, 2016 at 2:06 AM, Grant Edwards wrote: > So, when a browser wants to load a page that has the main html file, a > css file, a javascript library or two, and a few icons and background > bitmaps, they browser opens up a half-dozen SSL connections in > parallel. > > That's fine when t

OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
This is not Python specific, though I'm turning to Python to do some experimentation and to try to prototype a solution. Is there any way to limit the number of connections a browser uses to download a web page? Browser writers seems to assume that all https servers are massively parallel server

Re: What should a decorator do if an attribute already exists?

2016-05-16 Thread Kevin Conway
> I have a decorator that adds an attribute to the decorated function I might try to argue that this is not actually a decorator or, at least, this is not a great decorator pattern for Python. Adding the attribute to the function object implies you need to access it at some later point. If so then

Re: What should a decorator do if an attribute already exists?

2016-05-16 Thread jmp
On 05/10/2016 05:45 PM, Steven D'Aprano wrote: I have a decorator that adds an attribute to the decorated function: [snip] I think 5 is clearly wrong, 4 is too difficult, and 3 seems pointless. So I think either 1 or 2 is the right thing to do. Thoughts? It depends if the attribute "instrume

Re: What should a decorator do if an attribute already exists?

2016-05-16 Thread Francesco Loffredo
On 10/05/2016 17:45, Steven D'Aprano wrote: I have a decorator that adds an attribute to the decorated function: def decorate(func): instrument = make_instrument() @functools.wraps(func) def inner(*args): instrument.start() result = func(*args) instrum

Re: How to create development Python environment on Linux.

2016-05-16 Thread redirect . null
Rereading this through I notice I'm a bit vague on one point. In Point 2. User install site.py behaviour confusing, one of the things that confuses me is that the documentation for site.py here https://docs.python.org/2/library/site.html ...states (in bold) that 'This module is automatically im

How to create development Python environment on Linux.

2016-05-16 Thread redirect . null
I have a Linux system (Mint 17.3 based in Ubuntu 14.04) on which I wish to do some Python development. The system has Python 2.7.6 installed already (there is a Python 3 installation too but I won't be needing to use that to start with). I need to install various Python modules for the work I'm

Autotool - compile module for both Python 2 _and_ 3

2016-05-16 Thread Ervin Hegedüs
Hi All, there is a library, which written in C. I'ld like to use it from Python - from Python 2 _and_ 3. I can make the autotools* files for Python 2 and Python 3, but only exclusively. I can't make it for both in same time. There is a macro for autotool, called ax_python_devel.m4. This macro u

Re: Trouble porting glob bash behavior with argparse to windows shell

2016-05-16 Thread Peter Otten
Sayth Renshaw wrote: > On Wednesday, 4 May 2016 17:57:32 UTC+10, Sayth Renshaw wrote: >> Oops sorry noticed you did in the glob. Sorry squinting at phone. >> >> Sayth > > Hi > > this seems to be causing me an error in my thinking as well as the > program. I am creating a function GetArgs to ta