can this b done

2006-08-03 Thread JyotiC
hi, i hv a var of type IntVar, ca i get the name of this variable eg:- class someclass: def somefun(...): self.var=IntVar() def someotherfun(...): in this fun can i get the name of var. as in, can i get name var as a string 'var' Thanx

Re: can this b done

2006-08-03 Thread Gary Herron
JyotiC wrote: > hi, > > i hv a var of type IntVar, ca i get the name of this variable > > eg:- > class someclass: > def somefun(...): >self.var=IntVar() > > > def someotherfun(...): >in this fun can i get the name of var. >as in, can i

Re: Is there an obvious way to do this in python?

2006-08-03 Thread H J van Rooyen
"Nick Vatamaniuc" <[EMAIL PROTECTED]> wrote: | HJ, | | As someone already posted, the backend sounds very much like a | database, so why not use a database: transactions, specific views for | different users, limited access and so on = database! | Give PostgresSQL a try... *nods* - looks like I

Re: Is there an obvious way to do this in python?

2006-08-03 Thread H J van Rooyen
"Simon Forman" <[EMAIL PROTECTED]> wrote: | H J van Rooyen wrote: | > Hi, | > | > I want to write a small system that is transaction based. | > | > I want to split the GUI front end data entry away from the file handling and | > record keeping. | > | > Now it seems almost trivially easy using t

Re: serial ports, threads and windows

2006-08-03 Thread H J van Rooyen
"Tom Brown" <[EMAIL PROTECTED]> | Hey people, | | I've written a python app that r/w eight serial ports to control eight devices | using eight threads. This all works very nicely in Linux. I even put a GUI on | it using PyQt4. Still works nicely. | | Then I put the app on on a virtual Windows m

Re: Is there an obvious way to do this in python?

2006-08-03 Thread H J van Rooyen
"Yu-Xi Lim" <[EMAIL PROTECTED]> wrote: | Simon Forman wrote: | >> Or has all this been done already? - and no I don't want a web server and php | >> and browsers and Java and html or xml... - I want to write something that works | >> simply and reliably - its just short message accounting type d

Re: Is there an obvious way to do this in python?

2006-08-03 Thread H J van Rooyen
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: |H J van Rooyen a écrit : |> Hi, |> |> I want to write a small system that is transaction based. |> |> I want to split the GUI front end data entry away from the file handling and |> record keeping. |> |> Now it seems almost trivially easy using t

Re: Thread Question

2006-08-03 Thread Ritesh Raj Sarraf
Simon Forman wrote: > > One other question I had, > > If my user passes the --zip option, download_from_web() internally (when the > > download is successful) zips the downloaded data to a zip file. Since in > > case > > of threading there'll be multiple threads, and say if one of the thread > >

Re: need help of regular expression genius

