First  |  Prev |  Next  |  Last
Pages: 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
Manipulating sys.path
Hi all, I want to manipulate sys.path outside of PYTHONPATH (environment) and sys.path.append() (programmatically). A bit of background: We're maintaining a small application that includes a couple of Python scripts. Over time, a decent amount of code has been forked into modules, so the overall file syste... 9 Jul 2008 06:30
delete lines
I am new in python and I have the following problem: Suppose I have a list with words of which I want to remove each time the words in the lines below item1 and above item2: item1 a b item2 c d item3 e f item4 g h item1 i j item2 k l item3 m n item4 o p I did not find out how to do this... 9 Jul 2008 06:30
ActiveState Code: the new Python Cookbook site
hi Mike, nice job, I just took a quick look, Trent Mick wrote: The Python Cookbook is by far the most popular of the ASPN Cookbooks, so I wanted to get the Python community's feedback on the new site. What do you think? What works? What doesn't? I'll try to answer feedback on python-list or o... 11 Jul 2008 14:03
Regular Expressions Quick Question
hi! Try this: lis=['t','tes','test','testing'] [elem for elem in lis if re.compile("^te").search(elem)] ['tes', 'test', 'testing'] Cheers, Raj On Wed, Jul 9, 2008 at 12:13 AM, Lamonte Harris <pyth0nc0d3r(a)gmail.com> wrote: Alright, basically I have a list of words in a file and I load each wo... 9 Jul 2008 12:40
Newbie question
Hi list, i'm running Ubuntu Hardy Desktop and i've installed Tim Golden WMI. However importing wmi module i have this error: import wmi Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/site-packages/wmi.py", line 141, in <module> from win32com.client... 9 Jul 2008 12:40
Returning the positions of a list that are non-zero
I have a very large list of integers representing data needed for a histogram that I'm going to plot using pylab. However, most of these values (85%-95%) are zero and I would like to remove them to reduce the amount of memory I'm using and save time when it comes to plotting the data. To do this, I'm trying to find... 9 Jul 2008 11:38
a simple 'for' question
Hi fans, I want to use a 'for' iteration to manipulate files in a set of folders, something like: folders= ['1A28','1A6W','56Y7'] for x in folders: print x # print the current folder f = open('my/path/way/x/my_file.txt', 'r') ... where 'x' in the pathway should iterate over '1A28','1A6W',... 10 Jul 2008 12:22
find all ODBC databases ?
hello, I'm working on a general database manager, which will be open source and should preferable work under all OS. Now in windows I can find the ODBC databases by reading some reg key. I also know that ODBC is supported under Linux (I don't know anything of Linux), but how can I get all ODBC databases in ... 8 Jul 2008 19:16
how to remove oldest files up to a limit efficiently
I need to mantain a filesystem where I'll keep only the most recently used (MRU) files; least recently used ones (LRU) have to be removed to leave space for newer ones. The filesystem in question is a clustered fs (glusterfs) which is very slow on "find" operations. To add complexity there are more than 10^6 files ... 9 Jul 2008 18:52
(silly?) speed comparisons
Out of curiosity I decided to make some speed comparisons of the same algorithm in Python and C++. Moving slices of lists of strings around seemed like a good test case. Python code: def move_slice(list_arg, start, stop, dest): frag = list_arg[start:stop] if dest > stop: idx = dest - (stop - start) e... 9 Jul 2008 11:38
First  |  Prev |  Next  |  Last
Pages: 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347