Re: 10GB XML Blows out Memory, Suggestions?

2006-06-08 Thread Thomas Ganss
>>medium. Even a SQLite database table should do better, and you can ship it >>around just like a file (just can't open it up like a text file). > > > A table helps only if the data is tabular (i.e. a single relation), > i.e. probably never (otherwise the sending side would have shipped > someth

Re: GUI Program Error

2006-06-08 Thread Eric Brunel
On Wed, 07 Jun 2006 17:38:39 GMT, John Salerno <[EMAIL PROTECTED]> wrote: [snip] > But I will agree with you that it is confusing when it says, following > the top = Tk() line, "Notice that a new blank window has appeared", > because as you noticed, nothing appears yet. My only guess is that

Re: GUI Program Error

2006-06-08 Thread Fredrik Lundh
Eric Brunel wrote: > It may be a platform-specific issue: On Unix/Linux, a window *does* appear > when you instantiate Tk, at least with tcl/tk 8.3 and 8.4 (which is the > latest stable version AFAIK). same on Windows, but it often appears *beneath* the window you're typing into, so you have

Re: XML, JSON, or what?

2006-06-08 Thread A.T.Hofkamp
On 2006-06-08, Frank Millman <[EMAIL PROTECTED]> wrote: > I would rather make a decision now, otherwise I will have a lot of > changes to make later on. Does anyone have any recommendations? Did you consider XMPP? With XMPP you create XML streams between your server and the client. XMPP is an open

Re: The Nature of the “Unix Philosophy”

2006-06-08 Thread Nils O. Selåsdal
Xah Lee wrote: > The Nature of the “Unix Philosophy” > > Xah Lee, 2006-05 > > In the computing industry, especially among unix community, we often > hear that there's a “Unix Philosophy”. In this essay, i dissect the > nature and characterization of such “unix philosophy”, as have been > describe

Newbie question about updating multiple objects ...

2006-06-08 Thread fivenastydisco
All, Apologies in advance: I'm new to Python and OO, and I'm sure this is a really simple question, but I just can't seem to crack it on my own, or through looking at examples. I'm playing around with VPython (http://www.vypthon.org) to try and teach myself about objects: I've got a box that I've

Re: language-x-isms

2006-06-08 Thread astyonax
Fredrik Lundh wrote: > Bryan wrote: > > > for example, i've noticed several java developers i know write python code > > like > > this: > > > > foo_list = [...] > > for i in range(len(foo_list)): > > print '%d %s' % (i, foo_list[i]) > > which is a perfectly valid way of doing things if you're

Re: language-x-isms

2006-06-08 Thread Terry Reedy
"astyonax" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Fredrik Lundh wrote: >> Bryan wrote: >> >> > for example, i've noticed several java developers i know >> > write python code like >> > this: >> > >> > foo_list = [...] >> > for i in range(len(foo_list)): >> > print '%d

Re: language-x-isms

2006-06-08 Thread Fredrik Lundh
astyonax wrote: > But it's not the pythonic way. really? I'd say breaking stuff just because you can is remarkably unpythonic. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question about updating multiple objects ...

2006-06-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I've copied in the code I'm using below, as it's not very long -- can > anyone help me? I'll have some remarks: > <--START--> > > from visual import * > from random import randrange # to create random numbers > > numballs = 5 # number of balls > balls = [] # a list

Re: Regular Expression question

2006-06-08 Thread Duncan Booth
Paul McGuire wrote: >> import re >> r=re.compile('[^"]+)"[^>]*>',re.IGNORECASE) >> for m in r.finditer(html): >> print m.group('image') >> > > Ouch - this fails to match any tag that has some other > attribute, such as "height" or "width", before the "src" attribute. > www.yahoo.com has sev

Re: XML, JSON, or what?

2006-06-08 Thread Ant
> to use? I could go back to XML, or I could switch to JSON - I have read I'd favour JSON if the data structures are simple personally. XML is comparatively speaking a pain to deal with, where with JSON you can simply eval() the data and you have a Python dictionary at your disposal. I recently u

Re: language-x-isms

2006-06-08 Thread bruno at modulix
Bryan wrote: > does anyone know if there is a collection somewhere of common python > mistakes or inefficiencies or unpythonic code that java developers make > when first starting out writing python code? Try googling for "python is not java" !-) -- bruno desthuilliers python -c "print '@'.joi

Re: what are you using python language for?

2006-06-08 Thread Andrew Robert
I use python and the pymqi module to work with IBM WebSphere MQSeries and IBM WebSphere Message broker. -- http://mail.python.org/mailman/listinfo/python-list

simplexmlrpcserver and allow_none

2006-06-08 Thread Laszlo Nagy
Hello, I ran in the same problem again. Many others have the same problem. Just Google for this: "SimpleXMLRPCServer allow_none site:python.org". Looks like the 'allow_none' patch was commited to trunk on 2005 Dec ( http://mail.python.org/pipermail/python-checkins/2005-December/048289.html )

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
[Bryan] for example, i've noticed several java developers i know write python code like this: foo_list = [...] for i in range(len(foo_list)): print '%d %s' % (i, foo_list[i]) [Fredrik Lundh] >>> which is a perfectly valid way of doing things if you're targeti

Re: simplexmlrpcserver and allow_none

2006-06-08 Thread Fredrik Lundh
Laszlo Nagy wrote: > I ran in the same problem again. Many others have the same problem. Just > Google for this: "SimpleXMLRPCServer allow_none site:python.org". > Looks like the 'allow_none' patch was commited to trunk on 2005 Dec ( > http://mail.python.org/pipermail/python-checkins/2005-Decemb

Re: language-x-isms

2006-06-08 Thread Fredrik Lundh
Alan Kennedy wrote: > On jython 2.1, I use something like this > > #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > try: > enumerate > except NameError: > def enumerate(iterable): > results = [] ; ix = 0 > for item in iterable: > results.append( (ix, item) ) > ix = ix+1 > r

tracking dependencies

2006-06-08 Thread Michele Simionato
I have a big framework (not written by me) with lots of internal dependencies and I am looking for a tool to see the dependency tree. I.e. given a module x, it should show me all the modules imported by x, and the modules imported by them recursively. Standard library modules should be ignored and

Re: XML, JSON, or what?

2006-06-08 Thread Alan Kennedy
[Frank Millman] > I am writing a multi-user accounting/business application, which uses > sockets to communicate between server and client. The server contains > all the business logic. It has no direct knowledge of the client. I > have devised a simple message format to exchange information betwee

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
[Alan Kennedy] >> On jython 2.1, I use something like this >> >> #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >> try: >> enumerate >> except NameError: >> def enumerate(iterable): >> results = [] ; ix = 0 >> for item in iterable: >> results.append( (ix, item) ) >> ix = ix+1 >>

Re: language-x-isms

2006-06-08 Thread Fredrik Lundh
Alan Kennedy wrote: > Who's using a user-defined enumerate on cpython? anyone targeting older Python platforms. > On cpython, the reference to enumerate doesn't generate a NameError, > python Python 2.2.3 (#42, May 30 2003, 18:12:08) >>> enumerate Traceback (most recent call last): File ""

Re: language-x-isms

2006-06-08 Thread Steve Holden
Alan Kennedy wrote: > [Alan Kennedy] > >>>On jython 2.1, I use something like this >>> >>>#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >>>try: >>> enumerate >>>except NameError: >>> def enumerate(iterable): >>>results = [] ; ix = 0 >>>for item in iterable: >>> results.append( (ix, item

Re: XML, JSON, or what?

2006-06-08 Thread Steve Holden
Ant wrote: >>to use? I could go back to XML, or I could switch to JSON - I have read > > > I'd favour JSON if the data structures are simple personally. XML is > comparatively speaking a pain to deal with, where with JSON you can > simply eval() the data and you have a Python dictionary at your >

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
[Alan Kennedy] > On jython 2.1, I use something like this > #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > try: > enumerate > except NameError: > def enumerate(iterable): > results = [] ; ix = 0 > for item in iterable: > results.append( (ix, item) ) > ix = ix+1 > return res

Re: How to generate k+1 length strings from a list of k length strings?

2006-06-08 Thread MTD
Try this: def k2k1(string1, string2): for c in string1: string2 = string2.replace(c,"",1) if len(string2) == 1: string1 += string2 return string1 print k2k1("abcd", "ebcd") -- http://mail.python.org/mailman/listinfo/python-list

Re: How to generate k+1 length strings from a list of k length strings?

2006-06-08 Thread MTD
actually, minor fix: MTD wrote: > Try this: > > def k2k1(string1, string2): > for c in string1: > string2 = string2.replace(c,"",1) > > if len(string2) == 1: > string1 += string2 else: string1 = "" > > return string1 > > print k2k1("abcd", "ebcd

Re: language-x-isms

2006-06-08 Thread Fredrik Lundh
Alan Kennedy wrote: > Your comment makes "using a user-defined enumerate [on cpython] is > slower than using the built-in version" makes no sense in relation to > the code I posted try combining with the second sentence in my post. -- http://mail.python.org/mailman/listinfo/python-list

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
[Steve Holden] > You are assuming a relatively recent release of CPython. If you look at > the stuff that the effbot distributes you will see that most of it > supports CPython all the way back to 1.5.2. Oh for cripes sake. The code I posted 1. works on all versions of cpython 2. works on all ve

Re: How to generate k+1 length strings from a list of k length strings?

2006-06-08 Thread MTD
So yeah, just to put it all together, try this. From your two Ks, it either returns K+1 if it can or an empty string. def k2k1(string1, string2): for c in string1: string2 = string2.replace(c,"",1) if len(string2) == 1: string1 += string2 else: string1 = ""

Re: language-x-isms

2006-06-08 Thread Alan Kennedy
[Alan Kennedy] >> Your comment makes "using a user-defined enumerate [on cpython] is >> slower than using the built-in version" makes no sense in relation to >> the code I posted Fredrik Lundh wrote: > try combining with the second sentence in my post. OK, so putting "at least in CPython, using a

Re: Select hangs after some reads

2006-06-08 Thread [EMAIL PROTECTED]
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > > I'm building a multithreaded application and I encountered a tiny and > > annoying problem. I use a select to wait for data to be read from a > > socket, after some reads, the select simply blocks and stays that way > > until I close t

Re: language-x-isms

2006-06-08 Thread Gerard Flanagan
Alan Kennedy wrote: > [Alan Kennedy] > >> Your comment makes "using a user-defined enumerate [on cpython] is > >> slower than using the built-in version" makes no sense in relation to > >> the code I posted > > Fredrik Lundh wrote: > > try combining with the second sentence in my post. > > OK, so

Terminateable thread

2006-06-08 Thread Laszlo Nagy
I wote a TThread class that is 'soft terminateable'. For example: class MyProcessor(TThread): def run(self): while not self.terminated(): self.process_one_item() My question is that, do I really need to use events for this? Because of the GIL, assignments are atomic. Is

Re: Using C struct in Python

2006-06-08 Thread Sudheer Gupta
Dennis Lee Bieber wrote: > On Wed, 07 Jun 2006 17:35:58 -0400, Sudheer Gupta <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > >> print cp >> print cp.next >> >> There is a typo in this. Second statement was suppose to be cp = cp.next. I corrected it latter with

Re: language-x-isms

2006-06-08 Thread Fredrik Lundh
Alan Kennedy wrote: > We still don't get anything that sheds light on how the code I posted > is deficient. who said that? > Why can't you just say "I made a mistake, I thought your code replaced > the builtin enumerate, but it doesnt"? I can read python code quite well, thank you. the point h

Re: Test tool for python code.

2006-06-08 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >Is there any tool available that will tell me what are the different >test paths for any python code? . . . http://groups.google.com/groups?as_q=coverage&num=10&sc

Re: Terminateable thread

2006-06-08 Thread Diez B. Roggisch
Laszlo Nagy wrote: > > I wote a TThread class that is 'soft terminateable'. For example: > > class MyProcessor(TThread): > def run(self): >while not self.terminated(): > self.process_one_item() > > > My question is that, do I really need to use events for this? Because

CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-08 Thread Ilias Lazaridis
I have a few small questions subjecting python functionality, most importantly the "alias_method". - *IMPORT* I would like to know, if this construct is valid, or if it can result in problems (that I do not see as a newcomer): 1082try: 1083from django.rework.evolve imp

Re: Debugging a pickle

2006-06-08 Thread Jeffrey Barish
Steve Holden wrote: > First of all, verify that you are opening the file in binary mode. Not > doing this is the biggest cause of problems for Windows users, which the > intermittent failure makes me suspect you may be. > > regards > Steve Right on all counts. I am on Windows and I was not op

Extended zip() for lists

2006-06-08 Thread Florian Reiser
Hello, I have 4 lists: a, b, c and d Out of this 4 lists I want to build a table (e.g. list of lists): a|b|c|d --- a1|b1|c1|d1 a1|b2||d2 You see: the lists are not equally sized. Is there a command which fills up the shorter lists with blanks? Like an enhanced zip() c

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-08 Thread Duncan Booth
Ilias Lazaridis wrote: > I would like to know, if this construct is valid, or if it can result in > problems (that I do not see as a newcomer): > > 1082try: > 1083from django.rework.evolve import evolvedb > 1084except ImportError: > 1085def evolved

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-08 Thread Duncan Booth
Ilias Lazaridis wrote: > Is there any way (beside a patch) to alter the behaviour to an > existing function. Is ther a python construct similar to the > "alias_method" of Ruby: This is a Python list. Would you care to explain what alias_method does? > > (example from an simple evolution suppor

shared logs and multiple configurations

2006-06-08 Thread Chris Curvey
Hi all, I've apparently tied myself up a bit using the logging package. In my project, I have a core set of model and controller classes that set up their logging using logging.fileConfig(). So far, so good. But I use these core classes from a bunch of different places. Sometimes from within a C

Re: Select hangs after some reads

2006-06-08 Thread Grant Edwards
On 2006-06-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Well, actually I´m using a very simple protocol wich sends only > strings ended by newline. I need to send 3 chunks of information and a > newline after them. On the reader side I make 3 readline(), this way I > wouldn´t have to care ab

Re: Extended zip() for lists

2006-06-08 Thread Fredrik Lundh
Florian Reiser wrote: > I have 4 lists: a, b, c and d > Out of this 4 lists I want to build a table (e.g. list of lists): > > a|b|c|d > --- > a1|b1|c1|d1 > a1|b2||d2 > > You see: the lists are not equally sized. > Is there a command which fills up the shorter lists wi

Re: Extended zip() for lists

2006-06-08 Thread gene tani
Florian Reiser wrote: > Hello, > > I have 4 lists: a, b, c and d > Out of this 4 lists I want to build a table (e.g. list of lists): > > a|b|c|d > --- > a1|b1|c1|d1 > a1|b2||d2 > > You see: the lists are not equally sized. > Is there a command which fills up the shorter

Re: The Nature of the “Unix Philosophy”

2006-06-08 Thread Frank Silvermann
Nils O. Selåsdal wrote: > Xah Lee wrote: >> The Nature of the “Unix Philosophy” [snip] > Perhaps you should take a peek at the ideas in Plan 9 from Bell Labs, > which is a continuation of this philosophy, unlike the "modern" unix > clones. Is there an actual Plan 9? I'm only aware of the one fro

Re: Extended zip() for lists

2006-06-08 Thread Duncan Booth
Florian Reiser wrote: > Hello, > > I have 4 lists: a, b, c and d > Out of this 4 lists I want to build a table (e.g. list of lists): > > a|b|c|d > --- > a1|b1|c1|d1 > a1|b2||d2 > > You see: the lists are not equally sized. > Is there a command which fills up the shor

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-08 Thread Maric Michaud
Le Jeudi 08 Juin 2006 14:28, Ilias Lazaridis a écrit : > Another possibility is to enlink (hook?) the functionality into an > existent function > > Is there any way (beside a patch) to alter the behaviour to an existing > function. Is ther a python construct similar to the "alias_method" of Ruby: >

Re: How to generate k+1 length strings from a list of k length strings?

2006-06-08 Thread Jon Clements
Are you asking the question, "Which pairs of strings have one character different in each?", or "Which pairs of strings have a substring of len(string) - 1 in common?". Jon. Girish Sahani wrote: > I have a list of strings all of length k. For every pair of k length > strings which have k-1 charac

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-08 Thread Tim N. van der Leeuw
Since your question is so much about Django, you might want to ask on Django groups. Oops, you're not welcome there anymore, almost forgot. But if merely reading the subject of a posting I already know who's the poster, it's perhaps a bad sign. Further readers of this thread might be interested

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-08 Thread fuzzylollipop
[EMAIL PROTECTED] wrote: > Thanks guys for all your posts... > > So I am a bit confusedFuzzy, the code I saw looks like it > decompresses as a stream (i.e. per byte). Is this the case or are you > just compressing for file storage but the actual data set has to be > exploded in memory? > it w

how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Harold Fellermann
Hi, I need to create a temporary file and I need to retrieve the path of that file. os.tmpnam() would do the job quite well if it wasn't for the RuntimeWarning "tmpnam is a potential security risk to your program". I would like to switch to os.tmpfile() which is supposed to be safer, but I do not

Re: The Nature of the “Unix Philosophy”

2006-06-08 Thread Richard Bos
Frank Silvermann <[EMAIL PROTECTED]> wrote: > Nils O. Selåsdal wrote: > > Xah Lee wrote: > >> The Nature of the “Unix Philosophy” > > > Perhaps you should take a peek at the ideas in Plan 9 from Bell Labs, > > which is a continuation of this philosophy, unlike the "modern" unix > > clones.

Re: The Nature of the “Unix Philosophy”

2006-06-08 Thread Pascal Bourguignon
Frank Silvermann <[EMAIL PROTECTED]> writes: > Nils O. Selåsdal wrote: >> Xah Lee wrote: >>> The Nature of the “Unix Philosophy” > [snip] > >> Perhaps you should take a peek at the ideas in Plan 9 from Bell Labs, >> which is a continuation of this philosophy, unlike the "modern" unix >> clones. >

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-08 Thread Fredrik Lundh
fuzzylollipop wrote: > SAX style or a pull-parser has to be used when the data is "large" or > when you don't really need to process every element and attribute. > > This problem looks like it is just a data export / import problem. In > that case you will either have to use a sax style parser an

Re: what are you using python language for?

2006-06-08 Thread John Salerno
Jason wrote: > I've been working on an RPG character generator for consistent (yet > varied) set of role-playing systems. Nothing like a pen-and-pencil RPG > to throw in tons of special cases and strange rulesets. Sounds interesting. Something I've thought about as a project, but I'm not good en

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-08 Thread Maric Michaud
Le Jeudi 08 Juin 2006 15:15, Duncan Booth a écrit : > but the more usual way is just to call the original method directly in the > base class. > > class SqliteAdapter(BaseClass): > def create_table(self, *args) > self.table_evolve(*args) > result = BaseClass.create_table(self, *

Re: GUI Program Error

2006-06-08 Thread John Salerno
Fredrik Lundh wrote: > Eric Brunel wrote: > >> It may be a platform-specific issue: On Unix/Linux, a window *does* >> appear when you instantiate Tk, at least with tcl/tk 8.3 and 8.4 >> (which is the latest stable version AFAIK). > > same on Windows, but it often appears *beneath* the window

Re: XML, JSON, or what?

2006-06-08 Thread Alan Kennedy
[Ant] >> I'd favour JSON if the data structures are simple personally. XML is >> comparatively speaking a pain to deal with, where with JSON you can >> simply eval() the data and you have a Python dictionary at your >> disposal. [Steve] > Modulo any security problems that alert and malicious users

From Python to Shell

2006-06-08 Thread NightHawk
Im not a total noob but i don't know the command and the module to go from python to the default shell. (not from interactive mode - $python) -- http://mail.python.org/mailman/listinfo/python-list

Re: From Python to Shell

2006-06-08 Thread Fredrik Lundh
NightHawk wrote: > Im not a total noob but i don't know the command and the module to go > from python to the default shell. I'm not sure what you mean by "go to", but if you want to start an interactive OS shell from inside Python, you can do: >>> import os >>> os.system(os.env

Re: From Python to Shell

2006-06-08 Thread Harold Fellermann
> Im not a total noob but i don't know the command and the module to go > from python to the default shell. there are several ways depending on what exactly you want to achieve: sys.exit(return_value): terminates the python process and gives controll back to the shell os.system(command_string

Is there a python wrapper for OpenPAM?

2006-06-08 Thread Martin P. Hellwig
Hi all, I'm busy with a personal project that does password synchronization between NT and BSD. By using a password hook/filter/notifier when password is changed (on NT PasswdHk and on BSD a modified version of pam_exec*) I can retrieve a changed password, however when I want to check the valid

Re: how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Maric Michaud
Le Jeudi 08 Juin 2006 15:30, Harold Fellermann a écrit : > to os.tmpfile() which is supposed to be safer, but I do not know how to > get > the path information from the file object returned by tmpfile(). any > clues? There is no path for tmpfile, once it's closed, the file and its content are lost

cos: "Integer Required"?!?!?!?

2006-06-08 Thread moonman
Hello all, I've just jumped into Python trying to develop X-Plane plugins. All was chugging along well until I tried to use math.cos() snippet: import math cos_phi = math.cos(math.radians(XPLMGetDataf(self.ACphi))) # Error occurs here Now XPLMGetDataf should be returning float. Is th

Instead of saving text files i need as html

2006-06-08 Thread Shani
I have the following code which takes a list of urls "http://google.com";, without the quotes ofcourse, and then saves there source code as a text file. I wan to alter the code so that for the list of URLs an html file is saved. -begin- import urllib urlfile = open(r'c:\temp\url.txt', 'r')

Re: How to generate k+1 length strings from a list of k length strings?

2006-06-08 Thread Boris Borcic
Girish Sahani wrote: > I have a list of strings all of length k. For every pair of k length > strings which have k-1 characters in common, i want to generate a k+1 > length string(the k-1 common characters + 2 not common characters). > e.g i want to join 'abcd' with bcde' to get 'abcde' but i dont

Re: how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Harold Fellermann
Maric Michaud wrote: > Le Jeudi 08 Juin 2006 15:30, Harold Fellermann a écrit : > > to os.tmpfile() which is supposed to be safer, but I do not know how to > > get > > the path information from the file object returned by tmpfile(). any > > clues? > There is no path for tmpfile, once it's closed,

Re: simplexmlrpcserver and allow_none

2006-06-08 Thread Thomas Bellman
Laszlo Nagy <[EMAIL PROTECTED]> wrote: > I ran in the same problem again. Many others have the same problem. Just > Google for this: "SimpleXMLRPCServer allow_none site:python.org". > Looks like the 'allow_none' patch was commited to trunk on 2005 Dec ( > http://mail.python.org/pipermail/python-

Re: cos: "Integer Required"?!?!?!?

2006-06-08 Thread Fredrik Lundh
moonman wrote: > import math > > > > cos_phi = math.cos(math.radians(XPLMGetDataf(self.ACphi))) # Error > occurs here what error ? it's a lot easier to help if you include the traceback. > Now XPLMGetDataf should be returning float. should be ? have you verified this ? try adding

Re: Select hangs after some reads

2006-06-08 Thread [EMAIL PROTECTED]
Grant Edwards escreveu: > On 2006-06-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Well, actually I´m using a very simple protocol wich sends only > > strings ended by newline. I need to send 3 chunks of information and a > > newline after them. On the reader side I make 3 readline(), th

Re: Instead of saving text files i need as html

2006-06-08 Thread Larry Bates
Then just write HTML around your list. I would guess you want them inside a table. Just write appropriate HTML tags before/after the urls. If you want the URLs to be clickable make them in into url lines. -Larry Bates Shani wrote: > I have the following code which takes a list of urls > "http:

Re: Select hangs after some reads

2006-06-08 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Grant Edwards escreveu: > > >>On 2006-06-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> >>>Well, actually I´m using a very simple protocol wich sends only >>>strings ended by newline. I need to send 3 chunks of information and a >>>newline after them. On the rea

Re: how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Maric Michaud
Well, I never used gnuplot and I didn't use Tkinter for a while, but : Le Jeudi 08 Juin 2006 16:44, Harold Fellermann a écrit : >         tmp = os.tmpnam() >         gnuplot = subprocess.Popen( >             "gnuplot", shell=True, >             stdin=subprocess.PIPE, stdout=file(tmp,"w") >        

Re: Select hangs after some reads

2006-06-08 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Yes, as I expected, its the buffers. In my opinion the problem is that > the socket module doesn't provide a way of reading all its internal buffer. umm. that's what recv() does, of course, of you pass in a large enough buffersize. for your use case, I suggest lookin

Re: cos: "Integer Required"?!?!?!?

2006-06-08 Thread Larry Bates
First: Always post cut-paste tracebacks so we can see actual error message. Second: print out self.ACphi, XPLMGetDataf(self.ACphi) and math.radians(XPLMGetDataf(self.ACphi)) before this statement and you will find the problem. -Larry Bates moonman wrote: > Hello all, > > I've just jumped into

Re: how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Chris Lambacher
You should be able to find exactly what you need in the tempfile module. http://docs.python.org/lib/module-tempfile.html os.tmpfile() is no good whether you want the filename or not since on Windows it is likely to break if you are not a privileged user. Its a windows problem, not an actual bug i

Re: how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Steve Holden
Harold Fellermann wrote: > Maric Michaud wrote: > >>Le Jeudi 08 Juin 2006 15:30, Harold Fellermann a écrit : >> >>>to os.tmpfile() which is supposed to be safer, but I do not know how to >>>get >>>the path information from the file object returned by tmpfile(). any >>>clues? >> >>There is no path

Re: Select hangs after some reads

2006-06-08 Thread Grant Edwards
On 2006-06-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> Well, actually I´m using a very simple protocol wich sends >>> only strings ended by newline. I need to send 3 chunks of >>> information and a newline after them. On the reader side I >>> make 3 readline(), this way I wouldn´t have to

Re: how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Harold Fellermann
Chris Lambacher wrote: > You should be able to find exactly what you need in the tempfile module. > http://docs.python.org/lib/module-tempfile.html thanks! tempfile.NamedTemporaryFile() is exaclty what I have been looking for. Using python for such a long time now, and still there are unknown goo

Re: How to generate k+1 length strings from a list of k length strings?

2006-06-08 Thread MTD
Jon Clements wrote: > Are you asking the question, "Which pairs of strings have one character > different in each?", or "Which pairs of strings have a substring of > len(string) - 1 in common?". > > Jon. I imagine it's the former because the latter is trivially easy, I mean _really_ trivially eas

Re: how to switch from os.tmpnam to os.tmpfile

2006-06-08 Thread Nick Craig-Wood
Harold Fellermann <[EMAIL PROTECTED]> wrote: > I need to create a temporary file and I need to retrieve the path > of that file. os.tmpnam() would do the job quite well if it wasn't > for the RuntimeWarning "tmpnam is a potential security risk to your > program". I would like to switch to os.t

Re: cos: "Integer Required"?!?!?!?

2006-06-08 Thread moonman
print self.ACphi, type(self.ACphi) yields: 19412557 value = XPLMGetDataf(self.ACphi); print value type(value ) yields: -0.674469709396 print math.radians(XPLMGetDataf(self.ACphi)), type(math.radians(XPLMGetDataf(self.ACphi))) yields: TypeError : an integer is required Am I totally missing s

Re: cos: "Integer Required"?!?!?!?

2006-06-08 Thread Fredrik Lundh
moonman wrote: > print self.ACphi, type(self.ACphi) yields: > 19412557 > > value = XPLMGetDataf(self.ACphi); print value type(value ) yields: > -0.674469709396 > > print math.radians(XPLMGetDataf(self.ACphi)), > type(math.radians(XPLMGetDataf(self.ACphi))) yields: > > TypeError > : > an inte

Re: cos: "Integer Required"?!?!?!?

2006-06-08 Thread Mikael Olofsson
moonman wrote: > print self.ACphi, type(self.ACphi) yields: > 19412557 > > value = XPLMGetDataf(self.ACphi); print value type(value ) yields: > -0.674469709396 > > print math.radians(XPLMGetDataf(self.ACphi)), > type(math.radians(XPLMGetDataf(self.ACphi))) yields: > > TypeError > : > an integ

Re: simplexmlrpcserver and allow_none

2006-06-08 Thread Laszlo Nagy
Thomas Bellman írta: > Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > >> I ran in the same problem again. Many others have the same problem. Just >> Google for this: "SimpleXMLRPCServer allow_none site:python.org". >> Looks like the 'allow_none' patch was commited to trunk on 2005 Dec ( >> http://

Re: cos: "Integer Required"?!?!?!?

2006-06-08 Thread moonman
I'm using ActiveState PythonV2.4.1 I'm certainly not affecting 'math'. I wonder if the XPlane SDK Python binding is touching anything. I'll download the latest ActiveState Python and keep on plugging. Thanks! Mikael Olofsson wrote: > moonman wrote: > > print self.ACphi, type(self.ACphi) yields

Re: XML, JSON, or what?

2006-06-08 Thread Ant
> Yes, evaling JSON, or any other text coming from the web, is definitely > a bad idea. > > But there's no need for eval: there are safe JSON codecs for python, Fair enough. And I should imagine that the codecs are still much faster and easier to use than XML for the same purpose. For my purpose

Re: Instead of saving text files i need as html

2006-06-08 Thread 3c273
"Shani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have the following code which takes a list of urls > "http://google.com";, without the quotes ofcourse, and then saves there > source code as a text file. I wan to alter the code so that for the > list of URLs an html file is s

Re: The Nature of the Unix Philosophy

2006-06-08 Thread Al Balmer
On 7 Jun 2006 18:35:52 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote: >The Nature of the “Unix Philosophy” Good grief. Him again. -- Al Balmer Sun City, AZ -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI Program Error

2006-06-08 Thread Scott David Daniels
John Salerno wrote: > >> >>> It may be a platform-specific issue: On Unix/Linux, a window *does* >>> appear when you instantiate Tk, at least with tcl/tk 8.3 and 8.4 >>> (which is the latest stable version AFAIK). Here you should have chimed in with your OS and Python versions. >> same on

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-08 Thread fuzzylollipop
Fredrik Lundh wrote: > fuzzylollipop wrote: > > > SAX style or a pull-parser has to be used when the data is "large" or > > when you don't really need to process every element and attribute. > > > > This problem looks like it is just a data export / import problem. In > > that case you will either

Re: Select hangs after some reads

2006-06-08 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Steve Holden wrote: > Of course, if the client forces the TCP PSH flag true then the receiver > is guaranteed to debuffer the stream up to that point - this is how FTP > clients work, for example. I don't think that's right. You are confusing the PSH flag (which i

Re: How to generate k+1 length strings from a list of k length strings?

2006-06-08 Thread bearophileHUGS
Boris Borcic: > I'd favor the following, that I find most readable > sets = map(set,list_of_strings) > res = set(''.join(sorted(s1|s2)) for s1 in sets for s2 in sets if > len(s1^s2)==2) I think there can be written more readable code. For my programs I usually prefer simpler code, that (if possib

Re: Newbie question about updating multiple objects ...

2006-06-08 Thread donkeyboy
Awesome Diez -- I'll give this a go tomorrow, and hopefully it will all work!! Diez B. Roggisch wrote: > [EMAIL PROTECTED] wrote: > > I've copied in the code I'm using below, as it's not very long -- can > > anyone help me? > > I'll have some remarks: > > > > <--START--> > > > > from visual import

wxpython: where is the demo?

2006-06-08 Thread John Salerno
I just realized that after installing wxPython, it did not add the usual menu item to my Start menu (Windows), where I can access the docs and demo. I searched through the wxPython folder in the site-packages directory, but I can't seem to find it. Anyone know how I can get this back? Thanks.

Re: Instead of saving text files i need as html

2006-06-08 Thread 3c273
"Shani" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have the following code which takes a list of urls > "http://google.com";, without the quotes ofcourse, and then saves there > source code as a text file. I wan to alter the code so that for the > list of URLs an html file is s

Re: what are you using python language for?

2006-06-08 Thread gregarican
Wow that's serious Old School. Reminds me of way-back-when in Data Processing class we used VisiCalc on the old Trash-80's for spreadsheet work. Cut a notch in those 5 1/4" floppies and voila, you doubled your storage capacity :-) Dennis Lee Bieber wrote: > On Thu, 08 Jun 2006 13:52:38 GMT, John S

  1   2   >