cgitb performance issue

2008-05-05 Thread Ethan Furman
Greetings! I tried adding a form to our website for uploading large files. Personally, I dislike the forms that tell you you did something wrong and make you re-enter *all* your data again, so this one cycles and remembers your answers, and only prompts for the file once the rest of the

os.open and O_EXCL

2008-05-05 Thread Ethan Furman
Greetings! I am trying to lock a file so no other process can get read nor write access to it. I thought this was possible with os.open(filename, os.O_EXCL), but that is not working. I am aware of the win32file option to do file locking, so my question is this: what is the purpose of the

Re: #!/usr/bin/env python vs. #!/usr/bin/python

2008-05-06 Thread Ethan Furman
Banibrata Dutta wrote: On 5/6/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: At our site we run IRIX, UNICOS, Solaris, Tru64, Linux, cygwin and other unixy OSes. We have python installed in a number of different places: /bin/python /usr/local/bin/python /usr/bin/python

looking for a pdf module

2008-05-13 Thread Ethan Furman
Greetings! I'm hoping to be able to generate pdf files on the fly -- are there any python modules out there to do that? All help appreciated! -- Ethan -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for a pdf module

2008-05-13 Thread Ethan Furman
Gary Herron wrote: Ethan Furman wrote: Greetings! I'm hoping to be able to generate pdf files on the fly -- are there any python modules out there to do that? All help appreciated! -- Ethan -- http://mail.python.org

Re: cgitb performance issue

2008-05-14 Thread Ethan Furman
Gabriel Genellina wrote: En Mon, 05 May 2008 15:56:26 -0300, Ethan Furman [EMAIL PROTECTED] escribió: I tried adding a form to our website for uploading large files. Personally, I dislike the forms that tell you you did something wrong and make you re-enter *all* your data again, so

Re: built in list generator?

2008-05-14 Thread Ethan Furman
Ben Finney wrote: Subject: Re: built in list generator? From: Ben Finney [EMAIL PROTECTED] Date: Wed, 14 May 2008 09:43:43 +1000 To: python-list@python.org To: python-list@python.org Newsgroups: comp.lang.python Diez B. Roggisch [EMAIL PROTECTED] writes: globalrev schrieb: if i

Re: cgitb performance issue

2008-05-15 Thread Ethan Furman
Gabriel Genellina wrote: En Wed, 14 May 2008 13:51:40 -0300, Ethan Furman [EMAIL PROTECTED] escribió: Gabriel Genellina wrote: En Mon, 05 May 2008 15:56:26 -0300, Ethan Furman [EMAIL PROTECTED] escribió: I tried adding a form to our website for uploading large files. Personally, I

Re: Dbase / foxpro files

2008-05-16 Thread Ethan Furman
Johny wrote: Is there a module for reading/modifing db files from Python? Thanks for help B. -- http://mail.python.org/mailman/listinfo/python-list I'm switching my company's software base over from FoxPro 6 to Python. As part of that effort I have written (and am still enhancing :) a

ANN: Python dBase 0.84.18 released!

2009-02-23 Thread Ethan Furman
This module is designed to work with dBase III and Visual FoxPro 6.0 dbf files, along with their memo files. Index files are not supported. The table header is read into memory, table data is read into memory on first record access; field updates are immediately written to disk.

Re: pep 8 constants

2009-02-24 Thread Ethan Furman
Steve Holden wrote: Brian Allen Vanderburg II wrote: bock...@virgilio.it wrote: Constants would be a nice addition in python, sure enough. But I'm not sure that this can be done without a run-time check every time the constant is used, and python is already slow enough. Maybe a check that is

Re: why cannot assign to function call

2009-02-27 Thread Ethan Furman
as if by assignment (pbv)? It seems to me than you end up with the same thing in either case (in Python, at least), making the distinction non-existent. def func(bar): bar.pop() Pass-by-reference: foo = ['Ethan','Furman'] func(foo) # bar = foo Pass-by-value: foo = ['Python

Re: pep 8 constants

