Re: Can we pass some arguments to system("cmdline")?

2005-06-20 Thread Leif K-Brooks
Didier C wrote: > E.g in Perl, we can do something like: > > $dir="/home/cypher"; > > system("ls $dir"); > > Is there a way to reproduce the same thing in Python? system("ls %s" % dir) But you should really be using subprocess for security (so that if dir=="/home/foo; rm -rf /" nothing bad wil

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-20 Thread Ron Adam
Ron Adam wrote: > You might be able to use a dictionary of tuples. > > call_obj = {(type_obj1,0):obj1a, > (type_obj1,0):obj1b, > (type_boj2,1):obj2a, > (type_obj2,1):obj2b, > etc... } > call_obj[(type_of_obj,order)]() > > > Regards, Ron This won'

Re: catch argc-argv

2005-06-20 Thread mg
Wolfram Kraus wrote: >mg wrote: > > >>Hello, >> >>I am writting bindings for a FEM application. In one of my function >>'initModulename', called when the module is imported, I would like to >>get the argc and argv arguments used in the main function of Python. >>So, my question is: does the P

Re: references/addrresses in imperative languages

2005-06-20 Thread Walter Roberson
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 mathematics >there's no such thing

Re: login website that using PHP

2005-06-20 Thread [EMAIL PROTECTED]
pbpscript is a little python toolkit for simulating a webbrowser, specifically for doing testing. It handles all the cookies and stuff for you. You might want to have a look at it. Stephen. -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding Python - How to create a class instance

2005-06-20 Thread Denis S. Otkidach
On Sun, 19 Jun 2005 10:29:53 +0300 Miki Tebeka <[EMAIL PROTECTED]> wrote: > I'm trying to embed Python in a C application. > What I didn't find is how to create an instance once I have a class object. Class is a callable object. Just call it to create instance. > I'd like to do the equivalent o

Re: Can we pass some arguments to system("cmdline")?

2005-06-20 Thread Didier Casse
Thanks all for the reply. I'll try out those things out. :) Cheers, Didier. Leif K-Brooks a écrit : > Didier C wrote: > > E.g in Perl, we can do something like: > > > > $dir="/home/cypher"; > > > > system("ls $dir"); > > > > Is there a way to reproduce the same thing in Python? > > system("ls %s

Re: Why is there no instancemethod builtin?

2005-06-20 Thread Raymond Hettinger
[George Sakkis] > The fact that strings don't have __iter__ is an implementation > detail. I can't think of any reason other than historic and perhaps > backwards compatibility for this; > iterables should IMHO by definition be exactly > the objects with __iter__). There would be no benefit other

Re: functions with unlimited variable arguments...

2005-06-20 Thread Xah Lee
Dear Chinook Lee, Thank you very much. That seems a godsend. I'd like to also thank its author Richard Gruet. Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ Chinook wrote: > ... > I don't get to the reference docs much. Mostly I use the quick reference > guide and it's noted there in an easy to f

Re: how to operate the excel by python?

2005-06-20 Thread Simon Brunning
On 6/17/05, Hughes, Chad O <[EMAIL PROTECTED]> wrote: > > I have posed a more complete answer to your question, however, it is quite a > large and It is awaiting approval. For now, xlRight = -4152. You can find > this out by opening up Excel and typing the ALT-F11 combination. From there > use

Re: catch argc-argv

2005-06-20 Thread John Machin
mg wrote: > Hello, > > I am writting bindings for a FEM application. In one of my function > 'initModulename', called when the module is imported, I would like to > get the argc and argv arguments used in the main function of Python. This is an "interesting" way of writing bindings. Most peopl

Re: references/addrresses in imperative languages

2005-06-20 Thread pete
Xah Lee wrote: > > in coding Python yesterday, It seems to be giving you anxiety. Have you considered not coding on python? -- pete -- http://mail.python.org/mailman/listinfo/python-list

binary file

