What is python primarily used for?

Discussion in 'Mac Programming' started by Macman1993, Jul 28, 2008.

  1. Macman1993 macrumors 6502


    Nov 23, 2007
    I'm thinking of learning python but before I go out and get a book I just want to know what its primarily used for. So what is it primarily used for?
  2. TEG macrumors 604


    Jan 21, 2002
    Langley, Washington
  3. Sayer macrumors 6502a


    Jan 4, 2002
    Austin, TX
    Its used to make web apps by people who think PERL is not verbose enough and ruby is a "toy" language.

    Basically everyone has their own pet language and anything else is junk to them for any reason.

    I use whatever language will get the job done, because in the end that's the whole point, accomplishing work of some sort.
  4. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
    Python is used in scientific computing quite a bit now these days.
  5. HiRez macrumors 603


    Jan 6, 2004
    Western US
    Python, Ruby, Perl, and PHP all have pretty similar capabilities when you get down to it, so it's largely a matter of style. Python has a fairly clean and highly readable syntax IMO, and is concise while maintaining that readability. It has excellent string/text handling, and I like to use it for scripting jobs (batch processing filenames or text logs for example). With Django and/or Google's AppEngine, it's a pretty good alternative to Ruby+Rails for running database-aware server-side web applications too.
  6. kanenas macrumors newbie

    Jun 20, 2008
    My recommendation: go for it

    Learning python certainly won't hurt. In my opinion, the more programming languages you learn, the more flexible your mind becomes about programming and it's easier to learn new languages. The only problem is you can start mixing syntax or semantics--eg I sometimes need a reminder if I should use 'eq' or '==' compare strings, or concatenate strings with '+', '.' or '&', or forget if short-circuit boolean operators return the argument value (as in Perl, JS or Python) or cast the value to boolean (like in PHP, C).

    If you're looking for a language to help you learn programming, Python is a fine choice.

    If you're worried about the investment of time and money, start with the official Python tutorial.
  7. Catfish_Man macrumors 68030


    Sep 13, 2001
    Portland, OR
    Google uses Python-wrapped C++ quite a bit. It's an interesting approach.
  8. AlmostThere macrumors 6502a

    It is certainly not all web programming - http://www.tlb.org/scooter.html used python.

    It is important to remember that there is very little a language like Python can't do, and even where it is not an optimum overall solution, it is more than capable of building prototype systems.
  9. kanenas macrumors newbie

    Jun 20, 2008
    Blender, Gimp, Linux, finances, security

    More uses: plugins for (eg) Blender and GIMP, though you can also write GIMP plug-ins in Scheme, Perl and C/C++. Some linux distros use Python for installation & administration tools. Red Hat, I believe, makes extensive use. A friend of mine uses Python for bulk data translation & transfer at financial institutions. Finally, it's also used for IT security analysis.

    Like Algol, Fortran, C, C++, Java, Tcl/Tk, Smalltalk and VB, Python doesn't seem to have a primary use. I'm should probably include C# and ObjC in the list, but you could argue their primary usage is for Win32 and Mac programming, respectively.

    Edit: old thread, but here's a new use: controlling 15 ton robotic grapples (wiimote optional).
  10. Macman1993 thread starter macrumors 6502


    Nov 23, 2007
    Thanks for all the input guys. Today I ordered the book "Python Programming For The Absolute Beginner" so now I can start programing which is something I have wanted to do for a while.
  11. lee1210 macrumors 68040


    Jan 10, 2005
    Dallas, TX
    I started writing about this at length yesterday, but gave up because I was rambling. I'll try to be more concise.

    Python is used for programming. Every turing-complete (maybe I should say general purpose, due to a lack of infinite tape, but w/ virtual memory, local disk, network storage, and internet storage we have a practically infinite tape) language can accomplish the same task. The differences really come from:
    Clarity of Syntax
    Memory Management
    Libraries available
    APIs available

    If you want to write a web server in python, you certainly can. If you want to write web application, it seems like there are already libraries/frameworks in place to make this easy. If you want to script things, have at it. Write a client side business application? Sure, as long as you can bind to the GUI underpinnings of the targeted OS.

    One thing that seems to shape common uses of a language is whether the language is compiled or interpreted (or always compiled at runtime). Languages that are interpreted or compiled at runtime like Perl and Python seem to be very popular for scripting, possibly because of the write-compile-run-debug cycle having a step removed. This is of course not always the case. Where I work, we have a very large web-based application that uses Perl for the dynamic HTML generation and API layer.

    The times when language really matter are when you must use a particular API for a particular task. You can always make wrappers, but you'll have to write some code to interface with the API that you then wrap in something else. An example is Objective-C, and the Cocoa API.

    Good luck. I'm not familiar with Python but if you can, try to learn the basics before you dive headlong into Object-Orientation.

  12. complexgeek macrumors newbie

    Jun 1, 2006
    I'm a big fan of Python, because I've found it to be so versatile. I've written web applications, CLI scripts and desktop applications using it, and every time found it to be an easy yet powerful language to program in.

    I'm currently learning the Python bindings for Cocoa, and I've been writing some tutorials/how-tos as I go, because the documentation for it is close to non-existent.
  13. yeroen macrumors 6502a


    Mar 8, 2007
    Cambridge, MA
    Eric Raymond in 'The Art of UNIX Programming', available online for free, has an appraisal of Python (alongside appraisals of C, C++, Perl, Java, etc). He also cites case studies of projects written in *x* language.

    I'd take his C++ assessment with a grain of salt.
  14. johnselmos macrumors newbie

    Oct 7, 2009
    I use it for web development - Django specifically. But its useful for just about anything. :)
  15. Martster macrumors newbie

    Feb 9, 2008
    Van Diemen's Land
    another python fan

    Am a Python fan too.

    Easy syntax to write
    easy to read
    quick to get a program up and running
    lots of great Libraries

    check out PIL (Python Image Library)
    and NodeBox (http://www.nodebox.net/code/index.php/Home)

    and have fun
  16. teagls macrumors regular

    May 16, 2013
    The one thing I didn't really see mentioned is that Python has a lot of packages that you can easily download which allow you to do anything. Python is very useful for processing textual data for natural language processing. Another good example is for Machine Learning. There are numerous packages for machine learning that you would be hard pressed to find for other languages.
  17. cbdilger macrumors newbie

    Oct 15, 2013
    West Lafayette, IN
    I know a lot of researchers who use Python to process text and analyze data, often before or in combination with R. Many of them used Perl for this purpose in the past (and some still do).
  18. firewood macrumors 604

    Jul 29, 2003
    Silicon Valley
    Python is not only used for professional web development, but seems to have taken the place of Basic, Forth, MUMPS, and other interpretive languages used by non-professional-programmers to learn and script various science and learning activities. Python seems to be used a lot for university level courses in big data and machine learning courses; in scripting educational experiments using Raspberry Pi's; as well in a few books for teaching young kids how to code. There's even an embedded version for (relatively) tiny microcontrollers.

    Python sees quite a wide range of popular uses these days, putting it at #5 to #6 on the TIOBE index of computer language popularity, currently well above Objective C and Swift.
  19. sero macrumors member

    Aug 28, 2008
    I like python a lot.. and I bet the OP has mastered python in the nearly 8 years since they posted here!
  20. jaduff46 macrumors 6502


    Mar 3, 2010
    Second star on the right....
    Hard to believe people don't check to see how dated a thread is.

    But a few nice comments on the merits of the language.

    I picked up myself several years ago (pre-retirement) for a couple of "plumbing" projects at work.

Share This Page

19 July 28, 2008