2009-02-27 Thread Ethan Furman
Steve Holden wrote: Gabriel Genellina wrote: En Tue, 24 Feb 2009 22:52:20 -0200, Ethan Furman et...@stoneleaf.us escribió: Steve Holden wrote: Brian Allen Vanderburg II wrote: One idea to make constants possible would be to extend properties to be able to exist at the module level

Re: Python alternatives to Text::SimpleTable?

2009-03-03 Thread Ethan Furman
Ray Van Dolson wrote: So I'm looking for an easy (read: lazy) way to generate output in nice ASCII tables like the Text::SimpleTable[1] module in perl. I've come across two so far in the Python world that look promising[2][3] but I'm wondering if anyone else out there has some recommendations

Re: Dbase / foxpro files

2008-05-19 Thread Ethan Furman
Johny wrote: Thanks for your reply.Is it possible to delete a record by using the module? Thanks L -- http://mail.python.org/mailman/listinfo/python-list It is possible with mine. To clarify an earlier post, my module is for dBase III and VFP 6.0 files only (those were the only two I

Struct usage and varying sizes of h, l, etc

2008-05-20 Thread Ethan Furman
Greetings, I'm looking at the struct module for binary packing of ints and floats. The documentation refers to C datatypes. It's been many years since I looked at C, but I seem to remember that the data type sizes were not fixed -- for example, an int might be two byes on one machine, and

Re: Struct usage and varying sizes of h, l, etc

2008-05-21 Thread Ethan Furman
John Machin wrote: Robert Kern wrote: Ethan Furman wrote: Greetings, I'm looking at the struct module for binary packing of ints and floats. The documentation refers to C datatypes. It's been many years since I looked at C, but I seem to remember that the data type sizes were

Re: Struct usage and varying sizes of h, l, etc

2008-05-22 Thread Ethan Furman
John Machin wrote: Robert Kern wrote: Ethan Furman wrote: Greetings, I'm looking at the struct module for binary packing of ints and floats. The documentation refers to C datatypes. It's been many years since I looked at C, but I seem to remember that the data type sizes were

Re: csv iterator question

2008-05-23 Thread Ethan Furman
davidj411 wrote: When you save an open file to a variable, you can re-use that variable for membership checking. it does not seem to be that way with the csv.reader function, even when set to a variable name. what is the best way to store the open CSV file in memory or do i need to open the

Re: php vs python

2008-05-30 Thread Ethan Furman
Jerry Stuckle wrote: As I've said before - good programmers can write good code in any language. So... an eloquent speaker of English is also an eloquent speaker of Spanish/French/German? I think your statement would be correct if worded: some programmers can write good code in any

Re: can python do some kernel stuff?

2008-06-03 Thread Ethan Furman
Andrew Lee wrote: Diez B. Roggisch wrote: Andrew Lee schrieb: Diez B. Roggisch wrote: What has that todo with kernel programming? You can use e.g. pygame to get keystrokes. Or under linux, read (if you are root) the keyboard input file - I've done that to support several keyboards

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Ethan Furman
Ben Finney wrote: Roy Smith [EMAIL PROTECTED] writes: The only externally visible interface is pushTheButton(), yet you don't really want to call that during testing. What you do want to do is test that a random city really does get picked. Then what you're really testing is the

Re: Q about object identity

2008-06-06 Thread Ethan Furman
[EMAIL PROTECTED] wrote: Hello, I am testing object identity. If I do it from the interpreter, I get strange results. *print [] is []* *False* print id([]), id([]) 3083942700 3083942700 Why is that? Isn't this an error? If I test it in a script, all is OK. #!/usr/bin/python a

Re: Q re documentation Python style

2008-06-10 Thread Ethan Furman
kj wrote: I'm a Perlhead trying to learn the Way of Python. I like Python overall, but every once in a while I find myself trying to figure out why Python does some things the way it does. At the moment I'm scratching my head over Python's docstrings. As far as I understand this is the

Re: Alternative to Decimal type

