Program inefficiency?

2007-09-29 Thread hall . jeff
I wrote the following simple program to loop through our help files and fix some errors (in case you can't see the subtle RE search that's happening, we're replacing spaces in bookmarks with _'s) the program works great except for one thing. It's significantly slower through the later files in the

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
I did try moveing the re.compile's up and out of the replacecylce() but it didn't impact the time in any meaningful way (2 seconds maybe)... I'm not sure what an shell+sed script is... I'm fairly new to Python and my only other coding experience is with VBA... This was my first Python program In

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
XP is the OS... the files are split across a ton of subdirectories already... I'm actually starting to think there's a problem with certain files, however... We create help files for clients using RoboHelp... RoboHelp has Source HTML and then "webhelp" html which is what actually goes to the clie

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
no swaps... memory usage is about 14k (these are small Html files)... no hard drive cranking away or fan on my laptop going nutty... CPU usage isn't even pegged... that's what makes me think it's not some sort of bizarre memory leak... Unfortunately, it also means I'm out of ideas... -- http://ma

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
For anyone that cares, I figured out the "problem"... the webhelp files that it hits the wall on are the compiled search files... They are the only files in the system that have line lengths that are RIDICULOUS in length... I'm looking at one right now that has 32767 characters all on one line...

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
The search is trying to replace the spaces in our bookmarks (and the links that go to those bookmarks)... The bookmark tag looks like this: and the bookmark tag looks like this some pitfalls I've already run up against... SOMETIMES (but not often) the a and the href (or name) is split across

Re: Program inefficiency?

2007-09-29 Thread hall . jeff
It think he's saying it should look like this: # File: masseditor.py import re import os import time p1= re.compile('(href=|HREF=)+(.*)(#)+(.*)(\w\'\?-<:)+(.*)(">)+') p2= re.compile('(name=")+(.*)(\w\'\?-<:)+(.*)(">)+') p100= re.compile('(a name=)+(.*)(-)+(.*)(>)+') q1= r"\1\2\3\4_\6\7" q2= r"\1

Pulling data from a .asps site

2007-11-27 Thread hall . jeff
There's a government website which shows public data for banks. We'd like to pull the data down programmatically but the data is "hidden" behind .aspx... Is there anyway in Python to hook in directly to a browser (firefox or IE) to do the following... 1) Fill the search criteria 2) Press the "Sea

easy_install

2009-02-08 Thread hall . jeff
For the life of me I can not figure out how to get easy_install to work. The syntax displayed on the web page does not appear to work properly. easy_install c:\MySQL_python-1.2.2-py2.4-win32.egg Is there a simpler way to install a python egg? Or am I missing something with easy_install? -- http:/

Re: easy_install

2009-02-08 Thread hall . jeff
On Feb 8, 9:27 am, "Diez B. Roggisch" wrote: > hall.j...@gmail.com wrote: > > For the life of me I can not figure out how to get easy_install to > > work. The syntax displayed on the web page does not appear to work > > properly. > > > easy_install c:\MySQL_python-1.2.2-py2.4-win32.egg > > It usua

Re: easy_install

2009-02-09 Thread hall . jeff
I had it downloaded and sitting in the root c:\ but didn't get it to run because I didn't think about the \scripts folder not being in the Path. Problem solved and fixed. Thank you all for your help. On a side note, "easy_install MySQL-python" produced the following messages: Searching for MySQL-p

Re: socket error: connection refused?

2008-06-23 Thread hall . jeff
It's a security conflict. You should be able to run it again and have it work. Our company's cisco does the same thing (even after we approve the app) -- http://mail.python.org/mailman/listinfo/python-list

tuple.index() and tuple.count()

2008-06-23 Thread hall . jeff
Before the inevitable response comes, let me assure you I've read through the posts from Guido about this. 7 years ago Guido clearly expressed a displeasure with allowing these methods for tuple. Let me lay out (in a fresh way) why I think we should reconsider. 1) It's counterintuitive to exclude

Re: tuple.index() and tuple.count()

2008-06-23 Thread hall . jeff
never mind... a coworker pointed me to this http://bugs.python.org/issue1696444 apparently they're there in py3k... -- http://mail.python.org/mailman/listinfo/python-list

Preferred method for "Assignment by value"

2008-04-15 Thread hall . jeff
As a relative new comer to Python, I haven't done a heck of a lot of hacking around with it. I had my first run in with Python's quirky (to me at least) tendency to assign by reference rather than by value (I'm coming from a VBA world so that's the terminology I'm using). I was surprised that these

Re: Preferred method for "Assignment by value"

2008-04-15 Thread hall . jeff
Thank you both, the assigning using slicing works perfectly (as I'm sure you knew it would)... It just didn't occur to me because it seemed a little nonintuitive... The specific application was def dicttolist (inputdict): finallist=[] for k, v in inputdict.iteritems(): temp = v

Re: Preferred method for "Assignment by value"

2008-04-15 Thread hall . jeff
I think the fundamental "disconnect" is this issue of mutability and immutability that people talk about (mainly regarding tuples and whether they should be thought of as static lists or not) Coming from VBA I have a tendency to think of everything as an array... So when I create the following t