Re: references/addrresses in imperative languages

2005-06-20 Thread Kaz Kylheku
Walter Roberson wrote: > In article <[EMAIL PROTECTED]>, > Xah Lee <[EMAIL PROTECTED]> wrote: > >In hindsight analysis, such language behavior forces the programer to > >fuse mathematical or algorithmic ideas with implementation details. A > >easy way to see this, is to ask yourself: how come in ma

Re: Python choice of database

2005-06-20 Thread Philippe C. Martin
Yes, I agree, but as most of the customer base I target uses the O/S that cannot be named ;-) , file names could become a problem just as 'ln -s' is out of the question. Yet, this might be the best trade-off. Regards, Philippe Oren Tirosh wrote: > Philippe C. Martin wrote: >> Hi, >> >> I am

Re: Embedded Systems Python?

2005-06-20 Thread Diez B. Roggisch
Dennis Clark wrote: > I'm a bit of a newb when it comes to Python, is there anyone with experience > compiling it on Linux platforms that can offer me pointers to try this out > myself? Seatch for cross-compiling python patches. I'm working on an XScale255 platform with python2.2 and soon 2.3 -

Re: UML to Python/Java code generation

2005-06-20 Thread Magnus Lycka
James wrote: > The brain may be fine for generating Python from UML but it is MANY > MANY orders of magnitude harder to generate UML from code with just > your brain than using a tool (usually zero effort and error free) no > matter how good you are at Python. I've really only used Rational Rose,

Re: Python choice of database

2005-06-20 Thread Brian
I am really surprised that someone hasn't mentioned Gadfly yet. It is a quick, free, relational database written directly for Python itself. http://gadfly.sourceforge.net/ Brian --- Philippe C. Martin wrote: > Hi, > > I am looking for a stand-alone (not client/server) database solution for >

Re: binary file

2005-06-20 Thread Scott David Daniels
Kent Johnson wrote: > Nader Emami wrote: >> Kent Johnson wrote: >>> Nader Emami wrote: I have used the profile module to measure some thing as the next command: profile.run('command', 'file') ...How can I read (or convert) the binary file to an ascii file? >>> Use an instance o

Python and encodings drives me crazy

2005-06-20 Thread Oliver Andrich
Hi everybody, I have to write a little skript, that reads some nasty xml formated files. "Nasty xml formated" means, we have a xml like syntax, no dtd, use html entities without declaration and so on. A task as I like it. My task looks like that... 1. read the data from the file. 2. get rid of th

[no subject]

2005-06-20 Thread python-list-bounces+archive=mail-archive . com
#! rnews 902 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp From: Harry George <[EMAIL PROTECTED]> Subject: Re: Couple functions I need, assuming th

Re: Python and encodings drives me crazy

2005-06-20 Thread Steven Bethard
Oliver Andrich wrote: > def remove_html_entities(data): > for html, char in html2text: > data = apply(string.replace, [data, html, char]) > return data I know this isn't your question, but why write: > data = apply(string.replace, [data, html, char]) when you could write data

Re: JEP and JPype in a single process

2005-06-20 Thread Steve Menard
skn wrote: > Hello, > > I have written a very simple java class file, which invokes a Python script > using JEP. > > Code snippet:- > --- > Jep jep = new Jep(false); > jep.runScript("C:\\temp\\testscript.py"); > jep.close(); > > Now inside this Python script I want to make Java c

Re: Python and encodings drives me crazy

2005-06-20 Thread Oliver Andrich
> I know this isn't your question, but why write: > > > data = apply(string.replace, [data, html, char]) > > when you could write > > data = data.replace(html, char) > > ?? Cause I guess, that I am already blind. Thanks. Oliver -- Oliver Andrich <[EMAIL PROTECTED]> --- http://fith

Re: sudoku dictionary attack

2005-06-20 Thread Oliver Albrecht
Has some one an sodoku-task-generator? Here another solutions-ways: http://www.python-forum.de/viewtopic.php?t=3378 -- input -- http://mail.python.org/mailman/listinfo/python-list

reading a list from a file