2005-06-20 Thread Nader Emami
L.S., I have used the profile module to measure some thing as the next command: profile.run('command', 'file') But this make a binary file! How can I write the result of 'profile' in a ascii file? Others how can I read (or convert) the binary file to am ascii file? Regards, Nader -- http://m

Re: login website that using PHP

2005-06-20 Thread Tim Williams
- Original Message - From: "frost" <[EMAIL PROTECTED]> > Hi, > > I am trying to login a website that using PHP and javascript. This is > what happend if you browse that website using IE, after you login, you > can go anywhere without enter your name and password again, as long as > you

global name not defined :$

2005-06-20 Thread Anna M.
Hi I am trying to write a red-black tree implementation in python.  I am very new to python and appologize if my question is terribly stubid.  But I ran into some trouble.  I have a class and in it there are functions but when I try to run the code I have I just get an error on one of the

Re: login website that using PHP

2005-06-20 Thread Fuzzyman
The behaviour with the browser is what is known as a 'session cookie' -the site sets it when you login and the browser keeps it until you end the session by closing the browser. You handle the cookie using ClientCookie (Python 2.3) or cookielib (Python 2.4). You need to create a cookiejar instance

Re: Can we pass some arguments to system("cmdline")?

2005-06-20 Thread Piet van Oostrum
> "Didier Casse" <[EMAIL PROTECTED]> (DC) wrote: >DC> Thanks all for the reply. I'll try out those things out. :) But don't try the following >>> > system("ls $dir"); with >>> dir=="/home/foo; rm -rf /" -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP] Private e

Want to learn a language - is Python right?

2005-06-20 Thread Aziz McTang
Hi Group, I am not an experienced programmer at all. I've learned html and css well enough to hand-write simple websites. I'm now looking to move to the next step. Initially, I'd like to do 3 things: 1) Generate web pages This one's fairly obvious maybe. 2) Create a simplified translation packag

Re: catch argc-argv

2005-06-20 Thread Duncan Booth
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 there, that's probably for a good reason -- no demand, no use > case. > > Leaving a

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

2005-06-20 Thread Paul Rubin
"Aziz McTang" <[EMAIL PROTECTED]> writes: > 1) Generate web pages > This one's fairly obvious maybe. You might find this easier to do with PHP. Python is better in a deep way, but for web pages, that advantage only becomes real when you're doing complicated sites. Simple stuff is easier to do wi

subprocess.call(*args **kwargs) on Linux

2005-06-20 Thread McBooCzech
Hi all, I am trying to use subprocess module on Linux/Python-2.4.1, but I can't dig throught. I need to call executable which needs two parameters to be ginven (the serial port and the file name). It looks like /root/dex/dex /dev/ttyS0 blabla.txt in the shell. This is easy. Subprocess function "

Re: OO approach to decision sequence?

2005-06-20 Thread Thomas Lotze
Jordan Rastrick wrote: > Without knowing more about your problem, I think the most obvious OO > approach would be to write a seperate (simple) class for each of > node_type_1, node_type_2, etc. While I agree that this is the cleanest and usually simplest approach, it does have its drawbacks. I'm

dll files

2005-06-20 Thread Sabin
How can i create dll files in Python? Is it possible? If yes, how to enclose image and font files in a dll ? Plis reply. SABIN. B'lore. -- http://mail.python.org/mailman/listinfo/python-list

Re: utf8 and ftplib

2005-06-20 Thread Richard Lewis
OK, I'm still not getting this unicode business. Given this document: == aàáâã eèéêë iìíîï oòóôõ oùúûü == (If testing, make sure you save this as utf-8 encoded.) and this Python script: == import sys f

Re: Embedding Python - How to create a class instance

2005-06-20 Thread Miki Tebeka
Hello Denis, >> I'm trying to embed Python in a C application. >> What I didn't find is how to create an instance once I have a class object. > > Class is a callable object. Just call it to create instance. > ... > obj = PyObject_CallObject(A, NULL); Thanks. After grepping the Python sources I

Re: Extensions on Linux: import without underscore?

2005-06-20 Thread Kent Johnson
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 or more idiomatically and without adding _bright to the namespace: imp

Re: utf8 and ftplib

2005-06-20 Thread Richard Lewis
On Mon, 20 Jun 2005 12:37:42 +0100, "Richard Lewis" <[EMAIL PROTECTED]> said: > [SNIP] Just add to this: my input document was written using character references rather than literal characters (as was the sample output document). However, I've just noticed that my mail client (or maybe something

Re: subprocess.call(*args **kwargs) on Linux

2005-06-20 Thread Leif K-Brooks
McBooCzech wrote: > This is easy. Subprocess function "call" looks: > returncode = subprocess.call(["/root/dex/dex","/dev/ttyS0", > "blabla.txt"]) > and it runs smoothly. > > The problem starts when I am trying to add 1>/dev/null 2>/dev/null > parameters to suppres output sendings. from subproces

Re: binary file

2005-06-20 Thread Kent Johnson
Nader Emami wrote: > L.S., > > I have used the profile module to measure some thing as the next command: > > profile.run('command', 'file') > > But this make a binary file! How can I write the result of 'profile' in > a ascii file? Others how can I read (or convert) the binary file to am > asc

Re: Extensions on Linux: import without underscore?

2005-06-20 Thread James Carroll
Swig actually was generating a bright.py file, but scons was leaving it in the source directory instead of putting it next to my SharedLibrary(). Once I moved the bright.py next to the _bright.so, it all worked with just import bright. Thanks everyone. My next trick is to try the same thing with

Re: references/addrresses in imperative languages

2005-06-20 Thread SM Ryan
# 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. Thus Goedel was able to add back pointers contrary to the set hierarchy of the th

Re: utf8 and ftplib

2005-06-20 Thread Fredrik Lundh
Richard Lewis wrote: > OK, I'm still not getting this unicode business. obviously. > > aàáâã > eèéêë > iìíîï > oòóôõ > oùúûü > > > (If testing, make sure you save this as utf-8 encoded.) why? that XML snippet doesn't include any UTF-8-encoded characters. ::: >file =

Re: binary file

