Дефинира фунцията, името й и параметрите, които приема. (за динамични езици - Python, Ruby, JS)
Пример:
def print(string)| from sys import argv | |
| def cat(filename): | |
| file_contents = '' | |
| try: | |
| with open(filename, 'r') as f: | |
| file_contents = f.read() | |
| except FileNotFoundError: | |
| return 'File {} not found.'.format(filename) |
| import subprocess | |
| def main(): | |
| jps_processes = subprocess.check_output(["jps"]).split("\n") | |
| for line in jps_processes: | |
| if not "jps" in line.lower() and not "eclipse" in line.lower(): | |
| line = line.split() | |
| try: | |
| process_id = line[0] |
| import gdata.youtube | |
| import gdata.youtube.service | |
| # Dependencies: | |
| # - Python==2.7 | |
| # - gdata==2.0.18 | |
| # - google-api-python-client==1.2 | |
| from selenium import webdriver | |
| from selenium.webdriver.common.keys import Keys | |
| from selenium.webdriver.support.ui import Select | |
| from selenium.webdriver.common.keys import Keys | |
| from subprocess import call | |
| from os.path import exists | |
| from urllib.request import urlretrieve | |
| from os import remove | |
| from subprocess import call |