A little help with my new website - Python Facts

5 views
Skip to first unread message

Ron Reiter

unread,
Nov 24, 2011, 11:44:50 AM11/24/11
to pyweb-il
Hey guys!
I've created a nice Python tips website called Python Facts: http://facts.learnpython.org
I want to advertise it but I want to get some more tips (I currently have about 20).
I would really appreciate it if you can contribute some snippets of code you find useful.

Thanks a million :)

--

Ron Reiter

Facebook Twitter LinkedIn
Contact me: Skype ron.reiter

Yehonatan Daniv

unread,
Nov 24, 2011, 11:53:02 AM11/24/11
to pywe...@googlegroups.com
Kudos!
great stuff, hope i can think of something useful to add.

~Y



--
You received this message because you are subscribed to the Google Groups "PyWeb-IL" group.
To post to this group, send email to pywe...@googlegroups.com.
To unsubscribe from this group, send email to pyweb-il+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyweb-il?hl=en.

Udi Oron

unread,
Nov 24, 2011, 2:36:44 PM11/24/11
to pywe...@googlegroups.com
On Thu, Nov 24, 2011 at 6:44 PM, Ron Reiter <ron.r...@gmail.com> wrote:

Amit Aronovitch

unread,
Nov 25, 2011, 2:55:58 AM11/25/11
to pywe...@googlegroups.com
On Thu, Nov 24, 2011 at 6:44 PM, Ron Reiter <ron.r...@gmail.com> wrote:

Hey guys!
I've created a nice Python tips website called Python Facts: http://facts.learnpython.org
I want to advertise it but I want to get some more tips (I currently have about 20).
I would really appreciate it if you can contribute some snippets of code you find useful.

Thanks a million :)


Snippets that do not show output (because they do not use print):

1.
not working:
    map(int, "10 20 30".split())   

working:
    print map(int, "10 20 30".split())

2.
not working (not sure why):
    import this

working (but ugly)
    from this import d,s
    print "".join([d.get(c, c) for c in s])


Would be great if you could fix the app (instead of the snippets) such that they will work.
 
    AA

Omer Zak

unread,
Nov 25, 2011, 3:55:08 AM11/25/11
to pywe...@googlegroups.com

For me the snippets do work:

$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.


>>> map(int, "10 20 30".split())

[10, 20, 30]
>>> import this
The Zen of Python, by Tim Peters
[... rest was snipped ...]

--- Omer


--
$ python
>>> type(type(type))
<type 'type'> My own blog is at http://www.zak.co.il/tddpirate/
My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.html

Amit Aronovitch

unread,
Nov 25, 2011, 4:34:36 AM11/25/11
to pywe...@googlegroups.com
On Fri, Nov 25, 2011 at 10:55 AM, Omer Zak <w...@zak.co.il> wrote:
For me the snippets do work:

$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> map(int, "10 20 30".split())
[10, 20, 30]
>>> import this
The Zen of Python, by Tim Peters
[... rest was snipped ...]


I ment they do not work if you push the triangular "play" button in Ron's webapp.

 :-)
 

Ram Rachum

unread,
Nov 25, 2011, 10:53:49 AM11/25/11
to pywe...@googlegroups.com
I see there's an HN post:


Feel free to upvote.

On Thu, Nov 24, 2011 at 6:44 PM, Ron Reiter <ron.r...@gmail.com> wrote:

Ram Rachum

unread,
Nov 25, 2011, 11:03:07 AM11/25/11
to pywe...@googlegroups.com
Ron, an annoyance is that when you go over the snippets, it happens often that you get the same ones many times. You can either let them cycle instead of using a random order, or possibly make a random cycle that is calculated as a function of the user's IP address, or store in the session which tips have already been visited.

Also, you've forgotten to take your app out of debug mode.


On Thu, Nov 24, 2011 at 6:44 PM, Ron Reiter <ron.r...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages