-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathfeatures.astro
More file actions
160 lines (138 loc) · 7.59 KB
/
features.astro
File metadata and controls
160 lines (138 loc) · 7.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
import BaseLayout from '../layouts/BaseLayout.astro';
import Navigation from '../components/Navigation.astro';
import Footer from '../components/Footer.astro';
import PageHeader from '../components/PageHeader.astro';
---
<BaseLayout title="Features">
<Navigation />
<main class="min-h-screen bg-white dark:bg-ipython-dark">
<PageHeader
title="Features"
description="Discover what makes IPython powerful"
/>
<!-- Content -->
<section class="py-16 max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="space-y-12">
<!-- Smart Tab Completion -->
<div>
<h2 class="heading-lg">Smart Tab Completion</h2>
<p class="body-text">IPython's intelligent tab completion is powered by Jedi, providing context-aware suggestions for:</p>
<ul class="list-disc list-inside space-y-2 text-gray-600 dark:text-gray-400 mb-6">
<li>Object attributes and methods</li>
<li>Function parameters and arguments</li>
<li>File and directory paths</li>
<li>Module names and packages</li>
</ul>
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-300 dark:border-gray-700">
<pre class="text-gray-700 dark:text-gray-300 font-mono text-sm p-3"><code><span class="text-theme-primary">In [1]:</span> import numpy
<span class="text-theme-primary">In [2]:</span> numpy.array.<span class="text-theme-secondary">[press TAB]</span>
<span class="text-gray-500 dark:text-gray-400">append astype base byteswap ...</span></code></pre>
</div>
</div>
<!-- Magic Commands -->
<div>
<h2 class="heading-lg">Magic Commands</h2>
<p class="body-text">Built-in special commands for interactive computing:</p>
<ul class="list-disc list-inside space-y-2 text-gray-600 dark:text-gray-400 mb-6">
<li><code class="inline-code">%timeit</code> - Time code execution</li>
<li><code class="inline-code">%debug</code> - Enter debugger on exception</li>
<li><code class="inline-code">%run</code> - Execute Python scripts</li>
<li><code class="inline-code">%prun</code> - Profile code performance</li>
<li><code class="inline-code">%matplotlib</code> - Enable matplotlib integration</li>
</ul>
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-300 dark:border-gray-700">
<pre class="text-gray-700 dark:text-gray-300 font-mono text-sm p-3"><code><span class="text-theme-primary">In [1]:</span> %timeit sum(range(1000))
<span class="text-gray-500 dark:text-gray-400">14.2 µs ± 245 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)</span>
<span class="text-theme-primary">In [2]:</span> %run my_script.py
<span class="text-gray-500 dark:text-gray-400">Script executed successfully</span>
<span class="text-theme-primary">In [3]:</span> %matplotlib inline</code></pre>
</div>
</div>
<!-- Object Introspection -->
<div>
<h2 class="heading-lg">Object Introspection</h2>
<p class="body-text">Explore objects and code interactively:</p>
<ul class="list-disc list-inside space-y-2 text-gray-600 dark:text-gray-400 mb-6">
<li><code class="inline-code">?</code> - Show object documentation</li>
<li><code class="inline-code">??</code> - Show source code</li>
<li><code class="inline-code">help()</code> - Access Python help system</li>
</ul>
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-300 dark:border-gray-700">
<pre class="text-gray-700 dark:text-gray-300 font-mono text-sm p-3"><code><span class="text-theme-primary">In [1]:</span> import numpy
<span class="text-theme-primary">In [2]:</span> numpy.array?
<span class="text-gray-500 dark:text-gray-400">Type: type
String form: <class 'numpy.ndarray'>
Docstring:
ndarray(shape, dtype=float, buffer=None, offset=0,
strides=None, order=None)</span>
<span class="text-theme-primary">In [3]:</span> numpy.array??
<span class="text-gray-500 dark:text-gray-400">Source code for numpy.ndarray...</span></code></pre>
</div>
</div>
<!-- Rich Display System -->
<div>
<h2 class="heading-lg">Rich Display System</h2>
<p class="body-text">Display rich output including:</p>
<ul class="list-disc list-inside space-y-2 text-gray-600 dark:text-gray-400">
<li>HTML, Markdown, and LaTeX rendering</li>
<li>PNG, JPEG, and SVG images</li>
<li>Interactive plots and visualizations</li>
<li>Data tables and formatted output</li>
</ul>
</div>
<!-- History System -->
<div>
<h2 class="heading-lg">Rich History System</h2>
<p class="body-text">Powerful command history with:</p>
<ul class="list-disc list-inside space-y-2 text-gray-600 dark:text-gray-400 mb-6">
<li>Persistent history across sessions</li>
<li>Search and filter history</li>
<li>Access previous input/output with <code class="inline-code">_</code> and <code class="inline-code">_ih</code></li>
<li>History persistence to SQLite database</li>
</ul>
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-300 dark:border-gray-700">
<pre class="text-gray-700 dark:text-gray-300 font-mono text-sm p-3"><code><span class="text-theme-primary">In [1]:</span> x = 10
<span class="text-theme-primary">In [2]:</span> y = 20
<span class="text-theme-primary">In [3]:</span> x + y
<span class="text-theme-accent">Out[3]:</span> 30
<span class="text-theme-primary">In [4]:</span> _
<span class="text-theme-accent">Out[4]:</span> 30
<span class="text-theme-primary">In [5]:</span> _ih
<span class="text-gray-500 dark:text-gray-400">['x = 10', 'y = 20', 'x + y', '_', '_ih']</span></code></pre>
</div>
</div>
<!-- System Integration -->
<div>
<h2 class="heading-lg">System Integration</h2>
<p class="body-text">Seamlessly integrate shell commands:</p>
<ul class="list-disc list-inside space-y-2 text-gray-600 dark:text-gray-400 mb-6">
<li>Run shell commands with <code class="inline-code">!</code></li>
<li>Capture command output to variables</li>
<li>Access environment variables</li>
<li>Change directory with <code class="inline-code">%cd</code></li>
</ul>
<div class="bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-300 dark:border-gray-700">
<pre class="text-gray-700 dark:text-gray-300 font-mono text-sm p-3"><code><span class="text-theme-primary">In [1]:</span> !ls
<span class="text-theme-primary">In [2]:</span> files = !ls *.py
<span class="text-theme-primary">In [3]:</span> len(files)
<span class="text-theme-accent">Out[3]:</span> 42
<span class="text-theme-primary">In [4]:</span> %cd /tmp</code></pre>
</div>
</div>
<!-- Jupyter Integration -->
<div>
<h2 class="heading-lg">Jupyter Kernel</h2>
<p class="body-text">IPython powers the Jupyter ecosystem:</p>
<ul class="list-disc list-inside space-y-2 text-gray-600 dark:text-gray-400">
<li>Backend for Jupyter Notebook</li>
<li>Powers JupyterLab interactive environment</li>
<li>Enables remote code execution</li>
<li>Supports multiple programming languages through custom kernels</li>
</ul>
</div>
</div>
</section>
</main>
<Footer />
</BaseLayout>