2008-06-10 Thread Ethan Furman
Mel wrote: Frank Millman wrote: Hi all I have a standard requirement for a 'decimal' type, to instantiate and manipulate numeric data that is stored in a database. I came up with a solution long before the introduction of the Decimal type, which has been working well for me. I know the

Re: Alternative to Decimal type

2008-06-11 Thread Ethan Furman
Frank Millman wrote: Thanks to all for the various replies. They have all helped me to refine my ideas on the subject. These are my latest thoughts. Firstly, the Decimal type exists, it clearly works well, it is written by people much cleverer than me, so I would need a good reason not to use

Re: can't assign to literal

2008-06-11 Thread Ethan Furman
MRAB wrote: On Jun 10, 10:57 pm, Steven Clark [EMAIL PROTECTED] wrote: for 1 in oids, vals head_oids: SyntaxError: can't assign to literal -- 1 is a literal, you can't assign it to something. Are you trying to use it as a variable name? Slightly OT, but is there an editor that can display

Re: can't assign to literal

2008-06-11 Thread Ethan Furman
TheSaint wrote: On 00:15, giovedì 12 giugno 2008 Ethan Furman wrote: I like Vim (Vi Improved) What about justifying text ? Do you mean indenting, or wrapping? Vim has excellent indenting support, and Python files already included that support proper indenting, syntax coloring, etc. I

Re: basic code of what I am doing [was problems with opening files due to file's path]

2008-06-11 Thread Ethan Furman
Alexnb wrote: Haha, okay well sorry that I was being so stupid, but I get it now and I apoligize for causing you all the frustration. But I did get it to work finally. -- http://mail.python.org/mailman/listinfo/python-list

Re: can't assign to literal

2008-06-12 Thread Ethan Furman
TheSaint wrote: On 01:37, giovedì 12 giugno 2008 Ethan Furman wrote: Do you mean indenting, or wrapping? I mean fill the line by increasing spaces between words in order to get a paragraph aligned both side, left and right on the page. So if the width is 78 chars it wouldn't have jig saw

'string'.strip(chars)-like function that removes from the middle?

2008-06-16 Thread Ethan Furman
Greetings. The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) For example: .strip -- 'www.example.com'.strip('cmowz.') 'example' .??? -- ---

Re: 'string'.strip(chars)-like function that removes from the middle?

2008-06-17 Thread Ethan Furman
Ethan Furman wrote: Greetings. The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) For example: .strip -- 'www.example.com'.strip('cmowz.') 'example

Re: Decimals in python

2008-06-17 Thread Ethan Furman
[EMAIL PROTECTED] wrote: Hello. New to using Python. Python automatically round off watver i calculate using the floor function. How wud i make the exact value appear? Tried out fabs() in the math library but still confused. Cud some1 elaborate on it. [python] ---help(math.floor): Help on

Re: Does '!=' equivelent to 'is not' [drifting a little more]

2008-06-18 Thread Ethan Furman
Gabriel Genellina wrote: (This thread is getting way above 1cp...) What is 1cp? -- Ethan -- http://mail.python.org/mailman/listinfo/python-list

numeric emulation and __pos__

2008-07-07 Thread Ethan Furman
Greetings, List! I'm working on a numeric data type for measured values that will keep track of and limit results to the number of significant digits originally defined for the values in question. I am doing this primarily because I enjoy playing with numbers, and also to get some

Re: numeric emulation and __pos__

2008-07-08 Thread Ethan Furman
Mark Dickinson wrote: On Jul 8, 12:12 am, Ethan Furman [EMAIL PROTECTED] wrote: 1) Any reason to support the less common operators? i.e. , , , ^, | No reason to support any of these for a nonintegral nonbinary type, as far as I can see. 2) What, exactly, does .__pos__() do

Re: numeric emulation and __pos__

2008-07-08 Thread Ethan Furman
Terry Reedy wrote: Ethan Furman wrote: Anybody have an example of when the unary + actually does something? Besides the below Decimal example. I'm curious under what circumstances it would be useful for more than just completeness (although completeness for it's own sake is important, IMO

Re: a simple 'for' question

