ANN: rom 0.16 - Redis object mapper for Python

2013-07-18 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

Re: [Python-Dev] PEP 350: Codetags

2005-09-27 Thread Josiah Carlson
"Phillip J. Eby" <[EMAIL PROTECTED]> wrote: > At 03:35 PM 9/26/2005 -0700, Micah Elliott wrote: > >Please read/comment/vote. This circulated as a pre-PEP proposal > >submitted to c.l.py on August 10, but has changed quite a bit since > >then. I'm reposting this since it is now "Open (under consi

Re: [Python-Dev] PEP 350: Codetags

2005-09-29 Thread Josiah Carlson
Micah Elliott <[EMAIL PROTECTED]> wrote: > Josiah> an unofficial spec is sufficient. See koders.com and search > Josiah> for 'fixme' to see some common variants. > > But that's the problem -- there are already a bunch of "unofficial" > specs, which don't serve much purpose as such. It's a cool

Dr. Dobb's Python-URL! - weekly Python news and links (Jan 9)

2005-01-09 Thread Josiah Carlson
QOTW: Jim Fulton: "[What's] duck typing?" Andrew Koenig: "That's the Australian pronunciation of 'duct taping'." "I'm thinking that the I-Ching is a vast untapped resource for programming wisdom, plus it makes it funny." -- Mark Carter Nick Coghlan brings up the 'lambdas are going away in 3

Dr. Dobb's Python-URL! - weekly Python news and links (Jan 9)

2005-01-10 Thread Josiah Carlson
QOTW: Jim Fulton: "[What's] duck typing?" Andrew Koenig: "That's the Australian pronunciation of 'duct taping'." "I'm thinking that the I-Ching is a vast untapped resource for programming wisdom, plus it makes it funny." -- Mark Carter Nick Coghlan brings up the 'lambdas are going away in 3

Re: IDLE Problem in Windows XP

2005-01-22 Thread Josiah Carlson
Branden Smith <[EMAIL PROTECTED]> wrote: > > Hi, > > I am a teaching assistant for an introductory course at Georgia Tech > which uses Python, and I have a student who has been unable to start > IDLE on her Windows XP Home Edition machine. Clicking on the shortcut > (or the program executable) c

Dr. Dobb's Python-URL! - weekly Python news and links (Jan 23)

2005-01-23 Thread Josiah Carlson
QOTW: "XML with elementtree is what makes me never have [to] think about XML again." -- Istvan Albert "'Plays well with others' was a strong motivator for Python's design, and that often means playing by others' rules." -- Tim Peters Type mutability, and why some types are immutable. T

Dr. Dobb's Python-URL! - weekly Python news and links (Jan 23)

2005-01-25 Thread Josiah Carlson
QOTW: "XML with elementtree is what makes me never have [to] think about XML again." -- Istvan Albert "'Plays well with others' was a strong motivator for Python's design, and that often means playing by others' rules." -- Tim Peters Type mutability, and why some types are immutable. T

Re: [Python-Dev] PEP-343 - Context Managment variant

2005-08-08 Thread Josiah Carlson
falcon <[EMAIL PROTECTED]> wrote: > It's idea was token from Ruby. But I think, good idea is good whatever it > came from. > It can be not Pythonic. Just because something may be a good idea, doesn't mean that the idea is Pythonic. The only person who can truely say is Guido, but you can gain s

Python and games

2005-08-14 Thread Josiah Carlson
Perhaps some of you would get a kick out of this. - Josiah Like XML, scripting was extremely useful as both a mod tool and an internal development tool. If you don't have any need to expose code and algorithms in a simple and safe way to others, you can argue that providing a scripting languag

Re: network programming without goto

2004-11-28 Thread Josiah Carlson
se() except: pass - Josiah > > --- Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > > kent sin <[EMAIL PROTECTED]> wrote: > > > > > > Please help: > > > > > > I was really blocked here. without goto I really > > d

Re: wxStyledTextCtrl problem ?