2005-06-20 Thread Nader Emami
Kent Johnson wrote: > Nader Emami wrote: > >> L.S., >> >> I have used the profile module to measure some thing as the next command: >> >> profile.run('command', 'file') >> >> But this make a binary file! How can I write the result of 'profile' >> in a ascii file? Others how can I read (or convert

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Tim Hoffman
Hi Paul Based on your description of what you want to do, print is probably not the correct method of controlling output format. You should use write() method of the file handle to get unadulterated output. print is working as documented . From the Python 2.3 documentation, Section 6.6 The P

JEP and JPype in a single process

2005-06-20 Thread skn
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 calls using JPype. If I use startjvm

Re: Generating .pyo from .py

2005-06-20 Thread skn
Thanks a lot !! It works fine !! regards, skn "Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > skn wrote: > > Does the python compiler provide an option to generate a .pyo(optimized byte > > code file) from a .py (source file)? > > > > For generating .pyc I know that

Re: global name not defined :$

2005-06-20 Thread Fredrik Lundh
"Anna M." <[EMAIL PROTECTED]> wrote: > I am trying to write a red-black tree implementation in python. I am very > new to python and appologize if my question is terribly stubid. But I ran > into some trouble. I have a class and in it there are functions but when I > try to run the code I have

Re: functions with unlimeted variable arguments...

2005-06-20 Thread Peter Hansen
Xah Lee wrote: > oops... it is in the tutorial... sorry. If you're sorry, have you now *finally* gone and worked through the rest of tutorial, making a serious attempt to learn it? > This is not a rhetorical question, but where would one start to look > for it in the python ref? > > a language

Re: catch argc-argv

2005-06-20 Thread John Machin
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 there, that's probably for a good reason -- no demand, no us

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-20 Thread Peter Hansen
D H wrote: > Peter Hansen wrote: >> Bo Peng wrote: >> >>> I need to pass a bunch of parameters conditionally. In C/C++, I can do >>> func(cond1?a:b,cond2?c:d,.) >>> >>> Is there an easier way to do this in Python? >> >> Please read the FAQ to learn the answer and much other useful ... > > The

Re: log in to a website

2005-06-20 Thread passion_to_be_free
Works like a gem! Thanks a ton. ClientForm and ClientCookie are great! -- http://mail.python.org/mailman/listinfo/python-list

import via pathname

2005-06-20 Thread passion_to_be_free
Okay, so in my li'l python script I'm importing a few 3rd party modules that I have installed on my comp. I need to distribute this script to several other people, but I won't have access to install the modules on their comp's. I'm thinking I'll include these modules with my script and deliver th

Re: import via pathname

2005-06-20 Thread Thomas Guettler
Am Mon, 20 Jun 2005 06:31:38 -0700 schrieb passion_to_be_free: > Okay, so in my li'l python script I'm importing a few 3rd party modules > that I have installed on my comp. I need to distribute this script to > several other people, but I won't have access to install the modules on > their comp's

Re: utf8 and ftplib

2005-06-20 Thread Richard Lewis
On Mon, 20 Jun 2005 14:27:17 +0200, "Fredrik Lundh" <[EMAIL PROTECTED]> said: > > well, you're messing it up all by yourself. getting rid of all the > codecs and > unicode2charrefs nonsense will fix this: > Thanks for being so patient and understanding. OK, I've taken it all out. The only think

Re: dll files

2005-06-20 Thread Larry Bates
You are most likely better off creating COM objects than trying to create old .dll files. Good treatment of COM object creation is in the book titled Python Programming on Win32. Most other languages have no problem interfacing with COM objects. -Larry Sabin wrote: > How can i create dll files

Re: import via pathname

2005-06-20 Thread Larry Bates
If it is Windows use py2exe and Inno Installer to create an installation program that does this for you. If it is another OS, you need to put your modules into a subdirectory of site-packages and then Python will be able to see your modules. If you have a lot of modules you might consider turning

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-20 Thread Charles Krug
On Mon, 20 Jun 2005 06:36:42 GMT, Ron Adam <[EMAIL PROTECTED]> wrote: > Ron Adam wrote: > >> You might be able to use a dictionary of tuples. >> >> call_obj = {(type_obj1,0):obj1a, >> (type_obj1,0):obj1b, >> (type_boj2,1):obj2a, >> (type_obj2,1):obj2b, >>

Re: login website that using PHP

2005-06-20 Thread erinhouston
Here are the links to ishy_browser. http://www.ishpeck.net/index.php?P=b1115239318ishpeck http://www.ishpeck.net/index.php?P=b1115225809ishpeck -- http://mail.python.org/mailman/listinfo/python-list

[no subject]

2005-06-20 Thread python-list-bounces+archive=mail-archive . com
#! rnews 4339 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: Multiple instances of a python prog

Re: import via pathname

2005-06-20 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > I know this is wrong syntax, but I think it demonstrates what I'm > trying to do: > > import myModule path = /modules/myModule > import myModule2 path = /modules/myModule2 > > Something like that. Is it possible? I would put your additional modules into a 'modules' di

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

2005-06-20 Thread Aziz McTang
Hi Paul, Thanks for your input. As usual, hearing some answers helps formulate the question... What I'm looking for is more to learn one good, comprehensive programming language well than several approximately on an ad hoc basis. What I also failed to mention is the desire to develop my presentl

Couple functions I need, assuming they exist?

2005-06-20 Thread Charles Krug
List: First, I'm reading that aString.split() is depreciated. What's the current best practice for this? Or am I mistaking that: myWords = split(aString, aChar) is depreciated but myWords = aString.split(aChgar) is not? Second question, I've written a script that generates a LaTeX source c

Re: login website that using PHP

2005-06-20 Thread Chris Curvey
I'll add a plug for PAMIE (another set of Python classes that drive IE) http://pamie.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Python choice of database

2005-06-20 Thread Philippe C. Martin
Hi, I am looking for a stand-alone (not client/server) database solution for Python. 1) speed is not an issue 2) I wish to store less than 5000 records 3) each record should not be larger than 16K As I start with Python objects, I thought of using shelve, but looking at the restrictions (record

Re: Python choice of database

2005-06-20 Thread John Abel
Gadfly PySQLite ( requires SQLite library ) J Philippe C. Martin wrote: >Hi, > >I am looking for a stand-alone (not client/server) database solution for >Python. > >1) speed is not an issue >2) I wish to store less than 5000 records >3) each record should not be larger than 16K > > >As I start w