2008-07-09 Thread Ethan Furman
Ben Keshet wrote: it didn't help. it reads the pathway as is (see errors for both tries). It looks like it had the write pathway the first time, but could not find it because it searched in the path/way instead of in the path\way. thanks for trying. The form of slash ('\' vs '/') is

Re: Determining when a file has finished copying

2008-07-09 Thread Ethan Furman
writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the program that writes (pgm-W) as I'd like. Otherwise, the write to a different filename and then rename solution would work great. There's no

Re: Dynamic HTML from Python Script

2008-07-09 Thread Ethan Furman
Dave Parker wrote: On Jun 11, 10:43 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: Those are not /server side/ refreshes... Correct. But we weren't discussing server side refreshes. We were discussing how to make the browser refresh automatically in the server side: Two things:

Re: a simple 'for' question

2008-07-10 Thread Ethan Furman
Tim Roberts wrote: Ethan Furman [EMAIL PROTECTED] wrote: Ben Keshet wrote: it didn't help. it reads the pathway as is (see errors for both tries). It looks like it had the write pathway the first time, but could not find it because it searched in the path/way instead of in the path\way

numeric emulation and the rich comparison operators

2008-07-11 Thread Ethan Furman
Greetings, List! Still working on my Measure class, and my next question is... (drum roll please ;) What are the advantages of using __[eq|ne|lt|gt|le|ge]__ vs __cmp__? Thanks in advance! -- Ethan -- http://mail.python.org/mailman/listinfo/python-list

Re: numeric emulation and the rich comparison operators

2008-07-13 Thread Ethan Furman
Gabriel Genellina wrote: En Thu, 10 Jul 2008 17:37:42 -0300, Ethan Furman [EMAIL PROTECTED] escribi�: Greetings, List! Still working on my Measure class, and my next question is... (drum roll please ;) What are the advantages of using __[eq|ne|lt|gt|le|ge]__ vs __cmp__? If your

Re: Determining when a file has finished copying

2008-07-14 Thread Ethan Furman
Sean DiZazzo wrote: On Jul 9, 5:34 pm, keith [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control

Measure class, precision, significant digits, and divmod()

2008-07-15 Thread Ethan Furman
Hey all. My thanks to all who have responded so far with my other questions. It is much appreciated. Some background on what I'm doing (a good explanation can be found at http://www.hazelwood.k12.mo.us/~grichert/sciweb/phys8.htm): When measuring, there is some uncertainty as to the

Re: MySQL Insert

2008-07-15 Thread Ethan Furman
maestroQC wrote: Hi, Its one of those days. I cannot solve this. Any help would be greatly appreciated! When I execute this: class Db(object): def insertAccount(self, date, accountNumber, description, openingBalance): dec = decimal.Decimal(openingBalance) db =

Re: MySQL Insert

2008-07-15 Thread Ethan Furman
maestroQC wrote: Hi, Its one of those days. I cannot solve this. Any help would be greatly appreciated! When I execute this: class Db(object): def insertAccount(self, date, accountNumber, description, openingBalance): dec = decimal.Decimal(openingBalance) db =

Re: Measure class, precision, significant digits, and divmod()

2008-07-15 Thread Ethan Furman
Ken Starks wrote: Ethan Furman wrote: Hey all. snip As I have mentioned before, I am making this Measure class for two reasons: experience with unit testing, I like playing with numbers, I am unaware of anything like this having yet been done (okay, three reasons ;). snip Any

Re: Python Written in C?

2008-07-22 Thread Ethan Furman
Iain King wrote: On Jul 21, 6:58 am, Krishnakant Mane [EMAIL PROTECTED] wrote: First off all c# is absolute rubbish waist of time. if I need to learn it then I better lern java or pythonfor that matter. and by the way what is a real programmer? The story of a Real Programmer:

Re: Boolean tests

2008-07-29 Thread Ethan Furman
Matthew Woodcraft wrote: Ben Finney [EMAIL PROTECTED] wrote: No, he retracted the *insult* and restated the *advice* as a distinct statement. I think it's quite worthwhile to help people see the difference. Ben, it was quite clear from Anders' post that he knows about __nonzero__ . That's

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Ethan Furman
Russ P. wrote: Oh, Lordy. I understand perfectly well how boolean tests, __len__, and __nonzero__ work in Python. It's very basic stuff. You can quit patronizing me (and Carl too, I'm sure). The point that you seem to be missing, or refuse to acknowledge for some reason, is that if x can be

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Ethan Furman
Carl Banks wrote: On Jul 29, 6:42 pm, Matthew Fitzgibbons [EMAIL PROTECTED] wrote: I don't have any postable code (it's in a half way state and I haven't touched it for a while), but I'll see if I can't find the time to bang something up to give you the gist. I wouldn't bother at this point.

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Ethan Furman
Carl Banks wrote: On Jul 30, 4:49 am, Ethan Furman [EMAIL PROTECTED] wrote: Even for those that did realize, and in fact hoped that that is what you were attempting to accomplish, I was not attempting to accomplish what you think I was. I was looking for it, but I didn't want to see it. I

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Ethan Furman
Russ P. wrote: [snippers] The reason I wrote that it would be nice to be able to write if x is not empty: is that it reads naturally. [and more snippers] Reads naturally? For whom? Readability counts does not mean make it sound like english as much as possible. There are good reasons

