Re: Read / Write OpenOffice SpreadSheet ?

2010-12-16 Thread Tim Chase
On 12/16/2010 07:53 PM, Tim Harig wrote: On 2010-12-17, Torsten Mohr wrote: i search for a possibility to access OpenOffoce SpreadSheets from Python with a reasonably new version of Python. Can anybody point me to a package that can do this? There is no package needed to read or write the

Re: Newbie question about importing modules.

2010-12-17 Thread Tim Roberts
you are delivering a program to clients, then you should look at something like py2exe, which will examine your code and produce a zip file that includes all of the files your application will need. If you are delivering a script for someone that will definitely have Python installed, then you just ne

Re: If/then style question

2010-12-17 Thread Tim Golden
On 17/12/2010 15:53, Steve Holden wrote: [... snip example of for-else ...] This construct appears to be unpopular in actual use, and when it comes up in classes and seminars there is always interesting debate as people discuss potential uses and realise there are useful applications. I use t

Re: PyUNO [Was: Read / Write OpenOffice SpreadSheet ?]

2010-12-17 Thread Tim Harig
On 2010-12-17, Adam Tauno Williams wrote: > I would strongly recommend against floundering about in OOo's very > complex XML files - it is trivially easy to render a document unusable. I do it all the time and have never had a problem. I don't generate the documents from scratch; I generate a te

Re: Newbie question about importing modules.

2010-12-18 Thread Tim Roberts
s is a bit alien to me. That certainly works for individual scripts, but even with PHP there are customary central locations where complicated packages are installed. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to parse a HUGE(1gb) xml file

2010-12-20 Thread Tim Harig
[Wrapped to meet RFC1855 Netiquette Guidelines] On 2010-12-20, spaceman-spiff wrote: > This is a rather long post, but i wanted to include all the details & > everything i have tried so far myself, so please bear with me & read > the entire boringly long post. > > I am trying to parse a ginormous

Re: Trying to parse a HUGE(1gb) xml file

