-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pythonstartup
33 lines (33 loc) · 1010 Bytes
/
.pythonstartup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import readline
import rlcompleter
import atexit
import os
import sys
readline.parse_and_bind('tab: complete')
histfile = os.path.join(os.environ['HOME'], '.pythonhistory{}'.format(sys.version[0]))
try:
readline.read_history_file(histfile)
except IOError:
pass
atexit.register(readline.write_history_file, histfile)
del histfile
del atexit, readline, rlcompleter
# leaving sys, os and adding a few other useful
if not os.environ.get('IN_REGRTEST'):
import re
import datetime
import time
__autoimported__ = ['sys', 'os', 're', 'datetime', 'time']
try:
import asyncio
__autoimported__.append("asyncio")
from typing import *
__autoimported__.append("typing*")
from pathlib import Path
__autoimported__.append('Path')
from dataclasses import dataclass
__autoimported__.append('dataclass')
except ImportError:
pass
print('Auto-imported for your convenience:')
print(', '.join(sorted(__autoimported__)))