Re: Python choice of database

2005-06-20 Thread John Abel
Just thought of a couple more: SnakeSQL KirbyBase J John Abel wrote: >Gadfly >PySQLite ( requires SQLite library ) > >J > >Philippe C. Martin wrote: > > > >>Hi, >> >>I am looking for a stand-alone (not client/server) database solution for >>Python. >> >>1) speed is not an issue >>2) I wish to

Re: Python choice of database

2005-06-20 Thread Erik Max Francis
Philippe C. Martin wrote: > I am looking for a stand-alone (not client/server) database solution for > Python. > > 1) speed is not an issue > 2) I wish to store less than 5000 records > 3) each record should not be larger than 16K > > > As I start with Python objects, I thought of using shelve,

Embedded Systems Python?

2005-06-20 Thread Dennis Clark
Hi all, I've looked through the threads about embedded Python that are a year and a half old, and I thought that I'd ask this question now to see if anything has changed. Has anyone, or is anyone working with Python in an embedded Linux environment? Mine is NO where near as constrained as a

Re: Python choice of database

2005-06-20 Thread Richard Lewis
On Mon, 20 Jun 2005 15:18:58 GMT, "Philippe C. Martin" <[EMAIL PROTECTED]> said: > Hi, > > I am looking for a stand-alone (not client/server) database solution for > Python. > > 1) speed is not an issue > 2) I wish to store less than 5000 records > 3) each record should not be larger than 16K >

Re: Couple functions I need, assuming they exist?

2005-06-20 Thread Peter Hansen
Charles Krug wrote: > First, I'm reading that aString.split() is depreciated. What's the > current best practice for this? > > Or am I mistaking that: > > myWords = split(aString, aChar) > is depreciated but If you mean "import string; string.split(aString, aChar)" then yes, it's deprecated (

Re: import via pathname

2005-06-20 Thread passion_to_be_free
AhhI see. I played around with the sys.path function...and it looks like python automatically looks in the same directory as my script first. Then is searches to all the other pre-defined paths. So it works for me to just keep my main script in the same directory as the two modules I'm using

Re: Python choice of database

2005-06-20 Thread Peter Hansen
Philippe C. Martin wrote: > I am looking for a stand-alone (not client/server) database solution for > Python. > > 1) speed is not an issue > 2) I wish to store less than 5000 records > 3) each record should not be larger than 16K > > As I start with Python objects, I thought of using shelve, but

Re: JEP and JPype in a single process

2005-06-20 Thread Konstantin Veretennicov
On 6/20/05, skn <[EMAIL PROTECTED]> wrote: > Hello, > > I have written a very simple java class file, which invokes a Python script > using JEP. . . . > Now inside this Python script I want to make Java calls using JPype. I am not familiar with either Jepp or JPype, but I spotted this snippet on

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Paul Watson
Thanks for all replies. Ok. I agree. While printf() does tightly control formatting in C, it does not in Python. Using write() can be used to output with no changes to the data. "Tim Hoffman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Paul > > Based on your description

Re: Python choice of database

2005-06-20 Thread Peter Hansen
John Abel wrote: > Gadfly > PySQLite ( requires SQLite library ) I want to clarify this parenthetical comment, for the record. When I first downloaded PySQLite I had already gone and installed SQLite, thinking it was a prerequisite in that sense. In fact, the PySQLite install includes a .pyd w

