async, on-demand lazy rendering for jinja2 possible?

2014-07-21 Thread est
Hi all, Been reading @igrigorik's posts https://www.igvita.com/archives/ I found that flush response as early as possible is crucial for a website performance. I wanna make Time To First Byte (TTTFB) happen as early as possible with a Jinja2 site, Suppose a typical Jinja2 template: {{ site_

db agnostic admin for Flask?

2011-12-11 Thread est
Hi guys Are there any db agnostic admin for Flask/Django? Imagine you need CRUD lots of data from Mongodb, Redis, ini file or even remote sources, if such admin allows aggregate data regardless of DB types or syntax, it would be super useful. Anything like this exists? or should I start build on

SSE4a with ctypes in python? (gcc __builtin_popcount)

2011-10-31 Thread est
Hi guys, Here is the sample code http://stackoverflow.com/questions/6389841/efficiently-find-binary-strings-with-low-hamming-distance-in-large-set/6390606#6390606 static inline int distance(unsigned x, unsigned y) { return __builtin_popcount(x^y); } Is it possible to rewrite the above gcc c

SSE4a with ctypes in python? (gcc __builtin_popcount)

2011-10-30 Thread est
Hi guys, Here is the sample code http://stackoverflow.com/questions/6389841/efficiently-find-binary-strings-with-low-hamming-distance-in-large-set/6390606#6390606 static inline int distance(unsigned x, unsigned y) { return __builtin_popcount(x^y); } Is it possible to rewrite the above gcc c

Re: minimal python27.dll?

2011-04-27 Thread est
On Apr 27, 11:15 pm, Tim Golden wrote: > Perhaps have a look at tinypy? > >    http://www.tinypy.org/ > > Even if it's not exactly what you want, I expect that the > author will have useful ideas / experience. > > TJG Thanks, but I still need the completeness of CPython. AFAIK TinyPy is a python

minimal python27.dll?

2011-04-27 Thread est
Hi guys, I need to ship python runtime environment package on Windows, if I want to stripping unnessasery functions from python27.dll to make it as small as possible(and perhaps finally UPX it), which parts of python27.dll do you think can be removed? >From what I think, these parts are not neede

Re: Compiling xpython: No rule to make target `runathana.py', needed by `frozen/frozen.c'.

2010-10-10 Thread est
On Oct 10, 7:40 pm, est wrote: > I found an interesting project, it's a single 4.7 MB executable with > stdlib+PIL+pdf r/w+magpy+wxpython environment > > But when compiling following the instructions > > http://www.xpython.org/#compiling > > there is an error > &g

Compiling xpython: No rule to make target `runathana.py', needed by `frozen/frozen.c'.