Re: Boolean tests

2008-08-01 Thread Ethan Furman
Anders J. Munch wrote: Ethan Furman wrote: Even if we find out that C.__nonzero__ is called, what was it that __nonzero__ did again? reinforce the impression that he is unaware of the double-underscore functions and what they do and how they work. Only if your newsreader

__new__

2008-08-03 Thread Ethan Furman
Greetings, List! I was browsing through the Decimal source today, and found this: # We're immutable, so use __new__ not __init__ def __new__. . . self = object.__new__(cls) . . . return self Out of curiousity I then tried this: -- import

Re: __new__

2008-08-03 Thread Ethan Furman
Emile van Sebille wrote: Ethan Furman wrote: -- d25._int = (1, 5) Python considers names that start with a leading underscore as internal or private, and that abuse is the burden of the abuser... Is bytecodehacks still around? That was serious abuse :) Emile Good point. What I'm

Re: __new__

2008-08-04 Thread Ethan Furman
Calvin Spealman wrote: [snip] ask if you really feel the need to know. I am. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Function editing with Vim throws IndentError

2008-08-04 Thread Ethan Furman
Matimus wrote: On Jul 24, 9:32 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Matimus wrote: On Jul 24, 2:54 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Matimus wrote:

Re: Function editing with Vim throws IndentError

2008-08-04 Thread Ethan Furman
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Matimus wrote: On Jul 24, 9:32 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Matimus wrote: On Jul 24, 2:54 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand

Re: __new__

2008-08-04 Thread Ethan Furman
Mel wrote: Ethan Furman wrote: Emile van Sebille wrote: Ethan Furman wrote: -- d25._int = (1, 5) Python considers names that start with a leading underscore as internal or private, and that abuse is the burden of the abuser... Is bytecodehacks still around? That was serious abuse

Re: __new__

2008-08-05 Thread Ethan Furman
Rhamphoryncus wrote: On Aug 4, 11:46 am, Ethan Furman [EMAIL PROTECTED] wrote: Mel wrote: Ethan Furman wrote: Emile van Sebille wrote: Ethan Furman wrote: -- d25._int = (1, 5) Python considers names that start with a leading underscore as internal or private, and that abuse

Re: very newbie question

2008-08-07 Thread Ethan Furman
garywood wrote: stuck on python for absolute beginners chapter 6 i actually done what i was supposed to do use the function ask_number for guess a number but for some reason it does not count correctly the number of tries # Guess My Number # # The computer picks a random number between 1

Re: Negative integers

2008-08-20 Thread Ethan Furman
nntpman68 wrote: johnewing wrote: I am trying to figure out how to test if two numbers are of the same sign (both positive or both negative). I have tried abs(x) / x == abs(y) / y but that fails when one of the numbers is 0. I'm sure that there is an easy way to do this. Any suggestions?