2010-12-20 Thread Tim Harig
On 2010-12-20, spaceman-spiff wrote: > 0. Goal :I am looking for a specific element..there are several 10s/100s > occurrences of that element in the 1gb xml file. The contents of the xml, > is just a dump of config parameters from a packet switch( although imho, > the contents of the xml dont mat

Re: Python Web App

2010-12-22 Thread Tim Harig
On 2010-12-22, Sean wrote: > Anybody know where I can find a Python Development Environment in the > form of a web app for use with Chrome OS. I have been looking for a > few days and all i have been able to find is some old discussions with > python developers talking about they will want one for

Re: Python Web App

2010-12-22 Thread Tim Harig
[Reordered to preserve context in bottom posting] On 2010-12-23, Hidura wrote: > 2010/12/22, Tim Harig : >> On 2010-12-22, Sean wrote: >>> Anybody know where I can find a Python Development Environment in the >>> form of a web app for use with Chrome OS. I have been

Re: Python Web App

2010-12-22 Thread Tim Harig
On 2010-12-23, Hidura wrote: > Ok, but you are comparing a web-based framework with a native-based > framework that use the components of the system to make all the things > that need, a web-based framewok use the resourses of the browser to Right. That is exactly what I am comparing. > make it

Re: Python Web App

2010-12-23 Thread Tim Harig
On 2010-12-23, Daniel Fetchinson wrote: >> I don't personally think the web makes a good framework for highly >> interactive applications as they must work within the constraints of the >> browser and IDEs are highly interactive applications by their very nature. >> Perhaps HTML5/CSS3 will change

Re: How to order base classes?

2010-12-23 Thread Tim Roberts
so the mix-ins can modify the behavior. class BlueSpanishListBox( ListBox, ColorBlueMixIn, SpanishMixIn ): ... Reading it, a BlueSpanishListBox is-a ListBox that happens to have a few additional features. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to parse a HUGE(1gb) xml file

2010-12-25 Thread Tim Harig
On 2010-12-25, Steve Holden wrote: > On 12/23/2010 4:34 PM, Stefan Sonnenberg-Carstens wrote: >> For large datasets I always have huge question marks if one says "xml". >> But I don't want to start a flame war. I would agree; but, you don't always have the choice over the data format that you hav

Re: Trying to parse a HUGE(1gb) xml file

2010-12-25 Thread Tim Harig
On 2010-12-25, Nobody wrote: > On Sat, 25 Dec 2010 14:41:29 -0500, Roy Smith wrote: >>> XML works extremely well for large datasets. > One advantage it has over many legacy formats is that there are no > inherent 2^31/2^32 limitations. Many binary formats inherently cannot > support files larger t

Re: Trying to parse a HUGE(1gb) xml file

2010-12-25 Thread Tim Harig
On 2010-12-25, Adam Tauno Williams wrote: > On Sat, 2010-12-25 at 22:34 +, Nobody wrote: >> On Sat, 25 Dec 2010 14:41:29 -0500, Roy Smith wrote: >> XML is typically processed sequentially, so you don't need to create a >> decompressed copy of the file before you start processing it. > > Yep.

Re: Design Ideals Goals Python 3 - Forest for the trees

2010-12-25 Thread Tim Harig
On 2010-12-26, flebber wrote: > I was hoping someone could shed some (articles, links) in regards > python 3 design ideals. I was searching guido's blog which has his > overarching view of Python from an early development perspective > http://python-history.blogspot.com/2009/01/pythons-design-phil

Re: Trying to parse a HUGE(1gb) xml file

2010-12-26 Thread Tim Harig
On 2010-12-26, Nobody wrote: > On Sun, 26 Dec 2010 01:05:53 +0000, Tim Harig wrote: > >>> XML is typically processed sequentially, so you don't need to create a >>> decompressed copy of the file before you start processing it. >> >> Sometimes XML is

Re: Trying to parse a HUGE(1gb) xml file

2010-12-26 Thread Tim Harig
On 2010-12-26, Stefan Behnel wrote: > Tim Harig, 26.12.2010 02:05: >> On 2010-12-25, Nobody wrote: >>> On Sat, 25 Dec 2010 14:41:29 -0500, Roy Smith wrote: >>>> Of course, one advantage of XML is that with so much redundant text, it >>>> compresses well.

Re: Trying to parse a HUGE(1gb) xml file

2010-12-26 Thread Tim Harig
On 2010-12-26, Stefan Behnel wrote: > Tim Harig, 26.12.2010 10:22: >> On 2010-12-26, Stefan Behnel wrote: >>> Tim Harig, 26.12.2010 02:05: >>>> On 2010-12-25, Nobody wrote: >>>>> On Sat, 25 Dec 2010 14:41:29 -0500, Roy Smith wrote: >>>&g

Re: User input masks - Access Style

2010-12-26 Thread Tim Harig
On 2010-12-27, flebber wrote: > Is there anyay to use input masks in python? Similar to the function > found in access where a users input is limited to a type, length and > format. > > So in my case I want to ensure that numbers are saved in a basic > format. > 1) Currency so input limited to 000

Re: User input masks - Access Style

2010-12-26 Thread Tim Harig
On 2010-12-27, Tim Harig wrote: > ... if re.match(r'''^[0-9]{2}:[0-9]{2}:[0-9]{2}$''', timeInput) == None: [SNIP] > Currency works the same way using validating it against: > r'''[0-9]+\.[0-9]{2}''' Sorry, you need to check

Re: Trying to parse a HUGE(1gb) xml file

2010-12-27 Thread Tim Harig
On 2010-12-27, Alan Meyer wrote: > On 12/26/2010 3:15 PM, Tim Harig wrote: > ... >> The problem is that XML has become such a defacto standard that it >> used automatically, without thought, even when there are much better >> alternatives available. > > I agree wi

Re: Interning own classes like strings for speed and size?

2010-12-27 Thread Tim Delaney
You could even use the same canonicalisation dictionary so long as you could ensure that none of the different types compare equal (e.g. floats and integers). Note that as an implementation detail the integers -5...256 are already interned, but you can't rely on that (the range has changed over time). Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: User input masks - Access Style

