Re: Is c.l.py becoming less friendly?

2009-02-05 Thread Tim Rowe
2009/2/5 Tim Chase : > Is this where we tell you to shut up? ;-) [snip] > It would also be interesting to see how many of those posts are concentrated > in certain threads And, as you have clearly demonstrated, how many of those posts also contain a smiley or some other form of hed

Re: Couple of noobish question

2009-02-05 Thread Tim Rowe
stay clear of the os module :-) -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: "Weird" Indentation? (Or: is there a for...else construct?)

2009-02-08 Thread Tim Rowe
backwards. What's awful about it? Except in the sense of inspiring awe, of course. No, Steven's example isn't broken, it works as the epydoc authors intended. > (it's still in 3). Good. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

thread. question

2009-02-09 Thread Tim Wintle
(assuming they very infrequently block)? Since if you use the thread module direct the code doesn't seem to escape from C during the acquire() etc. or am I missing something important? Thanks, Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: thread. question

2009-02-09 Thread Tim Wintle
already using a multiple-process architecture overall, but using threads to avoid waiting when handling SQL and TCP. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Putting asterisks around text

2009-02-09 Thread Tim Rowe
w how to do it without using a while loop, but to help you we need to know what *you* know). Like: do you understand what a while loop does? And so on. We're a pretty friendly bunch in here, but most of us believe in "tough love" (http://en.wikipedia.org/wiki/Tough_love). --

Re: Putting asterisks around text

2009-02-09 Thread Tim Chase
D'Arcy J.M. Cain wrote: On Mon, 9 Feb 2009 10:09:26 -0800 "[email protected]" wrote: I'm trying to write a program that puts asterisks around the input text using while loop. I can do this without using while loop, but how can you do that using while loop? Example:Enter a string: Hello world*

Re: Python binaries with VC++ 8.0?

2009-02-09 Thread Tim Roberts
udes Visual C++ 9.0, and hence msvcrt90.dll. People say "VC8" when they really mean Visual Studio 2008. Visual Studio 98- VC++ 6.0 Visual Studio 2002 - VC++ 7.0 Visual Studio 2003 - VC++ 7.1 Visual Studio 2005 - VC++ 8.0 Visual Studio 2008 - VC++ 9.0 -- Tim

Re: AJAX Post requests

2009-02-09 Thread Tim Roberts
(query.get('data'))", and your blanket "except" would hide the error. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: import wx works interactive but not from script

