OT: Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Jeremy Jones
Tim Golden wrote: >As it happens, (and I suspect I'll have to don my flameproof suit here), >I prefer the Windows command line to bash/readline for day-to-day use, >including in Python. Why? Because it does what I can't for the life of >me get readline to do: you can type the first few letters

Re: Problem ... with threads in Python

2005-10-26 Thread Jeremy Jones
Negoescu Constantin wrote: > Hello. > > I know that Python is */not fully threadsafe/*. Unlike Java, where > threading was considered to be so important that it is a part of the > syntax, in Python threads were laid down at the altar of Portability. > But, i really have to finish a projec

urllib2 problem

2005-10-26 Thread Jeremy Martin
here? I apologize if this is kind of a rookie question but Ive been searching for about a week with no luck. Thanks! Jeremy Martin NWS WFO GLD -- http://mail.python.org/mailman/listinfo/python-list

Re: Web presentation layer/framework for python - recommendations?

2005-10-27 Thread Jeremy Jones
[EMAIL PROTECTED] wrote: >Hi, >I am a python newbie and need some advice. >I have been charged with redeveloping a web application with a front end >written in python that has a backend of XML files. >Currently it doesn't adequately separate out the presentation code from the >content code. >Fra

Re: socket.error: (32, 'Broken pipe'): need help

2005-10-27 Thread Jeremy Jones
Junhua Deng (AL/EAB) wrote: >Hi, >I have a simple server-client application with threading. It works fine when >both server and client on the same machine, but I get the following error >message if the server is on another machine: > >... ... >self.socket.send(outgoingMsg) >socket.error: (32

Re: Scanning a file

2005-10-28 Thread Jeremy Sanders
> > Read in blocks, not byte for byte. I had good experiences with block > sizes like 4096 or 8192. It's difficult to handle overlaps. The four byte sequence may occur at the end of one block and beginning of the next. You'd need to check for these special cases. Jeremy -- J

Why doesn't this work? :)

2005-10-28 Thread Jeremy Moles
Jumping right into the code (which should speak for itself): # --- try: # this will fail and be caught # below, w import foobar except ImportError, error: class foobar: @staticmethod def __getattr

Re: Why doesn't this work? :)

2005-10-28 Thread Jeremy Moles
am using. :) What I'm wondering is if the other method could work, of if it simply impossible in Python considering it's underlying implementation. > On Fri, Oct 28, 2005 at 02:02:29PM -0400, Jeremy Moles wrote: > > Jumping right into the code (which should speak for itself): &

publicity for Python-related projects

2005-11-03 Thread Jeremy Jones
#x27;s homepage, the release (or news) information, and what the project is about. I'm planning on posting nightly at around 5PM GMT +5 (10PM Eastern time in the states), so email that I receive before that time should be posted the same day. Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning multiple languages (question for general discussion)

2005-11-03 Thread Jeremy Greenwald
oding practices and what API's are useful in your domain. That should be your guide as to when you have "learned" a language, when you can answer more questions than you have about a language's style, coding practices, and API.

Re: PyFLTK - an underrated gem for GUI projects

2005-11-08 Thread Jeremy Sanders
aum wrote: > But for smaller gui programs not needing the power of wx, I find I get > the job done much more quickly and effortlessly with PyFLTK. Interesting. I've found PyQt very easy to use too. I wonder how they compare (providing you can GPL your app, of course). -- Jeremy S

Re: Pylab and pyserial plot in real time

2005-11-08 Thread Jeremy Sanders
as the windowing runs in a separate thread. The main problem is that I have only really tested it on Unix, but I have reports that it "mostly" works in Windows (I'm looking into supporting this soon). http://home.gna.org/veusz/ Alternatively matplotlib may be another solution. --

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-09 Thread Jeremy Sanders
e process, and use ulimit (or the resource module) to limit the memory usage. -- Jeremy Sanders http://www.jeremysanders.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Floating numbers and str

2005-11-09 Thread Jeremy Moles
I think you answered your own question. :) x = 0.12345678 y = "%.4f something here" % x On Wed, 2005-11-09 at 11:52 -0800, Tuvas wrote: > I would like to limit a floating variable to 4 signifigant digits, when > running thorugh a str command. Ei, > > > x=.13241414515 > y=str(x)+" something here

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-10 Thread Jeremy Sanders
ng back and forth all the time. -- Jeremy Sanders http://www.jeremysanders.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: help with using temporary files

2005-11-22 Thread Jeremy Jones
Gerard Flanagan wrote: >Hello > > I'm sure its basic but I'm confused about the error I get with the >following code. Any help on basic tempfile usage? > > >ActivePython 2.4.1 Build 247 (ActiveState Corp.) based on >Python 2.4.1 (#65, Jun 20 2005, 17:01:55) [MSC v.1310 32 bit (Intel)] >on win32 >

ncurses' Dark Devilry

2005-11-29 Thread Jeremy Moles
I'm working on a project using ncurses w/ Python. As an aside, I implemented addchstr in the cursesmodule.c file in Python SVN, if anyone wants me to try and get that made permanent. AT ANY RATE... I was wondering--and this is more a general curses question rather than a Python one, but I know th

Re: ncurses' Dark Devilry

2005-11-29 Thread Jeremy Moles
On Tue, 2005-11-29 at 20:50 +, Tony Nelson wrote: > In article <[EMAIL PROTECTED]>, > Jeremy Moles <[EMAIL PROTECTED]> wrote: > > > I'm working on a project using ncurses w/ Python. As an aside, I > > implemented addchstr in the cursesmodule.c file in

Re: How could I ask Thread B to call B().Method() from inside Thread A's run?

2005-11-30 Thread Jeremy Jones
could ildg wrote: > I have 2 thead instances, > A and B, > In A's run method, if I call B.Method(), it will be executed in thead A, > but I want B.Method() to be executed in B's thread. > That's to say, I want to tell Thead B to do B's stuff in B's thread, > kinda like PostMessage in win32. > Can

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-02 Thread Jeremy Jones
sandorf wrote: >I'm using the Windows version of Python and IDLE. When I debug my .py >file, my modification to the .py file does not seem to take effect >unless I restart IDLE. Saving the file and re-importing it doesn't help > >either. Where's the problem? > >Thanks. > > > No problem. Just r

Most SHAMEFUL one-liner:

2005-12-04 Thread Jeremy Moles
I was looking through some code of my today and noticed this little gem I wrote a few days back that I had totally forgot about: fill = [("%%-%ds\n" % (columns - 1)) % " " for i in range(yoffset - 2)] ...and then I went on to do: "".join(fill) Talk about using the wrong tool for the job... :(

Re: ElementTree - Why not part of the core?

2005-12-08 Thread Jeremy Hylton
plexity involved in managing a software distribution composed of third party software packages. At the very least, you've got the original sources and the copy in the distribution package, which leads to a synchronization problem. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: Python evolution: Unease

2005-01-04 Thread Jeremy Bowers
On Tue, 04 Jan 2005 17:12:04 -0800, Paul Rubin wrote: > Irrelevant, the issue isn't what docs can be written if someone wants to > do it, it's what docs are actually already there > I just see various other free software projects as > trying to live up to higher standards and I think Python sh

Re: Concepts RE: Python evolution: Unease

2005-01-05 Thread Jeremy Bowers
On Wed, 05 Jan 2005 12:15:29 +0300, Roman Suzi wrote: > As for concepts, they are from Generic Programming (by Musser and > Stepanov) and I feel that Python is in position to implement them to the > fullest extent. And IMHO it will be nicer than just Java-like interfaces > or Eiffel's contract app

Re: wxPython clipboard

2005-01-06 Thread Jeremy Bowers
On Thu, 06 Jan 2005 03:27:56 -0800, lbolognini wrote: > Could you please give me some advice on the best approach to solve this > problem? To the best of my knowledge, and I'd be surprised if this wasn't true, wxPython does not have the necessary tools to do this. That program doesn't even use t

Re: how to extract columns like awk $1 $5

2005-01-07 Thread Jeremy Sanders
On Fri, 07 Jan 2005 12:15:48 -0500, Anand S Bisen wrote: > Is there a simple way to extract words speerated by a space in python > the way i do it in awk '{print $4 $5}' . I am sure there should be some > but i dont know it. mystr = '1 2 3 4 5 6' parts = mystr.spl

Re: Getting rid of "self."

2005-01-07 Thread Jeremy Bowers
On Fri, 07 Jan 2005 14:39:09 +0100, BJÃrn Lindqvist wrote: > It works! exec(magic()) does the needed hi = self.hi. No it doesn't. Try "hi = 'newValue'" and see what happens. So the next step is to write an "unmagic" function. So now how do you add instance variables? There is no way to avoid "se

Re: Getting rid of "self."

2005-01-09 Thread Jeremy Bowers
On Mon, 10 Jan 2005 01:51:07 +0100, BJÃrn Lindqvist wrote: > This is promising, I'm content with whatever slowdowns necessary as long > as I can prove those who say "you can't do it" wrong. :) Since I think I'm the only person in this discussion that said anything about what you can't do, be clear

Re: Long strings as function parameters

2005-01-09 Thread Jeremy Bowers
On Sun, 09 Jan 2005 08:36:04 -0800, onlyonemc wrote: > I would like to have functions that operate on long strings, 10-100 MB. In > C I would of course pass a pointer to the string for a quick function > call. What is an efficient way to do this in python? Cheers, > -mark Others have pointed ou

Re: ftplib with unknown file names

2005-01-10 Thread Jeremy Jones
r the nlst command: http://www.python.org/doc/current/lib/ftp-objects.html HTH, Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking for X availability

2005-01-11 Thread Jeremy Bowers
On Tue, 11 Jan 2005 03:32:01 -0800, Flavio codeco coelho wrote: > So my question is: how can I check for the availability of X? i.e., How > will my program know if its running in a text only console or in console > window over X? The first thing that leaps to mind is... try it. If it fails, switch

Re: Producer/consumer Queue "trick"

2005-01-15 Thread Jeremy Bowers
On Fri, 14 Jan 2005 16:26:02 -0600, Evan Simpson wrote: > WEBoggle needs a new game board every three minutes. Boards take an > unpredictable (much less than 3min, but non-trivial) amount of time to > generate. I gotta ask, why? Looking over your information about "how to play", my only guess

Re: [perl-python] 20050115, for statement

2005-01-15 Thread Jeremy Bowers
On Sat, 15 Jan 2005 10:54:28 +, Michael Hoffman wrote: > Xah Lee wrote: > >> Â a = range(1,51) >> Â for x in a: >> Â if x % 2 == 0: >> Â print x, 'even' > > Now he's mixing tabs and spaces. Hideous. > > Are you doing things wrong on purpose? I think the most exciting thing is the br

Re: threading and sockets ?

2005-01-15 Thread Jeremy Bowers
On Sun, 16 Jan 2005 05:30:37 +0200, ionel wrote: > how to make a efficient server.. please point me to some good and clear > examples Your question is too broad. There is no such thing as "a server", the server must *do* something and it is generally named for what it does.. Please read http://w

Re: Newbie inheritance question.

2005-01-16 Thread Jeremy Bowers
On Sun, 16 Jan 2005 22:08:13 +0800, bwobbones wrote: > Hi all, > > I'm a java programmer struggling to come to terms with python - bear > with me! Christophe already identified the problem, I wanted to address another Javaism in your code, for your educational benefit. Speaking "idiomaticall

Re: generator expressions: performance anomaly?

2005-01-18 Thread Jeremy Bowers
On Tue, 18 Jan 2005 14:05:15 +, Antoon Pardon wrote: > I don't see how generating byte code for a = 9; when seeing the > expression a = 3 + 6, would be a problem for non-functional > languages. To answer nearly every post you've made to this thread, "because Python doesn't have the resources t

macros (was: RE: generator expressions: performance anomaly?)

2005-01-18 Thread Jeremy Bowers
On Tue, 18 Jan 2005 12:59:07 -0800, Robert Brewer wrote: > Especially since you can already do it explicitly with Raymond > Hettinger's cookbook recipe: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940 You know, Guido might as well give in now on the Macro issue. If he doesn't come

Re: macros

2005-01-18 Thread Jeremy Bowers
On Tue, 18 Jan 2005 14:36:08 -0800, Jeff Shannon wrote: > I think that this sort of thing is better to have as an explicitly > risky hack, than as an endorsed part of the language. The mere fact > that this *is* something that one can clearly tell is working around > certain deliberate limitati

Re: File objects? - under the hood question

2005-01-19 Thread Jeremy Bowers
On Tue, 18 Jan 2005 22:53:10 -0800, Eric Pederson wrote: > Perhaps I've answered my question and the under-the-hood mechanics are > handled on the OS side, and Python is just making requests of the OS... Almost by definition, the only correct way to read a file is to use the file system, which on

Re: simultaneous multiple requests to very simple database

2005-01-19 Thread Jeremy Sanders
). You might also consider berkeley db, which is a simple database to add to an application, (and which I believe supports locks), but I must admit I'm not a fan of the library. I assume that the bottleneck is processing the records, otherwise this all seems a bit academic. Jeremy -- http://

Re: ElementTree cannot parse UTF-8 Unicode?

2005-01-19 Thread Jeremy Bowers
On Wed, 19 Jan 2005 16:35:23 -0800, Erik Bethke wrote: > So it seems to me, that ElementTree is just not expecting to run into the > Korean characters for it is at column 16 that these begin. Am I > formatting the XML properly? You should post the file somewhere on the web. (I wouldn't expect Us

Re: xml parsing escape characters

2005-01-20 Thread Jeremy Bowers
On Thu, 20 Jan 2005 21:54:30 +0100, Martin v. LÃwis wrote: > Luis P. Mendes wrote: >> When I access the url via the Firefox browser and look into the source >> code, I also get: >> >> > xmlns="http"> ~ >> ~439 ~ >> >

Retrieving the last bit Re: File objects? - under the hood question

2005-01-20 Thread Jeremy Bowers
On Thu, 20 Jan 2005 21:06:31 -0800, Eric Pederson wrote: > Here the sort of thing (seek, then read) I think I want: > IDV2=open(("http://musicsite.com/song453.mp3","rb";)[:-128]) > song453.tags=IDV2.read() > len(song453.tags) > > 128 > > > But it's not a Python problem. :-( O

Re: DevX: "Processing EDI Documents into XML with Python"

2005-01-21 Thread Jeremy Jones
Claudio Grondi wrote: "You don't have to rely on expensive and proprietary EDI conversion software to parse, validate, and translate EDI X12 data to and from XML; you can build your own translator with any modern programming language, such as Python." by Jeremy Jones http

Re: Dynamic properties

2005-01-21 Thread Jeremy Bowers
On Fri, 21 Jan 2005 23:27:28 +0800, Craig Ringer wrote: > The chances are that whatever you want to do with dynamically created > properties is better done with __getattr__ and __setattr__ instead. Rather than post my own comment, I'd like to highlight this, emphasize it, and underline it twice. T

Re: how to write a tutorial

2005-01-21 Thread Jeremy Bowers
On Fri, 21 Jan 2005 03:08:50 -0800, Xah Lee wrote: > i've started to read python tutorial recently. > http://python.org/doc/2.3.4/tut/tut.html > > Here are some quick critique: You don't have the respect points for anyone to give a damn. Step one would be demonstrating that you understand the la

Re: finding name of instances created

2005-01-21 Thread Jeremy Bowers
On Fri, 21 Jan 2005 21:01:00 -0400, Andrà Roberge wrote: > etc. Since I want the user to learn Python's syntax, I don't want to > require him/her to write > alex = CreateRobot(name = 'alex') > to then be able to do > alex.move() This is just my opinion, but I've been involved with teaching new pro

Re: File objects? - under the hood question

2005-01-23 Thread Jeremy Bowers
On Sun, 23 Jan 2005 08:27:49 -0800, EP wrote: > >> My brain-teaser: What I'd like to do is read the last ~2K of a large >> number of large files on arbitrary servers across the net, without >> having to read each file from the beginning (which would be slow and >> resource inefficient)... >> >>

Re: RE:"private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-24 Thread Jeremy Bowers
On Mon, 24 Jan 2005 12:17:13 -0600, Philippe C. Martin wrote: > I use "__"for private variables because I must have read on net it was the > way to do so - yet this seems to have changed - It's still as true as ever, at least in terms of language support, it's just that the Python community, and

RE: Why I use private variables (WAS: RE:"private" variables a.k.a. name mangling?)

2005-01-24 Thread Jeremy Bowers
On Mon, 24 Jan 2005 15:35:11 -0600, Philippe C. Martin wrote: > The real reason behind my using private variables is so they do not appear > in the epydoc generated documentation and confuse my users. You mean single or double underscores? I just checked and at least epydoc 2.1 doesn't include si

Re: python without OO

2005-01-25 Thread Jeremy Bowers
On Tue, 25 Jan 2005 15:01:23 -0800, Davor wrote: > Thanks, > > I do not hate OO - I just do not need it for the project size I'm > dealing with - and the project will eventually become open-source and > have additional developers - so I would prefer that we all stick to > "simple procedural" stuf

Re: Python with no significant whitespace

2005-01-26 Thread Jeremy Sanders
> want to know. It probably would be easy to convert source in the form using brackets to indented form on the fly, and use exec to interpret the converted form. You need to do something like convert { to : foo Of course this isn't a good idea. Jeremy -- http://mail.pyth

when self-absorbed narcissists discover usenet [ was: how to write a tutorial ]

2005-01-26 Thread Jeremy Jones
of us mere mortals. So, ignore him, post responses for the benefit of others out there, entertain yourself by pointing out to yourself and others his folly, but don't waste your time replying back to him and trying to talk sense. Like I said, we're stuck with him. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: What's so funny? WAS Re: rotor replacement

2005-01-26 Thread Jeremy Bowers
On Thu, 27 Jan 2005 04:04:38 +, phr wrote: > Skip Montanaro <[EMAIL PROTECTED]> writes: >> Because good requirements specification is difficult and testing improves >> the breed. Better to have the major API changes and bugs taken care of, and >> to have its popularity demonstrated *before* i

IPython Article on O'Reilly's ONLamp site

2005-01-27 Thread Jeremy Jones
n. IPython has become an indispensible tool in my toolbox. I cannot say enough great things about it. Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] 20050127 traverse a dir

2005-01-29 Thread Jeremy Bowers
On Thu, 27 Jan 2005 15:01:12 -0500, Chris Mattern wrote: > Is it just me, or is the disappointing lack of flamewars > slowly ratcheting up the level of vitriol in his posts? What flabbergasts me is the stunning failure in trolling that XL is. I've accidentally trolled (if you can extend the trol

Re: gmail access with python!

2005-01-30 Thread Jeremy Bowers
On Sun, 30 Jan 2005 21:54:46 -0500, Daniel Bickett wrote: > Indeed, here is a detailed help document on GMail POP3 access: > > http://gmail.google.com/support/bin/answer.py?answer=12103 > > huh...look at that, they're using python :) Never noticed that before. Can you expand on that for us non-

Re: next line, new line

2005-01-30 Thread Jeremy Bowers
On Sun, 30 Jan 2005 19:42:22 -0800, rasdj wrote: > I have a lot of SQL to convert to postgres from oracle. I have most of the > problems worked out except for this last bit. Many of my tables need the > last comma replaced with a close parenthesis - they look like this: > > create table schema.ta

Re: next line, new line

2005-01-30 Thread Jeremy Bowers
On Sun, 30 Jan 2005 20:21:49 -0800, rasdj wrote: > Thanks Jeremy, something like this would work: > > try: > lines = [ line.replace(",\n;", ")\n;") for line in input ] > > If I could figgure out how to: > > IF ':' in line > READ next

Re: python and gpl

2005-01-30 Thread Jeremy Bowers
On Sun, 30 Jan 2005 22:25:10 -0600, John Hunter wrote: > The question is: does shipping a backend which imports a module that > links with GPL code make some or all of the library GPL. This > question is complicated, in my mind at least, by several factors. I believe the best and most honest answ

Re: set, dict and other structures

2005-01-31 Thread Jeremy Bowers
On Tue, 01 Feb 2005 00:43:21 +, Raymond Hettinger wrote: > My guess is that there will be two issues. One is that no one > implementation of graphs seems to satisfy all users. The second is that > only a small fraction of Python users need for graph support (there is > probably a much greater

Re: variable declaration

2005-02-01 Thread Jeremy Bowers
On Tue, 01 Feb 2005 09:13:36 -0600, Thomas Bartkus wrote: > *Is* there a reason why the interpreter couldn't/shouldn't require formal > variable declaration? You mean, other than the reasons already discussed at length in this thread, not to mention many many others? Your not *liking* the reasons

Re: how about writing some gui to a known console application

2005-02-01 Thread Jeremy Bowers
On Tue, 01 Feb 2005 21:57:45 +, Grant Edwards wrote: > On 2005-02-01, alexrait1 <[EMAIL PROTECTED]> wrote: > >> Do something useful... (at least for me) For instance I need a gtk >> frontend for pgp. So here you can have an opportunity to learn both >> pyGTK and pgp. A lot of python code... :

Re: Newbie Question

2005-02-01 Thread Jeremy Bowers
On Tue, 01 Feb 2005 17:47:39 -0800, Joel Eusebio wrote: > Whenever I access test.py from my browser it says "The page cannot be > found" , I have the file on /var/www/html, what did I miss? > > Thanks in advance, > Joel In general, you will need to post the relevant entries from your Apache erro

Re: hotspot profiler experience and accuracy?

2005-02-01 Thread Jeremy Bowers
On Tue, 01 Feb 2005 19:24:20 -0800, aurora wrote: > I have a parser I need to optimize. It has some disk IO and a lot of > looping over characters. > > I used the hotspot profiler to gain insight on optimization options. The > methods show up on on the top of this list seems fairly trivial and do

webbrowser.py

2005-02-02 Thread Jeremy Sanders
sets itself as a "default browser" on startup, so python could also look for a similar setting. webbrowser could identify whether it was running under KDE/Gnome (maybe scan the processes?), identify the correct desktop's browser (or just use Gnome, maybe), and start that web browser

Re: Apache & Python 500 Error

2005-02-02 Thread Jeremy Bowers
On Wed, 02 Feb 2005 10:28:46 +0100, Christian wrote: > Hello, > > i have an apache 1.3 server with python on debian. Python works fine but > the scripts wontÂt work. I know what your problem is. But first, check your apache error log. Then you will know what your error is, too. If you can't

Re: CONTEST - What is the (best) solution?

2005-02-02 Thread Jeremy Bowers
On Wed, 02 Feb 2005 02:35:03 -0800, python wrote: > Each pair in a dictionary is separated by CRLF and in each dictionary > numbers of pairs can be different. > I need to read only the the first and the last dictionaries.What is a > best solution? > Thanks > Lad Who cares about the best solution?

Re: Generating modul classes with eval

2005-02-02 Thread Jeremy Bowers
On Wed, 02 Feb 2005 20:49:07 +, Axel Straschil wrote: You are doing several things wrong. > I was fooling around with creating classes for a module with eval, You shouldn't create classes with eval, because you don't need to. "class" isn't a declaration, it is an executable statement that c

Re: Integrated Testing - Peppable?

2005-02-02 Thread Jeremy Bowers
On Wed, 02 Feb 2005 11:52:29 -0800, [EMAIL PROTECTED] wrote: > So... Should I turn this into a PEP? I would think a much more productive step one would be to put together the proposed functionality with unittest and the trace module, and use the output of your tool to drive some sort of simple ou

Re: Generating modul classes with eval

2005-02-02 Thread Jeremy Bowers
On Wed, 02 Feb 2005 16:20:41 -0500, Jeremy Bowers wrote: > That said, "__main__" indicates you ran it in the interactive shell. Or ran it directly on the command line. Duh. I thought that clause really loudly, but I guess I never actually typed it. -- http://mail.python.org/mai

Re: [EVALUATION] - E01: The Java Failure - May Python Helps?

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 09:26:08 +0200, Ilias Lazaridis wrote: > My question is essentially: > > How many of those constructs are already supported by python (and the > surrounding open-source-projects): > > http://lazaridis.com/case/stack/index.html This post is hard to follow, but I'm going to as

Re: Integrated Testing - Peppable?

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 09:40:55 -0800, [EMAIL PROTECTED] wrote: > Thanks, Jeremy, > >> No prose can compare to a live, functional demonstration. > > I agree; that's what my prototype amounts to: > > <http://prdownloads.sourceforge.net/zbt/zbt.zip?download> >

Re: Apache & Python 500 Error

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 13:55:13 +0100, Christian wrote: > from mod_python import apache > ^ > SyntaxError: invalid syntax > > > My test script: > #!/usr/bin/python > > print 'Content-Type: text/plain\r' > print '\r' > import os > print os.getcwd() For the quote of the error message, I'

Re: Awkwardness of C API for making tuples

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 07:45:22 -0500, Steve Holden wrote: > Fredrik Lundh wrote: >> in theory, if PyInt_FromLong succeeds, and PyTuple_SetItem fails, you'll leak >> an object. >> >> >> > And in practice this will only happen during a period when you are > relying critically on it *not* to ...

Re: Calling a method using an argument

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 15:48:05 +, C Gillespie wrote: > Dear All, > > I have a simple class > class hello: > def world(self): > return 'hello' > def test(self,arg): > return self.arg > > When I want to do is: >>hello.test('world') > 'hello' > > i.e. pass the method name

Re: [EVALUATION] - E01: The Java Failure - May Python Helps?

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 22:46:24 -0500, Markus Wankus wrote: > I realize your admirable intentions and the fact that you are simply > trying to help (the beauty of this community), but I beg you all > now...PLEASE...do not feed this troll. Any responses to his posts will > simply snowball into the

Re: OT: why are LAMP sites slow?

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 19:00:30 -0800, Paul Rubin wrote: > Hmm, I'm not familiar with Nevow. Twisted is pretty neat, though > confusing. I don't see how to scale it to multiple servers though. Same way you'd scale any webserver, load balancing in hardware, store all user state in a database, and te

Re: OT: why are LAMP sites slow?

2005-02-03 Thread Jeremy Bowers
On Thu, 03 Feb 2005 20:50:16 -0800, Paul Rubin wrote: > I understood the Twisted suggestion as meaning avoiding database > traffic by keeping both user and server state resident in the > application. Yes, if you use a database for that, you get multiple > app servers instead of a heavily loaded ce

Re: "Collapsing" a list into a list of changes

2005-02-04 Thread Jeremy Bowers
On Fri, 04 Feb 2005 12:43:37 -0500, Alan McIntyre wrote: > def straightforward_collapse(myList): > collapsed = [myList[0]] > for n in myList[1:]: > if n != collapsed[-1]: > collapsed.append(n) > > return collapsed > > Is there an elegant way to do this, or sho

Re: returning True, False or None

2005-02-04 Thread Jeremy Bowers
On Fri, 04 Feb 2005 10:48:44 -0700, Steven Bethard wrote: > I have lists containing values that are all either True, False or None, > e.g.: > > [True, None, None, False] > [None, False, False, None ] > [False, True, True, True ] > etc. > > For a given list: > * If all

Re: string issue

2005-02-04 Thread Jeremy Bowers
On Fri, 04 Feb 2005 14:49:43 -0500, rbt wrote: > Alan McIntyre wrote: >> I think it's because you're modifying the list as you're iterating over > > In this case then, shouldn't my 'except Exception' raise an error or > warning like: > > "Hey, stupid, you can't iterate and object and change it

Re: returning True, False or None

2005-02-04 Thread Jeremy Bowers
On Fri, 04 Feb 2005 16:44:48 -0500, Daniel Bickett wrote: > [ False , False , True , None ] > > False would be returned upon inspection of the first index, even > though True was in fact in the list. The same is true of the code of > Jeremy Bowers, Steve Juranich, and Jeff Shannon.

Re: [EVALUATION] - E01: The Java Failure - May Python Helps?

2005-02-05 Thread Jeremy Bowers
On Sat, 05 Feb 2005 16:44:11 +0200, Ilias Lazaridis wrote: >> * Deployment: I don't generally have enough problems with this to be >> worth thinking about. I don't know what the state of the remote >> debugging is on Python; Google "remote debugging Python". > > [I like to avoid interaction with g

Re: references/addrresses in imperative languages

2005-06-19 Thread Jeremy Jones
lysis of the same situation in Java, see >http://xahlee.org/java-a-day/assign_array_to_list.html > >How to write a tutorial >http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html > > Xah > [EMAIL PROTECTED] >∑ http://xahlee.org/ > > > It's really bad enough that you waste the time of the folks on comp.lang.python. Why cross post like you are? I really fail to see the point. Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: Python choice of database

2005-06-21 Thread Jeremy Sanders
e the first letter to divide the names up, for instance, or part of the hash value. Many Linux FSs can cope with lots of files, but it doesn't hurt to try to avoid this. Jeremy -- http://mail.python.org/mailman/listinfo/python-list

Re: tree functions daily exercise: Table

2005-06-21 Thread Jeremy Jones
Xah Lee wrote: >Very very nice! I don't know scheme well... but oh the macros, such a >wonderful facility... > > Macros suck. They created by moron so-called computer scientists and IT puntits in order opress the programming masses. But I say we must bring freedom to all programmers. In ord

Re: User interfaces in console (dialog like)

2005-06-23 Thread Jeremy Sanders
Negroup wrote: > Do you guys know an alternative that fits my needings without moving > from Python? Turbo Vision in dos used to be really good. There's a python binding to the free version here: http://tvision.sourceforge.net/ (I haven't tried it) -- Jer

Re: Dictionary to tuple

2005-06-28 Thread Jeremy Sanders
Erik Max Francis wrote: > But it doesn't return a tuple of them. Which is what the tuple call > there does. Yes, but I think he meant: t = tuple(d.items()) -- Jeremy Sanders http://www.jeremysanders.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Store multiple dictionaries in a file

2005-06-30 Thread Jeremy Sanders
epr() writes onto one line. If you're storing types without repr() representations this will not work. Jeremy -- Jeremy Sanders http://www.jeremysanders.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: I have a question.

2005-06-30 Thread Jeremy Jones
921336622176518 In [17]: random.random() Out[17]: 0.65521407248459007 In [18]: random.random() Out[18]: 0.74525381787627598 In [20]: r = range(10) In [21]: random.shuffle(r) In [22]: r Out[22]: [6, 4, 9, 7, 2, 0, 8, 3, 5, 1] Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: inheriting file object

2005-07-06 Thread Jeremy Jones
Jeremy wrote: >Hello all, > I am trying to inherit the file object and don't know how to do it. I >need to open a file and perform operations on it in the class I am >writing. I know the simple syntax is: > >class MyClass(file): > ... > >but I do

Inheritance/Late Private Binding

2005-07-06 Thread Jeremy Moles
class BaseClass: def __init__(self): self.__data = None def getMember(self): return self.__data class GoodSubClass(BaseClass): def __init__(self): BaseClass.__init__(self) class BadSubClass(BaseClass): def __init__(s

Polling, Fifos, and Linux

2005-07-07 Thread Jeremy Moles
This is my first time working with some of the more lower-level python "stuff." I was wondering if someone could tell me what I'm doing wrong with my simple test here? Basically, what I need is an easy way for application in userspace to simply echo values "down" to this fifo similar to the way pr

Re: file handling in a server (.py) file using xmlrpc

2005-07-08 Thread Jeremy Jones
at all? Spitting out an error? If so, what error? (And is it an error to the browser calling the cgi script, or in your apache logs?) Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: file handling in a server (.py) file using xmlrpc

2005-07-08 Thread Jeremy Jones
uwb wrote: >Jeremy Jones wrote: > > > >>uwb wrote: >> >> >> >>>I've got a call to glob in a .py file sitting in an apache cgi-bin >>>directory which refuses to work while the exact same code works from a >>>python conso

Re: Legacy data parsing

2005-07-08 Thread Jeremy Jones
": http://gnosis.cx/TPiP/ Don't know what all you're needing to do, but that small snip smells like it needs a state machine which this book has an excellent, simple one in (I think) chapter 4. Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: Sort files by date

2005-07-12 Thread Jeremy Sanders
fargo wrote: > I'm looking for some way to sort files by date. you could do something like: l = [(os.stat(i).st_mtime, i) for i in glob.glob('*')] l.sort() files = [i[1] for i in l] Jeremy -- Jeremy Sanders http://www.jeremysanders.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: breaking out of nested loop

2005-07-12 Thread Jeremy Sanders
rbt wrote: > What is the appropriate way to break out of this while loop if the for > loop finds a match? queue discussion why Python doesn't have a "break N" statement... -- Jeremy Sanders http://www.jeremysanders.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with mass remove in text file

2005-07-13 Thread Jeremy Moles
On Wed, 2005-07-13 at 09:00 -0700, [EMAIL PROTECTED] wrote: > I'm trying to open a text file, remove all instances of the words > "f=x;" and "i=x;" where x can be any number 0-14. Also, I want to > remove all { " or ) or ( or ' } each time one of those characters > occurs respectively. This

<    1   2   3   4   5   6   7   >