Results 1 to 10 of 10

Thread: "Batteries Included!"

  1. #1
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default "Batteries Included!"

    http://www.python.org

    Lookie: I found a language more powerful and more simple than Visual Basic.


    Its called Python, and you may have heard of it. I've been using it for a while as a 'scripting' language.


    Here are the main reasons I like it:

    • It has a very good standard library, with tonnes of other add ons to it made by other people
    • You don't have to compile it into an executable. This makes it good for testing.
    • You can't forget something like "end;", because it doesn't have any! It uses some thing where it looks at the tabs, etc.
    • It is harder to be mixed up with types: there is no type declarations, and casting is simple.
    • Any platform! Just send over the *.py files, and your done!


    Heres a simple sample that returns the amount of players playing.

    Code:
    import urllib2
    
    for line in urllib2.urlopen('http://www.runescape.com/title.ws'):
    	if 'There are currently' in line and 'playing!' in line:
    		print line
    
    Output:
         There are currently ***** people playing!
    P.S.: Be careful when typing http://www.python.org in, as the .com site is porn.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  2. #2
    Join Date
    May 2006
    Location
    Helsinki, Finland (capital)
    Posts
    269
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I like python too, cool compiler = <3

  3. #3
    Join Date
    Jun 2007
    Location
    Kentucky, United States of America
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Meh, I'm trying to get going with this, but I can't get it to re-open my scripts after I save them. I have the path set correctly, and I'm using the latest non-dev version of Python.

    I love the language, but I just want to be able to save all my scripts in a file so that I can just call on them, rather than making them into functions that I have to copy and paste into my main one.

    Any help would be much appreciated. I'm just getting started with it, not too great with the syntax yet.

  4. #4
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Python can get really complicated unfortunately when you want to do more complex tasks, kinda obvious I know, but it gets extreme in length. I have been using python pretty much since its development. I use it to create and edit Counter Strike mods mwaha.

  5. #5
    Join Date
    Jun 2007
    Location
    Kentucky, United States of America
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, any help then? Even when I import the module I saved, I can't just run it again by typing the name.

    Am I missing the command before I type the name of my module or what?

  6. #6
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    You might need to have them in the same directory, but to run them you do 'python SCRIPTDIR'
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  7. #7
    Join Date
    Dec 2007
    Location
    Somewhere in Idaho
    Posts
    480
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    python is good for simple scripts, and even more complex ones. But please don't write a game in it, it is way too slow for that (see fretsonfire).

  8. #8
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    having it based upon tabs seems kinda...not cool.

    but other than that and a lack of clear tutorials, as far as i can find (minus the one on the python website) it looks pretty O.K.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  9. #9
    Join Date
    Dec 2006
    Location
    SC
    Posts
    692
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I like a more formal syntax . I saw some other language similar to this and didn't like it.

  10. #10
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    P.S.: Be careful when typing http://www.python.org in, as the .com site is porn.
    Ohh, i think i know how you found out about python then xD

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 05-17-2008, 12:48 PM
  2. action="www.site.com" method="post"
    By Jason2gs in forum General
    Replies: 4
    Last Post: 05-17-2007, 11:50 PM
  3. Replies: 3
    Last Post: 04-19-2007, 03:44 AM
  4. Replies: 5
    Last Post: 10-26-2006, 11:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •