27;"
I don't have a freebsd system available to test this, but I think
this pattern should work:
re.compile(r'^(default|0\.0\.0\.0)\s+(\S+)')
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www2.celestial.com/ PO Box 820; 6641 E. M
ting that it thinks the 'From:' address,
is bogus.
There's no MX record for jss.hs.org, and no IP address for jss.hs.org
either.
The From: address should be legitimate and deliverable. It might
also accept a legitimate 'Reply-To:' address.
Bill
--
INTERNET: b...@cele
On Thu, Jan 30, 2014, Alan Gauld wrote:
> On 30/01/14 02:45, Bill Campbell wrote:
>> I'm writing a python script which uses imaplib
>
> We don't get many messages about imaplib so I'm
> not sure how many folks here know about it.
I've used it off and on for
7;N' which is uses for new messages.
I would like to have the script restore the 'N' status flag that
mutt uses instead of 'O'.
The mail server is using courier-imap with Maildir stores on
CentOS Linux. Mutt access is direct on the file system, not via
IMAP.
Bill
--
INTER
ses os.popen
import os
fh = os.popen('ifconfig')
for line in fh:
# scan line here
The more modern way to handle this is using the subprocess module
with something like:
from subprocess import PIPE, Popen
fh = Popen('ifconfig', stdout=PIPE).stdout
...
Bill
--
INTER
install-scripts=%(prefix)s/sbin
Better yet would be for the prefix to be available from the
command line or taken from sys.prefix if not specified.
Is there a way to do this other than fiddling the site.cfg file?
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Softwar
sions.
import re
_digits = re.compile(r'(\d+)')
def ver(s):
r = _digits.split(s)
r[1::2] = map(lambda x: int(x), r[1::2])
return(tuple(r))
class FileInfo(object):
def __init__(self, fname)
self.fname = fname
self.cmp = ver(fname)
def __cmp__(s
iable to these subprocesses? For example:
>
>mydir = "/usr/local/bin"
>subprocess.call("ls -l /usr/local/bin", shell=True)
>
>How do I replace /usr/local/bin in the subprocess call with the mydir variable?
subprocess.call("ls -l '%s'" % myd
llion samples.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island, WA 98040-0820
Fax:(206) 232-9186 Skype: jwccsllc (206) 855-5792
Independent self-rel
s here with vi (I've never been able to get my
fingers retrained for emacs after almost 30 years of vi :-).
Agreed on the quoting. Interspersing new information between
quoted sections is great, but quoting an entire message only to
add ``ditto'' at the end is idiotic.
Bill
--
I
me(f, fname)
Of course this works for http by simply changing the url.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island, WA 98040-0820
Fax:(20
link to the attachment in the body of the message. That's
a feature I would like to see an all webmail servers.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island
he imaplib documentation as lots
of ways to delete mailboxes (folders) and expunge messages from
folders, but I don't see anything about marking individual
messages as deleted.
What am I missing?
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.cel
clean key, but I think there ought
to be a neater way.
Thanks.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island, WA 98040-0820
Fax:(206) 232-9186
NTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island, WA 98040-0820
Fax:(206) 232-9186 Skype: jwccsllc (206) 855-5792
Intaxication: Euphoria at getting a refund fr
5-1995.
And should be more desirable today for applications that require
efficient, heads-down data entry where one does not want to take
fingers off of home keys or numeric keypads.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO B
edy, you can make it non-greedy with a
>question mark
As a general rule, it's a Good Idea(tm) to write regular
expressions using the raw quote syntax. Instead of:
re.compile('UserID: \{(.+)\}',...)
Use:
re.compile(r'UserID: \{(.+)\}',...)
The alternative is to backw
dex into the string matching
the argument to find. The test above will return -1 if ``Source
Heigtht'' is not in line, and one generally wants to have the
test return True if there is something to do. The alternative
would be to say ``if not line.find('Source Height') == -1: ...
ni, so that's why I think
>it's either not reading the ini, or perhaps it's being executed as the wrong
>user or something. (Linux environment)
Are you closing or flushing the output file before starting the subprocess?
Bill
--
INTERNET: b...@celestial.com Bill Campbell
s, a program that generates
wrappers for X11 applications that one can click on or drop files
on to execute them. For instance, I have one I call Gvim.app
that executes the vim editor in an xterm (I don't like the GUI
versions of vim, but prefer working in a simple xterm).
Bill
--
INTERNET: b
For a python script, say mypython.py, it should start with
something like this:
#!/usr/bin/env python
# do stuff here
Then ``chmod +x mypython.py'' and it's ready to go.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ P
eason why Python allows such ambiguity here?
>
>Cheers for a quick shot of enlightenment ;-)
``pydoc file'' is your friend. It says open is an alias for file.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box
ath37', 'filepath38', 'filepath39',
> 'filepath4', 'filepath40', 'filepath41', 'filepath42', 'filepath43',
> 'filepath44', 'filepath45', 'filepath46', 'filepath47',
strip()
> # This prints
> e...@emad-laptop:~/Desktop/TEMP$ python globbing.py
> This is four
> This is one
> This is two
> This is three
> Could somebody please tell me how to get the output in the right
> order?
files = glob.glob('*.temp')
fi
On Mon, Feb 16, 2009, David wrote:
>Bill Campbell wrote:
>>
>> The ``swatch'' program, written in perl, does this by using the
>> gnu-tail program via a pipe using.
>>
>> gtail --follow=name --lines=1 file1 file2 ...
>>
>> Use the sour
to see that
> code. If not why mention it?
>
The ``swatch'' program, written in perl, does this by using the
gnu-tail program via a pipe using.
gtail --follow=name --lines=1 file1 file2 ...
Use the source Luke.
Bill
--
INTERNET: b...@celestial.com
d available
on any datetime object. It uses the standard strftime expansion,
which on any Linux/Unix box will be found with ``man strftime''.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice:
;Python itself. You might try:
>eval ("1.0 * 3/2")
Make either the numerator or denominator floating point.
eval ('3.0/2')
Python does the Right Thing(tm) when dividing two integers,
returning an integer result.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestia
sudo = "sudo"
> tail = "tail"
> targ = "-f" # output appended data as the file grows
> sfile = "/var/log/messages"
> print colored("", "blue")
> call([sudo, tail, targ, sfile])
Looking at how swatch does this
tartswith(prefix):
> return True
It might be more useful to return the prefix that matched as the
caller already knows what ``word'' is.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer W
and perl, I have done it with two reads, the first to
get the length, the second to read the data with that length.
Bill
--
INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Merce
rything in decimal which made a lot of sense since they were designed
primarily to run COBOL accounting applications.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-
for about 4 years now.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island, WA 98040-0820
Fax:(206) 232-9186
"If taxation without consent is not
get unauthorized access or change things
they shouldn't.
Many of the common exploits of web pages are the result of poor
checking of input resulting in sql injection attacks, and other
breaches.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.
On Tue, Sep 23, 2008, Bill Campbell wrote:
>On Wed, Sep 24, 2008, John Fouhy wrote:
>>2008/9/24 Joe Python <[EMAIL PROTECTED]>:
>>> Hi Pythonistas,
>>>
>>> I have a large dictionary of dictionary (50,000+ keys) which has a structure
>>> as fol
f, other):
return(cmp((-self.income, self.name), -other.income, other.name))
d = dict(
key1 = MyStuff('john', 1),
key2 = MyStuff('bill', 2),
)
vals = d.values()
vals.sort()
# vals should be sorted by income in descending order and name.
Bill
--
INTERNET
line = line.replace(r'\001', r'\f')
print line
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
Voice: (206) 236-1676 Mercer Island, WA 98040-0820
Fax:(206) 232-9186
I
On Wed, Feb 27, 2008, Alex Ezell wrote:
>I must be missing some simple method on a file object or something.
>
>What I need to do is to truncate the first line of a file which has an
>unknown number of lines and an unknown size.
>
>The only thing I can think to do is to readlines() and then slice o
)
>
>obviously, the syntax doesn't work. This should be easy, but I've never seen
>example code. any pointers?
mylist.append(somefunc()[1])
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FA
to 4 spaces?
Do that, and in his ~/.vimrc file, add a line ``set expandtab''
(Friends don't let friends use emacs :-).
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-91
.out', 'U') instead of
the $DEITY/Awful DOSish backwacks.
If you're really enamoured of backslashes, add an r before the
single quotes to get what you want.
blast_out = open(r'C:\human\prb_blast.out','U')
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Ce
On Wed, Oct 10, 2007, Ed Goulart wrote:
>
> Hello!
>
> Though I've tried very hard, I couldn't find in the WEB the needed
> help; so, if you can help me, please...!!!
import os
os.rename(old, new)
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celesti
ou want more than simple
>spaces removed.
>
>Or you can use regexs. (Or the translate function might work too, but
>i haven't
>tried it for this)
import re
whitespace = re.compile(r'\s+')
cleanstring = whitespace.sub('', dirtystring)
Bill
--
INTERNET: [EMAIL PROTE
On Wed, Sep 12, 2007, Kent Johnson wrote:
>Bill Campbell wrote:
>> Most mailing lists limit the size
>> of messages to 40k or less.
>
>On this list large messages go to moderation. I think I was so
>captivated with the images that I forgot about the size. A better way to
otas.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
We'll show the world we are prosperous, even if we h
than Amazon or Powells. They're generally the
first place I look.
(my only assocation with any of them is as a customer).
...
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-
r expression strings in
reverse order such that the longer strings are tested first.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-
#!/usr/bin/python...
>
>Perhaps I should use the "#!/usr/bin/env python" one.
The case where ``#!/usr/bin/env python'' won't work is where
there are multiple versions of python on the system, and one
wants to run a version that's not first in the PATH. In that
cas
On Mon, May 21, 2007, Kent Johnson wrote:
>Bill Campbell wrote:
>> Is the behaviour defined if one is processing a dictionary using
>> iteritems, and delete items?
>>
>> for k, v in d.iteritems():
>> if somecondition(k, v): del d[k]
>>
>> Would
leary of deleting items while processing things
like this, keeping a list of keys to be deleted, then processing
that list upon completion of the mail loop to delete the items
from the original dictionary or database file.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software, LL
y any of [4,100,400]
While the modulus operator is generally useful for things like
this, one might want to use the calendar module for this if it's
smarter about some of the subtle quirks of leapyear:
import calendar
if calendar.isleap(year): ...
Bill
--
INTERNET: [EMAIL PROTECTED] Bill C
On Wed, May 02, 2007, Jason Coggins wrote:
>
> Is it possible to use os.path.join to link to a file located in the
> directory above where you are currently located?
os.path.join('..', filename)
os.path.realpath(os.path.join('..', filename))
Bill
--
INTERN
.mylist = mylist
Exception.__init__(self, msg)
try:
check_something()
except MyException, e:
for entry in e.mylist: ...
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 2
tuples)
I think what you want is ...(*list_of_tuples) similar to the syntax used
when calling functions with position arguments from a list.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:
On Fri, Feb 23, 2007, Alan Gauld wrote:
>"Bill Campbell" <[EMAIL PROTECTED]> wrote
>
>>>It seems that an SQL database would probably be the way to go, but I
>>>am a bit concerned about speed issues (even though running time is
>> ...
>> Yo
er off using one of the hash databases,
Berkeley, gdbm, etc. (see the anydbm documentation). These can
be treated exactly like dictionaries in python, and are probably
orders of magnitude faster than using an SQL database.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software L
On Thu, Feb 15, 2007, Luke Paireepinart wrote:
>Bill Campbell wrote:
>> The major reason for not setting Reply-To: thelist is that it makes it
>> *SLIGHTLY* more difficult to post something to the list and replys should
>> go to the sender. IHMO, one should have to go to a
``mutt'' mailer, this effort is simply pressing ``L'' instead of
``r'' when posting to the list and adding the listname to the subscribe
section of ~/.muttrc, hardly a major inconvenience.
http://www.unicom.com/pw/reply-to-harmful.html
...
Bill
--
INTERNET: [E
your ``from os import *'' is biting you in
the butt as the os.open command is being executed instead of the
normal open.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:
ike:
outDict = dict(map(lambda x: (x, 1), inList))
names = outDict.keys()
names.sort()
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-
On Sun, Oct 22, 2006, Matt Richardson wrote:
>I just used it a couple of weeks ago to produce a histogram of
>randomly generated numbers. Read the documentation, it's well written
>and has good examples.
You might also want to look at gnuplot.
Bill
--
INTERNET: [EMAIL PR
some_list.append(var)
> return some_list
> is this cool ?
Ayup!
The best way to find answers to questions like this is to just do
it, and see what python does.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ P
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
To say that UNIX is doomed is pretty rabid, OS/2 will certainly play a role,
but you d
t'' program in *NIX systems which
captures your entire session.
I haven't used pexpect with python yet, but the perl expect
module can also be used to capture things like this, and I would
expect that one could do this with pexpect as well.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill
On Mon, Oct 16, 2006, Alan Gauld wrote:
>
>"Bill Campbell" <[EMAIL PROTECTED]> wrote in message >> The
>function is in the os module ([2]
>>> http://docs.python.org/lib/os-file-dir.html).
>>
>> Silly me. I was looking in the os.path modul
On Sun, Oct 15, 2006, Michael P. Reilly wrote:
>
> On 10/15/06, Bill Campbell <[EMAIL PROTECTED]> wrote:
>
> Is there a python equivalent of the perl readlink() function
> (e.g. one that returns the relative path in cases where a command
> such as ``ln
olved path rather than the
relative one (/usr/local/bin/ls in the case above).
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
`
On Fri, Sep 08, 2006, Kent Johnson wrote:
>Bill Campbell wrote:
>> On Fri, Sep 08, 2006, Kent Johnson wrote:
>>> http://peak.telecommunity.com/DevCenter/EasyInstall
>>
>> Is it possible to use EasyInstall to install relative to a
>> directory other than the s
s description of GUIs ``GUIs make simple things simple
and complex things impossible''.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820;
se that if necessary, but would prefer a pure python solution.
Any hints on this?
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
`
qlobject. So far I haven't tried psycopg2.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
A child can go only so far
(Tiger) -- no /proc/mounts or /etc/fstab
SCO OpenServer 5.0.6a -- no /proc/mounts or /etc/fstab
All of these systems have the gnu gdf which returns information
in the same format.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Systems, Inc.
URL: http://www.celestial.com/ PO Bo
On Fri, Mar 17, 2006, Adam wrote:
>On 17/03/06, Bill Campbell <[EMAIL PROTECTED]> wrote:
>> On Fri, Mar 17, 2006, Michael Lange wrote:
>> >On Fri, 17 Mar 2006 00:36:35 -0700
>> >fortezza-pyt <[EMAIL PROTECTED]> wrote:
>> >
>> >> If
zip(gdf_cols, line.split(None, 5)))
filesys = rec['filesys']
dir = rec.get('dir')
if (
dir and not (filesys.find(':') >= 0
or pseudofilesys.get(filesys))
): mounted.append(dir)
df.close()
return mounte
from the passwd file. But I want to do
> something like:
> command(username)
> And get something that returns the uid (the number).
You're close:
import pwd
pw = pwd.getpwnam('username')
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Systems, In
h one
offhand). The licensing issues with mysql make me very leary of doing
anything commercial with it.
There is also the python sqlobject system which provides a very object
oriented wrapper on top of relational databases. Using sqlobject can make
many database functions very easy, and large
On Thu, Jan 19, 2006, Vincent Zee wrote:
>Hi,
>
>say you want to write a more-like program.
>How do you know how many lines the terminal window
>can display.
Use the curses library, and it will take care of this for you.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Cel
On Thu, Nov 10, 2005, Kent Johnson wrote:
>Bill Campbell wrote:
>
>>The problem I'm working on now is to have our client's machines connect to
>>our XML-RPC server in cron jobs which will do at least two things, check to
>>see if their dynamic IP address has cha
On Tue, Nov 08, 2005, Kent Johnson wrote:
>Kent Johnson wrote:
>> Bill Campbell wrote:
>>
>>>Is there a way in python for a method to determine its parent?
>>>
>>>In particular, I'm working with SimpleXMLRPCServer, and would
>>>like to be ab
don't know how to get to that.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/
My brother
he X
Resources that xterms support, but it would be much nicer if
there is something I can handle in my python ncurses routines
than if I have to dig into the keyboard mapping stuff.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill
, at least on Tiger and Panther which are the only machines I
have in-house for testing.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206)
rting the modules that
may or may not use them.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040-0820; (206)
e''
of python, indentation errors. The getday routine appears to be a
subroutine of __init__, not a method of the class.
BTW: Not to start a religious war, I hated BEGIN/END blocks on
ALGOL too, but in those days my editor was an 026 keypunch or
worse, making paper tapes on a telet
htab.html
Thanks for the references (occassionaly there's something that
government does that's actually useful :-).
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186
and a dictionary? I presume that using it with
small hashes will be faster than dictionries since it doesn't
have to calculate the hashes.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX:
ilman/listinfo/tutor
>>
>___
>Tutor maillist - Tutor@python.org
>http://mail.python.org/mailman/listinfo/tutor
>
--
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill PO Bo
>http://www.python.org/pypi
There's also the vaults of parnassus
http://www.vex.net/parnassus/
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer
expressions, keyed on the
first and third entries in os.uname() output.
I don't do Windows so can't say what it does (knowing Microsoft, it may
vary between Windows versions, patch levels, and the phase of the moon :-).
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Softwar
interface on the private
address which probably isn't what is required).
One disadvantage of parsing ifconfig is that output varies depending on the
operating system.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Systems, Inc.
UUCP: camco!bill PO Box 820; 6641 E
ndard input into a
file, and to its own standard output.
make 2>&1 | tee make.output
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX:(206) 232-9186 Mercer Island, WA 98040
s particular question in the
>book you recommend?
Good? That depends on what your standards are. I found ``Perl
to Python Migration'' by Martin C. Brown useful. I think I found
this on bookpool.com, but you can always try bookfinder.com which
can find pretty much anything.
Bill
ese in Linux)
Python scripts should Just Run(tm) whether they have a .py extension or not
on a Linux box. Linux, and most *nix flavours don't depend on the file
suffix to determine what type of file it is, but generally look at the
first few bytes of the file (if a text file starts with
out of the enum.
I've tried google to find a fix, but haven't found anything yet.
Is there a recommended fix for this?
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
FAX:(206) 23
re.compile(r'pattern1'),
re.compile(r'pattern2'),
...
)
fh = open('somefile')
for line in fh.xreadlines():
for regex in relist:
if regex.search(line): break
else: print line
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbe
no python!
>Back to Mandrake I think.
I have yet to see a SuSE distribution without python although you may have
to install it from using yast2. FWIW, I would strongly recommend the SuSE
Professional rather than the Personal if you're going to be doing any
serious development work.
Bi
of text here, perhaps with %s insertion
''' % 'variable'
You will have to use the ``printf'' type features of the ``%''
operator in places where one could include variable names within
perl's double quotes or ``HERE'' types.
Bill
--
INTERNET:
On Sat, Dec 04, 2004, Gonçalo Rodrigues wrote:
>Bill Campbell wrote:
...
>>>Both are extremely dangerous functions from a security
>>>and maintenance/reliability pouint of view and should be
>>>used very rarely.
>>
>>
>>True enough, but useful upon
variables with the name of
the table so I'm not accessing the dictionary. Would something
like this work:
# dbtables is already built
for table in dbtables.keys():
exec("%s = dbtables['%s']" % (table, table))
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell;
99 matches
Mail list logo