I was wondering if the position of import statements in a python program has any affect on performance. For example if I have this
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import requests
from flask import render_template, request, Flask, session, Markup, jsonify, send_from_directory
from wit import Wit
from os import urandom
from datetime import datetime
from uuid import uuid1
from random import choice
from FAAWrapper import FAA_API
from bs4 import BeautifulSoup
def function1():
from OpenSSL import SSL
from fuzzywuzzy import process
continue
def function2():
continue
Would performance be adversely affected by calling function1() being that function1 contains import statements? Should all of my imports be placed at the top or does the import only happen once the first time the function is called?