Re: Couple functions I need, assuming they exist?

2005-06-20 Thread Steven Bethard
Charles Krug wrote: > myWords = split(aString, aChar) > > is depreciated but > > myWords = aString.split(aChgar) > > is not? Yes, that's basically correct. What's deprecated are the functions in the string module. So string.split(a_str, b_str) is deprecated in favor of a_str.split

Re: Python choice of database

2005-06-20 Thread Philippe C. Martin
Well that would be shelve I guess ... with the restrictions I mentioned. Regards, Philippe Erik Max Francis wrote: > Philippe C. Martin wrote: > >> I am looking for a stand-alone (not client/server) database solution for >> Python. >> >> 1) speed is not an issue >> 2) I wish to store less t

Re: Python choice of database

2005-06-20 Thread Erik Max Francis
Philippe C. Martin wrote: > Well that would be shelve I guess ... with the restrictions I mentioned. I was talking about pickle, not shelve. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis I used to walk arou

Re: Python choice of database

2005-06-20 Thread Philippe C. Martin
Thank you all for your answers. A pure Python would have beenmy first choice. yet I now feel I should spend some time looking at PySQLite (I like the fact it's pre-compiled for Windows). Thanks. Philippe Philippe C. Martin wrote: > Hi, > > I am looking for a stand-alone (not client/server)

Re: Couple functions I need, assuming they exist?

2005-06-20 Thread Duncan Booth
Peter Hansen wrote: >> The target of the problems (my daughter) would prefer that the thousands >> be delimited. Is there a string function that does this? > > You refer to something like putting a comma between groups of three > digits, as in 1,000? This is locale-specific, and there's a "loc

Re: Python choice of database

2005-06-20 Thread Philippe C. Martin
You mean pickling a dictionnary of 5000/16K objects ? Erik Max Francis wrote: > Philippe C. Martin wrote: > >> Well that would be shelve I guess ... with the restrictions I mentioned. > > I was talking about pickle, not shelve. > -- http://mail.python.org/mailman/listinfo/python-list

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

2005-06-20 Thread Harlin Seritt
Aziz McTang wrote: > Hi Paul, > > Thanks for your input. > > As usual, hearing some answers helps formulate the question... > > What I'm looking for is more to learn one good, comprehensive > programming language well than several approximately on an ad hoc > basis. What I also failed to mentio

Re: import via pathname

2005-06-20 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > AhhI see. I played around with the sys.path function...and it > looks like python automatically looks in the same directory as my > script first. Then is searches to all the other pre-defined paths. So > it works for me to just keep my main script in the same direc

Re: Python choice of database

2005-06-20 Thread Erik Max Francis
Philippe C. Martin wrote: > You mean pickling a dictionnary of 5000/16K objects ? Yes. You said speed was not an issue; pickling only 5000 objects, each no more than 16 kB, is easily handled by any remotely modern machine (and even plenty which are not very modern). -- Erik Max Francis && [E

Re: Python choice of database

2005-06-20 Thread John Abel
Philippe C. Martin wrote: >Thank you all for your answers. > >A pure Python would have beenmy first choice. yet I now feel I should spend >some time looking at PySQLite (I like the fact it's pre-compiled for >Windows). > >Thanks. > >Philippe > > > >Philippe C. Martin wrote: > > > >>Hi, >> >>I am

Re: Couple functions I need, assuming they exist?

2005-06-20 Thread George Sakkis
> I assume you mean translating something like '100' to '1,000,000'? > I don't know of an existing function that does this, but here's a > relatively simple implementation: > > py> import itertools as it > py> def add_commas(s): > ... rev_chars = it.chain(s[::-1], it.repeat('', 2)) > ...

Re: Python choice of database

2005-06-20 Thread Philippe C. Martin
OK, I'll try that too. Regards, Philippe Erik Max Francis wrote: > Philippe C. Martin wrote: > >> You mean pickling a dictionnary of 5000/16K objects ? > > Yes. You said speed was not an issue; pickling only 5000 objects, each > no more than 16 kB, is easily handled by any remotely modern

Re: Python choice of database

2005-06-20 Thread William Park
Philippe C. Martin <[EMAIL PROTECTED]> wrote: > Hi, > > I am looking for a stand-alone (not client/server) database solution > for Python. > > 1) speed is not an issue > 2) I wish to store less than 5000 records > 3) each record should not be larger than 16K > > As I start with Python objects, I