2010-10-10 Thread est
I found an interesting project, it's a single 4.7 MB executable with stdlib+PIL+pdf r/w+magpy+wxpython environment But when compiling following the instructions http://www.xpython.org/#compiling there is an error make: *** No rule to make target `runathana.py', needed by `frozen/ frozen.c'. St

Re: GUIs - A Modest Proposal

2010-06-18 Thread est
> > Having said all that, I would like to eliminate some of the > depedencie. At some point I'll probably re-do the Windows > implementation using ctypes, because pywin32/mfc is hindering > more than helping in some areas. I'm also thinking about ways > to interface directly with Cocoa without goin

Re: What's the largest python/django powered website in the world?

2010-05-31 Thread est
On May 31, 8:14 am, Benjamin Kaplan wrote: > On Sun, May 30, 2010 at 4:27 PM, est wrote: > > > > I'm afraid you'll need to define what you mean by "python powered". > > > Except database, presentation layer, major business logic is done by > >

Re: What's the largest python/django powered website in the world?

2010-05-30 Thread est
> I'm afraid you'll need to define what you mean by "python powered". Except database, presentation layer, major business logic is done by python. Except Google/youtube, what's next? -- http://mail.python.org/mailman/listinfo/python-list

What's the largest python/django powered website in the world?

2010-05-30 Thread est
Hi list, just curious, what's the largest python powered website in the world? and what's the largest django powered website in the world? Is it disqus.com? -- http://mail.python.org/mailman/listinfo/python-list

modify a exe's RT_ACCELERATOR table using pefile module

2009-08-04 Thread est
Hi list, I need to modify a exe's RT_ACCELERATOR table, rename F1 to Ctrl+F1, and assign hotkey F1 to another function Is there a way to do it with pefile/python? A sample code is appreciated. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: psyco V2

2009-07-17 Thread est
On Jul 17, 10:48 am, Christian Tismer wrote: > Announcing Psyco V2 source release > -- > > This is the long awaited announcement of Psyco V2. > > Psyco V2 is a continuation of the well-known psyco project, > which was called finished and was dis-continued by its aut

ctypes to customize MSN now playing status

2009-01-06 Thread est
Hi guys, I am trying to switch MSN/WLM now playing status using ctypes with python, here's my code import ctypes, win32con, win32api, win32gui FindWindow = ctypes.windll.User32.FindWindowA SendMessage = ctypes.windll.User32.SendMessageA hWnd = FindWindow('MsnMsgrUIManager', None) s = u"\\0Music

Where can I get Lucid Toolkit?

2008-11-11 Thread est
Hi guys, I tried to grab source code for Lucid Toolkit http://www.clarographics.org/svn_details which was mentioned http://wiki.python.org/moin/GuiProgramming So is this project abandoned? Is there any backup that I can get the code? Any other recommands for simple GUI development, with out la

Re: a question about Chinese characters in a Python Program

2008-10-20 Thread est
On Oct 20, 11:46 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Mon, 20 Oct 2008 06:30:09 -0700, est wrote: > > Like I said, str() should NOT throw an exception BY DESIGN, it's a basic > > language standard. > > int() is also a basic l

Re: a question about Chinese characters in a Python Program

2008-10-20 Thread est
On Oct 20, 6:47 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 20 Okt, 07:32, est <[EMAIL PROTECTED]> wrote: > > > > > Personally I call it a serious bug in python > > Normally I'd entertain the possibility of bugs in Python, but your > reasoning is a

Re: a question about Chinese characters in a Python Program

2008-10-19 Thread est
On Oct 20, 10:48 am, Liang Chen <[EMAIL PROTECTED]> wrote: > Hope you all had a nice weekend. > > I have a question that I hope someone can help me out. I want to run a Python > program that uses Tkinter for the user interface (GUI). The program allows me > to type Chinese characters, but neverth

Re: TypeError: can't pickle HASH objects?

2008-10-02 Thread est
On Oct 2, 5:07 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 01 Oct 2008 16:50:05 -0300, est <[EMAIL PROTECTED]> escribió: > > > > > > >>>> import md5 > >>>> a=md5.md5() > >>>> import pickle &g

Re: TypeError: can't pickle HASH objects?

2008-10-02 Thread est
On Oct 2, 4:22 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Oct 2, 2:44 am, est <[EMAIL PROTECTED]> wrote: > > > > > > > On Oct 2, 1:51 pm, "James Mills" <[EMAIL PROTECTED]> wrote: > > > > O

Re: TypeError: can't pickle HASH objects?

2008-10-02 Thread est
On Oct 2, 1:51 pm, "James Mills" <[EMAIL PROTECTED]> wrote: > On Thu, Oct 2, 2008 at 3:34 PM, est <[EMAIL PROTECTED]> wrote: > > wow. It's giga-size file. I need stream reading it, md5 it. It may > > break for a while. > > So use gene

Re: TypeError: can't pickle HASH objects?

2008-10-01 Thread est
On Oct 2, 11:27 am, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Oct 1, 2:50 pm, est <[EMAIL PROTECTED]> wrote: > > > > > > > >>> import md5 > > >>> a=md5.md5() > > >>> import pi

TypeError: can't pickle HASH objects?

2008-10-01 Thread est
>>> import md5 >>> a=md5.md5() >>> import pickle >>> pickle.dumps(a) Traceback (most recent call last): File "", line 1, in File "C:\Python25\lib\pickle.py", line 1366, in dumps Pickler(file, protocol).dump(obj) File "C:\Python25\lib\pickle.py", line 224, in dump self.save(obj) Fil

Re: str() should convert ANY object to a string without EXCEPTIONS !

2008-09-28 Thread est
On Sep 28, 7:12 pm, Lie <[EMAIL PROTECTED]> wrote: > On Sep 28, 3:35 pm, est <[EMAIL PROTECTED]> wrote: > > > > Because that's how ASCII is defined. > > > Because that's how ASCII is defined.  ASCII is a 7-bit code. > > > Then why can't

Re: str() should convert ANY object to a string without EXCEPTIONS !

2008-09-28 Thread est
On Sep 28, 6:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sun, 28 Sep 2008 01:35:11 -0700, est wrote: > >> Because that's how ASCII is defined. > >> Because that's how ASCII is defined.  ASCII is a 7-bit code. > > > Then

Re: str() should convert ANY object to a string without EXCEPTIONS !

2008-09-28 Thread est
On Sep 28, 4:38 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 27 Sep 2008 22:37:09 -0700, est wrote: > >>>> str(u'\ue863') > > Traceback (most recent call last): > >   File "", line 1, in > > Un

Re: str() should convert ANY object to a string without EXCEPTIONS !

2008-09-28 Thread est
> Because that's how ASCII is defined. > Because that's how ASCII is defined. ASCII is a 7-bit code. Then why can't python use another default encoding internally range(256)? > Python refuses to guess and tries the lowest common denominator -- ASCII -- > instead. That's the problem. ASCII is I

str() should convert ANY object to a string without EXCEPTIONS !

2008-09-27 Thread est
>From python manual str( [object]) Return a string containing a nicely printable representation of an object. For strings, this returns the string itself. The difference with repr(object) is that str(object) does not always attempt to return a string that is acceptable to eval(); its goal is to r

Re: forkpty not working?

2008-03-21 Thread est
the current > process effectively goes away on exec. > > On Thu, 20 Mar 2008 00:40:49 -0700, est wrote: > > Hello everyone. I am trying to write a bash/ssh wrapper in python so > > python scripts could interact with bash/ssh. > > > Because when input passwords to s

forkpty not working?

2008-03-20 Thread est
Hello everyone. I am trying to write a bash/ssh wrapper in python so python scripts could interact with bash/ssh. Because when input passwords to ssh it requires a tty rather than stdin pipe, so i have to use a pty module to do that. I copied this snippet from this thread http://groups.google.com

Re: n00b with urllib2: How to make it handle cookie automatically?

2008-02-24 Thread est
On Feb 25, 5:46 am, 7stud <[EMAIL PROTECTED]> wrote: > On Feb 24, 4:41 am, est <[EMAIL PROTECTED]> wrote: > > > > > > > On Feb 23, 2:42 am, Rob Wolfe <[EMAIL PROTECTED]> wrote: > > > > est <[EMAIL PROTECTED]> writes: > > > >

Re: n00b with urllib2: How to make it handle cookie automatically?

2008-02-24 Thread est
On Feb 23, 2:42 am, Rob Wolfe <[EMAIL PROTECTED]> wrote: > est <[EMAIL PROTECTED]> writes: > > Hi all, > > > I need urllib2 do perform series of HTTP requests with cookie from > > PREVIOUS request(like our browsers usually do ). Many people suggest I > > u

Re: n00b with urllib2: How to make it handle cookie automatically?

2008-02-24 Thread est
On Feb 23, 5:57 am, 7stud <[EMAIL PROTECTED]> wrote: > On Feb 21, 11:50 pm, est <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > I need urllib2 do perform series of HTTP requests with cookie from > > PREVIOUS request(like our browsers usually do ). > >

n00b with urllib2: How to make it handle cookie automatically?

2008-02-21 Thread est
Hi all, I need urllib2 do perform series of HTTP requests with cookie from PREVIOUS request(like our browsers usually do ). Many people suggest I use some library(e.g. pycURL) instead but I guess it's good practise for a python beginner to DIY something rather than use existing tools. So my probl

Re: Could WSGI handle Asynchronous response?

2008-02-18 Thread est
On Feb 18, 10:35 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Mon, 18 Feb 2008 05:27:41 -0800 (PST), est <[EMAIL PROTECTED]> wrote: > >On Feb 18, 7:05 pm, est <[EMAIL PROTECTED]> wrote: > >> I am writing a small 'comet'-like app using flup,

Re: Could WSGI handle Asynchronous response?

2008-02-18 Thread est
On Feb 18, 7:05 pm, est <[EMAIL PROTECTED]> wrote: > I am writing a small 'comet'-like app using flup, something like this: > > def myapp(environ, start_response): >     start_response('200 OK', [('Content-Type', 'text/plain')]) >  

Could WSGI handle Asynchronous response?

2008-02-18 Thread est
I am writing a small 'comet'-like app using flup, something like this: def myapp(environ, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return ['Flup works!\n']<-Could this be part of response output? Could I time.sleep() for a while then

Help! pty interact with bash

2008-02-17 Thread est
#!/usr/bin/env python import os, pty, time class pty_Popen: def __init__ (self, command, *args): self.pid, self.fd = pty.fork () if self.pid == 0: os.execv (command, command, args) else: pass def read (self, max_read): return os.read

any python wrapper to call .lib static library(ufmod.lib)?

2008-02-16 Thread est
I want to play .XM music using Python, now I found ufmod http://ufmod.sourceforge.net It only provide a ufmod.lib to be compiled in C/C++/BASIC, and Python as a scripting language could not handle these static libraries. What could I do to with these .lib files? Cheers -- http://mail.python.org

Re: dbus-python for windows

2008-01-17 Thread est
<[EMAIL PROTECTED]> wrote: > est gmail.com> writes: > > > I am trying to port Scribes to Windows, > > Hi there like minded fellow > > > sourceforge.net/projects/windbus/≥ but it not for Python, so how could > > I install dbus module for Windows Python

Re: dbus-python for windows

2008-01-02 Thread est
102 13:41], est ([EMAIL PROTECTED]) wrote: > > >I am trying to port Scribes to Windows, but I could not find a package > >named dbus-python for windows. There is a windbus >sourceforge.net/projects/windbus/> but it not for Python, so how could > >I install dbus module

dbus-python for windows

2008-01-02 Thread est
Hi all I am trying to port Scribes to Windows, but I could not find a package named dbus-python for windows. There is a windbus but it not for Python, so how could I install dbus module for Windows Python 2.5 ? ps Is there anyone trying to port Scribes to Windows? -- http://mail.python.org/mail

Any library parsing wikipedia API

2007-10-28 Thread est
I got some text via wikipedia API http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Chengdu&rvprop=content&redirects&format=xml&callback=wikiCallback but it's not HTML formated. So how can I parse these texts to standard HTML? Are there any library in python could do this? --

Need suggestion on a GTalk Webservice

2007-10-11 Thread est
I am writing a GTalkBot which provides a webservice http://xxx.com/services/sendmessage.html If someone POST some text to http://xxx.com/services/sendmessage.html it will transfer the text to some friends on GTalk. I tried using django's __init__.py function to build this service but it seemed to

set_proxy in urllib2 is driving my crazy

2007-07-23 Thread est
A simple py script import urllib2 req=urllib2.Request("http://www.google.com";) req.set_proxy("127.0.0.1:1","http") print urllib2.urlopen(req).read() Here is error: "C:\Python25\python.exe" -u "E:\Python\Crawler\test.py" Traceback (most recent call last): File "E:\Python\Crawler\test.py"

Re: Newbie prob: How to write a file with 3 threads?

2007-05-08 Thread est
On May 8, 2:13 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 7 May 2007 18:22:07 -0700, est <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > > > I guess I will write multiple files, one thread one file, and after > > all

Re: Newbie prob: How to write a file with 3 threads?

2007-05-07 Thread est
On May 8, 1:29 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 7 May 2007 00:13:46 -0700, est <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > > > > I'll try Queue.Queue, thank you. I didn't expect that multithread > > wr

Re: Newbie prob: How to write a file with 3 threads?

2007-05-07 Thread est
On May 7, 5:12 am, MRAB <[EMAIL PROTECTED]> wrote: > On May 6, 9:51 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:> In > <[EMAIL PROTECTED]>, est wrote: > > > I need to write a file using 3 threads simutaniously, e.g. Thread 1 > > &g

Newbie prob: How to write a file with 3 threads?

2007-05-06 Thread est
I need to write a file using 3 threads simutaniously, e.g. Thread 1 write the first byte of test.bin with an "a", second thread write the second byte "b", third thread write the third byte "c". Anyone could give a little example on how to do that? I have my code, but it makes python intepreter cra

Re: py script modify it's Modified Time?

2007-04-12 Thread est
On 4月12日, 上午2时26分, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 11 Apr 2007 10:33:57 -0300, <[EMAIL PROTECTED]> escribió: > > > On Apr 11, 6:14 am, "est" <[EMAIL PROTECTED]> wrote: > >> I guess os.stat() could retrieve informat

py script modify it's Modified Time?

2007-04-11 Thread est
I guess os.stat() could retrieve information about ctime, mtime of a path, but how can I change them? Is it possible to make it work both under Win32 and Linux? P.S. How to get the current running python? (Like WScript.ScriptFullName in vbscript) -- http://mail.python.org/mailman/listinfo/pytho