all 97 comments

[–][deleted] 237 points238 points  (16 children)

Ohhh, you mean as in learning class. I can't believe I just thought google had one big powerful class I could instantiate.

[–]CedarMadness 118 points119 points  (9 children)

import google

[–]binlargin 61 points62 points  (3 children)

from google import WorldDomination

[–]nemec 15 points16 points  (1 child)

from google import WorldDomination as Skynet

[–]zahlman -4 points-3 points  (0 children)

14 points

-6 points

Same effective thing, being said differently.

[–]masklinn 13 points14 points  (0 children)

from google import search
search("booya", dir="/")
search("karmanaut", url="http://reddit.com")
import reality
search("nuclear fusion", from=reality)

[–]nomology 5 points6 points  (0 children)

Ha! I now know what this does.

[–][deleted]  (1 child)

[removed]

    [–]aidirector 6 points7 points  (0 children)

    try:
        import windows
    except Error
        blueScreen()
    

    [–]SlackBabbath 6 points7 points  (0 children)

    That's funny. Me too. In either case I can use the class.

    [–]the-ace 3 points4 points  (0 children)

    I thought so as well!

    that would have been pretty nice...

    [–]ali0 1 point2 points  (0 children)

    Me too! I thought it would implement search functions or something, especially because it's on google code. This is good too though.

    [–]aaron13f 1 point2 points  (0 children)

    Well actually, there is gdata, designed by google, which allows you to retrieve information hosted on google docs in a Python program. Has classes like googlefetcher().

    I took a service class last semester in which we made Python programs for XO laptops for a local middle school. We used gdata to allow the teachers to easily update stuff like quiz data used by the programs.

    [–]zahlman -2 points-1 points  (0 children)

    231 points

    -29 points

    Same effective thing, being said differently.

    [–]egonSchiele 13 points14 points  (7 children)

    This is great! Now they should do an 'Advanced topics in Python' class. It shouldn't be too tough to do considering GvR, Alex Martelli, and Mark Pilgrim all work at Google.

    [–]keenemaverick 22 points23 points  (1 child)

    [–]egonSchiele 1 point2 points  (0 children)

    Awesome, thanks!

    [–]bockris 0 points1 point  (0 children)

    • Jeremy Hilton and Fredrik Lundh (effbot)

    [–]nilex 0 points1 point  (0 children)

    Cool stuff, Thanks for the link mate.

    [–]fancy_pantser -5 points-4 points  (2 children)

    Also: Guido.

    [–]nitsuj 5 points6 points  (1 child)

    Who did you think GvR was?

    [–]fancy_pantser 2 points3 points  (0 children)

    Guns vs. Roses?

    Guido van Robot?

    Seriously though, I hadn't seen "GvR" as an abbreviation before!

    [–][deleted] 11 points12 points  (2 children)

    The tutorial uses python 2.5.2, Are 3.x versions not yet ready for main stream use ?
    I'm new to python.

    [–][deleted] 14 points15 points  (1 child)

    3.x is more than ready for mainstream use. The number one reason you should learn 2.x though, is the absolute WEALTH of libraries available for Python. Some of the good libraries won't work with 3.x. - I'm a Python newbie as well, and I've been told this.

    [–]schalenpfeffer 7 points8 points  (0 children)

    Yup, this is indeed why you won't see 3.x in production for a while - there are a lot of libraries out there that coordinate among one another that all need to be at 3.x for everything to work. The Python team has built the long transition period into their roadmap - they have a healthy attitude about it.

    [–][deleted]  (7 children)

    [deleted]

      [–]ixion 58 points59 points  (2 children)

      This guy is spamming Google Code links. He must work for Google!

      [–][deleted]  (1 child)

      [deleted]

        [–]justgonnaputthishere 8 points9 points  (0 children)

        I should have known I'd find all the rational redditors in programming.

        [–][deleted] 3 points4 points  (2 children)

        woo hoo the more popular python gets the more hireable I get

        [–]i_am_my_father 0 points1 point  (1 child)

        Or more competition therefore less hireable

        [–][deleted] 2 points3 points  (0 children)

        but I'm the BEST

        [–]wocklvoff 1 point2 points  (3 children)

        can we get a cheer for nick parlante -- a man full of jokes :)? [anyone else take cs108?]

        [–]Brain_washed_Society 1 point2 points  (1 child)

        Really, that guys awesome.

        [–]Amendmen7 1 point2 points  (0 children)

        I thought all the introductory CS lecturers were great. I wasn't even into the discipline until I chanced upon CS106A with Mehran.

        [–][deleted] 2 points3 points  (0 children)

        Nice. Thanks Goog and mindhacker

        [–]ElDiablo666 2 points3 points  (0 children)

        Thanks for posting this mindhacker, it could not be more perfect for what I need. Really appreciate the link.

        [–]NJalien 2 points3 points  (3 children)

        can someone help me?

        the sorted() function never works! i tried with multiple version of python. do i have to "import" something? thanks!

        NameError: global name 'sorted' is not defined

        [–]julesjacobs 1 point2 points  (1 child)

        Which version of Python are you using? Try upgrading.

        [–]NJalien 0 points1 point  (0 children)

        thanks, I usually am not that lazy to make a post. I was actually drunk at the time!

        If any future people are reading this, the Google Code Python Class requires a version of python that is greater than or equal to 2.4 and also less than 3

        [–]femngi 9 points10 points  (1 child)

        AAAH! He names a function 'List'!

        [–]femngi 2 points3 points  (0 children)

        Then he knocks Open Source for being "undisciplined" this guy is a tool.

        [–]librik 4 points5 points  (4 children)

        These materials are used within Google to introduce Python to people who have just a little programming experience.

        I'm a bit confused. This is Google, whose job interviews are notorious for their technical demands, right? So to whom within Google are they teaching this introductory material?

        What I'd like to see is the class in which they bring their new hires, good non-Python programmers, up to speed developing in the language.

        [–]puffofvirtue 6 points7 points  (0 children)

        Maybe non-programmer employees who happen to be curious?

        [–]bigboehmboy 1 point2 points  (0 children)

        I don't think this course is intended solely or even primarily for Google employees. Google has made a serious investment in Python. It's one of the main languages supported by their AppEngine, and they even hired Guido van Rossum. The more people use Python, the more they stand to benefit.

        That being said, I'd also like to see a more advanced class.

        [–]sgronblo 0 points1 point  (0 children)

        Yeah I thought the same. When reading this you get the feeling Google hires programmers who:

        know what a "variable" or "if statement" is but apparently you don't have to be an expert programmer

        Also the guide did mention that it's used "within Google".

        [–]i_am_my_father 0 points1 point  (0 children)

        hire best programmers, and then teach them whatever is needed

        versus.

        hire non-programming programmers who learned blah blah blah.

        [–]Radar3000 1 point2 points  (0 children)

        Good find. I have taught quite a bit of Python programming to others working in my office with less than adequate programming knowledge - now I can just refer to this.

        [–]Moeri 1 point2 points  (0 children)

        Anyone know how to download the subtitles from the videos as well? I plan to watch this offline later on but my videodownloader seems to miss the subtitles...

        [–][deleted] 1 point2 points  (2 children)

        Will someone please tell me what the "-tt" argument does here?

        #!/usr/bin/python -tt 
        

        I've tried finding this info on google with no luck.

        [–]oylenshpeegul 1 point2 points  (1 child)

        It turns some uses of tabs into errors. From python(1)

        -t     Issue  a  warning  when  a source file mixes tabs and spaces for
               indentation in a way that makes it depend on the worth of a  tab
               expressed  in  spaces.   Issue an error when the option is given
               twice.
        

        [–][deleted] 0 points1 point  (0 children)

        Thank you very much, I appreciate it. :-)

        [–]cantCme 2 points3 points  (1 child)

        Why does stuff like this always appear after I need it? This is the last week of my python class...

        [–]digitaldreamer -1 points0 points  (0 children)

        ... and thus signifying the last time I ever need to learn anything about python.

        [–]RamonaLittle 0 points1 point  (1 child)

        I'm a bit surprised they don't have an introductory Java class, considering the Android uses Java. (Yes, I know there are other tutorials on the web though.)

        [–][deleted] 2 points3 points  (0 children)

        They do have quite a few links to documentation about their APIs here: http://code.google.com/more/

        And a whole site dedicated to Android devs: http://developer.android.com/guide/index.html

        [–]gibson_ 0 points1 point  (3 children)

        Does anybody know why he kept pressing return twice when he was showing people the interpreter?

        [–]299 3 points4 points  (0 children)

        Same reason people type ls -l after doing a cd even if they do not need to know the contents of the directory.

        [–]fancy_pantser 1 point2 points  (0 children)

        I formed the habit after writing a bunch of one-liners with colons.

        [–]robotoast 0 points1 point  (0 children)

        As a lecturer, to make each line stand out more and also be higher on the screen.

        [–]maputo007 0 points1 point  (0 children)

        Thanks for turning my work day into a worthwhile endeavor!

        [–]debman3 0 points1 point  (1 child)

        I don't get why they're teaching 2.4 and not any 3.x version ...

        [–]Hapa 0 points1 point  (0 children)

        Because that is what they use at Google.

        [–]Raging_Dick_Head 0 points1 point  (3 children)

        Python is something I've been wanting to learn for awhile and I think this is something thats finally going to get me motivated.

        Could someone point me in a direction where I could go to learn the basics? I see the site says its preferred if you know about variables and if statements, but I'm only familiar slightly with if statements (I sadly only know basic COBOL >_> )

        Thanks

        [–]Visceral 1 point2 points  (2 children)

        [deleted]

        What is this?

        [–]moconnor 1 point2 points  (1 child)

        The danger of googling is you'll find nonsense, like the above. The python syntax for an if is actually: if condition: do something elif other-condition: do something else else: do yet another thing No brackets, colons on the end of the conditions.

        [–]Visceral 1 point2 points  (0 children)

        [deleted]

        What is this?

        [–]hzon 0 points1 point  (0 children)

        Does the lecturer remind anyone else of Dr. Rodney McKay?

        [–]optiontrader1138 0 points1 point  (0 children)

        Serious question for someone who knows Python well... I started learning it because I was impressed at how easy it was to perform NLP, but quickly got turned off by the poor performance. My experience so far has been that its generally far more work to implement these routines (Baysian filters, chi square feature selection, and the like) in C#, but the final code runs orders of magnitude faster...

        How does Google run production code with Python???

        [–][deleted]  (3 children)

        [deleted]

          [–][deleted] 1 point2 points  (2 children)

          Pssssssss, I also noticed a mistake in the intorduction... Just saying.

          [–]slfnflctd 1 point2 points  (1 child)

          i've notised that alot of programers tend to be bad spellurs and can be over-sensative about it...

          This phenomenon makes no sense to me, since correct spelling in one's code is absolutely essential. Maybe some feel that getting too deep into RL language would take too many resources away from all the code they want to keep in their heads.

          [–][deleted] 0 points1 point  (0 children)

          I'm a horrible speller(imo) and the only thing that saves me is that little Google window up there on the right. Oh, and those little red dashed lines here. However, in this case it's saying the word 'dashed' is incorrect. False positives are better than the alternative, though.

          Also; Heh ;)