1.filtered
# remove trailing junk [spaces & <]; cost: 1 min 3 secs
cat $1.filtered | sed -e 's/\([0-9]*\) * $1.cleaned
# remove intermediate files, good, sorted, filtered
rm -f *.good *.sorted *.filtered
#:~
...but strangely though, there's a discrepancy
The code it down to 5 lines!
#!/usr/bin/python
barred = set(open('/home/sajid/python/wip/CBR319.dat'))
postpaid_file = open('/home/sajid/python/wip/PSP320.dat')
outfile = open('/home/sajid/python/wip/PSP-CBR.dat', 'w')
outfile.writelines(number for number in postpaid
n Python above gives me one more reason to
love Python. And it is indeed fast, 5x!
Thank you all for all your help.
--
fynali
--
http://mail.python.org/mailman/listinfo/python-list
$ cat cleanup_ray.py
#!/usr/bin/python
import itertools
b = set(file('/home/sajid/python/wip/stc/2/CBR333'))
file('PSP-CBR.dat,ray','w').writelines(itertools.ifilterfalse(b.__contains__,file('/home/sajid/python/wip/stc/2/PSP333')))
--
$ time ./cleanup_ray.py
e possible of Raymond's or Fredrik's suggestions above which
will still give me the time saving made?
--
fynali
--
http://mail.python.org/mailman/listinfo/python-list
[bonono]
> Have you tried the explicit loop variant with psyco ?
Sure I wouldn't mind trying; can you suggest some code snippets along
the lines of which I should try...?
[fynali]
> Needless to say, I'm utterly new to python and my programming
> skills & k
ed[number] = None # just add it as a key
outfile.writelines([number for number in postpaid_file if number
not in barred])
postpaid_file.close(); outfile.close()
--
$ time ./cleanup.py
real0m31.007s
user0m24.660s
sys 0m3.550s
Can we say that using generators
and_list_compr.py
real0m39.638s
user0m5.532s
sys 0m0.868s
This was run on my machine (w/ Python 2.4.1), can't install psyco on
the actual server at the moment.
I guess using generators & newer Python is indeed faster|better.
--
fynali
--
http://mail.python.org/mailman/listinfo/python-list
up_use_psyco_and_list_compr.py
real0m24.293s
user0m22.633s
sys 0m0.524s
Saves ~6 secs.
--
fynali
--
http://mail.python.org/mailman/listinfo/python-list
Sorry, pls read that ~15 secs.
--
http://mail.python.org/mailman/listinfo/python-list
up_use_psyco_and_list_compr.py
real0m22.587s
user0m21.653s
sys 0m0.440s
Not using psyco is faster!
--
fynali
--
http://mail.python.org/mailman/listinfo/python-list
Love it.
--
fynali
--
http://mail.python.org/mailman/listinfo/python-list
> You idiot. Putting the word "official" in front of something doesn't
> mean it can't be FUD. Especially when it is written by people such as
> yourself. Have you not paid attention to anything happening in
> politics around the world during your lifetime?
Ridiculous boo-llshit!
--
http://ma
>
> 19729
>
> Did you count the 'L'?
>
(-:
--
http://mail.python.org/mailman/listinfo/python-list
t;100,000 Newsgroups
> > ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
>
> I FINALLY found taskscheduler (with the help of your post). I found
> it under
>
> ...\Python243\Lib\site-packages\win32comext\taskscheduler
>
> ... and, there seems to be a /
Python COM browser
PythonCOM comes with a basic COM browser that may show you the
information you need. Note that this package requires Pythonwin (ie,
the MFC GUI environment) to be installed for this to work.
There are far better COM browsers available - I tend to use the one
that comes with MSVC, or this one!
To run the browser, simply select it from the Pythonwin Tools menu, or
double-click on the file win32com\client\combrowse.py
"""
--
s|a fynali
--
http://mail.python.org/mailman/listinfo/python-list
mp; respective broadcast certificates.
All help and advice will be most appreciated.
Thank you.
s|a fynali
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 24, 4:36 pm, fynali iladijas <[EMAIL PROTECTED]> wrote:
> Hi, this query is regarding automating page insertions in Microsoft
> Document Imaging.
>
> I have two sets of MDIs generated fortnightly: Invoices and their
> corresponding Broadcast Certificates; about 150 of
18 matches
Mail list logo