Re: Python choice of database

2005-06-20 Thread Philippe C. Martin
> 1. 5000 files -- my personal favourite. You got a point William Park wrote: > Philippe C. Martin <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I am looking for a stand-alone (not client/server) database solution >> for Python. >> >> 1) speed is not an issue >> 2) I wish to store less than 5000

Re: Python choice of database

2005-06-20 Thread Philippe C. Martin
Thanks, I'm looking at KirbyBase also but wonder if it can handle bitmaps (I could always pickle it first I guess). Regards, Philippe John Abel wrote: > Philippe C. Martin wrote: > >>Thank you all for your answers. >> >>A pure Python would have beenmy first choice. yet I now feel I should >>

sudoku dictionary attack

2005-06-20 Thread sub1ime_uk
Thought I'd offer a method for solving all possible 9x9 sudoku puzzles in one go. It'll takes a bit of time to run however (and 9x9 seems to be about as big as is reasonably possible before combinatorial explosion completely scuppers this type of program)... Basic idea:- Start with a grid initial

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

2005-06-20 Thread Paul Watson
"Aziz McTang" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Paul, > > Thanks for your input. > > As usual, hearing some answers helps formulate the question... > > What I'm looking for is more to learn one good, comprehensive > programming language well than several approximatel

Re: Couple functions I need, assuming they exist?

2005-06-20 Thread Paul Watson
"Charles Krug" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > The target of the problems (my daughter) would prefer that the thousands > be delimited. Is there a string function that does this? Be sure to use the locale approach and avoid rolling your own. -- http://mail.py

Re: Python choice of database

2005-06-20 Thread Paul Rubin
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > 1) speed is not an issue > 2) I wish to store less than 5000 records > 3) each record should not be larger than 16K You don't mention whether multiple running programs need to use it concurrently. That's usually done with client/server db's but i

Re: sudoku dictionary attack

2005-06-20 Thread Jonathan
[EMAIL PROTECTED] wrote: > Thought I'd offer a method for solving all possible 9x9 sudoku puzzles > in one go. It'll takes a bit of time to run however (and 9x9 seems to > be about as big as is reasonably possible before combinatorial > explosion completely scuppers this type of program)... > > B

Re: login website that using PHP

2005-06-20 Thread Drazen Gemic
On Sun, 19 Jun 2005 19:11:38 -0700, frost wrote: > Hi, > > I am trying to login a website that using PHP and javascript. This is > what happend if you browse that website using IE, after you login, you Browser remembers so called HTTP authorization header field. It sends authorization informatio

Re: login website that using PHP

2005-06-20 Thread J Correia
"frost" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am trying to login a website that using PHP and javascript. This is > what happend if you browse that website using IE, after you login, you > can go anywhere without enter your name and password again, as long as > you

Re: Couple functions I need, assuming they exist?

2005-06-20 Thread Charles Krug
On 20 Jun 2005 15:51:07 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > Peter Hansen wrote: > >>> The target of the problems (my daughter) would prefer that the thousands >>> be delimited. Is there a string function that does this? >> >> You refer to something like putting a comma between groups

Re: Python choice of database

2005-06-20 Thread Philippe C. Martin
Correct, that's not a constraint right now. Paul Rubin wrote: > "Philippe C. Martin" <[EMAIL PROTECTED]> writes: >> 1) speed is not an issue >> 2) I wish to store less than 5000 records >> 3) each record should not be larger than 16K > > You don't mention whether multiple running programs need

