Re: [Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-03 Thread jean-michel bain-cornu
Hi, > Thx for the two pointers. Are those widgets more than just tables, ie. > can I edit the contents, including displaying a combo box, can items > be grouped or hierarchized, or are they just basic, read-only tables > to display results? > > I need this kind of widget to build a 2+ column inter

Re: OS independent files

2006-08-03 Thread Roger Upole
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > On Thu, 03 Aug 2006 21:55:21 +0200, Jarek Zgoda <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> crystalattice napisa?(a): >> >> > If I want to make sure the file/directory is made in a user's home >> > directory (e.g. /home/u

Re: Windows vs. Linux

2006-08-03 Thread Bryan Olson
Christopher Weimann wrote: > On 08/02/2006-08:06AM, [EMAIL PROTECTED] wrote: >> From a WinXP command prompt: >> >> C:\> >> C:\>cd /windows/system32 >> >> C:\WINDOWS\system32> >> >> > > > This doesn't work the way you think it does. > > C:\>cd /windows > > C:\WINDOWS>cd /system32 >

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

2006-08-03 Thread Ben Finney
"Leonel Gayard" <[EMAIL PROTECTED]> writes: > import sys > args = sys.argv[1:] > if args == []: > print """Concat: concatenates the arguments with a colon (:) between > them > Usage: concat arg1 [arg2...] > Example: concat a b c prints \"a.jar:b.jar:c/\ > sys.exit(1) > print reduc

Re: exception handling; python program that interacts with postgresql db

2006-08-03 Thread Tim Roberts
"damacy" <[EMAIL PROTECTED]> wrote: >hi, there. i have this question which might sound quite stupid to some >people, but here we go anyway. > >i have written a python program which interacts with a postgresql >database. what it does is simply drops an existing database called >'mytempdb'. > >the c

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

2006-08-03 Thread Jarek Zgoda
Alex Martelli napisał(a): >>>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 procedural or functional way and get y

Re: looking for a regular expression

2006-08-03 Thread John Machin
Tim Roberts wrote: > What is your signature supposed to be? It looks like you are trying to > inject ANSI terminal escape sequences. The vast majority of Usenet > participants are now reading these articles through GUI newsreaders or > web-based readers which show this as 5 lines of unrecognizab

Re: E' possibile integrare ironpython con visual studio 2005?

2006-08-03 Thread Alex Martelli
LaGuna <[EMAIL PROTECTED]> wrote: > Se si come? > > Ciao by Enzo Questo newsgroup preferisce l'inglese -- per favore, chiedi su it.comp.lang.python invece che qui. This newsgroup prefers English -- please ask on it.comp.lang.python rather than here. Alex -- http://mail.python.org/mailman/lis

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

2006-08-03 Thread Alex Martelli
Jarek Zgoda <[EMAIL PROTECTED]> wrote: > 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-

RELEASED Python 2.5 (beta 3)

2006-08-03 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the third BETA release of Python 2.5. This is an *beta* release of Python 2.5. As such, it is not suitable for a production environment. It is being released to solicit feedback and hopefully discover bugs, as

SWIG Python Extension winth C++ Problematic

2006-08-03 Thread Chandrashekhar kaushik
someone ??On 8/4/06, Chandrashekhar kaushik <[EMAIL PROTECTED]> wrote: HiI have been working getting my C++ code to be used in Python ( Basically Extending )This is the problem i am facing rite now.I have a function that returns a Pointer to a class in my C++ Code It looks like this SLSocket* SLSo

encoding of a file

2006-08-03 Thread Thomas Thomas
Hi All,   how can I find the encoding to use to open a file.. I have a file with "£" chararcter.. is there some utility function in python that I can use   how can I know which encoding to use   f=codecs.open(filename, "r", encoding='iso-8859-1') or f=codecs.open(filename, "r", encoding='lat

Re: programming is hard

2006-08-03 Thread placid
[EMAIL PROTECTED] wrote: > placid wrote: > > Alas, all good arguments. > > > > I rest my case. > > After you've just been proven wrong? > > I wouldn't want you for my lawyer. Aha, lucky i wont be a lawyer. -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for a regular expression

2006-08-03 Thread alex23
Tim Roberts wrote: > What is your signature supposed to be? It looks like you are trying to > inject ANSI terminal escape sequences. The vast majority of Usenet > participants are now reading these articles through GUI newsreaders or > web-based readers which show this as 5 lines of unrecognizabl

Re: Problem reading/writing files

2006-08-03 Thread John Machin
[EMAIL PROTECTED] wrote: > This is a bit of a peculiar problem. First off, this relates to Python > Challenge #12, so if you are attempting those and have yet to finish > #12, as there are potential spoilers here. > > I have five different image files shuffled up in one big binary file. > In order

Re: Problem reading/writing files

2006-08-03 Thread Simon Forman
[EMAIL PROTECTED] wrote: > This is a bit of a peculiar problem. First off, this relates to Python > Challenge #12, so if you are attempting those and have yet to finish > #12, as there are potential spoilers here. > > I have five different image files shuffled up in one big binary file. > In order

Re: two embedded problem. one maybe is python bug.

2006-08-03 Thread John McMonagle
On Fri, 2006-08-04 at 11:10 +0800, yy x wrote: > hi,all, > > > > the content of a.py : > #coding:gb2312 > #/usr/local/bin/python > import random > print random.randint(0,10) > > the c program: > #include > int main() > { > Py_Initialize(); > PyRun_SimpleString("import sys")

Re: Problem reading/writing files

2006-08-03 Thread faulkner
have you been using text mode? [EMAIL PROTECTED] wrote: > This is a bit of a peculiar problem. First off, this relates to Python > Challenge #12, so if you are attempting those and have yet to finish > #12, as there are potential spoilers here. > > I have five different image files shuffled up in

Re: looking for a regular expression

2006-08-03 Thread Tim Roberts
[EMAIL PROTECTED] (¨ì©³¦b²Ö¤°»ò°Ú¡H) wrote: > >¡° [EMAIL PROTECTED] (Peter Otten)¡n¤§»Ê¨¥¡G >> ¨ì©³¦b²Ö¤°»ò°Ú¡H 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

Re: current recursion level

2006-08-03 Thread Simon Forman
David Bear wrote: > Is there an easy way to get the current level of recursion? I don't mean > sys.getrecursionlimit. I want to know during a live run of a script how > many times the functions has recursed -- curses, I don't know how to say it > better. > > -- > David Bear > -- let me buy your in

Problem reading/writing files

2006-08-03 Thread smeenehan
This is a bit of a peculiar problem. First off, this relates to Python Challenge #12, so if you are attempting those and have yet to finish #12, as there are potential spoilers here. I have five different image files shuffled up in one big binary file. In order to view them I have to "unshuffle" t

two embedded problem. one maybe is python bug.

2006-08-03 Thread yy x
hi,all,       the content of a.py : #coding:gb2312#/usr/local/bin/pythonimport randomprint random.randint(0,10)   the c program: #include int main(){    Py_Initialize();    PyRun_SimpleString("import sys");    PyRun_SimpleString("sys.path.append('.')");     PyRun_SimpleString("impo

Re: md5 question

2006-08-03 Thread Dan Sommers
On 3 Aug 2006 18:36:14 -0700, "Dan" <[EMAIL PROTECTED]> wrote: > now pretend I wanted to save the string > '8b1a9953c4611296a827abf8c47804d7', and later create a new md5 object > such that when I did md5_w.update(" world") it would then have the hex > value '3e25960a79dbc69b674cd4ec67a72c62'. Is t

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

2006-08-03 Thread Nick Vatamaniuc
Hendrik, ---snip--- Now part of the reason I would like to go the transaction type route instead of the "per user" route is robustness and maintainability, and the ability it would give me to introduce new transaction types easily - as I see it if say an invoice's GUI code is stable I would never

Re: Python open a named pipe == hanging?

2006-08-03 Thread Alex Martelli
Rochester <[EMAIL PROTECTED]> wrote: > Hi, > > I just found out that the general open file mechanism doesn't work > for named pipes (fifo). Say I wrote something like this and it > simply hangs python: ...just as it would "hang" any other language...!-). Looks like you may not b

current recursion level

2006-08-03 Thread David Bear
Is there an easy way to get the current level of recursion? I don't mean sys.getrecursionlimit. I want to know during a live run of a script how many times the functions has recursed -- curses, I don't know how to say it better. -- David Bear -- let me buy your intellectual property, I want to o

md5 question

2006-08-03 Thread Dan
I have a question regarding the md5 module. Is there a way in "initialize" the md5 to a hex value, and continue processing with that value. For example: In [13]:md5_h = md5.md5("Hello world") In [14]:md5_h.hexdigest() Out[14]:'3e25960a79dbc69b674cd4ec67a72c62' In [15]:md5_w = md5.md5("Hello") I

Re: Windows vs. Linux

2006-08-03 Thread Bryan Olson
Duncan Booth wrote: > [EMAIL PROTECTED] wrote: > >> >From a WinXP command prompt: >> >> C:\> >> C:\>cd /windows/system32 >> >> C:\WINDOWS\system32> >> >> > Not from my Windows XP command prompt it doesn't. Do you have anything > strange installed on your system? Tons of strange stuff

Re: [Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-03 Thread Vincent Delporte
On Thu, 3 Aug 2006 22:07:04 +0100, Phil Thompson <[EMAIL PROTECTED]> wrote: >PyQt4 has QTableWidget... Thx for the two pointers. Are those widgets more than just tables, ie. can I edit the contents, including displaying a combo box, can items be grouped or hierarchized, or are they just basic, rea

Re: regex question

2006-08-03 Thread Alex Ross
This might be more flexible: pat = re.compile(r"^(a*(?=b)b*(?=[ac])c*(?=[abd])d*)+$") tests = [('aabbbaabbcccbbbcccddd', True), ('aabcabcd', True), ('abcd', True), ('aabbccaabbccabcabababbb', True), ('aabbccaabbccabcabababbbabcd', True),

Re: regex question

2006-08-03 Thread Tim Chase
> That's great! Thanks for the quick response. Yeah, abcdcd should be > possible too. The below passes that test now as well as a couple others I tossed at it. I changed it from a one-line regexp to a VERBOSE regexp to make it easier to read and see what's going on. You may be able to see th

Re: programming is hard

2006-08-03 Thread [EMAIL PROTECTED]
placid wrote: > Alas, all good arguments. > > I rest my case. After you've just been proven wrong? I wouldn't want you for my lawyer. > > :( > > > Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: programming is hard

2006-08-03 Thread placid
Alas, all good arguments. I rest my case. :( Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: Running queries on large data structure

2006-08-03 Thread John Machin
Christoph Haas wrote: > I assume that XQuery can't to weird queries like IP ranges, or can it? That's twice now you've indicated that IP ranges are causing you some problems. What's the big deal? (a) If you don't have a specialised data type, just parse an IP address into an unsigned 32-bit int

Re: Running queries on large data structure

2006-08-03 Thread Paul Rubin
Christoph Haas <[EMAIL PROTECTED]> writes: > So the question is: would you rather force the data into a relational > database and write object-relational wrappers around it? Or would you > pickle it and load it later and work on the data? The latter application > is currently a CGI. I'm open to

threads, file access and stuff

2006-08-03 Thread [EMAIL PROTECTED]
Hi, i'm trying to make a download manager (getright, flashget, etc..) for linux (pygtk), i'm using pyCurl, so the thing is.. the app need to be able to use mirrors, like : i download the first 400 kb from X, and the second 200 kb from Y and the rest from Z. i've plan to do this with threads and usi

Enhanced Listbox

2006-08-03 Thread drodrig
My apologies if this question has been asked an answered. I am looking for a tkinter grid control or enhanced listbox that can act as a "receipt" for a cash register program. I would like the widget to contain a visible grid of columns and rows. I've tried binding multiple listboxes to a scrollbar

Re: Nested function scope problem

2006-08-03 Thread Bruno Desthuilliers
Antoon Pardon a écrit : > On 2006-07-31, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > >>Antoon Pardon wrote: >>(snip) >> >>>Sure it is usefull. It may be not 100% formally correct, but often >>>things that are not 100% formally correct can be better in bringing >>>an idea accross. >> >>hear he

Re: Megawidget Syntax (Tix)

2006-08-03 Thread Al in Dallas
Al in Dallas wrote: > I'm new to Python*. I am having trouble with the Tix NoteBook > megawidget. When I use a simpler megawidget, such as a ButtonBox, I can > add buttons by invoking > > .add ('button3', text='Retry') > > Unfortunately, with the Notebook, I need access to a subwidget, and all > my

Re: help - iter & dict

2006-08-03 Thread John Machin
Something strange possessed Tim Chase and caused him to write: > def findClosest(dataset, target): [subtly *BUGGY* and overly verbose] > def findClosest2(dataset, target): [evil] Try this (tested to the extent shown): C:\junk>type dict_closest.py def findClosest(dataset, target): [snip] def find

Re: help - iter & dict

2006-08-03 Thread aking
Quoting taleinat <[EMAIL PROTECTED]>: > Ali writes: > > >> Im trying to iterate through values in a dictionary so i can find the > >> closest value and then extract the key for that valuewhat ive done > so far: > >> > >> def pcloop(dictionary, exvalue): > >> z = dictionary.itervalues

Re: regex question

2006-08-03 Thread Tim Chase
Gabriel Murray wrote: > Hello, I'm looking for a regular expression which will match strings as > follows: if there are symbols a, b, c and d, then any pattern is valid if it > begins with a and ends with d and proceeds in order through the symbols. > However, at any point the pattern may reset to

Re: where i can find this module

2006-08-03 Thread Simon Brunning
On 8/3/06, enas khalil <[EMAIL PROTECTED]> wrote: > first i want to subscribe on this list Go to . > i have a question , i run a script which uses module as follows > import ag > > but got the error : > > ImportError: No module named ag

Re: help - iter & dict

2006-08-03 Thread Simon Forman
[EMAIL PROTECTED] wrote: > Dear Python people, > > im a newbie to python and here...so hello! Hi Ali, and welcome. > Im trying to iterate through values in a dictionary so i can find the > closest value and then extract the key for that valuewhat ive done so far: > > def pcloop(dictionary, ex

Python Extension winth C++ Problematic :(

2006-08-03 Thread Chandrashekhar kaushik
HiI have been working getting my C++ code to be used in Python ( Basically Extending )This is the problem i am facing rite now.I have a function that returns a Pointer to a class in my C++ CodeIt looks like this SLSocket* SLSocket::accept( SLHostInfo& client ){    socklen_t    addrlen = sizeof( st

Re: help - iter & dict

2006-08-03 Thread taleinat
Ali writes: >> Im trying to iterate through values in a dictionary so i can find the >> closest value and then extract the key for that valuewhat ive done so >> far: >> >> def pcloop(dictionary, exvalue): >> z = dictionary.itervalues() >> y = z - exvalue >> v = (y*y)*

regex question

2006-08-03 Thread Gabriel Murray
Hello, I'm looking for a regular _expression_ which will match strings as follows: if there are symbols a, b, c and d, then any pattern is valid if it begins with a and ends with d and proceeds in order through the symbols. However, at any point the pattern may reset to an earlier position in the s

Re: [Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-03 Thread Phil Thompson
On Thursday 03 August 2006 9:54 pm, Vincent Delporte wrote: > Hello > > I'd like to use Python under Linux to write a business application, > and I'll need a good grid/spreadsheet editable widget, maybe not on > par with eg. ComponentOne's excellent VSFlexGrid > (http://www.componentone.com/newimag

Re: Python open a named pipe == hanging?

2006-08-03 Thread Rob Williscroft
Rochester wrote in news:[EMAIL PROTECTED] in comp.lang.python: > I just found out that the general open file mechanism doesn't work > for named pipes (fifo). Say I wrote something like this and it > simply hangs python: > > #!/usr/bin/python > > import os > > os.mkfifo('my_fifo

Re: [Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-03 Thread Philippe Martin
Vincent Delporte wrote: > Hello > > I'd like to use Python under Linux to write a business application, > and I'll need a good grid/spreadsheet editable widget, maybe not on > par with eg. ComponentOne's excellent VSFlexGrid > (http://www.componentone.com/newimages/flexgrid_02_lg.gif), but > some

Re: help - iter & dict

2006-08-03 Thread Justin Azoff
[EMAIL PROTECTED] wrote: > Im trying to iterate through values in a dictionary so i can find the > closest value and then extract the key for that valuewhat ive done so far: [snip] > short time. I was trying to define a function (its my first!) so that i > could apply to several 'dictionary's a

[Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-03 Thread Vincent Delporte
Hello I'd like to use Python under Linux to write a business application, and I'll need a good grid/spreadsheet editable widget, maybe not on par with eg. ComponentOne's excellent VSFlexGrid (http://www.componentone.com/newimages/flexgrid_02_lg.gif), but somewhat professional-grade. Any recomme

Re: How to force a thread to stop

2006-08-03 Thread Paul Rubin
"Carl J. Van Arsdall" <[EMAIL PROTECTED]> writes: > Yea, there are other free solutions you might want to check out, I've > been looking at ganglia and nagios. These require constant > communication with a server, however they are customizable in that you > can have the server take action on vario

Re: Need a compelling argument to use Django instead of Rails

2006-08-03 Thread aaronwmail-usenet
Paul Rubin wrote: > I didn't realize you could do shared hosting with mod_python, because > of the lack of security barriers between Python objects (i.e. someone > else's application could reach into yours). You really need a > separate interpreter per user. A typical shared hosting place might

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

2006-08-03 Thread Bryan Olson
H J van Rooyen wrote: [...] > This is broadly what I had in mind, yes - but sort of down to a transaction > level - this user does invoicing, this one enters cheques, this one does credit > notes, and their supervisor can do all three, and in a different department its > different because th

E' possibile integrare ironpython con visual studio 2005?

2006-08-03 Thread LaGuna
Se si come? Ciao by Enzo -- http://mail.python.org/mailman/listinfo/python-list

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

2006-08-03 Thread Bruno Desthuilliers
H J van Rooyen wrote: (snip) > I would like to split this down further - see above - so for each user there > is > a sort of *pointer* to each of the kinds of transactions she can do, and these > are shipped separately and *linked* at the client side... > (snip) > > Now part of the reason I would

[ANNOUNCE] Thirty-fourth release of PythonCAD now available

2006-08-03 Thread Art Haas
Hi. I'm pleased to announce the thirty-fourth development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually excee

Python open a named pipe == hanging?

2006-08-03 Thread Rochester
Hi, I just found out that the general open file mechanism doesn't work for named pipes (fifo). Say I wrote something like this and it simply hangs python: #!/usr/bin/python import os os.mkfifo('my_fifo') open('my_fifo', 'r+').write('some strings.') x = os.popen('cat my_fifo').r

Re: Nested function scope problem

2006-08-03 Thread Gerhard Fiedler
On 2006-08-03 10:57:22, Slawomir Nowaczyk 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) > #> 3368152 > #> >>> b=a

Re: help - iter & dict

2006-08-03 Thread Tim Chase
> Im trying to iterate through values in a dictionary so i can find the > closest value and then extract the key for that valuewhat ive done so far: > > def pcloop(dictionary, exvalue): > z = dictionary.itervalues() > y = z - exvalue > v = (y*y)**1/2 > if v < 0.

Re: OS independent files

2006-08-03 Thread Gerhard Fiedler
On 2006-08-03 16:21:13, crystalattice wrote: > 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

Re: Static Variables in Python?

2006-08-03 Thread Slawomir Nowaczyk
On Tue, 01 Aug 2006 07:37:20 -0400 Michael Yanowitz <[EMAIL PROTECTED]> wrote: #>I like the class idea, however I realize that the class object itself #> has to be global. But no more global than your original set_bit was... -- Best wishes, Slawomir Nowaczyk ( [EMAIL PROTECTED] )

Re: OS independent files

2006-08-03 Thread Jarek Zgoda
Tim Chase napisał(a): > Well, there in os.path you'll find expanduser() so you can do things like > homedir = os.path.expanduser("~") filename = os.path.join(homedir, "myfiles", "myfile.dat") > > Seems to work well for me. On Windows, this is consistent between releases (i.e. you'll e

Re: OS independent files

2006-08-03 Thread crystalattice
Simon Forman wrote: > Google groups has a very good search. That's what I'm using, and it still came up with 600-900 results depending on my search terms. > Try os.path.expanduser('~') (in > http://docs.python.org/lib/module-os.path.html) or you could just look > up the HOME environment variable

Re: OS independent files

2006-08-03 Thread Jarek Zgoda
crystalattice napisał(a): > If I want to make sure the file/directory is made in a user's home > directory (e.g. /home/users/path/to/file) but also compatible w/ > Windows, how would I rewrite this (if required)? On Windows, there's no notion of user's home directory, there is a directory for use

Re: OS independent files

2006-08-03 Thread Tim Chase
> location prior to pickling something to it. But I have a question > about it. In Windows I can make a file with this: > > os.path.join("C:", "myfiles", "myfile.dat") > > If I want to make sure the file/directory is made in a user's home > directory (e.g. /home/users/path/to/file) but also com

Re: OS independent files

2006-08-03 Thread Simon Forman
crystalattice wrote: > 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. Google groups has a very good search. > I've figured out how to use os.path.join to make a file o

help - iter & dict

2006-08-03 Thread aking
Dear Python people, im a newbie to python and here...so hello! Im trying to iterate through values in a dictionary so i can find the closest value and then extract the key for that valuewhat ive done so far: def pcloop(dictionary, exvalue): z = dictionary.itervalues() y = z

Re: OS independent files

2006-08-03 Thread Larry Bates
crystalattice wrote: > 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 pickl

where i can find this module

2006-08-03 Thread enas khalil
hello first i want to subscribe on this list   i have a question , i run a script which uses module as follows import sysimport agimport reimport getoptimport codecsimport timeimport os     but got the error :   ImportError: No module named ag   so where can i obtain this module thank

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

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

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: 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: 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: 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: 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: 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

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: 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).

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: 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: 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: 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

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: 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

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: 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 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: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: 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: 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: [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 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: 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: 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: 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: 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: 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

  1   2   >