2005-06-20 Thread David Bear
I have a file that contains lists -- python lists. sadly, these are not pickled. These are lists that were made using a simple print list statement. Is there an easy way to read this file into a list again? I'm thinking I would have to read until char = '[' read until char = " ' " Well, rea

Re: Python and encodings drives me crazy

2005-06-20 Thread Oliver Andrich
Well, I narrowed my problem down to writing a macroman or cp850 file using the codecs module. The rest was basically a misunderstanding about codecs module and the wrong assumption, that my input data is iso-latin-1 encode. It is UTF-8 encoded. So, curently I am at the point where I have my data re

Re: reading a list from a file

2005-06-20 Thread Tim Williams
- Original Message - From: "David Bear" <[EMAIL PROTECTED]> > I have a file that contains lists -- python lists. sadly, these are not > pickled. These are lists that were made using a simple print list > statement. > > Is there an easy way to read this file into a list again? I'm thin

Question about HTMLgen

2005-06-20 Thread Sebastian Bassi
Hello, I am using HTMLgen. It is very nice. But I can't make it to generate an arbitrary command. For example I want to output this: Each time I put "<" it gets escaped from HTML, instead of being inserted inside. -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups

Re: references/addrresses in imperative languages

2005-06-20 Thread Michael Sparks
Jeremy Jones wrote: > I think the only reason I read your posts is for comedy, Indeed. > Xah Lee wrote: > ... [ lots of stuff, that if Xah cared about Xah would attempt to write > better docs, rather than criticise) ... ... >>Btw, behavior such as this one, common in imperative languages and i

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Michael Hoffman
Paul Watson wrote: > While printf() does tightly control formatting in C, it does not in > Python. There is no printf() in Python. You should not think of print as being a Python version of printf. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and encodings drives me crazy

2005-06-20 Thread Diez B. Roggisch
Oliver Andrich wrote: > Well, I narrowed my problem down to writing a macroman or cp850 file > using the codecs module. The rest was basically a misunderstanding > about codecs module and the wrong assumption, that my input data is > iso-latin-1 encode. It is UTF-8 encoded. So, curently I am at the

Re: reading a list from a file

2005-06-20 Thread Jordan Rastrick
Be careful, though - make sure you can absolutely trust your source of data before calling eval on it. If an unauthorised person could forseeably modify your file, then they could insert a string containing arbitrary Python code into it in place of your list, and then running your program would ca

Re: Python and encodings drives me crazy

2005-06-20 Thread Konstantin Veretennicov
On 6/20/05, Oliver Andrich <[EMAIL PROTECTED]> wrote: > Does the following code write headline and caption in > MacRoman encoding to the disk? > > f = codecs.open(outfilename, "w", "macroman") > f.write(headline) It does, as long as headline and caption *can* actually be encoded as macrom

Re: Python and encodings drives me crazy

2005-06-20 Thread Oliver Andrich
2005/6/21, Konstantin Veretennicov <[EMAIL PROTECTED]>: > It does, as long as headline and caption *can* actually be encoded as > macroman. After you decode headline from utf-8 it will be unicode and > not all unicode characters can be mapped to macroman: > > >>> u'\u0160'.encode('utf8') > '\xc5\x

Re: reading a list from a file

2005-06-20 Thread Jordan Rastrick
If you decide to steer clear of eval, the following comes close to what you want, and is somewhat Pythonic (I feel): def back_to_list(str): return str.strip("[]").split(", ") >>> s = "[1, 2, 3, 4, 5, 6]" >>> back_to_list(s) ['1', '2', '3', '4', '5', '6'] So parsing the list structure is prett

Re: references/addrresses in imperative languages

2005-06-20 Thread Jordan Rastrick
You can add Australia to the list :) Any volunteers for a fourth continent? Antarctica, perhaps? ;) - Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: reading a list from a file

