"""
IDLE main entry point

Run IDLE as python -m idlelib
"""


# # # # import idlelib.pyshell
# # # # idlelib.pyshell.main()


# # # # # # # # # # # # # # # # ##############上面是idlelib的__main__的内容 
import os
thispath=os.path.dirname(os.path.abspath(__file__))
print(thispath)
print(thispath)
print(thispath)

import sys
# print(sys.argv)
if len(sys.argv) >=2:
	# sys.argv[1]='333'   #执行不报错。 但貌似无效。 估计因为sys是只读的
	nameee=sys.argv[1]
else:
	import random
# 	nameee='new-'+str(random.randint(1001,9999))+'.py'

	
# open('ttt.txt','w').write(nameee)
import subprocess
# param=thispath+'\..\..\..\pythonw.exe -m idlelib'
# param=thispath+'\..\..\..\python.exe -m idlelib'
param=thispath+'\..\..\python.exe -m idlelib'

# print(param)
# print(param)
# print(param)

subprocess.Popen(param, shell=True)

# subprocess.Popen(thispath+'\\..\\..\\..\\pythonw.exe -m idlelib "'+nameee+'"', shell=True)



# # # # # # # # # # # # #下面 是thonny原代码

