Some Fuctions And What They Do - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Python Programming Language (https://www.supportforums.net/forumdisplay.php?fid=32) +---- Thread: Some Fuctions And What They Do (/showthread.php?tid=1718) |
Some Fuctions And What They Do - nevets04 - 10-17-2009 open("file.txt", "w") Opens a file with text reading to be written to it Common use: x = open("file.txt", "w") raw_input("Text") Takes input from user. Common use: x = raw_input("") x.write(Text) Write text to what ever file x opens. Commonly used with: x = open("file.txt", "w") input("Text") Takes input from user. Common use: x = input("") print "Text" Displays text +, -, *, / Addition, Subtraction, Multiplication, Division Import module imports a module. Common Use: import random random.choice(a) Choose a random quote or variable from a string. Commonly used with a = ['1','2'] range(a,b,c) Displays numbers a through b counting by c. Common use for i in range(y,z,x): /n Makes a new line os.system("clear") Clears the terminal. Commonly used with: import os RE: Some Fuctions And What They Do - L0iz - 10-18-2009 I think you should explain the difference between input and raw_input. Nice, anyways. |