2005-06-20 Thread Rune Strand
But iif it are many lists in the file and they're organised like this: ['a','b','c','d','e'] ['a','b','c','d','e'] ['A','B','C','D','E'] ['X','F','R','E','Q'] I think this'll do it data = open('the_file', 'r').read().split(']') lists = [] for el in data: el = el.replace('[', '').strip()

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Tim Williams (gmail)
On 6/20/05, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Paul Watson wrote: > > > While printf() does tightly control formatting in C, it does not in > > Python. > > There is no printf() in Python. You should not think of print as being a > Python version of printf. For quick and simple removal

Re: references/addrresses in imperative languages

2005-06-20 Thread Andrea Griffini
On Sun, 19 Jun 2005 22:25:13 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: >> PS is there any difference between >> t=t+[li] >> t.append(li) > >No, but Yes, a big one. In the first you're creating a new list and binding the name t to it, in the second you're extending a list by adding one more

Re: What is different with Python ?

2005-06-20 Thread Mike Meyer
Andrea Griffini <[EMAIL PROTECTED]> writes: > On Tue, 14 Jun 2005 16:40:42 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: > > >Um, you didn't do the translation right. > > Whoops. > > So you know assembler, no other possibility as it's such > a complex language that unless someone already knows i

Re: What is different with Python ?

2005-06-20 Thread Mike Meyer
Andrew Dalke <[EMAIL PROTECTED]> writes: > Andrea Griffini wrote: > > Wow... I always get surprises from physics. For example I > > thought that no one could drop confutability requirement > > for a theory in an experimental science... > > Some physicists (often mathematical physicists) propose >

Re: What is different with Python ?

2005-06-20 Thread Mike Meyer
"Claudio Grondi" <[EMAIL PROTECTED]> writes: > > What has it all to do with Python? To be not fully off-topic, I > suggest here, that it is much easier to discuss programming > related matters (especially in case of Python :-) or mathematics > than any other subjects related to nature, because pr

Re: Python and encodings drives me crazy

2005-06-20 Thread John Machin
Oliver Andrich wrote: > 2005/6/21, Konstantin Veretennicov <[EMAIL PROTECTED]>: > >>It does, as long as headline and caption *can* actually be encoded as >>macroman. After you decode headline from utf-8 it will be unicode and >>not all unicode characters can be mapped to macroman: >> >> >u'\u0

Re: Question about HTMLgen

2005-06-20 Thread Konstantin Veretennicov
On 6/20/05, Sebastian Bassi <[EMAIL PROTECTED]> wrote: > Hello, > > I am using HTMLgen. It is very nice. But I can't make it to > generate an arbitrary command. > For example I want to output this: > > type="image/svg+xml" name="wmap" wmode="transparent"> Works for me... >>> d = HTMLgen.BasicD

Install MySQL-python-0.9.1

2005-06-20 Thread Cathy Hui
I am trying to install MySQL-Python 0.9.1 on my Solaris 8 system. The system has Python 2.3.3 and Mysql 4.0.21 installed. This is where I downloaded the distribution of the Mysql-python package: http://www.ravenbrook.com/project/p4dti/import/2001-10-16/MySQL-python-0.9.1/MySQL-python-0.9.1.tar.g

Re: reading a list from a file

2005-06-20 Thread John Machin
Rune Strand wrote: > But iif it are many lists in the file and they're organised like this: > > ['a','b','c','d','e'] > ['a','b','c','d','e'] > ['A','B','C','D','E'] ['X','F','R','E','Q'] > > I think this'll do it > > data = open('the_file', 'r').read().split(']') > > lists = [] > for el in dat

Tuple Unpacking in raise

2005-06-20 Thread James Stroud
Hello All, Is this a bug? Why is this tuple getting unpacked by raise? Am I missing some subtle logic? Why does print not work the same way as raise? Both are statements. Why does raise need to be so special? py> sometup = 1,2 py> print sometup (1, 2) py> print 1,2,3, sometup 1 2 3 (1, 2) py> c

Re: Want to learn a language - is Python right?

2005-06-20 Thread James Stroud
Python will help you as a novice for these reasons: 1. Help you to learn programming concepts and develop good habits. 2. Powerful Standard Library to help you do more advanced things. 3. Smooth, shallow learning curve, e.g. hello world is: print "Hello World" So you can do simple th

