This script uses a simple for loop to zip some files. However I am
repeating code that cries out for a nested loop. My two lists of
files_to_be_zipped (spare and seekfacts) are of uneven length so I
can't seem to decipher the "for_logic". I would appreciate any help.
Thanks, Bill
import zipfile
im
Some web feeds use decimal character entities that seem to confuse
Python (or me). For example, the string "doesn't" may be coded as
"doesn’t" which should produce a right leaning apostrophe.
Python hates decimal entities beyond 128 so it chokes unless you do
something like string.encode('utf-8').
This simple script writes html color codes that can be viewed in a
browser. I used short form hex codes (fff or 000, etc) and my list
has only six hex numbers otherwise the results get rather large. I
invite criticism as to whether my code is "pythonic". Are there other
ways to generate the hex co
I wrote my own feed reader using feedparser.py but it takes about 14
seconds to process 7 feeds (on a windows box), which seems slow on my
DSL line. Does anyone see how I can optimize the script below? Thanks
in advance, Bill
# UTF-8
import feedparser
rss = [
'http://feeds.feedburner.com/typepad/
I downloaded Mark Pilgrims's feedparser.py in a zipfile to my Windows
machine, unzipped it and tried to install it to no avail.
Here is the result =>
C:\>python c:\scripts\feedparser-4.1\setup.py install
running install
running build
running build_py
file feedparser.py (for module feedparser) not
On Jun 18, 10:18 am, Duncan Booth <[EMAIL PROTECTED]>
wrote:
> [EMAIL PROTECTED] wrote:
> > I downloaded BeautifulSoup.py from
> >http://www.crummy.com/software/BeautifulSoup/and being a n00bie, I
> > just placed it in my Windows c:\python25\lib\ file. When I type
> > "import beautifulsoup" from th
On Jun 18, 10:18 am, Duncan Booth <[EMAIL PROTECTED]>
wrote:
> [EMAIL PROTECTED] wrote:
> > I downloaded BeautifulSoup.py from
> >http://www.crummy.com/software/BeautifulSoup/and being a n00bie, I
> > just placed it in my Windows c:\python25\lib\ file. When I type
> > "import beautifulsoup" from th
I downloaded BeautifulSoup.py from http://www.crummy.com/software/BeautifulSoup/
and being a n00bie, I just placed it in my Windows c:\python25\lib\
file. When I type "import beautifulsoup" from the interactive prompt
it works like a charm. This seemed too easy in retrospect.
Then I downloaded the
After a couple of weeks studying Python, I already have a few useful
scripts, including one that downloads 1500 Yahoo stock quotes in 6
seconds. However, many things are puzzling to me. I keep on seeing
things like "__main__" in scripts. A more obscure example would be
"__add__" used in string con
The python community is very helpful to newbies like me. I did however
manage to solve my problem in the meantime. I needed the modification
time of certain files on various computers, but I didn't know the
usernames ahead of time, so I used windows %userprofile% method.
Python likes forward slash
On Jun 10, 8:56 am, [EMAIL PROTECTED] wrote:
> In xp when I try os.path.getmtime("%userprofile/dir/file%") Python
> bites back with "cannot find the path specified" Since my script has
> to run on machines where the username is unspecified I need a fix.
> Thanks in advance.
oops that should be os.
In xp when I try os.path.getmtime("%userprofile/dir/file%") Python
bites back with "cannot find the path specified" Since my script has
to run on machines where the username is unspecified I need a fix.
Thanks in advance.
--
http://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo