exclude binary files from os.walk

2005-01-26 Thread rbt
Is there an easy way to exclude binary files (I'm working on Windows XP) from the file list returned by os.walk()? Also, when reading files and you're unsure as to whether or not they are ascii or binary, I've always thought it safer to 'rb' on the read, is this correct... and if so, what's the

Re: urllib2 and proxy question

2005-01-24 Thread rbt
Fuzzyman wrote: urllib2 (under windows) will auto-detect your proxy settings and use those. Normally that's a good thing (I guess), except when it's not ! How do I switch off this behaviour ? I'm behind a censoring proxy and wanting to test things *locally*. IE is set to not use the proxy when fetc

Re: Memory Usage

2005-01-24 Thread rbt
Peter Hansen wrote: rbt wrote: Would a Python process consume more memory on a PC with lots of memory? For example, say I have the same Python script running on two WinXP computers that both have Python 2.4.0. One computer has 256 MB of Ram while the other has 2 GB of Ram. On the machine with

Memory Usage

2005-01-24 Thread rbt
about 1 MB of Ram. On the machine with more Ram, it uses 9 MB of Ram. Is this normal and expected behavior? Thanks, rbt -- http://mail.python.org/mailman/listinfo/python-list

Re: Install Python 2.4 on Fedora 3 Core

2005-01-17 Thread rbt
Bill wrote: I have less than a week experience on linux, so I am a new newbie. Python 2.3 came preinstalled. I installed version 2.4. All seemed to go well except it installed to usr/local? 1. Was it wrong to install when logged in as 'root'? Does it make a difference? 2. I looked in the package

Re: dynamic data types

2005-01-17 Thread rbt
Charlie wrote: Hi, The description of Python always mentions "very high level dynamic data types". Now, I can't seem to find any examples of these (nothing described with this term anyway). Is this simply refering to built-in dynamic data structures such as lists and dictionaries, with a great deal

Re: Debian says "Warning! you are running an untested version of Python." on 2.3

2005-01-13 Thread rbt
Nick Craig-Wood wrote: > Alex Stapleton <[EMAIL PROTECTED]> wrote: >> Whenever I run python I get >> >> "Warning! you are running an untested version of Python." >> >> prepended to the start of any output on stdout. >> >> This is with Debian and python 2.3 (running the debian 2.1 and 2.2 >>

Re: exceptions and items in a list

2005-01-10 Thread rbt
Andrey Tatarinov wrote: rbt wrote: If I have a Python list that I'm iterating over and one of the objects in the list raises an exception and I have code like this: try: do something to object in list except Exception: pass Does the code just skip the bad object and continue wit

exceptions and items in a list

2005-01-10 Thread rbt
If I have a Python list that I'm iterating over and one of the objects in the list raises an exception and I have code like this: try: do something to object in list except Exception: pass Does the code just skip the bad object and continue with the other objects in the list, or does it

Re: ftplib with unknown file names

2005-01-10 Thread rbt
Jeremy Jones wrote: rbt wrote: How can I use ftplib to retrieve files when I do not know their names? I can do this to get a listing of the directory's contents: ftp_server.retrlines('LIST') The output from this goes to the console and I can't figure out how to turn that

ftplib with unknown file names

2005-01-10 Thread rbt
How can I use ftplib to retrieve files when I do not know their names? I can do this to get a listing of the directory's contents: ftp_server.retrlines('LIST') The output from this goes to the console and I can't figure out how to turn that into something I can use to actually get the files (lik

Re: arbitrary number of arguments in a function declaration

2005-01-02 Thread rbt
Nick Coghlan wrote: rbt wrote: How do I set up a function so that it can take an arbitrary number of arguments? For example, I have a bunch of expenses which may grow or shrink depending on the client's circumstance and a function that sums them up... hard coding them is tedious. How mi

arbitrary number of arguments in a function declaration

2005-01-02 Thread rbt
How do I set up a function so that it can take an arbitrary number of arguments? For example, I have a bunch of expenses which may grow or shrink depending on the client's circumstance and a function that sums them up... hard coding them is tedious. How might I make this dynamic so that it can

Reading a HP Printer Web Interface

2004-12-27 Thread rbt
Hello there, Depending on the firmware version of the HP printer and the model type, one will encounter a myriad of combinations of the following strings while reading the index page: hp HP color Color Printer Printer Status Status: Device: Device Status laserjet LaserJet How can I go about dete

<    1   2   3