Re: sudoku dictionary attack

2005-06-20 Thread r.e.s.
"Oliver Albrecht" <[EMAIL PROTECTED]> wrote ... > Has some one an sodoku-task-generator? Sudoku puzzles can be generated (and solved) online at http://act365.com/sudoku/ -- http://mail.python.org/mailman/listinfo/python-list

Re: reading a list from a file

2005-06-20 Thread Konstantin Veretennicov
On 6/20/05, David Bear <[EMAIL PROTECTED]> wrote: > I have a file that contains lists -- python lists. sadly, these > are not pickled. These are lists that were made using > a simple print list statement. Sad, indeed. But what kind of objects they held? Only ints? Ints and strings? Arbitrary objec

Re: Tuple Unpacking in raise

2005-06-20 Thread Steven Bethard
James Stroud wrote: > Hello All, > > Is this a bug? Why is this tuple getting unpacked by raise? Am I missing some > subtle logic? Why does print not work the same way as raise? Both are > statements. Why does raise need to be so special? > > py> sometup = 1,2 > py> print sometup > (1, 2) > py>

Re: Tuple Unpacking in raise

2005-06-20 Thread Konstantin Veretennicov
On 6/21/05, James Stroud <[EMAIL PROTECTED]> wrote: > Hello All, > > Is this a bug? No, it works as documented. You should've consulted language reference: http://docs.python.org/ref/raise.html - kv -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple Unpacking in raise

2005-06-20 Thread Konstantin Veretennicov
On 6/21/05, Steven Bethard <[EMAIL PROTECTED]> wrote: > James Stroud wrote: > P.S. If you insist on using the two argument version of raise, you can > do it like this: > > py> class E(Exception): > ... def __init__(self, atup): > ... Exception.__init__(self, "Error with %s-%s" % atup)

Re: reading a list from a file

2005-06-20 Thread Rune Strand
:-/ You're right! -- http://mail.python.org/mailman/listinfo/python-list

getting list of all available modules

