MVC for wxWidgets or Tkinter?

2006-08-04 Thread samuraisam
Are there any MVC-framework-like libraries for wxWidgets or Tkinter for Python? If so, any experiences with using them? I need to develop a desktop application *fast* and experiences with the likes of Turbogears have taught me that you can indeed develop very fast with a framework and the MVC struc

Bytes/File Size Format Function

2007-06-12 Thread samuraisam
Quick file size formatting for all those seekers out there... import math def filesizeformat(bytes, precision=2): """Returns a humanized string for a given amount of bytes""" bytes = int(bytes) if bytes is 0: return '0bytes' log = math.floor(math.log(bytes, 1024)) retu

Re: Bytes/File Size Format Function

2007-06-13 Thread samuraisam
Haha, you guys. Use it however you want. But trust me, if you put MiB and GiB instead of the more-common mb and gb [MB and GB] in your applications, your users will probably have a harder time understanding what you mean. -- http://mail.python.org/mailman/listinfo/python-list

FTP Date Format Function

2007-06-14 Thread samuraisam
FTP LST/LIST/NLST date field formatting function for all those seekers out there... import time import datetime def ftpdateformat(value): """Formats dates from most FTP servers""" if ":" in value: # within 6 months return datetime.datetime( *time.strptime( # have to gu

Re: FTP Date Format Function

2007-06-15 Thread samuraisam
On Jun 14, 10:53 pm, billiejoex <[EMAIL PROTECTED]> wrote: > On 14 Giu, 19:25, samuraisam <[EMAIL PROTECTED]> wrote: > > > > > FTP LST/LIST/NLST date field formatting function for all those seekers > > out there... > > > import time >

Current Fastest Python Implementation?

2008-02-18 Thread samuraisam
Has anyone done any recent testing as to which current python implementation is the quickest? Perhaps for Django development - though the current one certainly is fast (and I doubt micro optimizations would make much difference in overall performance). Regardless - have those pypy folks made a fast