2006-08-03 Thread GHUM
Paul, > text = """ ... input source text ... "" > from pyparsing import SkipTo,Literal,replaceWith > ign1 = "$$" + SkipTo("$$") + "$$" > ign2 = "$_$" + SkipTo("$_$") + "$_$" > semi = Literal(";").setParseAction( replaceWith("; <***>") ) > print (ign1 | ign2 | semi).transformString(text) Thank you

Re: VisualStudio2005 supported in distutils

2006-08-03 Thread mg
I know the incompatibility problem to have Python compiled with one compiler and packages with another one. Nevertheless, in my case, Python is well compiled with VisualStudio2005 thank to project files provided by Mr Python himself. So, Python is not yet ready to support completely VisualStudi

Re: xml.sax problem, help needed.

2006-08-03 Thread K.S.Sreeram
Hari Sekhon wrote: > I've written an xml parser using xml.sax which works most of the time > but often traces back when trying to read a file. The output of the > traceback is below: > > Traceback (most recent call last): > File "/usr/lib/python2.4/site-packages/cherrypy/_cphttptools.py", > line

Re: can this b done

2006-08-03 Thread JyotiC
thanx for the help Gary Herron wrote: > JyotiC wrote: > > hi, > > > > i hv a var of type IntVar, ca i get the name of this variable > > > > eg:- > > class someclass: > > def somefun(...): > >self.var=IntVar() > > > > > > def someotherfun(...): > >i

Re: BCD List to HEX List

2006-08-03 Thread bryanjugglercryptographer
ohn Machin wrote: > [EMAIL PROTECTED] wrote: > > "For each nibble n of x" means to take each 4 bit piece of the BCD > > integer as a value from zero to sixteen (though only 0 through 9 > > will appear), from most significant to least significant. > The OP's input, unvaryingly through the whole thre

Grammar parsing

2006-08-03 Thread Paolo Pantaleo
Hi, How can I write a pareser for a certain gramamr? I found PyPy that does it, is thare any other tool? Maybe something built-in the python interpreter? Thnx PAolo -- if you have a minute to spend please visit my photogrphy site: http://mypic.co.nr -- http://mail.python.org/mailman/listinfo

karrigell and multi-threading

2006-08-03 Thread Shalyd
Hello, Here is my problem :-) : i am actually using karrigell, and i use Karrigell.py server, i have a page running a script (which takes around 5 min to execute), when i launch this script (by the page) then, i cant acces to any other page of the site until the script ends. so i tried the karrige

Re: Railroad track syntax diagrams

2006-08-03 Thread bearophileHUGS
Paul McGuire: > generation of the railroad diagrams (in something > more legible/appealing than ASCII-art!). That ASCII-art looks easy enough to read. It may be bad when the graph becomes very big. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Grammar parsing

2006-08-03 Thread Gregor Horvath
Paolo Pantaleo schrieb: > How can I write a pareser for a certain gramamr? I found PyPy that > does it, is thare any other tool? Maybe something built-in the python > interpreter? > http://pyparsing.wikispaces.com/ -- Servus, Gregor http://www.gregor-horvath.com -- http://mail.python.org/

Re: Is there an obvious way to do this in python?

2006-08-03 Thread Bruno Desthuilliers
H J van Rooyen wrote: > "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: > > > |H J van Rooyen a écrit : > |> Hi, > |> > |> I want to write a small system that is transaction based. > |> > |> I want to split the GUI front end data entry away from the file handling > and > |> record keeping. > |>

Re: serial ports, threads and windows

2006-08-03 Thread Pekka Niiranen
Tom Brown wrote: > Hey people, > > I've written a python app that r/w eight serial ports to control eight > devices > using eight threads. This all works very nicely in Linux. I even put a GUI on > it using PyQt4. Still works nicely. > > Then I put the app on on a virtual Windows machine runn

Re: Can Your Programming Language Do This? Joel on functional programming and briefly on anonymous functions!

2006-08-03 Thread Bruno Desthuilliers
Casey Hawthorne wrote: > Can Your Programming Language Do This? And the answer is "yes, of course" !-) > Joel on functional programming and briefly on anonymous functions! > > http://www.joelonsoftware.com/items/2006/08/01.html > > -- > Regards, > Casey -- bruno desthuilliers python -c "prin

Re: need help of regular expression genius

2006-08-03 Thread Paul McGuire
"GHUM" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Paul, > > > text = """ ... input source text ... "" > > from pyparsing import SkipTo,Literal,replaceWith > > ign1 = "$$" + SkipTo("$$") + "$$" > > ign2 = "$_$" + SkipTo("$_$") + "$_$" > > semi = Literal(";").setParseAction( replac

Re: Programming newbie coming from Ruby: a few Python questions

2006-08-03 Thread H J van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: | On Wed, 02 Aug 2006 22:25:35 +0200, Jarek Zgoda <[EMAIL PROTECTED]> | declaimed the following in comp.lang.python: | | > | > At the end of day we will be these who count bodies. ;) | | o/~ Listen children, to a story | that was written long a

Re: How to force a thread to stop

2006-08-03 Thread H J van Rooyen
"Alex Martelli" <[EMAIL PROTECTED]> Wrote: | H J van Rooyen <[EMAIL PROTECTED]> wrote: | | > "Paul Rubin" Writes: | > | > | "H J van Rooyen" <[EMAIL PROTECTED]> writes: | > | > *grin* - Yes of course - if the WDT was enabled - its something that | > | > I have not seen

Re: Grammar parsing

2006-08-03 Thread Ben Finney
"Paolo Pantaleo" <[EMAIL PROTECTED]> writes: > How can I write a pareser for a certain gramamr? I found PyPy that > does it, is thare any other tool? Maybe something built-in the > python interpreter? The standard library gets you partway there, with 'shlex': http://docs.python.org/lib/modul