Re: Case-insensitive string compare?

2008-09-05 Thread Ethan Furman
Maric Michaud wrote: Le Friday 05 September 2008 14:33:22 J. Clifford Dyer, vous avez écrit : On Thu, 2008-09-04 at 18:48 -0500, Robert Dailey wrote: Thanks everyone for your help. I'm not opposed to using [key.lower() for key in stage_map] at all, I was just curious to see if there were any

Re: print doesn't respect file inheritance?

2008-09-05 Thread Ethan Furman
bukzor wrote: I was trying to change the behaviour of print (tee all output to a temp file) by inheriting from file and overwriting sys.stdout, but it looks like print uses C-level stuff to do its writes which bypasses the python object/inhertiance system. It looks like I need to use

Call-By-Object

2008-11-10 Thread Ethan Furman
Many thanks to Stephen, Marc, Terry, and everyone else. Even thanks to those whose stubborn refusal to think at the appropriate layer extended the thread clear off my mail reader's screen. This is one area where my understanding was weak, and in fact have had to change code because I didn't

Re: python bug when subclassing list?

2008-11-11 Thread Ethan Furman
Hamish McKenzie wrote: I want to write a Vector class and it makes the most sense to just subclass list. I also want to be able to instantiate a vector using either: Vector( 1, 2, 3 ) OR Vector( [1, 2, 3] ) so I have this: class Vector(list): def __new__( cls, *a ): try:

Re: Python IF THEN chain equivalence

2008-11-13 Thread Ethan Furman
jzakiya wrote: I'm translating a program in Python that has this IF Then chain IF x1 limit: --- do a --- IF x2 limit: --- do b --- IF x3 limit: --- do c --- .- -- IF x10 limt: --- do j ---

Re: Little direction please Python MySQL

2008-11-13 Thread Ethan Furman
len wrote: Hi all; [snip] Here is my problem. I need to start doing this in the really world at my company converting some older cobol system and data to python programs and MySQL. I have gotten past packed decimal fields and various other little tidbits. My problem is the data files

Re: Python IF THEN chain equivalence

2008-11-13 Thread Ethan Furman
Grant Edwards wrote: On 2008-11-14, Ethan Furman [EMAIL PROTECTED] wrote: jzakiya wrote: I'm translating a program in Python that has this IF Then chain IF x1 limit: --- do a --- IF x2 limit: --- do b --- IF x3 limit: --- do c

Re: Little direction please Python MySQL

2008-11-15 Thread Ethan Furman
len wrote: On Nov 13, 7:32 pm, Ethan Furman [EMAIL PROTECTED] wrote: len wrote: Hi all; [snip] Here is my problem. I need to start doing this in the really world at my company converting some older cobol system and data to python programs and MySQL. I have gotten past packed decimal

dBase III files and Visual Foxpro 6 files

2008-12-08 Thread Ethan Furman
Greetings All! I nearly have support complete for dBase III dbf/dbt files -- just wrapping up support for dates. The null value has been a hindrance for awhile but I nearly have that solved as well. For any who know of a cool dbf module already in existence for dBase III and Visual Foxpro

datetime and the rich-companison operators

2008-12-08 Thread Ethan Furman
Greetings All! I am implementing a NullDate class in order to mirror dates and datetimes that have no value (yes, this is for my dbf module :) I'm still a bit fuzzy about class methods, hashing, and __new__, but my question of the moment is this: it seems to me that with two dates or

Re: dBase III files and Visual Foxpro 6 files

2008-12-08 Thread Ethan Furman
sniffer wrote: On Dec 8, 12:53 pm, Ethan Furman [EMAIL PROTECTED] wrote: Greetings All! I nearly have support complete for dBase III dbf/dbt files -- just wrapping up support for dates. The null value has been a hindrance for awhile but I nearly have that solved as well. For any who know

Re: datetime and the rich-companison operators