2004-11-28 Thread Josiah Carlson
Paul Robson <[EMAIL PROTECTED]> wrote: > > I have a wierd thing with a little editor app I'm writing. > > I'm using wxStyledTextCtrl ; the wrapper for Scintilla. When I create the > frame in wxPython, I use self.Editor.SetFocus() to put the focus initially > on the editor. > > This works fine.

Re: python API wrapper for C++ API

2004-11-30 Thread Josiah Carlson
"Mark Doberenz" <[EMAIL PROTECTED]> wrote: > I'm fairly new at Python, but I've got a project I really want to do. > > I'm working with a real-time 3D program called Deep Creator, and it has > a C++ API written for it. I'm wondering what it would take to create a > Python wrapper that would all

Re: Few things

2004-11-30 Thread Josiah Carlson
[EMAIL PROTECTED] (bearophile) wrote: > > Thank you for the comments and answers, and sorry for my answering > delay... > > Josiah Carlson: > > >Decorators can do this without additional syntax. Think @accepts and > @returns.< > > The purpose of those pre-p

Re: decorators ?

2004-11-30 Thread Josiah Carlson
km <[EMAIL PROTECTED]> wrote: > > Hi all, > was going thru the new features introduced into python2.4 version. > i was stuck with 'decorators' - can someone explain me the need of such a > thing called decorators ? Decorators are not 'needed'. They are a convenience. Among the things that

Re: A way to wait Python event

2004-12-02 Thread Josiah Carlson
[EMAIL PROTECTED] (Chang LI) wrote: > > I tried to launch "python.exe test.py" in another program. After the > launch the console was showed and exited on Windows. I want the > console stay there. Is there a Python statement to wait an event loop > like Tcl's "after forever"? I'm a fan of... _

Re: decorators ?

2004-12-02 Thread Josiah Carlson
Jacek Generowicz <[EMAIL PROTECTED]> wrote: > > BJörn Lindqvist <[EMAIL PROTECTED]> writes: > > > I think the essence of decorators is that it makes it possible to do > > in Python what you in other languages do with method qualifiers. > > I find it fascinating that the addition of a bit of syn

Re: using cmd.exe as a telnet client

2004-12-03 Thread Josiah Carlson
Donnal Walter <[EMAIL PROTECTED]> wrote: > > Several months ago I tried using the telnet module (on Windows XP) to > communicate with a proprietary host on our network. This was > unsuccessful due to problems with "option negotiation", and I gave up on > the project for a while. I still have n

Re: Semaphore or what should I use?

2004-12-03 Thread Josiah Carlson
Pierre Barbier de Reuille <[EMAIL PROTECTED]> wrote: > > Ville Vainio a écrit : > >>"Bastian" == Bastian Hammer <[EMAIL PROTECTED]> writes: > > > > > > Bastian> Now I have to make sure, that both threads are > > Bastian> synchronal, 1 thread edits something and the other is > >

Re: string slicing

2004-12-05 Thread Josiah Carlson
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Ishwor wrote: > > > I am trying some interactive examples here where i have come across > > inconsistencies??? :O > > obsession with implementation artifacts is a premature optimization, > and should be avoided. [snip] > a suggestion: if you rea

Re: string slicing

2004-12-05 Thread Josiah Carlson
Ishwor <[EMAIL PROTECTED]> wrote: > > On Sun, 05 Dec 2004 10:31:12 -0800, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > > > a suggestion: if you really want to be productive in pyt

Re: Mean, median, and mode

2004-12-06 Thread Josiah Carlson
[EMAIL PROTECTED] (Sean McIlroy) wrote: > > >>> median = lambda x: (max(x)-min(x))/2 That is /not/ the median in the general case. median = lambda x: x.sort() or x[len(x)//2] - Josiah -- http://mail.python.org/mailman/listinfo/python-list

Re: Deadlock detection

2004-12-06 Thread Josiah Carlson
Duncan Grisby <[EMAIL PROTECTED]> wrote: > > Hi, > > Does anyone know of a deadlock detector for Python? I don't think it > would be too hard to hook into the threading module and instrument > mutexes so they can be tested for deadlocks. I've googled around but I > haven't found anything. I'm

Re: Mean, median, and mode

2004-12-06 Thread Josiah Carlson
"Robert Brewer" <[EMAIL PROTECTED]> wrote: > > Josiah Carlson wrote: > > [EMAIL PROTECTED] (Sean McIlroy) wrote: > > > > > > >>> median = lambda x: (max(x)-min(x))/2 > > > > That is /not/ the median in the general case. &g

Re: Mean, median, and mode

2004-12-06 Thread Josiah Carlson
[EMAIL PROTECTED] (Michael Fuhr) wrote: > > Josiah Carlson <[EMAIL PROTECTED]> writes: > > > > "Robert Brewer" <[EMAIL PROTECTED]> wrote: > > > > > > Josiah Carlson wrote: > > > > > > > > median = lambda x:

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 10)