using globals

2006-08-03 Thread sj . vanwerkhoven
Hi, I have got a problem with importing global variables. For instance I have got two files: # t1.py #t2.py counter = 1 def counter_adder(filenr): def show_adder(): global counter

Re: Is there an obvious way to do this in python?

2006-08-03 Thread Nick Vatamaniuc
HJ, As far as GUI language/library goes: Some people suggested HTML, but I think HTML is a very awkward way to create a good looking dynamic GUI that is _both_ easy to use and fast and easy to design (which is what you would want probably). Just to have a nice user editable table for example, yo

Re: using globals

2006-08-03 Thread Amit Khemka
On 8/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I have got a problem with importing global variables. For instance I have > got two files: > > # t1.py #t2.py > > counter = 1 > > def counter_adder(filenr):

[no subject]

2006-08-03 Thread subramanian2003
Hello All, From where I can have "python for arcgis" tutorial in detail. Thnx, Subramanian. -- http://mail.python.org/mailman/listinfo/python-list

Python for arcgis

2006-08-03 Thread subramanian2003
Hello All, From where I can get "Python for arcgis" tutorial. Bye, Subramanian. Sign Up for your FREE eWallet at www.wallet365.com -- http://mail.python.org/mailman/listinfo/python-list

python-dev summary for 2006-06-16 to 2006-06-30

2006-08-03 Thread Steven Bethard
python-dev Summary for 2006-06-16 through 2006-06-30 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-06-16_2006-06-30] = Announcements = --- Pyth

Re: Thread Question

2006-08-03 Thread Ritesh Raj Sarraf
Simon Forman wrote: > > The other threads will just take the next request from the Queue and > process it. They won't "care" what the one thread is doing, > downloading, zipping, whatever. > As I mentioned in my previous post, the other threads will also have to go through the same "zip the file

opposite of import

2006-08-03 Thread [EMAIL PROTECTED]
Hi I am new to python. I wanted to know if there is an opposite of "import" -- http://mail.python.org/mailman/listinfo/python-list

Re: opposite of import

2006-08-03 Thread Lawrence Oluyede
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am new to python. I wanted to know if there is an opposite of "import" What do you mean? What are you trying to accomplish? -- Lawrence - http://www.oluyede.org/blog "Nothing is more dangerous than an idea if it's the only one you have" - E. A. C

Re: opposite of import

2006-08-03 Thread Simon Brunning
On 3 Aug 2006 04:50:35 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi > I am new to python. I wanted to know if there is an opposite of "import" Err, depends upon what you mean by opposite. If you want to remove the module from a namespace into which you imported it, you can do that wi

Re: opposite of import

2006-08-03 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: > Hi > I am new to python. I wanted to know if there is an opposite of "import" > If you mean 'import' adds something, so you ask how to get rid of something? Here you are: Look at the 'del' statement if it is what you are looking for. Claudio Grondi -- http://mail.pyt

Re: Is there an obvious way to do this in python?

2006-08-03 Thread H J van Rooyen
"Yu-Xi Lim" <[EMAIL PROTECTED]> wrote: | H J van Rooyen wrote: | > | | > |> And I would like to make this flexible, so that it becomes easy to introduce | > new | > |> transactions, without having to run around updating the code in all the user | > |> machines, with the concomitant version numbe

Re: Is there an obvious way to do this in python?

2006-08-03 Thread H J van Rooyen
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: |H J van Rooyen wrote: |> "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: |> |> 8<--- |> |You'll at least need bits of SQL (but SQLAlchemy may hide away most of |> |it) and HTML (but there are some pyt

Re: need help of regular expression genius

2006-08-03 Thread GHUM
Paul, > Pyparsing ships with JPG and PNG files containing class diagrams, plus an > htmldoc directory containing epydoc-generated help files. > There are also about 20 example programs included (also accessible in the > wiki). Yes. That's what I have been missing. Maybe you could add: "please als

Re: opposite of import

2006-08-03 Thread Simon Brunning
On 8/3/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > If you want to remove the module from a namespace into which you > imported it, you can do that with del: > > import amodule > amodule.afunction() # Works fine > > del amodule > amodule.afunction() # Will die now Note that this doesn't get rid