Re: Embedded Systems Python?

2005-06-20 Thread phil
I developed for my former employee a thin client whose primary purpose was AS400 connectivity. This required a fairly complex interactive gui configuration which I wrote in Python. This system could also be configed by a remote manager. Wrote that also in python using UDP sockets. The hardware was

Re: utf8 and ftplib

2005-06-20 Thread Kent Johnson
Richard Lewis wrote: > My code now works without generating any errors but Konqueror's KHTML > and Embedded Advanced Text Viewer and IE5 on the Mac still show > capital-A-with-a-tilde in all the files that have been > generated/altered. Whereas my text editor and Mozilla show them > correctly. How

Re: utf8 and ftplib

2005-06-20 Thread Fredrik Lundh
Richard Lewis wrote: > On Mon, 20 Jun 2005 14:27:17 +0200, "Fredrik Lundh" > <[EMAIL PROTECTED]> said: > > > > well, you're messing it up all by yourself. getting rid of all the > > codecs and > > unicode2charrefs nonsense will fix this: > > > Thanks for being so patient and understanding. > > OK

Re: Back to the future - python to C++ advice wanted

2005-06-20 Thread George Sakkis
"Kay Schluehr" wrote: > I recommend studying C++ idioms carefully. > > http://www1.bell-labs.com/user/cope/Patterns/C++Idioms/EuroPLoP98.html Thanks for the link; very useful indeed. > If Georges starts on greenfields he may have a look at Qt and it's > object library which is not only concerned

Re: binary file

2005-06-20 Thread Kent Johnson
Nader Emami wrote: > Kent Johnson wrote: > >> Nader Emami wrote: >> >>> L.S., >>> >>> I have used the profile module to measure some thing as the next >>> command: >>> >>> profile.run('command', 'file') >>> >>> But this make a binary file! How can I write the result of 'profile' >>> in a ascii f

Re: login website that using PHP

2005-06-20 Thread frost
Thank you all for the help. This problem bothered me for 3 days, Now I get it! You are right, it is the session cookie, after I use the cookiejar and the opener, I got it!!! I am really glad I found this place. Thank you again! -- http://mail.python.org/mailman/listinfo/python-list

RE: Python choice of database

2005-06-20 Thread Hughes, Chad O
One db that is very much worth trying is Firebird. This is an open source Interbase 6.0 (Borland product) compatible db. It is a SourceForge project. There are three versions: the super server which is a client/server db, classic server (the one that I am very familiar with) which is also a clie

Re: Python choice of database

2005-06-20 Thread Oren Tirosh
Philippe C. Martin wrote: > Hi, > > I am looking for a stand-alone (not client/server) database solution for > Python. > > 1) speed is not an issue > 2) I wish to store less than 5000 records > 3) each record should not be larger than 16K How about using the filesystem as a database? For the numbe

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

2005-06-20 Thread John Ochiltree
On 2005-06-18 05:26:13 +0100, Dennis Lee Bieber <[EMAIL PROTECTED]> said: > On Sat, 18 Jun 2005 03:02:13 +1000, Steven D'Aprano > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> >> The language is *always* spelt without the "a", and usually all in >> lower-case: perl. >>

Re: What is different with Python ?

2005-06-20 Thread Rocco Moretti
Andrea Griffini wrote: > Indeed when talking about if learning "C" can hinder > or help learning "C++" I remember thinking that to > learn "C++" *superficially* learning "C" first is > surely pointless or can even hinder. > But to learn "C++" deeply (with all its quirks) I > think that learning "C

Re: Embedded Systems Python?

2005-06-20 Thread Michael Sparks
Dennis Clark wrote: ... > Has anyone, or is anyone working with Python in an embedded Linux > environment? Mine is NO where near as constrained as a cell phone since > I've got plenty of memory to work with, I'm just running a Linux 2.4 > kernel on an ARM9 platform. This really shouldn't be a p

  1   2   >