2004-12-12 Thread Josiah Carlson
QOTW: "I still think this is a silly idea, but at least it doesn't track mud all over Python's nice clean rugs." -- Michael J. Fromberger http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/dde861393aa5a68/eb3a5e53f9743413 "Basically, in tk, canvases are for vector draw

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 10)

2004-12-10 Thread Josiah Carlson
QOTW: "I still think this is a silly idea, but at least it doesn't track mud all over Python's nice clean rugs." -- Michael J. Fromberger http://groups-beta.google.com/group/comp.lang.python/browse_thread/thread/dde861393aa5a68/eb3a5e53f9743413 "Basically, in tk, canvases are for vector draw

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 25)

2004-12-25 Thread Josiah Carlson
QOTW: "Python, the language that wraps tightly around a problem and swallows it whole." -- Raymond Hettinger Because it is so important, this link is re-posted for the future (originally appeared in the December 15 Python-Url! posting by Cameron Laird): Martin Bless summarizes in an

ANN: rom 0.25.0 - Redis object mapper for Python

2014-01-21 Thread Josiah Carlson
Hey everyone, Big change today: rom now supports fast prefix, suffix, and pattern match queries over your data. The method is based on the autocomplete process described in my book, Redis in Action The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's O

ANN: rom 0.18 - Redis object mapper for Python

2013-08-18 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: rom 0.19 - Redis object mapper for Python

2013-08-27 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

Ann: rom 0.20 - Redis object mapper for Python

2013-09-12 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: RPQueue 0.21

2013-09-20 Thread Josiah Carlson
Hello everyone, For those of you who didn't know, if you are interested in a Redis-backed time and/or fifo-queue with priorities, retries, etc., to be used with Python, one exists and is mature: it's called RPQueue, and it seeks to simplify your life of task execution. The recent changelog entries

ANN: rom 0.21 - Redis object mapper for Python

2013-10-02 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: RPQueue 0.22

2013-10-08 Thread Josiah Carlson
Hello everyone, For those of you who didn't know, if you are interested in a Redis-backed time and/or fifo-queue with priorities, retries, etc., to be used with Python, one exists and is mature: it's called RPQueue, and it seeks to simplify your life of task execution. The recent changelog entries

ANN: rom 0.22 - Redis object mapper for Python

2013-11-03 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

ANN: rom 0.10 - Redis object mapper for Python

2013-04-21 Thread Josiah Carlson
Hey everyone, I know, it's been several years since I announced anything on these lists, but I suspect that some of you may have uses for my new package, so here you go. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or

Re: [wxPython-users] Re:

2006-10-24 Thread Josiah Carlson
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Tuesday 24/10/2006 23:25, Michael S wrote: > > >I extended part of my program in C, since that part > >was too involved for Python. Now when I import the > >module I created and call its functions, I am trying > >to feedback some information bac t

Re: [wxPython-users] Re:

