在我的 gatsby 项目中,我收到了将样式导入文件pages/index.js 的警告
import { Link } from "gatsby"
import React from "react"
import Layout from "../components/Layout"
import style from "../styles/home.module.css"
export default function Home() {
return (
<Layout>
<section className={style.header}>
<div>
<h2>Design</h2>
<h3>Develop & deploy</h3>
<p>Become web ninja</p>
<Link to="/projects" className={style.btn}>
My Portfolio Projects
</Link>
</div>
<img src="banner.png" alt="site banner" style={{ maxWidth: "80%" }} />
</section>
</Layout>
)
}
Run Code Online (Sandbox Code Playgroud)
warn Attempted import error: '../styles/home.module.css' does not contain a default export (imported as 'style').
我正在使用模块样式表。所以home.module.css看起来像这样 …
我正在查看Popen.communicate()的官方文档。
p = subprocess.Popen('echo hello',stdout=subprocess.PIPE,stderr=subprocess.PIPE,shell=True,universal_newlines=True)
r,e = p.communicate()
Run Code Online (Sandbox Code Playgroud)
我想知道在什么情况下它将返回字符串输出以及在什么情况下它将以字节为单位返回。(有例子会很棒)
在上面的例子中,r类型是字符串。
Popen.communicate(input=None, timeout=None)
Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate and set the returncode attribute. The optional input argument should be data to be sent to the child process, or None, if no data should be sent to the child. If streams were opened in text mode, input must be a string. …Run Code Online (Sandbox Code Playgroud)