2009-02-10 Thread Tim Golden
jefm wrote: when I call "import wx" from the interactive console, it works (i.e. it doesn't complain). But when I call the same from a script, it complains that it can not find the wx module. works for interactive Python 2.6.1 (r261:67517, Dec 4 2008, 16:

Re: COM and threading, "CoInitialize"?

2009-02-10 Thread Tim Golden
Ferdinand Sousa wrote: Greetings to list members, I am trying to use an Acrobat COM object in a class that is subclassed from threading.Thread. Since threading.Thread is subclassed, the __init__ method of the inheriting class must explicitly call the threading.Thread.__init__ method of the paren

Re: import wx works interactive but not from script

2009-02-10 Thread Tim Golden
jefm wrote: I ran the script from a command line, so it is not a file association thing. Ummm... if you ran it by just typing the script name -- c:\test\whatever.py rather than c:\pythonxx\python c:\test\whatever.py -- then it certainly could be a file association issue. I do have multiple ve

Re: optparse versus getopt

2009-02-10 Thread Tim Chase
Matthew Sacks wrote: does anyone have any arguments against optparse vs getopt I've found that the optparse module beats getopt on *every* aspect except in the event that you have experience with the C getopt libraries *and* just want something that behaves like those libraries. Optparse is

Re: Scanning a file character by character

2009-02-10 Thread Tim Chase
Or for a slightly less simple minded splitting you could try re.split: re.split("(\w+)", "The quick brown fox jumps, and falls over.")[1::2] ['The', 'quick', 'brown', 'fox', 'jumps', 'and', 'falls', 'over'] Perhaps I'm missing something, but the above regex does the exact same thing as line

Re: access to MS Access password-protected database?

2009-02-11 Thread Tim Golden
Ken McDonald wrote: Can anyone direct me towards a code snippet showing how to use Python to insert data into a password-protected MS Access database? My google searches have been uninformative for dbs that are password-protected. Caveat: I've never done it and I have no Access db to hand, but

Re: Python binaries with VC++ 8.0?

2009-02-11 Thread Tim Roberts
would have said either "Executable operational semantics for Python," or "An executable operational semantic for Python." "A semantics" just doesn't flow. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Embarrasing questio

2009-02-12 Thread Tim Rowe
2009/2/12 km : > Hi, > > you could do it this way also : > > if i in [3,5]: > do something... True, you could do it, but it would be wrong. The original is true for i = 6, 9, 10, 12 and so on, but yours doesn't seem to be... -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Spam

2009-02-12 Thread Tim Chase
If you subscribe to C.P.L as a mailing list instead of a newsgroup, I believe most of the spam gets filtered out at the mailing list<->news group gateway by the Python.org spam filters... At least no spam in my Gmail spam folder appears to be flagged from this group(at a very brief glance) so they

Re: A little bit else I would like to discuss

2009-02-12 Thread Tim Golden
Philip Semanchuk wrote: On Feb 12, 2009, at 3:04 PM, azrael wrote: Why will Microsoft's products kick the ass of open source. Because anyone does what he wants. Let's say There are 5 GUI libraries competing against each other. Think about it what could these 5 teams acomplish if they would wor

Re: thread. question

2009-02-13 Thread Tim Wintle
econdary process (already passed most of it) and dealing with requests in a completely synchronous process. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Invoking CutePDF from within Python

2009-02-13 Thread Tim Golden
John Henry wrote: I have a need to invoke CutePDF from within a Python program. All I need is to say "Print this to CUTEPDF and store as xyz.pdf". Private Sub Print_PDF() lRetVal = RegCreateKeyEx(HKEY_CURRENT_USER, "Software\Custom PDF Printer", _ 0&, vbNullString

Re: Break large file down into multiple files

2009-02-13 Thread Tim Chase
New to python I have a large file that I need to break up into multiple smaller files. I need to break the large file into sections where there are 65535 lines and then write those sections to seperate files. I am familiar with opening and writing files, however, I am struggling with creating

Re: Invoking CutePDF from within Python

2009-02-13 Thread Tim Golden
[email protected] wrote: Tim, FWIW, I usually generate PDFs by printing to a Postscript printer (some random Apple Laserthingy) and then using Ghostscript to do the conversion. I'm happy to post if you're interested. If its not too much bother, I would be interested in learning

Re: GetKeyboardLayoutName Win32API

2009-02-15 Thread Tim Golden
Tsolakos Stavros wrote: Hi all. I was trying to find a way to read the currently selected input layout from an app written in python. I am aware that if the app were written in C, I would have to call the GetKeyboardLayoutName() function. How can this be done in Python? I want to avoid writing a

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Tim Golden
[email protected] wrote: # str_to_num.py def isnumber( input ): try: num = float( input ) return True except ValueError: return False Just for the info, Malcolm, you don't actually need to assign the result of float (input) to anything if you don't need to u

Re: illegal list name

2009-02-15 Thread Tim Roberts
the habit of purchasing software when you have no clue what to do with it, my best advice is that you should stop purchasing software. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to enum all the users from a windows domain via python win32net module?

2009-02-16 Thread Tim Golden
vimuser wrote: I tried the command "net user /DOMAIN" in windows console(cmd.exe), and it showed me all the usernames in my domain without any problems. But when I tried it in python with these commands : info=win32net.NetUserEnum("DOMAIN_NAME",1), info=win32net.NetUserEnum(r"\\DOMAIN_NAME",1),an

[Fwd: Re: Pythonic way to determine if a string is a number]

2009-02-16 Thread Tim Golden
[Resending after a bounce from mailing list] [email protected] wrote: try: float (input) except ValueError: return False else: return True I follow the semantics, but I don't know why I would prefer the try/else technique over the simpler: try: float( input ) return True exc

Re: Will multithreading make python less popular?

2009-02-16 Thread Tim Rowe
ded. For those few cases where threading is a genuine advantage, Python is not ideal. But in the real world I doubt they're enough to make a significant dent in Python's popularity. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Will multithreading make python less popular?

2009-02-16 Thread Tim Rowe
es, defined in an XML script, was a dream in Python when I'd probably still be coding it today in C++. Horses for courses. It's almost always wrong to say that language A is better than language B; the most you can say is that language A is better than language B for some specific task. -

Re: Module to read/write MIDI ?

2009-02-16 Thread Tim Wintle
> I had my first look around pypi.python.org/pypi yesterday and didn't > see anything. Is there a MIDI-module for Python ? If not, I'll > email Sean to ask if he'd mind me translating his module into Python3... This is the only project I have seen

Re: flexible find and replace ?

2009-02-16 Thread Tim Chase
how would you do a clever find and replace, where the value replacing the tag is changing on each occurence ? "...TAGTAGTAG..TAG." is replaced by this : "...REPL01REPL02REPL03..REPL04..." This is a variant o

Re: Speedup Bitmap Parser

2009-02-17 Thread Tim Wintle
on is often better left to C (or compiled extensions to python in Cython etc.) than done in Python - it's just too tough to do pointer-magic in Python. You may find that so much time is being spent by your application in the ".create_line" method that there's no other opti

Re: memory recycling/garbage collecting problem

2009-02-17 Thread Tim Wintle
w large again and keeps hold of a percentage of the memory. The outcome is that trying to reduce memory usage can change what data structures you should use - tupples use less space than lists, etc. Tim W -- http://mail.python.org/mailman/listinfo/python-list

Re: Python change a value of a variable by itself.

2009-02-17 Thread Tim Chase
I have the following simple code: r = {} r[1] = [0.00] r_new = {} print r[1][0] r_new[1] = r[1] r_new[1][0] = r[1][0] + 0.02 print r[1][0] It outputs: 0.0 0.02 it is something strange to me since in the first and second case I output the same variable (r[1][0]) and it the two cases it has

Re: Is there something easier than ORM?

2009-02-17 Thread Tim Golden
Philip Semanchuk wrote: [... snip comments on SqlAlchemy which could likewise apply to other similar offerings ...] I don't intend this as a criticism of SqlAlchemy. On the contrary I am impressed by what it does. But I often see people promoting ORM as the solution to all database access prob

Re: Reading from text

2009-02-17 Thread Tim Chase
Assuming this is a real task and not a homework problem, then I'd do it this way: $ cd [directory containing 50 test files] $ (for file in *; do head -n11 $file | tail -n5; done) >/path/to/results-file.txt I'd use sed: sed -ns 7,11p /source/path/*.txt >/path/to/results.txt hard to get

Re: Scanning a file character by character

2009-02-17 Thread Tim Chase
Josh Dukes wrote: In [401]: import shlex In [402]: shlex.split("""Joe went to 'the store' where he bought a "box of chocolates" and stuff.""") how's that work for ya? It works great if that's the desired behavior. However, the OP wrote about splitting the lines into separate words, not "

Re: Found a very nice, small, cross-platform GUI toolkit for Python.

2009-02-18 Thread Tim Roberts
if you are already using SDL and PyGame, this sounds like a great solution. But for someone starting from scratch, it's not yet clear to me that OcempGUI substantially better than wx. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

urllib confusion

2009-02-18 Thread Tim H
print "Actual url:", f.geturl() print f.read() f.close() results in: url: http://site.org/foo/1/bar Actual url: http://site.org/foo/1/bar page 1 contents url: http://site.org/foo/2/bar Actual url: http://site.org/foo/1/bar page 1 contents f.getinfo() shows two different

Re: memory recycling/garbage collecting problem

2009-02-18 Thread Tim Wintle
On Tue, 2009-02-17 at 17:04 +0100, Christian Heimes wrote: > Tim Wintle wrote: > > Basically malloc() and free() are computationally expensive, so Python > > tries to call them as little as possible - but it's quite clever at > > knowing what to do - e.g. if a list ha

Re: Revision Control

2009-02-18 Thread Tim Chase
-CVS (One of the first RCS, I think most projects are moving away from this one.) I wouldn't suggest starting a new project with CVS. Subversion (svn) resolves several of the main issues with it, so using SVN instead wins over CVS in just about every possible way. - Subversion-(pretty popu

Re: Searching Google?

2009-02-18 Thread Tim Wintle
On Wed, 2009-02-18 at 13:36 +0100, Johannes Bauer wrote: > Curt Hash schrieb: > > > You just need to change your User-Agent so that Google doesn't know a > > Python script is making the request: > > Why would Google not send a response if the User-Agent header field is > not a recognized browser?

Re: Revision Control

2009-02-18 Thread Tim Wintle
up-stream etc. bazaar is really great in my experience, although relatively new so you might prefer to stick to svn. I haven't tried using bazaar on windows. If you do go with svn, try the latest version, since merging support is much better in this. Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Revision Control

2009-02-19 Thread Tim Chase
FWIW, Bazaar and Mercurial both have about half a dozen C modules. (Most of Bazaar's are Pyrex, though, not straight C.) Thanks for the update -- it's been about 6 months since I played much with Bazaar. Hopefully these C module help with some of the speed issues that plagued bzr in my past e

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Rowe
language. I think it will be a long search. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

os.fdopen giving "Invalid Argument" from pipes

2009-02-19 Thread Tim Wintle
File "test.py", line 20, in run_multi_proc() File "test.py", line 15, in run_multi_proc server_send = os.fdopen(server_send,"w") OSError: [Errno 22] Invalid argument really confused about why this isn't working - running on Linux with python 2.5.2 Tim W -- http://mail.python.org/mailman/listinfo/python-list

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Rowe
2009/2/19 : > Thank you Tim... > > It is not a search for perfect language. It is a search for a capable > language to modern worlds' needs. That would be just about any of the ones you mentioned, then. Unless you mean the needs of a specific project, in which case the suitabili

Re: os.fdopen giving "Invalid Argument" from pipes

2009-02-19 Thread Tim Wintle
On Thu, 2009-02-19 at 11:50 -0500, Jean-Paul Calderone wrote: > You got server_send and logger_receive backwards Doh! > (also, i before e *except* after c et cetera). Flip 'em around and > all is well. Thanks - never was great at speling :-) Tim -- http://mail.python.org/ma

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Wintle
e in Python. Yes, we're coming to a point where we're going to have tens of cores in a chip, but by that time someone far cleverer than me (possibly someone who's on this list) will have solved that problem. The top experts in many fields use Python, and if they weren'

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Rowe
on. Not speed of /execution/ that is. Different languages have different trade-offs. Python's trade-offs suit us. If they don't suit you, use a language with trade-offs that do. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Rowe
rovide threads and processes and > programmer choose the way. I really believe that GIL is a design > error. It's only an error if it gets in the way. It's the experience of a lot of programmers that it doesn't, so it's not an error. -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Wintle
mounts of code into my 4mb level-2 cache *on my laptop*! That's a huge impact for numerical work. (3) Multiple cores scale processing power linearly at best with the number of cores (since you're normally going to be IO based at some point). Perhaps the GIL will be relaxed a bit, but it&#x

Re: Will multithreading make python less popular?

2009-02-19 Thread Tim Roberts
Paul Rubin <http://[email protected]> wrote: > >C is basically never appropriate. C should be outlawed by Congress >with the ban enforced by roving pie-throwing squads . One of my favorite quotes: The last good thing written in C was Schubert's Ninth Symphony

Re: Which Version of wxPython for Win XP

2009-02-19 Thread Tim Roberts
all) performance advantage in using the Unicode APIs instead of the ANSI APIs. Unless you need your wx programs to run on Windows 98, I recommend you use the Unicode version of wxPython. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: get most common number in a list with tolerance

2009-02-20 Thread Tim Rowe
lar kernel. What would you expect the output to be if the data set were [10,30,20,20,11,12,13] and the tolerance were 2? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Tim Wintle
On Fri, 2009-02-20 at 16:38 +, Nigel Rantor wrote: > Luke Dunn wrote: That was my initial thought when I read this too - but I'm not certain that is guaranteed to find a solution (i.e. a solution that's optimal). I'd welcome a proof that it will though, a few minutes thought hasn't found a

Re: datetime.time and midnight

2009-02-22 Thread Tim Rowe
't have an expectation, why are you interpreting it as a Boolean? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Forwarding keyword arguments from one function to another

2009-02-22 Thread Tim Wintle
g the parameter "string" as the first parameter, and then a sequence of keyword arguments taken from kwds, which will be passed separately. This is what the second form expects, but not what the first one expects. Tim Wintle -- http://mail.python.org/mailman/listinfo/python-list

Re: Metaclass conflict TypeError exception: problem demonstration script

2009-02-23 Thread Tim Golden
$ cat -n metaclass_test01.py | head 1 #!/usr/bin/env python 2 3 import sys 4 import wx 5 import CopyAndPaste 6 7 class ListControl(wx.Frame, CopyAndPaste): 8 #class ListControl(wx.Frame): 9 def __init__(self, parent, id, title, list, max_list

Re: Quick nested loop syntax?

2008-11-23 Thread Tim Chase
if I remember correctly, wasn't there a way to quickly iterate through nested loops? Something like a = { "a", "b", "c" } b = { 4, 9, 13} for (x, y) in someoperator(a, b): print(x, y) You may be reaching for this thread: http://mail.python.org/pipermail/python-list/2008-January/473650.

Re: Python 3.0 - is this true?

2008-11-24 Thread Tim Rowe
l Python be introducing strong type checking and early binding, so we can catch more bius earlier (compile rather than run time?) ;-) -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: for loop specifying the amount of vars

2008-11-24 Thread Tim Chase
I have a list which contains a folder structure, for instance: dirs=['c:\', 'temp', 'foo', 'bar'] The length of the list can vary. I'd like to be able to construct a os.path.join on the list, but as the list can vary in length I'm unsure how to do this neatly. Sounds like you want argument un

Re: Printing digits in one place

2008-11-24 Thread Tim Chase
Try repeatedly writing something like "\r \rBytes Transferred So Far %d" \ % count Rather than backing up twice with \r, I'd just suggest "\rBytes Transferred So Far %d " % count or even "\rBytes Transferred So Far %d%s" % (count, ' '*20)

Re: end of print = lower productivity ?

2008-11-25 Thread Tim Chase
p = print p("f") Voila, 4 keystrokes saved :-) When I write "print", it is both effortless and instantaneous : my hands do not move, a wave goes through my fingers, it all happens in a tenth of a second. Contrast this with what one has to go through to catch the SHIFT key, and then the "(" : m

Re: hello from colombia

2008-11-26 Thread Tim Rowe
choice and work out whether Python actually /would/ be better. If you can do that, in the process you will have gathered the evidence you need. If you can't do that, why are you assuming that Python will be better? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: end of print = lower productivity ?

2008-11-26 Thread Tim Roberts
this day, 6 years after XP, I still find myself looking at "driverquery.exe" instead of the "drivers" directory. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: asp versus cgi

2008-11-26 Thread Tim Roberts
eb site, it's sent through a POST request. However, keeping data out of the URL is a big factor. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Confused about class relationships

2008-11-28 Thread Tim Roberts
essed that relationship properly. When I have these kinds of philosophical debates over my own code, I always try to summarize them in the comments inside the module, just so others can get "inside my head" to understand the thinking that led to my design. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

python.org coming back as unreachable in Dillo (IPv6 routing error?)

2008-11-28 Thread Tim Chase
Though only semi-Python related, it impacts me because I (until recently) use Dillo at home for browsing docs.python.org. I'm trying to figure out if something network-related changed. Within the last week or two (time-frame is fuzzy), it seems that something changed and I now get "Network unr

Re: python.org coming back as unreachable in Dillo (IPv6 routing error?)

2008-11-29 Thread Tim Chase
You shouldn't need to do anything. It should be no problem that you can't reach www.python.org through IPv6, since all your applications will immediately fall back to using IPv4 on their own. It may be that some application misbehaves, i.e. it tries to get an IPv6 connection, which it can't, and

Re: end of print = lower productivity ?

2008-11-29 Thread Tim Chase
It's not so much "ridiculous" as a failure of your editor to assist you. In Vim (my editor-of-choice), I'd do something like seriously, I don't think anyone in Windows uses vim Are you just guessing, or do you have any sort of facts to back this up? It's my editor of choice when I'm stuck in

Re: hello from colombia

2008-11-30 Thread Tim Rowe
2008/11/27 fel <[EMAIL PROTECTED]>: > that's a lot of bytes for "do your own homework" > but thanks, I'll do it. It also included "You haven't defined the issue precisely enough" :-) -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: end of print = lower productivity ?

2008-11-30 Thread Tim Roberts
Lie Ryan <[EMAIL PROTECTED]> wrote: >On Sat, 2008-11-29 at 17:51 -0600, Tim Chase wrote: >> >> It's not so much "ridiculous" as a failure of your editor to >> >> assist you. In Vim (my editor-of-choice), I'd do something >> >> li

Re: 11001, 'getaddrinfo failed' : Error in httplib but not in urllib2

2008-12-01 Thread Tim Golden
RajNewbie wrote: Hi all, I am trying to connect to localhost via httplib, but it fails. To check whether it is a firewall problem etc, I tried to connect via urllib2, but it went through fine. Could some one help me out on this? I cannot use urllib2 in the program because I have to

Re: end of print = lower productivity ?

2008-12-01 Thread Tim Chase
For a proof, let's see what Google has to say about this: "Windows text editor". Vim is on page 3, near the turning point where nobody is talking about text-editor anymore and more about text-editor reviews. Even worse is Emacs, on page 6, after many other popular text-editors have been mentioned

Re: Simple ini Config parser examples needed

2008-12-02 Thread Tim Chase
I have a very simple ini file that I needs parsed. What is the best way I can parse an ini file that doesn't include sections? As in: person=tall height=small shoes=big Thats it. Can anyone help me? The built-in ConfigParser module assumes at least one INI-style section, which if it

Re: Simple ini Config parser examples needed

2008-12-03 Thread Tim Chase
Tim provided a correct-looking answer, albeit somewhat complex, as it doesn't reuse the logic in the ConfigParser. It didn't start out very complex, but it was so easy to make it a bit more robust with such a scant few lines of code that I went ahead. The original just l

Re: Python advocacy ... HELP!

2008-12-04 Thread Tim Rowe
hing computer science, so that the students will be able to cope with whatever they meet once they graduate, or are we teaching computer programming, in a couple of specific languages, so that the students will be completely unprepared if they meet anything else?" -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeDecodeError quick question

2008-12-04 Thread Tim Golden
[EMAIL PROTECTED] wrote: Hi Everyone, I am using Python 2.4 and I am converting an excel spreadsheet to a pipe delimited text file and some of the cells contain utf-8 characters. I solved this problem in a very unintuitive way and I wanted to ask why. If I do, csvfile.write(cell.encode("utf-8

Re: Please fix your clock [was Re: Multiple equates]

2008-12-04 Thread Tim Chase
Steven D'Aprano wrote: Hendrik, I think your PC's clock is wrong. You seem to be posting from the future. further evidence of the Guido's time-machine[1]. For the secret cabal of core developers who borrow the time-machine, I recommend not sending email from within it. :) -tkc [1] http:

Re: Find Files in a Folder Between 2 Dates

2008-12-04 Thread Tim Chase
Is there a way to find all the files in a folder, between 2 dates? For example: Firstdate = 20080101 Seconddate = 20080102 Find all the files in C:\Folder that are between Firstdate and SecondDate. This should do it: import time import os firstdate = "20080101" seconddate

Re: Can I load a python program at the interactive >>> prompt?

2008-12-05 Thread Tim Golden
walterbyrd wrote: I am running cygwin on xp. Much to my annoyance, I can not cut-and-paste from a windows app to the python prompt. I think I could do this with putty, but I do not have the permissions to install putty on my xp box. I do this all the time. The key (altho' not strictly essentia

Re: Can I load a python program at the interactive >>> prompt?

2008-12-05 Thread Tim Golden
walterbyrd wrote: I am running cygwin on xp. and I just noticed this vital bit. So not sure how much of my other post applies. Sorry. Maybe it'll help anyway. :) TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread Tim Rowe
n adopt the new language. That way you won't have to think of it in terms of breaking any sort of backwards compatibility because there is no backwards ;-) -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining whether a variable is less/greater than a range.

2008-12-08 Thread Tim Chase
a = list(range(10, 21)) b = 9 c = 21 How can I find out if b and c have values less or more than the values in list a? Sounds like a good use for 2.5's addition of the any() and all() functions -- you don't mention whether you want your variable compared against *any* of the list items or *

Re: pretty strange behavior of "strip"

2008-12-08 Thread Tim Roberts
4.html', >'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html'] > >>> test[4] >'toc.html' > >>> test[4].strip('.html') >'oc' > >>> test[2].strip(&

Python 3 For Python 2 Users

2008-12-09 Thread Tim Daneliuk
s all the major changes to give me a better sense of the Gestalt of the new language. TIA, -- -------- Tim Daneliuk [EMAIL PROTECTED] PGP Key: http://www.tundraware.com/PGP/ -- http://mail.python.org/mailman/listinfo/python-list

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

2008-12-10 Thread Tim Rowe
had no chance, but I was impressed with how close-run I could make it with Python. Fun, yes, but no way anything I would consider for code that is actually going to be /used/ in any way whatsoever! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: get todays files

2008-12-10 Thread Tim Chase
I have a script that will login to my ftp server and download all the backup files, but I want it to only download the files that were created today, e.g. if I ran the script today I want it to only fetch files created today. Use Python's ftp module and send the MDTM command to get back the tim

Re: get todays files

2008-12-10 Thread Tim Chase
This looks very good and I have tested successfully, but is there a way I can set the today to automatically become todays date in that format? Yes...see the python datetime module[1]...particularly the strftime() call on date/datetime objects. -tkc [1] http://docs.python.org/library/datetim

Re: Python is slow

2008-12-10 Thread Tim Chase
[nibbling a little flame-bait] Python is even slower than PHP! Just go to any Python website and you will know. An example is: http://www2.ljworld.com/ I'm not sure I'm seeing what you're seeing -- the dynamic page loaded in under 2 seconds -- about on par with sun.com, python.org, php.net

Re: SequenceMatcher bug ?

2008-12-11 Thread Tim Roberts
nceMatcher(None, [4], [5] * 200).ratio() If you print get_matching_blocks(), you'll see that there are none, because the "b" sequence is optimized completely away. The #1528074 calls it "working by designed" and suggests updating the doc. However, I would argue that it's worth checking for this. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: get todays files

2008-12-11 Thread Tim Chase
I know this will sound like I am being very cheeky, but is there a way you can make this for where the ftp server is actually windows server? For Windows Server, I don't have a Windows FTP server to test with -- I've got the company Linux server, and the previous testing site I used (I think I

Re: Removing None objects from a sequence

2008-12-12 Thread Tim Rowe
2008/12/12 Filip GruszczyƄski : > I don't mean memory, but space in code ;-) Trying to save printer paper for your listings, then? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question...

2008-12-12 Thread Tim Chase
Im new at python and I just want to know if (and how) it is possible to send parameters to a program. what I mean is that when we start python I can call a file that should be run like this: python myfile.py can I send additional parameters along with it? like::: python myfile.py myVar1 myVar2

Re: (Very Newbie) Problems defining a variable

2008-12-12 Thread Tim Rowe
y!\n") else: interest = 0 year = 0 while interest < target: rate = get_rate(balance) interest = balance * rate balance += interest year += 1 print("Year %s, at %s rate: %s paid, %s in bank." % (year, rate, interest, balance)) -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: (Very Newbie) Problems defining a variable

2008-12-12 Thread Tim Rowe
gt;if balance > threshold: >return rate >return .0 Yes, once it's changed from a dictionary to tuples it becomes easier, doesn't it? D'oh! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: (Very Newbie) Problems defining a variable

2008-12-12 Thread Tim Rowe
ogram, there'd be no need for it to know about overdraft limits because it's not making actual transactions. Why would they increase coupling unneccesarily? -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question...

2008-12-12 Thread Tim Rowe
;s never too early to start thinking about what you would /want/ it to do. What do you think it will do for invalid or no command line arguments at the moment? Try it! -- Tim Rowe -- http://mail.python.org/mailman/listinfo/python-list

<    46   47   48   49   50   51   52   53   54   55   >