2006-10-25 Thread Josiah Carlson
nes.html . It would allow you to do all of your GUI manipulation/updating in Python without having to worry about locks or calling Python code from C. - Josiah > --- Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > > Gabriel Genellina <[EMAIL PROTEC

where the hell is the run command of PyPe editor?

2006-11-02 Thread Josiah Carlson
daniel <[EMAIL PROTECTED]> wrote: > I'm trying to use PyPe, but I just got so frustrated when attempting to > run a script, this is the very first feature I would use for an editor, > OMG. I browsed through every single menu item and gave up... > > any help would be appreciated, (the most silly

Re: [Python-Dev] The baby and the bathwater (Re: Scoping, augmented assignment, 'fast locals' - conclusion)

2006-06-15 Thread Josiah Carlson
Boris Borcic <[EMAIL PROTECTED]> wrote: > [this is bytes of an oversized put-all-into-it intervention. A possibly > expanded > version will be submitted on clp with local followup before a couple days] > > Josiah Carlson wrote: > > [BB] > >> I'd say

Re: a good programming text editor (not IDE)

2006-06-15 Thread josiah . carlson
John Salerno wrote: > I know there's a request for a good IDE at least once a week on the ng, > but hopefully this question is a little different. I'm looking for > suggestions for a good cross-platform text editor (which the features > for coding, such as syntax highlighting, etc.) but not a full

Re: a good programming text editor (not IDE)

2006-06-16 Thread josiah . carlson
Walter Dörwald wrote: > I tried it out and the first problem I noticed is that on Windows > opening a file from a Samba drive doesn't seem to work, as PyPE converts > the filename to lowercase. ...Samba is tricky, and I hadn't thought of it before. Normal Windows is case-insensitive but case-pres

Re: [Python-Dev] The baby and the bathwater (Re: Scoping, augmented assignment, 'fast locals' - conclusion)

2006-06-16 Thread Josiah Carlson
nd if anyone else has anything to say about the topic, they can reply to either of us. Boris Borcic <[EMAIL PROTECTED]> wrote: > Josiah Carlson wrote: > > In my initial and later readings of your messages, I read 2 reasons why > > you were using a closure rather than some ot

sys.settrace() and Python 2.3

2006-06-28 Thread Josiah Carlson
According to my reading of Python 2.3 docs, the call to goo() at the end should exit with a KeyboardInterrupt... import sys def goo(): while 1: pass count = [100] def foo(frame, event, arg): count[0] -= 1 if not count[0]: raise Key

Re: compiling python (or ironpython) to .exe or .dll for or not for .NET

2006-06-29 Thread josiah . carlson
per9000 wrote: > Update: > > I have found a holy handgrenade. > > I found something that seems to work fine for me - I've only tried it > for 5 minutes but seems to work very smoothly. Open-source, Mozilla > license, you know the drill... > > http://www.py2exe.org/ > > py2exe (the name makes me fa

Re: [wxPython-users] Problem in threading

2006-02-02 Thread Josiah Carlson
My response is at the end. Sbaush <[EMAIL PROTECTED]> wrote: > Hi all. > I've a problem with thread in python. > My applications has a GUI that has some button. > I've a MVC-like architecture. > If i click on a button there is this effect: > > view.button_1_delete.Bind(EVT_BUTTON,self.OnDelete)

Re: interesting take on python OO

2007-06-02 Thread Josiah Carlson
7stud wrote: > http://www.evolt.org/article/OO_programming_the_Python_way/18/449/ > > lol I would have to agree. I could spend time talking about how bad that article was, but instead I will offer useful advice for the new Python programmer. For new users of Python and/or object-oriented prog

Re: Python rocks

2007-06-02 Thread Josiah Carlson
Mark Carter wrote: > Not that I'm particularly knowledgeable about language design issues, > but maybe closures and slightly different scoping rules would be nice. Python has had closures for years. What kind of scoping did you desire? > A > pitfall of Python is knowing whether an operation is

Re: Non-blocking subprocess call

2007-06-02 Thread Josiah Carlson
Kevin Walzer wrote: > I'm currently using os.popen in an application of mine, which calls for > non-blocking data, in this fashion: > > self.file = os.popen('echo %s | sudo -S /sw/bin/fink -y install %s' % > (self.passtext, self.packagename), 'r', os.O_NONBLOCK) > > What is the equivalent/comp

Re: Python rocks

2007-06-02 Thread Josiah Carlson
Mark Carter wrote: > Josiah Carlson wrote: >> What kind of scoping did you desire? > > Well, I had in mind so that if you defined a function, but wanted to > access a global var, that you didn't have to use the global keyword. Not > much of a biggie, I guess. You

Re: another thread on Python threading

2007-06-03 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I've recently been working on an application[1] which does quite a bit > of searching through large data structures and string matching, and I > was thinking that it would help to put some of this CPU-intensive work > in another thread, but of course this won't work becau

Re: magic names in python

2007-06-04 Thread Josiah Carlson
per9000 wrote: > So my questions: > * is there a comprehensive list of magic names in python (so far i > know of __init__ and __repr__)? > * are these lists complete or can magic names be added over time (to > the python "core")? > * are magic names the same in different python versions? I don'

Re: another thread on Python threading

2007-06-04 Thread Josiah Carlson
sturlamolden wrote: > On Jun 4, 3:10 am, Josiah Carlson <[EMAIL PROTECTED]> > wrote: >> From what I understand, the Java runtime uses fine-grained locking on >> all objects. You just don't notice it because you don't need to write >> the acquire()/rele

Re: Python, Dutch, English, Chinese, Japanese, etc.

2007-06-04 Thread Josiah Carlson
Steve Howell wrote: > I don't predict a huge upswing in Slavic-writing > Python programmers after PEP 3131, even among > children. Are you predicting a sharp upswing in Chinese-writing (or any language) Python programmers after PEP 3131 among children? If so, why certain groups of children and

Re: another thread on Python threading

2007-06-05 Thread Josiah Carlson
sturlamolden wrote: > On Jun 4, 10:11 pm, Josiah Carlson <[EMAIL PROTECTED]> > wrote: > >> lock = threading.Lock() >> >> with lock: >> #synchronized block! >> pass > > True, except that the lock has to be shared

Re: another thread on Python threading

2007-06-05 Thread Josiah Carlson
sturlamolden wrote: > On Jun 4, 10:11 pm, Josiah Carlson <[EMAIL PROTECTED]> > wrote: > >> However, locking isn't just for refcounts, it's to make sure that thread >> A isn't mangling your object while thread B is traversing it. > > >> W

Re: lists - append - unique and sorted

2007-06-06 Thread Josiah Carlson
Neil Cerutti wrote: > On 2007-06-06, rhXX <[EMAIL PROTECTED]> wrote: >> and/or >> >> - SORTED - INSERT in the correct place using some criteria? > > Consult the Python Docs about the heapq module. Heaps (as produced by heapq) are not sorted. This will not produce correct results unless one then

Re: who know?

2007-06-06 Thread Josiah Carlson
Michel Claveau wrote: > Hi! > > This image show IronPython. > But... what is it? > > Link : > http://msdn2.microsoft.com/en-us/vstudio/bb510103.vss_IronPython_large.jpg What is generally referred to as "Python", available from python.org, is really the 'CPython' runtime and associated libraries

Re: How Can I Increase the Speed of a Large Number of Date Conversions

2007-06-07 Thread Josiah Carlson
Some Other Guy wrote: > vdicarlo wrote: >> I am a programming amateur and a Python newbie who needs to convert >> about 100,000,000 strings of the form "1999-12-30" into ordinal dates >> for sorting, comparison, and calculations. Though my script does a ton >> of heavy calculational lifting (for wh

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-09 Thread Josiah Carlson
James Stroud wrote: > Terry Reedy wrote: >> In Python, you have a choice of recursion (normal or tail) > > Please explain this. I remember reading on this newsgroup that an > advantage of ruby (wrt python) is that ruby has tail recursion, implying > that python does not. Does python have fully o

Re: Hooking exceptions outside of call stack

2007-06-09 Thread Josiah Carlson
Warren Stringer wrote: > Here is what I would like to do: > > # > a = Tr3() # implements domain specific language > a.b = 1# this works, Tr3 overrides __getattr__ > a.__dict__['b'] = 2# just so you know th

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-09 Thread Josiah Carlson
Alexander Schmolck wrote: > Josiah Carlson <[EMAIL PROTECTED]> writes: > >> James Stroud wrote: >>> Terry Reedy wrote: >>>> In Python, you have a choice of recursion (normal or tail) >>> Please explain this. I remember reading on this newsgroup th

Re: Hooking exceptions outside of call stack

2007-06-09 Thread Josiah Carlson
Warren Stringer wrote: > Am still trying to hook a NameError exception and continue to run. After a > few more hours of searching the web and pouring over Martelli's book, the > closest I've come is: [snip] > Is there a way of intervening as `exec cmd in globals, locals` attempts to > translate 'c'

Re: Multiple python interpreters within the same process

2007-06-09 Thread Josiah Carlson
André wrote: > On Jun 9, 5:00 pm, "Marcin Kalicinski" <[EMAIL PROTECTED]> wrote: >> How do I use multiple Python interpreters within the same process? >> >> I know there's a function Py_NewInterpreter. However, how do I use functions >> like Py_RunString etc. with it? They don't take any arguments

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Josiah Carlson
Steven D'Aprano wrote: > On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote: > >> the only thing that optimization >> currently does in Python at present is to discard docstrings > > Python, or at least CPython, does more optimizations than that. Aside from

Re: Hooking exceptions outside of call stack

2007-06-10 Thread Josiah Carlson
Warren Stringer wrote: > Josiah Carlson wrote: >> >>> foo = type(foo)(foo.func_code, d, foo.func_name, foo.func_defaults, >> foo.func_closure) > > Wow! I've never seen that, before. Is there documentation for `type(n)(...)` > somewhere? I did find a very u

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread Josiah Carlson
John Nagle wrote: > Josiah Carlson wrote: [snip] >> Constant folding happens regardless of optimization level in current >> Pythons. > >> So really, assert and docstring removals. Eh. > >It's hard to optimize Python code well without global analysis. >

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-10 Thread Josiah Carlson
Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> Not tail calls, in general, no. >> Sorry, how does that work? You're suggesting that there is an algorithm >> which the compiler could follow to optimize away tail-recursion, but human >> beings can't follow the same algorithm? >>

Re: memory efficient set/dictionary

2007-06-10 Thread Josiah Carlson
Rafael Darder Calvo wrote: >> > > Please recommend a module that allows persistent set/dict storage + >> > > fast query that best fits my problem, >> > >> > What is the problem you are trying to solve? How many keys do you have? >> >> Corpus processing. There are in the order of billions to tens of

Re: memory efficient set/dictionary

2007-06-11 Thread Josiah Carlson
koara wrote: >>> I would recommend you to use a database since it meets your >>> requirements (off-memory, fast, persistent). The bsdddb module >>> (berkeley db) even gives you a dictionary like interface. >>> http://www.python.org/doc/lib/module-bsddb.html >> Standard SQL databases can work for th

Re: save class

2007-06-13 Thread Josiah Carlson
Gabriel Genellina wrote: > En Wed, 13 Jun 2007 23:11:22 -0300, nik <[EMAIL PROTECTED]> escribió: >> It would seem that I want to actually save the source code for the >> class. I know that I could of course open up an editor and just make >> it, but my ideal would be to have the base class, Map, be

Re: dynamically generated runtime methods & reflection

2007-06-13 Thread Josiah Carlson
Jay Loden wrote: > Hi all, > > First, apologies if anyone gets this twice, but it took me quite a > while to figure out that Python.org is evidently rejecting all mail > from my mail server because I don't have reverse DNS configured. > Anyway: > > I'm not even sure how to phrase this question pr

Re: dynamically generated runtime methods & reflection

2007-06-14 Thread Josiah Carlson
Jay Loden wrote: > Josiah Carlson wrote: >> Ahh, so you want to pass the method name to the method that you are >> returning to be called. No problem. >> >> >>> import functools >> >>> >> >>> class foo: >> ...

Re: Method much slower than function?

2007-06-14 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > On Jun 14, 1:10 am, Paul Rubin wrote: >> "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >>> take virtually the same amount of time on my machine (2.5), and the >>> non-join version is clearer, IMO. I'd still use join in case I wind >>> up runn

Re: Method much slower than function?

2007-06-14 Thread Josiah Carlson
Francesco Guerrieri wrote: > On 6/14/07, Peter Otten <[EMAIL PROTECTED]> wrote: >> Gabriel Genellina wrote: >> > ... >> > py> print timeit.Timer("f2()", "from __main__ import >> f2").repeat(number=1) >> > [0.42673663831576358, 0.42807591467630662, 0.44401481193838876] >> > py> print timeit.Timer("

Re: save class

2007-06-14 Thread Josiah Carlson
nik wrote: > of having to keep track of a separate dictionary file. I am new to > this, but I thought that this would be a regular thing to do in > python, because people must make classes in the interactive console > and then export them somehow for later use. Create a file. Put your code in it.

Re: dynamically generated runtime methods & reflection

2007-06-14 Thread Josiah Carlson
Josiah Carlson wrote: > Well, the particular operation is typically called 'currying a > function', and unless you know what to look for, it isn't very easy to > make happen. Replace "make happen" to "discover in the standard library". - Josiah

Re: Priority Queue with Mutable Elements

2007-06-15 Thread Josiah Carlson
Chris Lasher wrote: > I am working with large graphs (~150,000 to 500,000 nodes) which I > need decompose node-by-node, in order of a node's value. A node's > value is determined by the sum of its edge weights. When a node is > removed from the graph, its neighbors' values must be updated to take >

Re: smtp server simulation using Python

2007-06-17 Thread Josiah Carlson
William Gill wrote: > I have a (web) development computer w/o an SMTP server and want to test > form generated e-mail using a dummy SMTP server that delivers the mail > message to a file, or better yet, to a text editor instead of actually > sending it. Is it possible to extend the DebuggingSer

Re: Trivial string substitution/parser

2007-06-17 Thread Josiah Carlson
Samuel wrote: > On Sun, 17 Jun 2007 11:00:58 +, Duncan Booth wrote: > >> The elegant and lazy way would be to change your specification so that $ >> characters are escaped by $$ not by backslashes. Then you can write: >> > from string import Template > ... > > Thanks, however, turns o

Re: MS Word parser

2007-06-17 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I'm currently using antiword to extract content from MS Word files. > Is there another way to do this without relying on any command prompt > application? There is also wvware http://wvware.sourceforge.net/, but it is also generally a command-line application. Either o

Re: Memory problem with Python

2007-06-18 Thread Josiah Carlson
Squzer Crawler wrote: > On Jun 18, 11:06 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> On Jun 17, 8:51 pm, Squzer Crawler <[EMAIL PROTECTED]> wrote: >> >>> i am developing distributed environment in my college using Python. I >>> am using therads in client for downloading wepages. Even thou

Re: cStringIO unicode weirdness

2007-06-18 Thread Josiah Carlson
Paul Rubin wrote: > Python 2.5 (r25:51908, Oct 6 2006, 15:24:43) > [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import StringIO, cStringIO > >>> StringIO.StringIO('a').getvalu

Re: Python and (n)curses

2007-06-18 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I need to develop a cross-platform text-mode application. I would like > to do it in Python and I would like to use a mature text-mode library > for the UI stuff. > > The obvious choice, I thought, was ncurses. But as far as I can tell, > it is not available for Python o

Re: high performance/threaded applications in Python - your experiences?

2007-06-24 Thread Josiah Carlson
Ivan Voras wrote: > Jay Loden wrote: > >> I was hoping for some experiences that some of you on the list may have had >> in dealing with Python in a high performance and/or threaded environment. In >> essence, I'm wondering how big of a deal the GIL can be in a real-world >> scenario where you

Re: Chroot Jail Not Secure for Sandboxing Python?

2007-06-25 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > On Jun 25, 1:43 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] schrieb: >> >>> This wiki page suggests using a chroot jail to sandbox Python, but >>> wouldn't running something like this in your sandboxed Python instance >>> still break you out of t

Re: Internals and complexity of types, containers and algorithms

2007-06-26 Thread Josiah Carlson
Harald Luessen wrote: > On Mon, 25 Jun 2007 Martin v. Löwis wrote: > >> Sure, see below: >> >> - tuples are represented as arrays, with a single block for the >> entire objects (object header, tuple size, and data) >> - list are represented as arrays, with two memory blocks: >> one for object he

Re: guidance needed: best practice for script packaging

2007-06-26 Thread Josiah Carlson
Alan Isaac wrote: > This is a simple question about actual practice. > I just want to know how you (yes you) are > approaching this problem. > The problem: > What is the recommended packaging of > demo scripts or test scripts for a package > to be distributed to others to "play with". > (I.e., wit

Re: 16bit hash

2007-06-27 Thread Josiah Carlson
Robin Becker wrote: > Is the any way to get an efficient 16bit hash in python? hash(obj)&65535 - Josiah -- http://mail.python.org/mailman/listinfo/python-list

Re: Building a Python app with Mozilla

2007-06-30 Thread Josiah Carlson
Thorsten Kampe wrote: > Hi, > > I've already sent this to the Komodo mailing list (which seemed to me > the more appropriate place) but unfortunately I got no response. > > I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor > PyQT are actually what I want (because the lack of

Re: Memory leak issue with complex data structure

2007-07-04 Thread Josiah Carlson
Alan Franzoni wrote: > I have a root node which is not referenced by any other node. So, I > created a "clear()" method which is called on all children (by calling > their clear() method" and then clears the set with the references of the > node itself. Using the .clear() method on sets (or dictio

Re: CGI vs WSGI

2007-07-04 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I'm wondering because the only variables I ever needed were PATH_INFO, > REQUEST_METHOD, QUERY_STRING and maybe one more, all of which should > be available from CGI, too. CGI starts up a new process for every request, using stdin/stdout for passing information. I beli

Re: Interfacing python program to C++ program instance

2007-07-05 Thread Josiah Carlson
Jim Langston wrote: > Windows. Situation: Using a Python program called OpenRPG. I have a program > that displays form data (a character sheet) in C++. I am able in the C++ > program to build a string and copy it into the clipboard, then paste it into > the input in the running Python program.

Re: Auto-parallelizing with decorators?

2007-07-07 Thread Josiah Carlson
Kirk Strauser wrote: > In article <[EMAIL PROTECTED]>, > Kirk Strauser <[EMAIL PROTECTED]> wrote: > >> I was thinking about how a lot of Lisp proponents claim that Lisp is >> inherently parallelizable because its functions don't have (or are not >> supposed to have) side effects, and therefore th

Re: Getting the home directory in Python and a bug in os.path.expanduser

2007-07-07 Thread Josiah Carlson
Edward Diener wrote: > What is the generic operating system way of getting the home directory ? > > I am guessing it is os.path.expanduser("~"). Is there a better way or an > alternate way ? > > If it is as I surmise, the aforementioned expanduser("~") of os.path > seems incorrect to me under W

Re: trouble controlling vim with subprocess on windows machine

2007-07-09 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > I am having trouble contolling vim with subprocess on a windows > machine. It appears that vim comes up on the machine all right and it > sometimes looks like it is doing the searchs what I am asking it to do > but when I am asking it to load a file it doesn't do an

Re: trouble controlling vim with subprocess on windows machine

2007-07-09 Thread Josiah Carlson
[EMAIL PROTECTED] wrote: > On Jul 9, 11:06 am, Josiah Carlson <[EMAIL PROTECTED]> > wrote: >> [EMAIL PROTECTED] wrote: >>> I am having trouble contolling vim with subprocess on a windows >>> machine. It appears that vim comes up on the machine all right a

Re: highly einteractive editor for python

2007-07-09 Thread Josiah Carlson
Atul Bhingarde wrote: > Does anybody know an editor that facilitates, interactive python > development. Where GUI etc developed will be possible to see in real time > mode. Boa Constructor? wxGlade embedded in some other software (SPE?) XRCed? What do you mean by "real time mode"? - Josi

Re: trouble controlling vim with subprocess on windows machine

2007-07-10 Thread Josiah Carlson
agc wrote: > Hi Josiah, > This recipe for asynchronous communication usingsubprocesscould be used to write an expect-like tool: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554 > > I have played with the above recipe and it is excellent, > but could you please go i

  1   2   >