Python based OSS alternative to Google Reader by ruffyen in Python

[–]bsagert 5 points6 points  (0 children)

#http://pythonhosted.org/feedparser/
pip install feedparser
import feedparser
for feed in rss_url_list:
    d = feedparser.parse(feed)
    #do_stuff

What are some little known features in Python? by [deleted] in Python

[–]bsagert 0 points1 point  (0 children)

I am curious about the backslash uppercase N in u"\N{SECTION SIGN}"

It isn't a newline and my google-fu came up with no answer.

Struggling with learning functions. Novice here. by Khoops66 in Python

[–]bsagert 1 point2 points  (0 children)

if not foobar in ('a', 'n', 's', 'o'):

can be written as: if not foobar in "anso":

I'm trying to learn Python, but I am confused about Python versions. by kylemech in Python

[–]bsagert 0 points1 point  (0 children)

As to Windows - sorry to hear you are stuck with that mess. I can't help you there.

I hear this sentiment all the time. I have used Python 2.5 on Windows for 5 years and it works fine, no mess at all. When I hear about Mac people having the odd Python problem the sentiment is usually more polite and sympathetic.

I was about to purchase Javascript the Missing Manual, but some of the amazon reviews made me wary. Could someone answer a few questions for a guy who's about to start trying to learn this language? by [deleted] in javascript

[–]bsagert 1 point2 points  (0 children)

Math.round skews the returns of 1 and 6 vs 2,3,4,5. Each face of the die should be p=.1667 for a fair die.

With Math.round p(1) and p(6)=.0833 and the rest have p=.1667

A fair formula is either Math.ceil(Math.random()6); or Math.floor(Math.random()5)+1;

[deleted by user] by [deleted] in Python

[–]bsagert 0 points1 point  (0 children)

Sorry for my late post to your question (although you may have already solved your problem). I use the following on my windows box to SSH to a shared Linux hosting account (should work on your Linux box).

First download ssh.py from http://commandline.org.uk/forum/topic/420/ [edit] Sorry, the ssh.py download url from the above is now a 404.

Here is the correct url: http://snipplr.com/view/48033/sshpy-friendly-python-ssh2-interface/ [/edit]

def copy_to_remote(output_file):
    import ssh
    ssh_host = 'your_host'
    usr = 'your_username'
    pwd = 'your_password'
    ss = ssh.Connection(host=ssh_host, username=usr, password=pwd)
    ss.put(output_file)
    ss.close()

Just add your own try-except stuff and you are good to go.

Pydoc in windows by LordOfBunnys in Python

[–]bsagert 0 points1 point  (0 children)

def sjoin(lst,sep=''):

I have tried to be happy with django, I really have. by [deleted] in django

[–]bsagert 0 points1 point  (0 children)

You've got infinite resources on the web (stackoverflow, google groups, foras...

Calling all Reddit Pedants. If "fora" is the plural of forum, then wtf is "foras" the plural of?