Just import it
import myDict print myDict.airportCode
or, better
from myDict import airportCode print airportCode
Just be careful to put both scripts on the same directory (or make a python package, a subdir with __init__.py
file; or put the path to script.py on the PYTHONPATH; but these are “advanced options”, just put it on the same directory and it’ll be fine).
Related Posts:
- `from … import` vs `import .` [duplicate]
- Can’t import my own modules in Python
- Import Error: No module named numpy
- ImportError: No module named tensorflow
- What is __init__.py for?
- What is __init__.py for?
- beyond top level package error in relative import
- beyond top level package error in relative import
- Importing modules from parent folder
- Importing modules from parent folder
- beyond top level package error in relative import
- ImportError: No module named ‘pygame’
- ImportError: No module named ‘pygame’
- Python – from . import
- How do I unload (reload) a Python module?
- filename.whl is not a supported wheel on this platform
- Call a function from another file?
- Python – Module Not Found
- Python 3: ImportError “No Module named Setuptools”
- What’s the difference between a Python module and a Python package?
- Python can’t find module in the same folder
- from PIL import Image – ImportError: No module named PIL
- Importing variables from another file?
- importing external “.txt” file in python
- “ImportError: No module named site” on Windows
- What’s the difference between a Python module and a Python package?
- What does “Symbol not found / Expected in: flat namespace” actually mean?
- ImportError: No module named six
- Purpose of python antigravity module
- Python name ‘os’ is not defined
- Difference between import tkinter as tk and from tkinter import
- Python 3.6 import requests
- Python way to clone a git repository
- Error: No module named ‘fcntl’
- How can I install the Beautiful Soup module on the Mac?
- ModuleNotFoundError: What does it mean __main__ is not a package?
- Replacements for switch statement in Python?
- Correct way to write line to file?
- How to read a file line-by-line into a list?
- How do I sort a dictionary by value?
- How to install pytorch in Anaconda with conda or pip?
- How can I remove a key from a Python dictionary?
- What does numpy.random.seed(0) do?
- How do I check if a variable exists?
- Is there a label/goto in Python?
- Why do I get “Pickle – EOFError: Ran out of input” reading an empty file?
- Getting TypeError: __init__() missing 1 required positional argument: ‘on_delete’ when trying to add parent table after child table with entries
- Python Pandas Counting the Occurrences of a Specific value
- What does the c underscore expression `c_` do exactly?
- Count unique values per groups with Pandas
- Get unique values from a list in python [duplicate]
- How do you decode Base64 data in Python?
- What is the difference between Jupyter Notebook and JupyterLab?
- Python 3 ImportError: No module named ‘ConfigParser’
- How does Python’s super() work with multiple inheritance?
- How can the Euclidean distance be calculated with NumPy?
- Tkinter understanding mainloop
- Embedding in pytorch
- Check string “None” or “not” in Python 2.7
- re.search().TypeError: cannot use a string pattern on a bytes-like object
- Cannot uninstall Tensorflow
- Add Legend to Seaborn point plot
- Get key by value in dictionary
- How to add multiple values to a dictionary key in python?
- Where can I find a list of the Flask SQLAlchemy Column types and options?
- Use of “global” keyword in Python
- Convert a Pandas DataFrame to a dictionary
- Python: Write array values into file
- use np.random.multinomial() in python
- pg_config executable not found
- Import error when trying to import tensorflow with gpu
- Removing Punctuation From Python List Items
- Python Array Rotation
- standard_init_linux.go:178: exec user process caused “exec format error”
- How to find char in string and get all the indexes?
- How can I create an array/list of dictionaries in python?
- How to unnest a nested list
- How to sort a list/tuple of lists/tuples by the element at a given index?
- What can lead to “IOError: [Errno 9] Bad file descriptor” during os.system()?
- Shebang doesn’t work with python3
- Directing print output to a .txt file
- How to get a value from a cell of a dataframe?
- TypeError: can only concatenate str (not “float”) to str
- Converting a sentence to piglatin in Python
- write multiple lines in a file in python
- JSON object must be str, bytes or bytearray, not dict
- How can I create an object and add attributes to it?
- Checking to see if a string is an integer or float
- How to create a list of objects?
- How does cv2.boundingRect() function of OpenCV work?
- Convert Unicode to ASCII without errors in Python
- python-How to set global variables in Flask?
- How do I install pip on macOS or OS X?
- NameError: name ‘get_ipython’ is not defined
- Equivalent to matlab’s imagesc in matplotlib? [duplicate]
- bash: syntax error near unexpected token `(‘ – Python
- Find all files in a directory with extension .txt in Python
- “public” or “private” attribute in Python ? What is the best way?
- How to search for a string in text files?
- TypeError: ‘zip’ object is not subscriptable