+ Reply to Thread
Results 1 to 3 of 3

Thread: Python 3000 help

  1. #1
    Learning Programmer deer dance is an unknown quantity at this point deer dance's Avatar
    Join Date
    Feb 2009
    Location
    Indiana
    Age
    16
    Posts
    40

    Python 3000 help

    I'm new to Python and I cannot figure out how to use if statements and I'm growing desperate

    Could someone with some more experience in the language help me out?

    Here's the code I'm using
    Code:
    # mOS Beta v0.1
    
    help1 = HELP
    dir1 = DIR
    
    input("Enter Command: ")
    # HELP Command
        if(help1)
            print("Common Commands:\n")
            print("HELP - list common commands")
            print("DIR - open directory navigator")
    # Directory Manager        
        elif(dir1)
            input("Specify Directory: ")
            in input("Select file or folder: ")
            in input("Select file or folder: ")
            in print("Opening file...")
        else print("Improper Command; Type [HELP] for a list of common commands")
    input()
    Ameteur programmer
    HTML Expert
    Official Lunatic

  2. #2
    Programming Professional PythonPower is on a distinguished road PythonPower's Avatar
    Join Date
    Feb 2009
    Location
    England
    Posts
    228

    Re: Python 3000 help

    Something like this? (See this for more information.)

    Code:
    # Input a command into the variable 'command'
    command input('Enter a command: ')

    # If 'command' = "help"
    if command == 'help':
        print(
    'Commands available:\n\nhelp\ndir\n...')

    # If 'command' = "dir"
    elif command == 'dir':
        print(
    'You are in root directory.')

    # Not a valid command
    else:
        print(
    'Improper command - see help for complete list.'

  3. #3
    Learning Programmer deer dance is an unknown quantity at this point deer dance's Avatar
    Join Date
    Feb 2009
    Location
    Indiana
    Age
    16
    Posts
    40
    Thank you. Unfortunately I can't test it now but when I get the chance I'll let you know how it goes

    As for this:
    Code:
    \n\nhelp\ndir\n...
    I know that '\n' is the new line escape, but as for the rest, what is it?

    I've also seen that documentation, but I couldn't make heads or tails of that thing.

    Nope. Didn't work.

    Is that possibly Python 2.5 or 2.6?

    Either way, Py3k is absolutely not backwards-compatible with and version of Python 2.

    I've looked at the Python 3000 documentation and edited it to resemble the if statment example, yet still no dice. I'd post the current code, but I'm once again on my iPod.

    Nope. Didn't work.

    Is that possibly Python 2.5 or 2.6?

    Either way, Py3k is absolutely not backwards-compatible with and version of Python 2.

    I've looked at the Python 3000 documentation and edited it to resemble the if statment example, yet still no dice. I'd post the current code, but I'm once again on my iPod.
    Last edited by WingedPanther; 02-11-2009 at 04:20 AM. Reason: Quadrupal posting
    Ameteur programmer
    HTML Expert
    Official Lunatic

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Python resources
    By v0id in forum Python
    Replies: 10
    Last Post: 05-07-2010, 08:57 AM
  2. Power Of Python - What Has Been Written In Python?
    By Raja Sekharan in forum Python
    Replies: 7
    Last Post: 02-02-2009, 11:55 AM
  3. Python frequently asked questions
    By v0id in forum Python
    Replies: 1
    Last Post: 08-06-2008, 07:05 AM
  4. embedding python in C
    By BlueDream in forum Python
    Replies: 0
    Last Post: 05-04-2008, 07:42 AM
  5. Python Collection
    By reachpradeep in forum Python
    Replies: 1
    Last Post: 03-03-2007, 12:50 PM