2010-12-31 Thread Tim Harig
On 2010-12-31, flebber wrote: > On Dec 28 2010, 12:21 am, Adam Tauno Williams > wrote: >> On Sun, 2010-12-26 at 20:37 -0800, flebber wrote: >> > Is there anyay to use input masks in python? Similar to the function >> > found in access where a users input is limited to a type, length and >> > form

Re: Tkinter: The good, the bad, and the ugly!

2011-01-02 Thread Tim Chase
On 01/01/2011 06:39 PM, rantingrick wrote: On Jan 1, 5:39 pm, CM wrote: And I don't see this as a problem anyway. I wanted to do GUI programming in Python, so I read a bit, chose wxPython, downloaded it, and started learning it. Done. I, I, I...Me,Me,Me. Seems you are only concerned about

Re: Interrput a thread

2011-01-02 Thread Tim Roberts
quot;should I die?" flag, and then commit suicide. That is the ONLY clean way to handle this problem. There is simply no clean way to force another thread to die without its permission. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Matrix multiplication

2011-01-04 Thread Tim Roberts
makes more sense iteratively. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Graphing API,

2011-01-05 Thread Tim Harig
On 2011-01-05, Slie wrote: > Is there a graphing API, someone suggests? You should check the archives, variations of this question get asked a lot. I use GNUplot to do my graphing. I simply pipe it commands and data through the subprocess module; but, there are libraries available for interacti

Re: Google Chart API, HTTP POST request format.

2011-01-05 Thread Tim Harig
On 2011-01-06, Slie wrote: [reformated to <80 columns per RFC 1855 guidelines] > I have read several examples on python post requests but I'm not sure > mine needs to be that complicated. >From the HTML example on the page you posted:

Re: Google Chart API, HTTP POST request format.

2011-01-06 Thread Tim Harig
On 2011-01-06, Chris Rebert wrote: > On Wed, Jan 5, 2011 at 11:21 PM, Garland Fulton wrote: >> On Wed, Jan 5, 2011 at 7:26 PM, Tim Harig wrote: >>>    Python 3.1.2 (r312:79147, Oct  9 2010, 00:16:06) >>>    [GCC 4.4.4] on linux2 >>>    Type "help"

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Tim Harig
On 2011-01-06, dmitrey wrote: > and after several pages of code they are using somewhere, maybe only > one time, e.g. [SNIP] > It makes programs less clear, you have to scroll several pages of code > in IDE to understand what it refers to. Python doesn't require imports to be at the top of a file

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Tim Harig
On 2011-01-06, dmitrey wrote: [re-ordered] > On Jan 6, 5:57 pm, Tim Harig wrote: >> Python doesn't require imports to be at the top of a file.  They can be >> imported at any time. >> >> > import MyModule >> > (...lots of code...) >>

Re: PEP: possibility of inline using of a symbol instead of "import"

2011-01-06 Thread Tim Chase
On 01/06/2011 10:32 AM, Tim Harig wrote: 2. Your so-called PEP probably clashes with Python's use of @ for decorators. 3. Do you really expect a language holding the mantra that there should be a single way of doing things to embrace a language bloating feature for

Re: How to read ansic file into a pre-defined class?

2011-01-08 Thread Tim Roberts
().split() for j in range(numitems)] ) Then len(classlist) tells you how many classes. len(classlist[0]) tells you how many items in the first class. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested structures question

2011-01-12 Thread Tim Harig
On 2011-01-12, Physics Python wrote: > while guess != the_number: = > while tries > 7: > if guess > the_number: > print "Lower..." > else: > print "Higher..." > guess = int(raw_input("Take a guess:

Re: Nested structures question

2011-01-12 Thread Tim Harig
[wrapped lines to <80 characters per RFC 1855] On 2011-01-12, Physics Python wrote: > Is this an indentation problem then? That depends how you look at it. I was not clear from your code exactly where you wanted to handle things. > How do I update the sentinel within the secondary while loop. I

Re: Nested structures question

2011-01-12 Thread Tim Harig
On 2011-01-12, Jason Staudenmayer wrote: > Return False instead of break should work > > else: > print "You guessed it! The number was", the_number > print "And it only took you", tries, "tries!\n" > return False Since he isn't in a function, that isn't any good. He wo

Re: Nested structures question

2011-01-12 Thread Tim Harig
In case you still need help: - # Set the initial values - the_number= random.randrange(100) + 1 - tries = 0 - guess = None - - # Guessing loop - while guess != the_number and tries < 7: - guess = int(raw_input("Take a guess: ")) - if guess > the_number: - print "Lower..." -

Re: Developing a program to make a family tree.

2011-01-14 Thread Tim Harig
On 2011-01-14, Ata Jafari wrote: > I'm trying to develop a program like family tree maker. I have all > information, so there is no need to search on the net. This must be > something like trees. Can someone help me? I'm at the beginning. I don't know anything specific about family tree software

Re: After C++, what with Python?

2011-01-16 Thread Tim Harig
On 2011-01-16, John Nagle wrote: > On 1/15/2011 10:48 PM, Aman wrote: >> @nagle Means you are suggesting me not to proceed with Python because I've >> had experience with C++? > >No, Python is quite useful, but on the slow side. If you're I/O > bound, not time critical, or otherwise not perf

[OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-16 Thread Tim Harig
On 2011-01-16, Paul Rubin wrote: > Tim Harig writes: >> Those who are concerned about performance should check out Go. >> Garbage collection, duck typing, and compiles to a native binary. >> It creates a great middle ground between C++ and Python. Any C and/or >>

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-16 Thread Tim Harig
On 2011-01-16, Steven D'Aprano wrote: > On Sun, 16 Jan 2011 09:47:35 +0000, Tim Harig wrote: > >> One of the things that gives me hope >> for Go is that it is backed by Google so I expect that it may gain some >> rather rapid adoption. It has made enough of a wake

Re: Not clear about the dot notation

2011-01-16 Thread Tim Roberts
rl = self.request.get("url") >item.author = users.get_current_user() > item.put() >self.redirect("/newest") > >so his vote.vote is like my item.url ? Exactly. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-17 Thread Tim Harig
On 2011-01-16, geremy condra wrote: > On Sun, Jan 16, 2011 at 3:03 AM, Tim Harig wrote: >> On 2011-01-16, Steven D'Aprano wrote: >>> If the author thinks that Go is a "tried and true" (his words, not mine) >>> language "where programmers can

Re: [OT] Python like lanugages

2011-01-17 Thread Tim Harig
On 2011-01-17, Paul Rubin wrote: > geremy condra writes: >> I agree. That does not make Go that language, and many of the choices >> made during Go's development indicate that they don't think it's that >> language either. I'm speaking specifically of its non-object model, >> lack of exceptions,

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-17 Thread Tim Harig
On 2011-01-17, Steven D'Aprano wrote: > On Mon, 17 Jan 2011 09:12:04 +0000, Tim Harig wrote: > >> Python has been widely used by people like us that happen to like the >> language and found ways to use it in our workplaces; but, most of the >> time it is an unoffici

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-17 Thread Tim Harig
On 2011-01-17, Chris Rebert wrote: > On Mon, Jan 17, 2011 at 1:12 AM, Tim Harig wrote: >> On 2011-01-16, geremy condra wrote: >>> On Sun, Jan 16, 2011 at 3:03 AM, Tim Harig wrote: > >>>> Personally, I think the time is ripe for a language that bridges the >

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-17 Thread Tim Harig
In comp.lang.python, you wrote: > Tim Harig, 17.01.2011 13:25: >> If I didn't think Python was a good language, I wouldn't be here. >> Nevertheless, it isn't a good fit for many pieces of software where a >> systems language is better suited. Reasons includ

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-17 Thread Tim Harig
On 2011-01-17, geremy condra wrote: > On Mon, Jan 17, 2011 at 1:12 AM, Tim Harig wrote: >> On 2011-01-16, geremy condra wrote: >> I wouldn't say Go is narrowly targeted.  It's a systems language that can >> compete in the same domain with scripting languages.  It

Re: [OT] Python like lanugages

2011-01-17 Thread Tim Harig
On 2011-01-17, John Nagle wrote: > That's been done once or twice. There's what are called "single > assignment languages". Each variable can only be assigned once. > The result looks like an imperative language but works like a functional > language. Look up "SISAL" for an example. This

Re: UTF-8 question from Dive into Python 3

2011-01-17 Thread Tim Harig
On 2011-01-17, carlo wrote: > Is it true UTF-8 does not have any "big-endian/little-endian" issue > because of its encoding method? And if it is true, why Mark (and > everyone does) writes about UTF-8 with and without BOM some chapters > later? What would be the BOM purpose then? Yes, it is true.

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-17 Thread Tim Harig
On 2011-01-17, geremy condra wrote: > On Mon, Jan 17, 2011 at 1:07 PM, Tim Harig wrote: >> On 2011-01-17, geremy condra wrote: >>> On Mon, Jan 17, 2011 at 1:12 AM, Tim Harig wrote: >>>> On 2011-01-16, geremy condra wrote: >> Go is every bit of a general

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-18 Thread Tim Harig
On 2011-01-18, Steven D'Aprano wrote: > On Mon, 17 Jan 2011 19:41:54 +0000, Tim Harig wrote: > >> One of the arguments for Python has always made is that you can optimize >> it by writing the most important parts in C. Perhaps that is a crutch >> that has held t

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-18 Thread Tim Harig
On 2011-01-18, Stefan Behnel wrote: > Tim Harig, 17.01.2011 20:41: >> One of the arguments for Python has always made is that you can optimize >> it by writing the most important parts in C. Perhaps that is a crutch >> that has held the communty back from seeking higher

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-18 Thread Tim Harig
On 2011-01-18, Rui Maciel wrote: > Tim Harig wrote: > >> You still don't see many >> companies doing large scale internal development using Python and you >> definately don't see any doing external developement using a language >> that gives the customers

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-18 Thread Tim Harig
On 2011-01-18, geremy condra wrote: > On Mon, Jan 17, 2011 at 4:02 PM, Tim Harig wrote: >> I really question that you get Java anywhere even close to C performance. >> Google reports they get within the same order of magnitude as C for >> their long-lived server processes

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-18 Thread Tim Harig
On 2011-01-18, Terry Reedy wrote: > On 1/18/2011 10:30 AM, Tim Harig wrote: > >> Whether or not you actually agree with that economic reality is >> irrelevant. Those who fund commerical projects do; and, any developement >> tool which violates the security of the source

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-18 Thread Tim Harig
On 2011-01-18, geremy condra wrote: > On Tue, Jan 18, 2011 at 11:05 AM, Tim Harig wrote: >> Even assuming that PyPy does actually manage to reach within a magnitude >> of C with the extra effort required to leverage two languages, why >> would I bother when I can do i

Re: UTF-8 question from Dive into Python 3

2011-01-18 Thread Tim Roberts
Tim Harig wrote: >On 2011-01-17, carlo wrote: > >> 2- If that were true, can you point me to some documentation about the >> math that, as Mark says, demonstrates this? > >It is true because UTF-8 is essentially an 8 bit encoding that resorts >to the next bit once

Re: UTF-8 question from Dive into Python 3

2011-01-19 Thread Tim Harig
On 2011-01-19, Tim Roberts wrote: > Tim Harig wrote: >>On 2011-01-17, carlo wrote: >> >>> 2- If that were true, can you point me to some documentation about the >>> math that, as Mark says, demonstrates this? >> >>It is true because UTF-8 is essent

Re: UTF-8 question from Dive into Python 3

2011-01-19 Thread Tim Harig
Considering you post contained no information or evidence for your negations, I shouldn't even bother responding. I will bite once. Hopefully next time your arguments will contain some pith. On 2011-01-19, Antoine Pitrou wrote: > On Wed, 19 Jan 2011 11:34:53 + (UTC) > Tim H

Re: UTF-8 question from Dive into Python 3

2011-01-19 Thread Tim Harig
On 2011-01-19, Adam Skutt wrote: > On Jan 19, 9:00 am, Tim Harig wrote: >> That is why I say that byte streams are essentially big endian. It is >> all a matter of how you look at it. > > It is nothing of the sort. Some byte streams are in fact, little > endian: whe

Re: UTF-8 question from Dive into Python 3

2011-01-19 Thread Tim Harig
On 2011-01-19, Antoine Pitrou wrote: > On Wed, 19 Jan 2011 14:00:13 + (UTC) > Tim Harig wrote: >> UTF-8 has no apparent endianess if you only store it as a byte stream. >> It does however have a byte order. If you store it using multibytes >> (six bytes for all UTF

Re: UTF-8 question from Dive into Python 3

2011-01-19 Thread Tim Harig
On 2011-01-19, Antoine Pitrou wrote: > On Wed, 19 Jan 2011 16:03:11 + (UTC) > Tim Harig wrote: >> >> For many operations, it is just much faster and simpler to use a single >> character based container opposed to having to process an entire byte >> stream t

Re: UTF-8 question from Dive into Python 3

2011-01-19 Thread Tim Harig
On 2011-01-19, Antoine Pitrou wrote: > On Wed, 19 Jan 2011 18:02:22 + (UTC) > Tim Harig wrote: >> Converting to a fixed byte >> representation (UTF-32/UCS-4) or separating all of the bytes for each >> UTF-8 into 6 byte containers both make it possible to simply i

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-19 Thread Tim Delaney
utely *must* obfuscate your object code more than the python bytecode, just put it all into a separate module and compile it with Cython <http://cython.org/>. Then you end up with machine-specific object code which is somewhat harder to reverse engineer for most people (but quite a few people

Re: Part of RFC 822 ignored by email module

2011-01-21 Thread Tim Roberts
re are several such things) is not all that important. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP8, line continuations and string formatting operations

2011-01-21 Thread Tim Chase
On 01/21/2011 01:53 PM, Gerald Britton wrote: What about string formatting operations (old style) though? The % symbols is a binary operator between a string and the substitution values. Strictly reading PEP 8 leads to: my_string = ("A long string with %s substitutions that %s the line should

Re: Short circuting

2011-01-21 Thread Tim Chase
On 01/21/2011 05:33 PM, Ed Connell wrote: Consider the following please: (re_section, re_name, etc are previously compiled patterns) result1 = re_section.search(line); result2 = re_name.search(line); result3 = re_data1.sear

Re: Which is the best book to learn python

2011-01-25 Thread Tim Harig
On 2011-01-25, Mark Summerfield wrote: > On Jan 24, 5:09 pm, santosh hs wrote: >> Hi All, >> i am beginner to python please tell me which is the best available >> reference for beginner to start from novice > > If you want to learn Python 3 and have some prior programming > experience (in any mod

Re: WxPython versus Tkinter.

2011-01-25 Thread Tim Chase
On 01/25/2011 07:07 PM, rantingrick wrote: What is it going to take for you (and others) to take me seriously? Easy: Stop ranting, start writing quality code. -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Syntax help

2011-01-26 Thread Tim Chase
On 01/26/2011 04:05 AM, Jean-Michel Pichavant wrote: How to read syntax like this given in the documentation of python? (Newbie) defparameter ::= parameter ["=" expression] Just in case you're about to learn python using these defintions: Nobody's learning a syntax that way. They are not m

Re: how to read the last line of a huge file???

2011-01-29 Thread Tim Chase
On 01/26/2011 04:59 AM, Xavier Heruacles wrote: I have do some log processing which is usually huge. The length of each line is variable. How can I get the last line?? Don't tell me to use readlines or something like linecache... I wrote a modestly tested version (including missing terminal-EO

Re: Use the Source Luke

2011-01-30 Thread Tim Wintle
ly worked with would feel comfortable reading C - so for the other half reading C source code probably isn't going to help them understand exactly what's going on (although in the long run it might help them a lot) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: files,folders,paths

2011-02-13 Thread Tim Roberts
#$%, then don't use them. You can use forward slashes everywhere in Windows, except when typing commands at the command prompt. ALL of the Windows file system APIs accept forward slashes. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: files,folders,paths

2011-02-13 Thread Tim Roberts
xtra step of separating the directories and the files automatically. Why can't you just iterate through "dirs" creating your subdirectories, and then iterate through "files" doing the copies? Then, when os.walk calls you with the files in the subdirectories, you'll kno

newbie question about PYTHONPATH

2011-02-15 Thread Tim Hanson
I am to the point in _Learning_Python_ where functions are introduced. I decided to experiment by putting a function into a file and importing it into Idle. Of course, Idle couldn't find it, so I executed the following command in Bash: PYTHONPATH=/home/foo/prog/learning_python export PYTHONP

Re: file find skips first letter

2011-02-15 Thread Tim Chase
On 02/15/2011 12:32 PM, Wanderer wrote: if f.find(fileBase)> 0: .find() returns "-1" on failure, not 0. You want ">=" instead of just ">", or even more readably if fileBase in f: -tkc -- http://mail.python.org/mailman/listinfo/python-list

another problem with modules

2011-02-17 Thread Tim Hanson
Okay, I solved my problem with Python finding modules: I put the following into a file in my home directory, on the good advice of Andrea Crotti: import sys sys.path.append('/home/foo/mypath' I named the file "~/pypath.py", so now, in idle: import pypath No errors. I'm still getting a little

Re: Problems of Symbol Congestion in Computer Languages

2011-02-21 Thread Tim Wintle
us improvement taking in everybody's opinions etc - although I suppose that if production never starts because the improvements are done to a spec, rather than the product, it would be a massive hindrance. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2 and html.escape function

2011-02-21 Thread Tim Delaney
version change; any other changes should result in another release candidate. IIRC there have been one or two cases in the not-recent past where a release has been made which includes a bugfix not included in any RC (and I distinctly remember at least one brown paper bag release following just suc

Re: Python fails on math

2011-02-22 Thread Tim Wintle
ra software to attempt). (from the rest of your email I'm assuming you know what's actually happening) Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating Long Lists

2011-02-23 Thread Tim Wintle
with the different flags to sort (compression of intermediate results, intermediate batch size, etc) Tim -- http://mail.python.org/mailman/listinfo/python-list

PIL question

2010-04-05 Thread Tim Eichholz
I'm trying to cut a BMP with 80 adjacent frames down to 40 using the Image.copy and .paste functions but I'm getting error "ValueError: images do not match" on the paste line. Here is the source --- import sys from PIL import Image if len(sys.argv) == 2: file = sys.argv[1] else: p

Re: PIL question

2010-04-06 Thread Tim Eichholz
On Apr 6, 3:05 am, Peter Otten <[email protected]> wrote: > Tim Eichholz wrote: > > I'm trying to cut a BMP with 80 adjacent frames down to 40 using the > > Image.copy and .paste functions but I'm getting error "ValueError: > > images do not match" on

pass object or use self.object?

2010-04-06 Thread Tim Arnold
been told that the first case is easier to understand. I never thought of it before, so I'd appreciate any comments. thanks, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Impersonating a Different Logon

2010-04-06 Thread Tim Golden
On 06/04/2010 20:26, Kevin Holleran wrote: Hello, I am sweeping some of our networks to find devices. When I find a device I try to connect to the registry using _winreg and then query a specific key that I am interested in. This works great for machines that are on our domain, but there are l

Re: Impersonating a Different Logon

2010-04-07 Thread Tim Golden
On 07/04/2010 14:57, Kevin Holleran wrote: Thanks, I was able to connect to the remote machine. However, how do I query for a very specific key value? I have to scan hundreds of machines and need want to reduce what I am querying. I would like to be able to scan a very specific key and report

Re: pass object or use self.object?

2010-04-07 Thread Tim Arnold
On Apr 6, 11:19 am, Jean-Michel Pichavant wrote: > Tim Arnold wrote: > > Hi, > > I have a few classes that manipulate documents. One is really a > > process that I use a class for just to bundle a bunch of functions > > together (and to keep my call signatu

Re: ftp and python

2010-04-07 Thread Tim Chase
Matjaz Pfefferer wrote: What would be the easiest way to copy files from one ftp folder to another without downloading them to local system? As best I can tell, this isn't well-supported by FTP[1] which doesn't seem to have a native "copy this file from server-location to server-location bypa

Re: ftp and python

2010-04-08 Thread Tim Chase
Simon wrote: You could user FTP.voidcmd() E.G. ftp.voidcmd('RNFT filename.txt')ftp.voidcmd('RNTO newdir/filename.txt') From the rfc: RENAME FROM (RNFR) This command specifies the old pathname of the file which is to be renamed. This command must be immediately followed by a "rename

Re: The Regex Story

2010-04-08 Thread Tim Chase
Lie Ryan wrote: Why am I seeing a lot of this pattern lately: OP: Got problem with string +- A: Suggested a regex-based solution +- B: Quoted "Some people ... regex ... two problems." or OP: Writes some regex, found problem +- A: Quoted "Some people ... regex ... two problems." +- B: Sup

Re: pass object or use self.object?

2010-04-08 Thread Tim Arnold
e outside an object's method working on the object. > > wrt/ these two points, your "document should encapsulate its own logic" > note seems a bit dogmatic (and not necessarily right) to me - hence my > answer. The 'document' in this case is an lxml Elementtree, so I think it makes sense to have code outside the object (e.g. static methods) working on the object. thanks, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: regex help: splitting string gets weird groups

2010-04-08 Thread Tim Chase
gry wrote: [ python3.1.1, re.__version__='2.2.1' ] I'm trying to use re to split a string into (any number of) pieces of these kinds: 1) contiguous runs of letters 2) contiguous runs of digits 3) single other characters e.g. 555tHe-rain.in#=1234 should give: [555, 'tHe', '-', 'rain', '.',

Re: How to open and read an unknown extension file

2010-04-08 Thread Tim Chase
On 04/08/2010 12:22 PM, varnikat t wrote: it gives me this error TypeError: coercing to Unicode: need string or buffer, list found Thanks for the help.it detects now using glob.glob("*.*.txt") Can u suggest how to open and read file this way? *if glob.glob("*.*.txt"): file=open(gl

Re: Imports again...

2010-04-09 Thread Tim Golden
On 08/04/2010 14:16, Alex Hall wrote: The above link is to a project. I am new to using multiple files in Python, and I have a lot of tangled imports where many files in the same folder are importing each other. When I tried to follow the manual to make some files into packages, it did not work.

Re: Imports again...

2010-04-09 Thread Tim Golden
On 09/04/2010 15:19, Gabriel Genellina wrote: In addition to what Tim Golden has said (which appears to be based on another version of this project Just downloaded again, and there's definitely an empty package structure of the kind I described. (Altho' I certainly did have a

Re: The Regex Story

2010-04-09 Thread Tim Chase
On 04/09/2010 06:18 AM, Stefan Behnel wrote: Tim Chase, 08.04.2010 16:23: Lie Ryan wrote: OP: Got problem with string +- A: Suggested a regex-based solution +- B: Quoted "Some people ... regex ... two problems." or OP: Writes some regex, found problem +- A: Quoted "Some p

Re: urllib2: post request to textarea

2010-04-09 Thread Tim Roberts
, and my >real problem is something else? It's just a coincidence. The contents of a are transmitted exactly like the contents of an . My guess is that you did the encoding improperly. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tempering Client Expectations (OT)

2010-04-10 Thread Tim Chase
On 04/10/2010 11:10 AM, Victor Subervi wrote: Hi; I'm working with my first client where I've developed a custom script. I way underbid the project and I ate that as part of my learning experience. We outlined as precisely as I knew how what functionality was needed. Then he went to input data an

<    61   62   63   64   65   66   67   68   69   70   >