Results 1 to 4 of 4
  1. #1
    saiprem's Avatar
    Join Date
    May 2012
    Gender
    male
    Location
    India
    Posts
    246
    Reputation
    10
    Thanks
    11
    My Mood
    Angelic

    Setting up Python and creating a simple Array + addons

    First of all you need to go to Pythons website: Python Programming Language – Official Website
    Secondly you need to download Python so you can run it's code of course. Download Python



    Here is something simple you can create in Python:

    Code:
    print'hello'
    b = 'aasdfsadf' #Prints
    print(b)
    # Or you can do
    b
    # Is a comment
    Now here is something I learned from a website in python you can import anywhere. For example

    Code:
    a = 'b'
    c = 'a'
    import ctypes
    You can also create messageboxes in python.

    Code:
    import ctypes
    MessageBox = ctypes.windll.user32.MessageBoxA # You have to use MessageBoxA!
    MessageBox = (None, 'Hello', 'Python', 0) # Creates the messagebox
    This is basic stuff as you know, now for the grand finale the simple array.


    Code:
    a = 'yes' #Variable
    if a:
     print a
     print'yes'
     print'no' #Prints variable a
     numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] #Array
    if 8:
        print'8'
        print numbers #Prints the array
        print'done' #Just my little finisher
    The explanation is in the comments of the code (#).

    Python is an object oriented programming language that is free of course it is nice and clean, I'm pretty sure many of you would like it if you gave it a try. I'm not sure why everybody always wants to try a language like c++ over Python, python is a pretty good language. And you know many interactive games are created by python.

  2. The Following 2 Users Say Thank You to saiprem For This Useful Post:

    Crumbs (04-02-2013),IOnlyThankAutisticRetards (07-18-2013)

  3. #2
    TheSolidGamer's Avatar
    Join Date
    Nov 2012
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    Is it just me or did you use both python 2 and 3

    Ive been learning Python 2 and print goes like:

    print "string"

    and in Python 3:

    print("string")

    In your first example you do it Python 2 style, then in the last example, you do it Python 3 style

    If I am right consider my months of learning python a success

  4. #3
    Crumbs's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Location
    if(evt.getID() == 200) {
    Posts
    568
    Reputation
    36
    Thanks
    353
    My Mood
    Amazed
    Nice tutorial!. I have to use python to write script for netw0rk Administrat0r

  5. #4
    wEFTwefwfefesfefe's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    1,922
    Reputation
    72
    Thanks
    490
    My Mood
    Cold
    I use Python in School

    But i like VB better

Similar Threads

  1. Replies: 36
    Last Post: 04-23-2011, 08:00 AM
  2. Would any1 like to get together and create a MOD team?
    By NeonNoise in forum Combat Arms Discussions
    Replies: 14
    Last Post: 11-30-2009, 10:47 PM
  3. Fully Pro and Overdone or Simple?
    By Richo in forum Art & Graphic Design
    Replies: 13
    Last Post: 08-26-2009, 04:01 AM
  4. Replies: 5
    Last Post: 06-30-2009, 04:35 AM
  5. Monty Python and the Holy Grail
    By BluSpex in forum General
    Replies: 18
    Last Post: 08-16-2007, 07:49 PM