Spaces:
Running
Running
Situation A specialized web-based Python code editor is required with a focused approach on data science libraries, specifically NumPy and Pandas, while maintaining standard code editing functionality.
901a21b verified Download editor.html from nathishwar/deepsite-project: direct link, hf CLI and curl.
- Browser
- Download file 3.69 kB
-
https://huggingface.co/spaces/nathishwar/deepsite-project/resolve/main/editor.html
- Command line
-
hf download hf://spaces/nathishwar/deepsite-project/editor.html
-
curl -L -o editor.html https://huggingface.co/spaces/nathishwar/deepsite-project/resolve/main/editor.html
3.69 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Python Data Science IDE</title> | |
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> | |
| <link href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/codemirror.min.css" rel="stylesheet"> | |
| <link href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/theme/dracula.min.css" rel="stylesheet"> | |
| <style> | |
| body { | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| } | |
| #editor-container { | |
| display: flex; | |
| height: 100vh; | |
| overflow: hidden; | |
| } | |
| #code-editor { | |
| flex: 1; | |
| height: 100%; | |
| } | |
| #output-container { | |
| flex: 1; | |
| padding: 15px; | |
| overflow-y: auto; | |
| background: #f8f9fa; | |
| } | |
| .toolbar { | |
| background: #343a40; | |
| padding: 10px; | |
| display: flex; | |
| justify-content: space-between; | |
| } | |
| .mode-toggle { | |
| cursor: pointer; | |
| color: white; | |
| } | |
| .data-preview { | |
| margin-bottom: 20px; | |
| border: 1px solid #dee2e6; | |
| border-radius: 4px; | |
| padding: 10px; | |
| background: white; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="toolbar"> | |
| <div> | |
| <span class="text-white">Python Data Science IDE</span> | |
| </div> | |
| <div class="mode-toggle" id="theme-toggle"> | |
| <i class="fas fa-moon"></i> Dark Mode | |
| </div> | |
| </div> | |
| <div id="editor-container"> | |
| <div id="code-editor"></div> | |
| <div id="output-container"> | |
| <h4>Output & Data Preview</h4> | |
| <div id="data-preview"></div> | |
| </div> | |
| </div> | |
| <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/codemirror.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/mode/python/python.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/addon/hint/show-hint.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.2/addon/hint/python-hint.min.js"></script> | |
| <script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script> | |
| <script> | |
| const editor = CodeMirror(document.getElementById('code-editor'), { | |
| mode: 'python', | |
| theme: 'dracula', | |
| lineNumbers: true, | |
| indentUnit: 4, | |
| extraKeys: { | |
| 'Ctrl-Space': 'autocomplete', | |
| } | |
| }); | |
| editor.setValue(`# Python Data Science IDE | |
| import numpy as np | |
| import pandas as pd | |
| # Create sample data | |
| data = np.random.rand(5, 3) | |
| df = pd.DataFrame(data, columns=['A', 'B', 'C']) | |
| # Preview your data | |
| print(data) | |
| print(df)`); | |
| document.getElementById('theme-toggle').addEventListener('click', function() { | |
| const currentTheme = editor.getOption('theme'); | |
| const newTheme = currentTheme === 'default' ? 'dracula' : 'default'; | |
| editor.setOption('theme', newTheme); | |
| this.innerHTML = newTheme === 'default' | |
| ? '<i class="fas fa-moon"></i> Dark Mode' | |
| : '<i class="fas fa-sun"></i> Light Mode'; | |
| document.body.style.backgroundColor = newTheme === 'default' ? '#f8f9fa' : '#282a36'; | |
| }); | |
| </script> | |
| </body> | |
| </html> |