{"id":46316,"date":"2023-06-30T19:35:22","date_gmt":"2023-03-22T08:14:56","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/"},"modified":"2024-04-30T11:23:42","modified_gmt":"2024-04-30T03:23:42","slug":"46316-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/","title":{"rendered":""},"content":{"rendered":"<p>Jupyter \u3067\u30de\u30b8\u30c3\u30af\u30b3\u30de\u30f3\u30c9\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3092\u77e5\u3063\u305f\u306e\u3067\u8a18\u9332\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>%quickref\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d63e437434c4406d03301\/2-0.png\" alt=\"image.png\" \/><\/div>\n<p>\u51fa\u529b\u3055\u308c\u308b\u60c5\u5831<\/p>\n<pre class=\"post-pre\"><code>IPython -- An enhanced Interactive Python - Quick Reference Card\r\n================================================================\r\n\r\nobj?, obj??      : Get help, or more help for object (also works as\r\n                   ?obj, ??obj).\r\n?foo.*abc*       : List names in 'foo' containing 'abc' in them.\r\n%magic           : Information about IPython's 'magic' % functions.\r\n\r\nMagic functions are prefixed by % or %%, and typically take their arguments\r\nwithout parentheses, quotes or even commas for convenience.  Line magics take a\r\nsingle % and cell magics are prefixed with two %%.\r\n\r\nExample magic function calls:\r\n\r\n%alias d ls -F   : 'd' is now an alias for 'ls -F'\r\nalias d ls -F    : Works if 'alias' not a python name\r\nalist = %alias   : Get list of aliases to 'alist'\r\ncd \/usr\/share    : Obvious. cd -&lt;tab&gt; to choose from visited dirs.\r\n%cd??            : See help AND source for magic %cd\r\n%timeit x=10     : time the 'x=10' statement with high precision.\r\n%%timeit x=2**100\r\nx**100           : time 'x**100' with a setup of 'x=2**100'; setup code is not\r\n                   counted.  This is an example of a cell magic.\r\n\r\nSystem commands:\r\n\r\n!cp a.txt b\/     : System command escape, calls os.system()\r\ncp a.txt b\/      : after %rehashx, most system commands work without !\r\ncp ${f}.txt $bar : Variable expansion in magics and system commands\r\nfiles = !ls \/usr : Capture system command output\r\nfiles.s, files.l, files.n: \"a b c\", ['a','b','c'], 'a\\nb\\nc'\r\n\r\nHistory:\r\n\r\n_i, _ii, _iii    : Previous, next previous, next next previous input\r\n_i4, _ih[2:5]    : Input history line 4, lines 2-4\r\nexec _i81        : Execute input history line #81 again\r\n%rep 81          : Edit input history line #81\r\n_, __, ___       : previous, next previous, next next previous output\r\n_dh              : Directory history\r\n_oh              : Output history\r\n%hist            : Command history of current session.\r\n%hist -g foo     : Search command history of (almost) all sessions for 'foo'.\r\n%hist -g         : Command history of (almost) all sessions.\r\n%hist 1\/2-8      : Command history containing lines 2-8 of session 1.\r\n%hist 1\/ ~2\/     : Command history of session 1 and 2 sessions before current.\r\n%hist ~8\/1-~6\/5  : Command history from line 1 of 8 sessions ago to\r\n                   line 5 of 6 sessions ago.\r\n%edit 0\/         : Open editor to execute code with history of current session.\r\n\r\nAutocall:\r\n\r\nf 1,2            : f(1,2)  # Off by default, enable with %autocall magic.\r\n\/f 1,2           : f(1,2) (forced autoparen)\r\n,f 1 2           : f(\"1\",\"2\")\r\n;f 1 2           : f(\"1 2\")\r\n\r\nRemember: TAB completion works in many contexts, not just file names\r\nor python names.\r\n\r\nThe following magic functions are currently available:\r\n\r\n%alias:\r\n    Define an alias for a system command.\r\n%alias_magic:\r\n    ::\r\n%autoawait:\r\n\r\n%autocall:\r\n    Make functions callable without having to type parentheses.\r\n%automagic:\r\n    Make magic functions callable without having to type the initial %.\r\n%autosave:\r\n    Set the autosave interval in the notebook (in seconds).\r\n%bookmark:\r\n    Manage IPython's bookmark system.\r\n%cd:\r\n    Change the current working directory.\r\n%clear:\r\n    Clear the terminal.\r\n%cls:\r\n    Clear the terminal.\r\n%colors:\r\n    Switch color scheme for prompts, info system and exception handlers.\r\n%conda:\r\n    Run the conda package manager within the current kernel.\r\n%config:\r\n    configure IPython\r\n%connect_info:\r\n    Print information for connecting other clients to this kernel\r\n%copy:\r\n    Alias for `!copy`\r\n%ddir:\r\n    Alias for `!dir \/ad \/on`\r\n%debug:\r\n    ::\r\n%dhist:\r\n    Print your history of visited directories.\r\n%dirs:\r\n    Return the current directory stack.\r\n%doctest_mode:\r\n    Toggle doctest mode on and off.\r\n%echo:\r\n    Alias for `!echo`\r\n%ed:\r\n    Alias for `%edit`.\r\n%edit:\r\n    Bring up an editor and execute the resulting code.\r\n%env:\r\n    Get, set, or list environment variables.\r\n%gui:\r\n    Enable or disable IPython GUI event loop integration.\r\n%hist:\r\n    Alias for `%history`.\r\n%history:\r\n    ::\r\n%killbgscripts:\r\n    Kill all BG processes started by %%script and its family.\r\n%ldir:\r\n    Alias for `!dir \/ad \/on`\r\n%less:\r\n    Show a file through the pager.\r\n%load:\r\n    Load code into the current frontend.\r\n%load_ext:\r\n    Load an IPython extension by its module name.\r\n%loadpy:\r\n    Alias of `%load`\r\n%logoff:\r\n    Temporarily stop logging.\r\n%logon:\r\n    Restart logging.\r\n%logstart:\r\n    Start logging anywhere in a session.\r\n%logstate:\r\n    Print the status of the logging system.\r\n%logstop:\r\n    Fully stop logging and close log file.\r\n%ls:\r\n    Alias for `!dir \/on`\r\n%lsmagic:\r\n    List currently available magic functions.\r\n%macro:\r\n    Define a macro for future re-execution. It accepts ranges of history,\r\n%magic:\r\n    Print information about the magic function system.\r\n%matplotlib:\r\n    ::\r\n%mkdir:\r\n    Alias for `!mkdir`\r\n%more:\r\n    Show a file through the pager.\r\n%notebook:\r\n    ::\r\n%page:\r\n    Pretty print the object and display it through a pager.\r\n%pastebin:\r\n    Upload code to dpaste.com, returning the URL.\r\n%pdb:\r\n    Control the automatic calling of the pdb interactive debugger.\r\n%pdef:\r\n    Print the call signature for any callable object.\r\n%pdoc:\r\n    Print the docstring for an object.\r\n%pfile:\r\n    Print (or run through pager) the file where an object is defined.\r\n%pinfo:\r\n    Provide detailed information about an object.\r\n%pinfo2:\r\n    Provide extra detailed information about an object.\r\n%pip:\r\n    Run the pip package manager within the current kernel.\r\n%popd:\r\n    Change to directory popped off the top of the stack.\r\n%pprint:\r\n    Toggle pretty printing on\/off.\r\n%precision:\r\n    Set floating point precision for pretty printing.\r\n%prun:\r\n    Run a statement through the python code profiler.\r\n%psearch:\r\n    Search for object in namespaces by wildcard.\r\n%psource:\r\n    Print (or run through pager) the source code for an object.\r\n%pushd:\r\n    Place the current dir on stack and change directory.\r\n%pwd:\r\n    Return the current working directory path.\r\n%pycat:\r\n    Show a syntax-highlighted file through a pager.\r\n%pylab:\r\n    ::\r\n%qtconsole:\r\n    Open a qtconsole connected to this kernel.\r\n%quickref:\r\n    Show a quick reference sheet \r\n%recall:\r\n    Repeat a command, or get command to input line for editing.\r\n%rehashx:\r\n    Update the alias table with all executable files in $PATH.\r\n%reload_ext:\r\n    Reload an IPython extension by its module name.\r\n%ren:\r\n    Alias for `!ren`\r\n%rep:\r\n    Alias for `%recall`.\r\n%rerun:\r\n    Re-run previous input\r\n%reset:\r\n    Resets the namespace by removing all names defined by the user, if\r\n%reset_selective:\r\n    Resets the namespace by removing names defined by the user.\r\n%rmdir:\r\n    Alias for `!rmdir`\r\n%run:\r\n    Run the named file inside IPython as a program.\r\n%save:\r\n    Save a set of lines or a macro to a given filename.\r\n%sc:\r\n    Shell capture - run shell command and capture output (DEPRECATED use !).\r\n%set_env:\r\n    Set environment variables.  Assumptions are that either \"val\" is a\r\n%store:\r\n    Lightweight persistence for python variables.\r\n%sx:\r\n    Shell execute - run shell command and capture output (!! is short-hand).\r\n%system:\r\n    Shell execute - run shell command and capture output (!! is short-hand).\r\n%tb:\r\n    Print the last traceback.\r\n%time:\r\n    Time execution of a Python statement or expression.\r\n%timeit:\r\n    Time execution of a Python statement or expression\r\n%unalias:\r\n    Remove an alias\r\n%unload_ext:\r\n    Unload an IPython extension by its module name.\r\n%who:\r\n    Print all interactive variables, with some minimal formatting.\r\n%who_ls:\r\n    Return a sorted list of all interactive variables.\r\n%whos:\r\n    Like %who, but gives some extra information about each variable.\r\n%xdel:\r\n    Delete a variable, trying to clear it from anywhere that\r\n%xmode:\r\n    Switch modes for the exception handlers.\r\n%%!:\r\n    Shell execute - run shell command and capture output (!! is short-hand).\r\n%%HTML:\r\n    Alias for `%%html`.\r\n%%SVG:\r\n    Alias for `%%svg`.\r\n%%bash:\r\n    %%bash script magic\r\n%%capture:\r\n    ::\r\n%%cmd:\r\n    %%cmd script magic\r\n%%debug:\r\n    ::\r\n%%file:\r\n    Alias for `%%writefile`.\r\n%%html:\r\n    ::\r\n%%javascript:\r\n    Run the cell block of Javascript code\r\n%%js:\r\n    Run the cell block of Javascript code\r\n%%latex:\r\n    Render the cell as a block of latex\r\n%%markdown:\r\n    Render the cell as Markdown text block\r\n%%perl:\r\n    %%perl script magic\r\n%%prun:\r\n    Run a statement through the python code profiler.\r\n%%pypy:\r\n    %%pypy script magic\r\n%%python:\r\n    %%python script magic\r\n%%python2:\r\n    %%python2 script magic\r\n%%python3:\r\n    %%python3 script magic\r\n%%ruby:\r\n    %%ruby script magic\r\n%%script:\r\n    ::\r\n%%sh:\r\n    %%sh script magic\r\n%%svg:\r\n    Render the cell as an SVG literal\r\n%%sx:\r\n    Shell execute - run shell command and capture output (!! is short-hand).\r\n%%system:\r\n    Shell execute - run shell command and capture output (!! is short-hand).\r\n%%time:\r\n    Time execution of a Python statement or expression.\r\n%%timeit:\r\n    Time execution of a Python statement or expression\r\n%%writefile:\r\n    ::\r\n\r\n\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Jupyter \u3067\u30de\u30b8\u30c3\u30af\u30b3\u30de\u30f3\u30c9\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3092\u77e5\u3063\u305f\u306e\u3067\u8a18\u9332\u3057\u3066\u304a\u304d\u307e\u3059\u3002 %quickref \u51fa\u529b [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-46316","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>- Blog - Silicon Cloud<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:description\" content=\"Jupyter \u3067\u30de\u30b8\u30c3\u30af\u30b3\u30de\u30f3\u30c9\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3092\u77e5\u3063\u305f\u306e\u3067\u8a18\u9332\u3057\u3066\u304a\u304d\u307e\u3059\u3002 %quickref \u51fa\u529b [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-22T08:14:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T03:23:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d63e437434c4406d03301\/2-0.png\" \/>\n<meta name=\"author\" content=\"\u97f5, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u97f5, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/\",\"name\":\"- Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-03-22T08:14:56+00:00\",\"dateModified\":\"2024-04-30T03:23:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e\",\"name\":\"\u97f5, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g\",\"caption\":\"\u97f5, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"- Blog - Silicon Cloud","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/","og_locale":"zh_CN","og_type":"article","og_description":"Jupyter \u3067\u30de\u30b8\u30c3\u30af\u30b3\u30de\u30f3\u30c9\u306e\u4e00\u89a7\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5\u3092\u77e5\u3063\u305f\u306e\u3067\u8a18\u9332\u3057\u3066\u304a\u304d\u307e\u3059\u3002 %quickref \u51fa\u529b [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-03-22T08:14:56+00:00","article_modified_time":"2024-04-30T03:23:42+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d63e437434c4406d03301\/2-0.png"}],"author":"\u97f5, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u97f5, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/","name":"- Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-03-22T08:14:56+00:00","dateModified":"2024-04-30T03:23:42+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/6530331a63adef3b3443a1fab53a0e6e","name":"\u97f5, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429ccb39b3fff5188bc17986222cfb0936cbadb8cc933cff04ab5ca01bd30a08?s=96&d=mm&r=g","caption":"\u97f5, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunke\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/46316-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=46316"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46316\/revisions"}],"predecessor-version":[{"id":91615,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/46316\/revisions\/91615"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=46316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=46316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=46316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}