< H2 > purpose < H2 > can dynamically call different py files, pass in parameters and get return parameters. Here is the imaginary implementation. a.py: path_file = b.py -sharp py para_in = 123 para_out = xxx(path_file,para_in) -sharp pat...
problem description I read the difference data from two different excel, and then put them into a new excel. It is normal to display a column of ID number under IDE, but it becomes a scientific counting method in excel. Is there a way to make a column...
the following code opens the yahoo.com home page and outputs all the text in the p tag import urllib.request import lxml.html chaper_url="https: www.yahoo.com " headers = { User-Agent : Mozilla 5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko 2...
I successfully created a repository, in Github and submitted the code. but when I update the code and do the commit operation, the log display is successful. but there is no update code in repository. what is the reason, please? ...
def scope_test(): def do_local(): spam = "local spam" def do_nonlocal(): nonlocal spam spam = "nonlocal spam" def do_global(): global spam spam = "global spam" spam = &...
problem description Fields of the database: uid, year, quarter, score 1 2018 4 1 2018 3 1 2018 3 2 2017 5 credits are counted on a quarterly basis, so points for a quarter need to be summed up. ...
class A(): pass if xxxx( A ): print( A exists ) else: print("A not exists")...
as the title I use the mac operating system, and have just come into contact with python . I have installed 3.6.1 before, but now the latest version of 3.6.x is 3.6.6 . I want to upgrade 3.6.1 in the system to 3.6.6 . Can you download and i...
operating system cetnos7 python3.7 scrapy crawl my crawler 2018-07-12 08:49:04 [scrapy.utils.log] INFO: Scrapy 1.5.1 started (bot: mm) 2018-07-12 08:49:05 [scrapy.utils.log] INFO: Versions: lxml 4.2.3.0, libxml2 2.9.8, cssselect 1.0.3, parsel 1.5.0, w...
problem description I want to execute the SQL script directly to initialize the database when initializing the flask application. the database is Postgresql. the environmental background of the problems and what methods you have tried flask tutor...
the environment variable has been set and the initialization file has been created, why is it still prompted that the module cannot be found? (Flask-Practice) ydx@ydx-PC:$ ls app config config.py instance LICENSE.md README.md requirements.txt (Fl...
if divided, then show how to write relative to import and how to write relative to import. ...
recently, I was learning about crawlers, and then I used get to connect to the web page, and then I asked a lot of questions. I said one by one, when I get, I added the following information params = header header = {user-agent: xxxx} the resulting te...
o = bytes ( helloworld , utf-8 ) r = o.center print (r) the second line of python code above reported an error. The error prompt is as follows: r = o.center TypeError: center () argument 2 must be a byte string of length 1, not str The ...
question 1: is it normal to start by printing the following information? [D 180708 22:10:53 callback:161] Added: { callback : < bound method Connection._on_connection_error of < pika.adapters.tornado_connection.TornadoConnection object at 0x11043c8d0...
I display such an error after executing according to the following code. class Game (object): top_score = 0 @staticmethod def __init__(self, player_name): self.player_name = player_name @staticmethod def show_help(): print(":") @...
uses the scrapy.Request method to collect pages, but nothing is done. import scrapy def ret(response): print( start print ) print(response.body) url = https: doc.scrapy.org en latest intro tutorial.html v = scrapy.http.Request(url=url,...
it is friendly to install Anaconda, with qtconsole code coloring. The base (root), of the default environment for Anaconda does not display virtual environments created with python-m venv . now want to enter the virtual environment in qtconsole, how t...
since python2, is installed by default in mac, now I want to use python3, , so I installed a python3, prompt Installed kernelspec python3 in usr local share jupyter kernels python3 on the terminal, indicating that the core installation of python3 is...
this is how aiohttp officially requests a single url. What should I do if I request multiple url and get the content? import aiohttp import asyncio async def fetch(session, url): async with session.get(url) as response: return await respon...