2008-12-08 Thread Ethan Furman
Chris Rebert wrote: On Sun, Dec 7, 2008 at 11:41 PM, Ethan Furman [EMAIL PROTECTED] wrote: Greetings All! I am implementing a NullDate class in order to mirror dates and datetimes that have no value (yes, this is for my dbf module :) I'm still a bit fuzzy about class methods, hashing

Re: Don't you just love writing this sort of thing :)

2008-12-09 Thread Ethan Furman
Lawrence D'Oliveiro wrote: for \ Entry \ in \ sorted \ ( f for f in os.listdir(PatchesDir) if PatchDatePat.search(f) != None ) \ : Patch = (open, gzip.GzipFile)[Entry.endswith(.gz)](os.path.join(PatchesDir, Entry), r) ... read from

internal circular class references

2008-12-10 Thread Ethan Furman
Greetings List! I'm writing a wrapper to the datetime.date module to support having no date. Its intended use is to hold a date value from a dbf file, which can be empty. The class is functional at this point, but there is one thing I would like to change -- datetime.date.max and

Re: internal circular class references

2008-12-11 Thread Ethan Furman
Carl Banks wrote: On Dec 10, 5:26 pm, Ethan Furman [EMAIL PROTECTED] wrote: Greetings List! I'm writing a wrapper to the datetime.date module to support having no date. Its intended use is to hold a date value from a dbf file, which can be empty. The class is functional at this point

Re: internal circular class references

2008-12-11 Thread Ethan Furman
Thanks, Carl! Thanks, RDM! Your examples and ideas are much appreciated. Many thanks also to everyone else who responded. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question: if var1 == var2:

2008-12-12 Thread Ethan Furman
Andrew Robert wrote: Two issues regarding script. You have a typo on the file you are trying to open. It is listed with a file extension of .in when it should be .ini . Pardon? The OPs original post used .in both in the python code and the command line. Doesn't look like a typo to me.

Re: Limit traceback from most recent call

2008-12-15 Thread Ethan Furman
Brian Allen Vanderburg II wrote: I've looked at traceback module but I can't find how to limit traceback from the most recent call if it is possible. I see that extract_tb has a limit parameter, but it limits from the start and not the end. Currently I've made my own traceback code to do

datetime.time and midnight

2009-02-21 Thread Ethan Furman
Greetings, List! I was curious if anyone knew the rationale behind making midnight False? -- import datetime -- midnight = datetime.time(0,0,0) -- bool(midnight) False To my way of thinking, midnight does actually exist so it should be true. If datetime.time was measuring an *amount* of

Re: datetime.time and midnight

2009-02-22 Thread Ethan Furman
Tim Rowe wrote: 2009/2/22 Mark Dickinson dicki...@gmail.com: On Feb 21, 10:44 pm, Ethan Furman et...@stoneleaf.us wrote: -- midnight = datetime.time(0,0,0) -- bool(midnight) False I'd call this a bug. No more so than zero being false. Zero exists too (check my bank

Re: unicode and dbf files

2009-10-27 Thread Ethan Furman
John Machin wrote: There may possibly different interpretations of a codepage out there somewhere, but they are all *intended* to be the same, and I advise you to cross the different-cp437s bridge *if* it exists and you ever come to it. Have you got access to files with LDID not in (0, 1) that

Re: Web development with Python 3.1

