Later I experimented with a simple python program with no import,which use same way to generate executable program,and It can use
def sum(a,b):
sum1 = a + b
return sum1
a = int(input('please enter a number'))
b = int(input('please enter a number again:'))
m = sum(a,b)
print(m)
This does not work:
import requests
from bs4 import BeautifulSoup
import os
from io import StringIO
while True:
print('please enter the amount of page you want to download')
page = input()
url = 'http://a.qidian.com/?size=-1&sign=-1&tag=-1&chanId=-1&subCateId=-1&orderId=2&update=-1&page='
header = {'User-Agent': "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0",
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
'Accept - Language': "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
'Accept - Encoding': "compress, compress",
'Connection': "keep-alive"}
string = StringIO()
try:
for i in range(1, int(page) + 1):
#expression
(sorry,my English is poor,so my expression bad)