2005-06-20 Thread Benjamin Rutt
I note that the help() function of interactive python can determine all available modules: [EMAIL PROTECTED] ~]$ python Python 2.4 (#1, Mar 31 2005, 15:26:02) [GCC 3.2.3 (Debian)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> help()

Re: Tuple Unpacking in raise

2005-06-20 Thread James Stroud
Thank you Steven and Konstantin, that clears things up. Sometimes I forget how incomplete my Python Essential Reference is. James On Monday 20 June 2005 05:40 pm, Steven Bethard wrote: > Well, it's not a bug, because that's what the documentation says it'll do: > > "The second object is used to

multi threading and win9x

2005-06-20 Thread Timothy Smith
i want to run my sql statements on a seperate thread to prevent my app from stop responding to input (atm is says "not responding" under windows until the sql is finished) but i'm hesitant because i have to still support win9x and i'm not sure how well this will play. -- http://mail.python.org/

Re: multi threading and win9x

2005-06-20 Thread Tim Peters
[Timothy Smith] > i want to run my sql statements on a seperate thread to prevent my app > from stop responding to input (atm is says "not responding" under > windows until the sql is finished) > but i'm hesitant because i have to still support win9x and i'm not sure > how well this will play. All

Re: references/addrresses in imperative languages

2005-06-20 Thread Kaz Kylheku
SM Ryan wrote: > # easy way to see this, is to ask yourself: how come in mathematics > # there's no such thing as "addresses/pointers/references". > > The whole point of Goedelisation was to add to name/value references into > number theory. Is that so? That implies that there is some table where

Re: references/addrresses in imperative languages

2005-06-20 Thread Kaz Kylheku
Lawrence D’Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > "Xah Lee" <[EMAIL PROTECTED]> wrote: > > >A[n] easy way to see this, is to ask yourself: how come in mathematics > >there's no such thing as "addresses/pointers/references". > > Yes there are such things in mathematics, though not ne

Using code objects?

2005-06-20 Thread Chinook
Using code objects? === As an OO exercise I have a factory pattern that returns class objects that each have an "action" method. ClassObj.action() in turn returns a code object in my recursive process loop. I create the code objects as a one time step outside my factory pattern

Re: regarding cache clearing header in python cgi

2005-06-20 Thread praba kar
Dear All, In Php the following headers base we can clean the cache in the url "header('Cache-Control: no-store, no-cache, must-revalidate'); " I want to know Php equivalent headers in Python-cgi If any know regarding this kindly mail me. regards, Prabahar __

Re: references/addrresses in imperative languages

2005-06-20 Thread SM Ryan
"Kaz Kylheku" <[EMAIL PROTECTED]> wrote: # SM Ryan wrote: # > # easy way to see this, is to ask yourself: how come in mathematics # > # there's no such thing as "addresses/pointers/references". # > # > The whole point of Goedelisation was to add to name/value references into # > number theory. # #

after transfer of data from MS-outlook(mail ids) to application, mail ids are consisting of strange characters

2005-06-20 Thread vamsikrishna_b
Hello all,the following problem i encountered while transferring data(mail ids) from MS-outlook to one application.Some mail ids after came into the application looked as strange characters.Eg are [Å@ [Å. [Å,©Ä@ ©Ä. ©Ä etc.I thought these are the Ascii characters but i'm not quite sure about this.

Re: references/addrresses in imperative languages

2005-06-20 Thread Kaz Kylheku
SM Ryan wrote: > "Kaz Kylheku" <[EMAIL PROTECTED]> wrote: > # SM Ryan wrote: > # > # easy way to see this, is to ask yourself: how come in mathematics > # > # there's no such thing as "addresses/pointers/references". > # > > # > The whole point of Goedelisation was to add to name/value references

Re: references/addrresses in imperative languages

2005-06-20 Thread Kaz Kylheku
SM Ryan wrote: > "Kaz Kylheku" <[EMAIL PROTECTED]> wrote: > # SM Ryan wrote: > # > # easy way to see this, is to ask yourself: how come in mathematics > # > # there's no such thing as "addresses/pointers/references". > # > > # > The whole point of Goedelisation was to add to name/value references

A tool for Python - request for some advice

2005-06-20 Thread TPJ
First I have to admit that my English isn't good enough. I'm still studying and sometimes I just can't express what I want to express. A few weeks ago I've written 'Python Builder' - a bash script that allows anyone to download, compile (with flags given by user) and install Python and some exter

Re: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-20 Thread Paul Du Bois
kj wrote: > I am hoping that it may be better this time around. For one thing, > like Perl, Python was then (and maybe still is) a "work in progress." > So I figure that Python scoping may have improved since then. Even > if not, I think that Python is mature enough by now that adequate > alterna

regarding cache clearing header in python cgi

2005-06-20 Thread praba kar
Dear All, In Php the following headers base we can clean the cache in the url "header('Cache-Control: no-store, no-cache, must-revalidate'); " I want to know Php equivalent headers in Python-cgi If anybody know regarding this kindly mail me. regards, Prabahar __

Re: references/addrresses in imperative languages

2005-06-20 Thread Xah Lee
Dear Andrea Griffini, Thanks for explaning this tricky underneath stuff. Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ Andrea Griffini wrote: > On Sun, 19 Jun 2005 22:25:13 -0500, Terry Hancock > <[EMAIL PROTECTED]> wrote: > > >> PS is there any difference between > >> t=t+[li] > >> t.append(li)

Re: Extensions on Linux: import without underscore?

2005-06-20 Thread Terry Hancock
On Monday 20 June 2005 06:39 am, Kent Johnson wrote: > Terry Hancock wrote: > > Okay, you may want a more elegant way to do this and other people > > have already responded to that point, but you do at least know you > > can just give it a new name: > > > > import _bright > > bright = _bright > >

Re: catch argc-argv

2005-06-20 Thread mg
John Machin wrote: >Duncan Booth wrote: > > >>John Machin wrote: >> >> >> >> So, my question is: does the Python API containe fonctions like 'get_argc()' and 'get_argv()' ? >>>If you can't see them in the documentation, they aren't there. If they >>>aren't the

<    1   2