2009-10-29 Thread Ethan Furman
Bruno Desthuilliers wrote: Dotan Cohen a écrit : I don't want to learn some templating language that duplicates what Python already has built in! Then use Mako - it uses plain Python to manage the presentation logic. And if you go for Mako, then you might as well switch to Pylons. Great

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-29 Thread Ethan Furman
Mark Hammond wrote: On 29/10/2009 11:06 AM, Alf P. Steinbach wrote: So I suggest switching to some other more light-weight installer technology. Thanks for the suggestion, but I expect we will stick with MSI even with its shortcomings. Using MSI files has significant other advantages,

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Ethan Furman
Alf P. Steinbach wrote: * James Harris: You get way too deep into Python in places (for a beginner's course in programming). For example, from now on I’ll always use from __future__ in any program that uses print. Sorry, but I think that hiding such concerns is a real disservice. The

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-29 Thread Ethan Furman
Alf P. Steinbach wrote: * Ethan Furman: Mark Hammond wrote: On 29/10/2009 11:06 AM, Alf P. Steinbach wrote: So I suggest switching to some other more light-weight installer technology. Thanks for the suggestion, but I expect we will stick with MSI even with its shortcomings. Using

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Ethan Furman
Alf P. Steinbach wrote: * Ethan Furman: Alf P. Steinbach wrote: * James Harris: You get way too deep into Python in places (for a beginner's course in programming). For example, from now on I’ll always use from __future__ in any program that uses print. Sorry, but I think that hiding

ANN: python-dBase 0.86 Released!

2009-11-03 Thread Ethan Furman
Greetings! I am happy to announce the latest release of python-dBase (dbf for short)! At this point it supports dBase III and Visual FoxPro 6 dbf files. It's a bit quicker now since it's using array.array to hold the records and not strings, and the API has been standardized. It also now

Re: Pyfora, a place for python

2009-11-03 Thread Ethan Furman
Daniel Fetchinson wrote: I was referring to this comment by Ben: Suggestion: Please don't make efforts to fragment the community. This IMHO is hostile, because it presupposes that the mere goal of the OP is fragmenting the community It presupposes nothing of any goal. It describes a

Re: self.__dict__ tricks

2009-11-03 Thread Ethan Furman
Simon Brunning wrote: 2009/11/1 Steven D'Aprano st...@remove-this-cybersource.com.au: The only stupid question is the one you are afraid to ask. I was once asked, and I quote exactly, are there any fish in the Atlantic sea? That's pretty stupid. ;-) Are there any fish in the Dead Sea?

Re: Pyfora, a place for python

2009-11-04 Thread Ethan Furman
Daniel Fetchinson wrote: I was referring to this comment by Ben: Suggestion: Please don't make efforts to fragment the community. This IMHO is hostile, because it presupposes that the mere goal of the OP is fragmenting the community It presupposes nothing of any goal. It describes a

Re: self.__dict__ tricks

2009-11-04 Thread Ethan Furman
Dennis Lee Bieber wrote: Perfectly valid answer -- there are no fish as there is no Atlantic sea G Steven D'Aprano wrote: Once in the distant past, there were no fish in what would become the Atlantic Ocean (not sea) What's with the bias against the word 'sea'? sea –noun 1. the salt

Re: Python as network protocol

2009-11-10 Thread Ethan Furman
Daniel Fetchinson wrote: I'm the king in my castle, although I'm fully aware of the fact that my castle might be ugly from the outside :) +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as network protocol

2009-11-10 Thread Ethan Furman
Steven D'Aprano wrote: I can only repeat what I said to Daniel: can you guarantee that the nice safe, low-risk environment will never change? If not, then choose a more realistic threat model, and build the walls of your locked box accordingly. Seems to me you can't really *guarentee*

Re: How can a module know the module that imported it?

2009-11-11 Thread Ethan Furman
Aahz wrote: In article hdf63i$cm...@reader1.panix.com, kj no.em...@please.post wrote: The subject line says it all. You are probably trying to remove a screw with a hammer -- why don't you tell us what you really want to do and we'll come up with a Pythonic solution? Well, I don't know

using inspect

2009-11-11 Thread Ethan Furman
Greetings! How wise is it to base code on inspect? Specifically on things like live frames on the stack and whatnot. It occurs to me that this is leaning towards implementation details, and away from pure, pristine Python. As an example, I have this routine in a module I'm working on: def

Re: How can a module know the module that imported it?

2009-11-12 Thread Ethan Furman
AK Eric wrote: so: # moduleA.py import moduleB # moduleB.py import sys stuff = sys._getframe(1).f_locals print stuff Prints: {'__builtins__': module '__builtin__' (built-in), '__file__': 'C:\\Documents and Settings\\userName\\My Documents\ \python\\moduleA.py', '__name__': '__main__',

  1   2   3   4   5   6   7   8   9   10   >