Datetime question

2006-08-03 Thread Lad
In a datetime object I would like to change days and hours. Or in other words, I would like to copy this datetime object but increase days and hours. Is it possible? For example:If I have a datetime object like this datetime.datetime(2006, 8, 3, 14, 13, 56, 609000) I would like to make a new ,for

Re: Datetime question

2006-08-03 Thread Rama
the datetime object appears to have a replace method which could achieve what you want to do, albeith with some computation from your end first,   >>> d = datetime.datetime(2006, 8, 3, 14, 13, 56, 609000)>>> dir(d)['__add__', '__class__', '__delattr__', '__doc__', '__eq__', '__ge__', '__getattribut

Re: Datetime question

2006-08-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Lad wrote: > In a datetime object I would like to change days and hours. > Or in other words, I would like to copy this datetime object but > increase days and hours. > Is it possible? > For example:If I have a datetime object like this > datetime.datetime(2006, 8, 3, 14, 1

Re: Datetime question

2006-08-03 Thread Diez B. Roggisch
Lad schrieb: > In a datetime object I would like to change days and hours. > Or in other words, I would like to copy this datetime object but > increase days and hours. > Is it possible? > For example:If I have a datetime object like this > datetime.datetime(2006, 8, 3, 14, 13, 56, 609000) > > I w

programming is hard

2006-08-03 Thread placid
Hi all, this site is contains code snippets for various languages and python does not have many code snippet posters. Just lettting you know http://programmingishard.com Cheers P.S: I have no connection with this site! -- http://mail.python.org/mailman/listinfo/python-list

Re: Grammar parsing

2006-08-03 Thread Nicola Musatti
Paolo Pantaleo wrote: > Hi, > > How can I write a pareser for a certain gramamr? I found PyPy that > does it, is thare any other tool? Maybe something built-in the python > interpreter? Check out Dave Beazley's Ply: http://www.dabeaz.com/ply/ . Cheers, Nicola Musatti -- http://mail.python.org/

Re: looking for a regular expression

2006-08-03 Thread �쩳�b�֤����ڡH
※ [EMAIL PROTECTED] (Peter Otten)》之銘言: > 到底在累什麼啊? wrote: > > Thanks a lot! I have never thought of that. > > But what if there's not only commas, but also periods and semicolons? I > > want to find words between 2 near by punctuations. I think it would make > > it diffic

Re: Datetime question

2006-08-03 Thread Rama
> In a datetime object I would like to change days and hours.you'd been pointed to the resources yesterday - please read manuals carefully!a = datetime.datetime(2006, 8, 12, 10, 13, 56, 609000)b = a + datetime.timedelta(days=-2, hours=-4)      But wont this create a new object? Whereas if you wa

Re: opposite of import

2006-08-03 Thread Gerhard Fiedler
On 2006-08-03 09:26:54, Simon Brunning wrote: >> import amodule >> amodule.afunction() # Works fine >> >> del amodule >> amodule.afunction() # Will die now > > Note that this doesn't get rid of a module entirely. Python will still > holds on to the module, and if you just import it again at this

Re: Datetime question

2006-08-03 Thread Simon Brunning
On 8/3/06, Rama <[EMAIL PROTECTED]> wrote: > But wont this create a new object? Whereas if you want to modify the same > object, should we not be using replace? Or does it not matter in the global > picture? datetime objects are immutable. You can't change the value of an existing datetime object,

Re: Datetime question

2006-08-03 Thread Rama
datetime objects are immutable. You can't change the value of anexisting datetime object, only create a new one.     Um.. then how do I get the same ID when I call the replace method?     >>> a = datetime.datetime(2006, 8, 12, 10, 13, 56, 609000)>>> b = a + datetime.timedelta(days=-2, hours=-4)>>>

Re: opposite of import

2006-08-03 Thread Simon Brunning
On 8/3/06, Gerhard Fiedler <[EMAIL PROTECTED]> wrote: > Is that guaranteed, or is that just until the garbage collector has removed > the module (at some arbitrary point)? I *think* it's guaranteed. It's not a matter for the garbage collector. GC only exists to remove cyclic references. Ordinary

Re: Using Python for my web site

2006-08-03 Thread paul kölle
Cliff Wells wrote: > For myself, I handle user-installation of TurboGears pretty much like I > do all user-installed Python packages: using setuptools. Any user who > uses easy_install or 'python setup.py install' gets their packages > automatically installed into a subdirectory of their home dir

Re: Thread Question

2006-08-03 Thread Carl Banks
Ritesh Raj Sarraf wrote: > Simon Forman wrote: > > > One other question I had, > > > If my user passes the --zip option, download_from_web() internally (when > > > the > > > download is successful) zips the downloaded data to a zip file. Since in > > > case > > > of threading there'll be multiple

Re: opposite of import

2006-08-03 Thread Duncan Booth
Gerhard Fiedler wrote: > On 2006-08-03 09:26:54, Simon Brunning wrote: > >>> import amodule >>> amodule.afunction() # Works fine >>> >>> del amodule >>> amodule.afunction() # Will die now >> >> Note that this doesn't get rid of a module entirely. Python will >> still holds on to the module, and

Re: Grammar parsing

2006-08-03 Thread Paolo Pantaleo
2006/8/3, Ben Finney <[EMAIL PROTECTED]>: > "Paolo Pantaleo" <[EMAIL PROTECTED]> writes: > > > How can I write a pareser for a certain gramamr? I found PyPy that > > does it, is thare any other tool? Maybe something built-in the > > python interpreter? > > The standard library gets you partway ther

Re: opposite of import

2006-08-03 Thread John Salerno
Simon Brunning wrote: > but for the fact that Python > stashes a reference to the module in (IIRC) sys.__modules__. And you > mess with *that* at your peril. ;-) According to Python in a Nutshell, references are stored in the dictionary sys.modules, but I'm not sure if it matters that it's not

Re: programming is hard

2006-08-03 Thread Stefan Schwarzer
Hi placid: On 2006-08-03 14:56, placid wrote: > this site is contains code snippets for various languages and python > does not have many code snippet posters. Probably that's because there's a Python "snippet repository" at http://aspn.activestate.com/ASPN/Python/Cookbook/ :-) It wouldn't make

Re: Thread Question

2006-08-03 Thread Gerhard Fiedler
On 2006-08-03 08:49:45, Ritesh Raj Sarraf wrote: > I implemented it but am seeing some issues. > If I use a single thread, all files are zipped to the archive. > Obviously this has to work. > > If threads are 2 or 3 or 4 in numbers, some of the files don't show up > in the archive. > > What woul

Re: Nested function scope problem

2006-08-03 Thread Slawomir Nowaczyk
On Sun, 30 Jul 2006 11:18:10 -0300 Gerhard Fiedler <[EMAIL PROTECTED]> wrote: #> In any case, the following doesn't seem to be implementation detail #> (and rather a part of the language), but it's not really #> understandable with a C++ concept of "variable": #> #> >>> a=3 #> >>> id(a) #> 336815

Re: programming is hard

2006-08-03 Thread Tim Chase
> this site is contains code snippets for various languages and python > does not have many code snippet posters. Just lettting you know > > http://programmingishard.com In addition to Stefan's comment about the pre-existing repository for Python code snippets at http://aspn.activestate.com/AS

Re: How to force a thread to stop

2006-08-03 Thread Gerhard Fiedler
On 2006-08-03 06:07:31, H J van Rooyen wrote: > Thanks - will check it out - seems a lot of money for 555 functionality > though > > Especially if like I, you have to pay for it with Rand - I have started > to call the local currency Runt... Depending on what you're up to, you can make suc

Re: opposite of import

2006-08-03 Thread Simon Brunning
On 8/3/06, John Salerno <[EMAIL PROTECTED]> wrote: > According to Python in a Nutshell, references are stored in the > dictionary sys.modules, but I'm not sure if it matters that it's not > __modules__ instead (unless that also exists). Right you are - it's sys.modules, not sys.__modules__. -- C

Re: Datetime question

2006-08-03 Thread Simon Brunning
On 8/3/06, Rama <[EMAIL PROTECTED]> wrote: > Just curious why when > I call id(a) I get the same id after I call the replace method. In your example, you called a's replace() method, but did nothing with the new datetime object that it returned. The original object, a, naturally still has the same

Re: Datetime question

2006-08-03 Thread Rama
Ah, true. Sorry. I got thrown by the ouput after the line got executed and assumed it was the value of a.   thanks, Rama   On 03/08/06, Simon Brunning <[EMAIL PROTECTED]> wrote: On 8/3/06, Rama <[EMAIL PROTECTED]> wrote: > Just curious why when> I call id(a) I get the same id after I call the repla

Re: Running queries on large data structure

2006-08-03 Thread Christoph Haas
On Wednesday 02 August 2006 22:24, Christoph Haas wrote: > I have written an application in Perl some time ago (I was young and > needed the money) that parses multiple large text files containing > nested data structures and allows the user to run quick queries on the > data. [...] I suppose my f

Re: Hiding Console Output

2006-08-03 Thread Kkaa
This seems like the right thing to do, but it runs the program in the background, and I need my program to wait until the x.exe has finished. I tried using this code: p = subprocess.Popen("x.exe",shell=True,stdout=subprocess.PIPE,stdin=subprocess.PIPE, stderr=subprocess.PIPE) sts = os.waitpid(p.p

Re: Is there an obvious way to do this in python?

2006-08-03 Thread Bruno Desthuilliers
H J van Rooyen wrote: > "Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: (snip) > |> If my original post was unclear I am sorry - the point I want answered, if > |> possible, is how to make the client code effectively updateable on the fly > - > |> because the answer to this will influence the wh

Re: Using Python for my web site

2006-08-03 Thread Paul Boddie
Cliff Wells wrote: > On Wed, 2006-08-02 at 23:13 -0300, Gerhard Fiedler wrote: > > Another one is that it seems (here I go again :) that there is something > > like a marriage between Python and PostgreSQL (or in other words, that > > Python fans that develop web apps have a tendency to favor Postg

Re: Running queries on large data structure

2006-08-03 Thread jay graves
Christoph Haas wrote: > On Wednesday 02 August 2006 22:24, Christoph Haas wrote: > I suppose my former posting was too long and concrete. So allow me to try > it in a different way. :) OK. I'll bite. > The situation is that I have input data that take ~1 minute to parse while > the users need to

Re: Running queries on large data structure

2006-08-03 Thread hiaips
Christoph, Several possibilities come to mind... >From your description, maybe something like Postgres, MySql, or sqlite would not be the best option. (However, I'm wondering what your query requirements are -- for example, if you really need the power of SQL, maybe you should just bite the bulle

What is the best way to print the usage string ?

2006-08-03 Thread Leonel Gayard
Hi all, I had to write a small script, and I did it in python instead of shell-script. My script takes some arguments from the command line, like this. import sys args = sys.argv[1:] if args == []: print """Concat: concatenates the arguments with a colon (:) between them Usage: concat ar

Re: Programming newbie coming from Ruby: a few Python questions

2006-08-03 Thread Thomas Nelson
I strongly recommend trying to come up with your own projects. Just pick small things that reflect something you actually want to do: maybe make a simple board game, or a few scripts to help you keep all your files organized, etc. Generally speaking I think it's easier to teach yourself a languag

Re: Using Python for my web site

2006-08-03 Thread Cliff Wells
On Thu, 2006-08-03 at 15:51 +0200, paul kölle wrote: > Cliff Wells wrote: > > > For myself, I handle user-installation of TurboGears pretty much like I > > do all user-installed Python packages: using setuptools. Any user who > > uses easy_install or 'python setup.py install' gets their packages

Re: Using Python for my web site

2006-08-03 Thread Cliff Wells
On Thu, 2006-08-03 at 09:49 +0200, Sybren Stuvel wrote: > Cliff Wells enlightened us with: > > 1) PostgreSQL fans are perhaps a bit paranoid about claims of MySQL > > being better. There used to be a tiny bit of truth in this claim > > for certain applications (mostly relating to performance and e

Re: What is the best way to print the usage string ?

2006-08-03 Thread BartlebyScrivener
Leonel Gayard wrote: > > Notice that the string messes the indentation in my script. The > indentation is correct, and if the script is invoked without > arguments, the usage string is printed correctly. > > Now, how can I achieve the same result while keeping a clean > indentation ? How is this do

Re: programming is hard

2006-08-03 Thread BartlebyScrivener
Tim Chase wrote: > it may also be that "programmingishard...unless you use python" ;) > > -tkc Or if somebody made a site called programmingisfun.com, then you might find some Python snippets there. rd -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the name of a class

2006-08-03 Thread Shane Hathaway
John Salerno wrote: > Shane Hathaway wrote: > >> Don't forget to file a bug. > > I'm reluctant to call it a bug just yet. Here's more stuff below. > There's obviously a difference between old- and new-style classes. It > seems that as far as new-style is concerned, __name__ is an attribute of

Re: [ANN] The argparse module

2006-08-03 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the name of a class

2006-08-03 Thread John Salerno
Shane Hathaway wrote: > The bug is that the expression "dir(someclass)", where the class is a > user-defined class of either new or old style, never reveals to the user > that the class object has a __name__ attribute. I guess maybe it is a bug. This seems to be the relevant code to prove it:

Re: How to force a thread to stop

2006-08-03 Thread Carl J. Van Arsdall
Alex Martelli wrote: > H J van Rooyen <[EMAIL PROTECTED]> wrote: > > >> "Paul Rubin" Writes: >> >> | "H J van Rooyen" <[EMAIL PROTECTED]> writes: >> | > *grin* - Yes of course - if the WDT was enabled - its something that >> | > I have not seen on PC's yet... >> | >> |

Re: Running queries on large data structure

2006-08-03 Thread Christoph Haas
On Thursday 03 August 2006 17:40, jay graves wrote: > Christoph Haas wrote: > > The situation is that I have input data that take ~1 minute to parse > > while the users need to run queries on that within seconds. I can > > think of two ways: > > What is the raw data size? The file containing the o

Re: What is the best way to print the usage string ?

2006-08-03 Thread Peter Otten
Leonel Gayard wrote: > Notice that the string messes the indentation in my script. The > indentation is correct, and if the script is invoked without > arguments, the usage string is printed correctly. > > Now, how can I achieve the same result while keeping a clean > indentation ? How is this do

Re: Running queries on large data structure

2006-08-03 Thread Christoph Haas
On Thursday 03 August 2006 17:45, hiaips wrote: > Christoph, > > Several possibilities come to mind... > > From your description, maybe something like Postgres, MySql, or sqlite > would not be the best option. (However, I'm wondering what your query > requirements are Imagine this example firewall

Re: What is the best way to print the usage string ?

2006-08-03 Thread Simon Forman
Leonel Gayard wrote: > Hi all, > > I had to write a small script, and I did it in python instead of > shell-script. My script takes some arguments from the command line, > like this. > > import sys > args = sys.argv[1:] > if args == []: > print """Concat: concatenates the arguments with a col

Re: Can Your Programming Language Do This? Joel on functional programming and briefly on anonymous functions!

2006-08-03 Thread Jarek Zgoda
Casey Hawthorne napisał(a): > Can Your Programming Language Do This? > > Joel on functional programming and briefly on anonymous functions! > > http://www.joelonsoftware.com/items/2006/08/01.html Ridiculos. That's how single-programming-mood people react when they find that you can program in p

distutils is not found

2006-08-03 Thread Saketh
Under openSUSE 10.0, I installed Python 2.4.1. I executed a setup.py which imports distutils, but I received an error which gave an "ImportError: module not found" for distutils. I thought that distutils is part of the standard library under Python, but is there something that I am missing? Can I (

Re: What is the best way to print the usage string ?

2006-08-03 Thread Bruno Desthuilliers
Leonel Gayard wrote: > Hi all, > > I had to write a small script, and I did it in python instead of > shell-script. My script takes some arguments from the command line, > like this. > > import sys > args = sys.argv[1:] > if args == []: > print """Concat: concatenates the arguments with a col

Re: What is the best way to print the usage string ?

2006-08-03 Thread Steven Bethard
Leonel Gayard wrote: > Hi all, > > I had to write a small script, and I did it in python instead of > shell-script. My script takes some arguments from the command line, > like this. > > import sys > args = sys.argv[1:] > if args == []: > print """Concat: concatenates the arguments with a col

Re: Hiding Console Output

2006-08-03 Thread Simon Forman
Kkaa wrote: > This seems like the right thing to do, but it runs the program in the > background, and I need my program to wait until the x.exe has finished. > I tried using this code: > > p = > subprocess.Popen("x.exe",shell=True,stdout=subprocess.PIPE,stdin=subprocess.PIPE, > stderr=subprocess.P

Re: distutils is not found

2006-08-03 Thread Diez B. Roggisch
Saketh schrieb: > Under openSUSE 10.0, I installed Python 2.4.1. I executed a setup.py > which imports distutils, but I received an error which gave an > "ImportError: module not found" for distutils. I thought that distutils > is part of the standard library under Python, but is there something >

Re: Is there an obvious way to do this in python?

2006-08-03 Thread H J van Rooyen
"Nick Vatamaniuc" <[EMAIL PROTECTED]> wrote: |HJ, | |As far as GUI language/library goes: | |Some people suggested HTML, but I think HTML is a very awkward way to |create a good looking dynamic GUI that is _both_ easy to use and fast |and easy to design (which is what you would want probably).

Negative division bug?

2006-08-03 Thread Michael Yanowitz
Hello: Just wondering if this is a bug, is this as designed, or do I have to import math or something to make it correct: I was just screwing around. and found: >>> -1/100 -1 Shouldn't it be zero? 1/100 returns 0 but -1/ANY_POSITIVE_INTEGER_NUMBER returns -1 >>> -10/3 -4 It behaves

Re: Running queries on large data structure

2006-08-03 Thread hiaips
Christoph, Well, if you format the data as a Python dictionary and give the data file a .py extension, it becomes a Python module that you can load and reload dynamically. That's sort of what I was thinking. --Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: Negative division bug?

2006-08-03 Thread casevh
>I was just screwing around. > and found: > >>> -1/100 > -1 > Shouldn't it be zero? > 1/100 returns 0 > but -1/ANY_POSITIVE_INTEGER_NUMBER > returns -1 > > >>> -10/3 > -4 > >It behaves correct for positive numbers, but for negative > integers it seems to subtract one from the expected

Re: Negative division bug?

2006-08-03 Thread Carsten Haese
On Thu, 2006-08-03 at 13:51, Michael Yanowitz wrote: > Hello: > > Just wondering if this is a bug, is this as designed, > or do I have to import math or something to make it correct: > >I was just screwing around. > and found: > >>> -1/100 > -1 > Shouldn't it be zero? > 1/100 returns 0 >

Re: Running queries on large data structure

2006-08-03 Thread Christoph Haas
On Thursday 03 August 2006 19:54, hiaips wrote: > Well, if you format the data as a Python dictionary and give the data > file a .py extension, it becomes a Python module that you can load and > reload dynamically. That's sort of what I was thinking. Ah, okay. You mean like just using expr() on th

Re: install python on cdrom

2006-08-03 Thread Fabian Braennstroem
Hi Martin, * Martin v. Löwis <[EMAIL PROTECTED]> wrote: > Fabian Braennstroem schrieb: >> I look for an easy way to use the newest scipy, pyvtk, matplotlib, >> f2py, numpy, paraview/vtk,... on a entreprise redhat machine >> without administration rights. >> My first thought was to install the whol

Re: cleaner way to write this try/except statement?

2006-08-03 Thread Boris Borcic
Simon Forman wrote: > Boris Borcic wrote: >> John Salerno wrote: >>> The code to look at is the try statement in the NumbersValidator class, >>> just a few lines down. Is this a clean way to write it? i.e. is it okay >>> to have all those return statements? Is this a good use of try? Etc. >>> >>> T

Re: Running queries on large data structure

2006-08-03 Thread jay graves
Christoph Haas wrote: > On Thursday 03 August 2006 17:40, jay graves wrote: > > How hard would it be to create this nested structure? > Not hard. Instead of doing "INSERT INTO" I would add values to a dictionary > or list. That's even simpler. > > I've found > > pickling really large data structure

OS independent files

2006-08-03 Thread crystalattice
I'm sure this has been addressed before but it's difficult to search through several thousand postings for exactly what I need, so I apologize if this a redundant question. I've figured out how to use os.path.join to make a file or directory location prior to pickling something to it. But I have

  1   2   >