我正在尝试创建一个纯HTML和基于CSS的布局,它显示左侧页面的主要内容(扩展到页面的整个宽度,减去框)和右侧的小框,用于导航或某种信息.以下是导致问题的代码示例,其中描述了以下问题:
<!DOCTYPE HTML>
<html lang="en" dir="ltr">
<head>
<title>Floating Div Madness upon Window Resize</title>
<style>
* {margin:0; padding:0}
body {margin:20px; font-size:0px; color:#000000}
div.page {margin-right:120px; background-color:#AAAAFF; float:left}
div.wide {width:300px; background-color:#AAFFAA}
div.box {width:100px; margin-left:-100px; background-color:#FFAAAA; float:left}
h1 {font-size:x-large}
p {padding-bottom:5px; font-size:small}
</style>
</head>
<body>
<div class="page">
<h1>MAIN PAGE</h1>
<p>This is the main portion of the page (light blue). It is currently floated left with a right margin of 120px, to account for the box (light red) as well as the white …Run Code Online (Sandbox Code Playgroud) 我正在开发一个简单的函数来在 node.js 中创建基于控制台的提示,而无需使用一堆额外的库:
\n\n\xe2\x80\x9c\xe2\x80\x9c\xe2\x80\x9c
\n\nfunction prompt(text, callback) { // Text can be a question or statement.\n \'use strict\';\n var input, output;\n\n process.stdout.write(text + \' \');\n process.stdin.addListener(\'readable\', function read() { // Stream type *must* be correct!\n input = process.stdin.read();\n if (input) { // Wait for actual input!\n output = input.toString().slice(0, -2); // Slicing removes the trailing newline, an artifact of the \'readable\' stream type.\n process.stdout.write(\'You typed: \' + output);\n process.stdin.pause(); // Stops waiting for user input, else the listener …Run Code Online (Sandbox Code Playgroud) 对于导入的模块,help(<module_name>)在解释器中调用将打印模块的描述;通常,这是一个文档字符串,但如果模块以注释开头,它将作为描述传递。在未导入的脚本中(即任何带有__name__of的脚本__main__),调用print(__doc__)将给出类似的结果——但前提是存在文档字符串;它不会像help()那样拉任何评论。
那么我如何调用help()脚本本身并获取描述,特别是如果没有正确的文档字符串而只有注释?
css ×1
css-float ×1
html ×1
interpreter ×1
javascript ×1
node.js ×1
python ×1
python-3.x ×1
resize ×1
stdout ×1