Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -217,88 +217,109 @@ python_parts = {
|
|
217 |
"Functions": {"emoji": "π§", "details": "Defining, Calling, Parameters, Return Values"},
|
218 |
"Classes": {"emoji": "ποΈ", "details": "Creating, Inheritance, Methods, Properties"},
|
219 |
"API Interaction": {"emoji": "π", "details": "Requests, JSON Parsing, HTTP Methods"},
|
220 |
-
"Data Visualization Libraries1": {"emoji": "π", "details": "matplotlib"},
|
221 |
-
"Data Visualization Libraries2": {"emoji": "π", "details": "
|
222 |
-
"Data Visualization Libraries3": {"emoji": "π", "details": "plotly"},
|
223 |
-
"Data Visualization Libraries4": {"emoji": "π", "details": "altair"},
|
224 |
-
"Data Visualization Libraries5": {"emoji": "π", "details": "bokeh"},
|
225 |
-
"Data Visualization Libraries6": {"emoji": "π", "details": "pydeck"},
|
226 |
-
"Data Visualization Libraries7": {"emoji": "π", "details": "holoviews"},
|
227 |
-
"Data Visualization Libraries8": {"emoji": "π", "details": "plotnine"},
|
228 |
-
"Data Visualization Libraries9": {"emoji": "π", "details": "graphviz"},
|
229 |
"Error Handling": {"emoji": "β οΈ", "details": "Try, Except, Finally, Raising"},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
"Scientific & Data Analysis Libraries": {"emoji": "π§ͺ", "details": "Numpy, Pandas, Scikit-Learn, TensorFlow, SciPy, Pillow"},
|
231 |
"Advanced Concepts": {"emoji": "π§ ", "details": "Decorators, Generators, Context Managers, Metaclasses, Asynchronous Programming"},
|
232 |
"Web & Network Libraries": {"emoji": "πΈοΈ", "details": "Flask, Django, Requests, BeautifulSoup, HTTPX, Asyncio"},
|
233 |
-
"Streamlit &
|
234 |
-
"Streamlit & Extensions2": {"emoji": "π‘", "details": "Streamlit-AgGrid"},
|
235 |
-
"Streamlit & Extensions3": {"emoji": "π‘", "details": "Streamlit-Folium"},
|
236 |
-
"Streamlit & Extensions4": {"emoji": "π‘", "details": "Streamlit-Pandas-Profiling"},
|
237 |
-
"Streamlit & Extensions5": {"emoji": "π‘", "details": "Streamlit-Vega-Lite, Gradio"},
|
238 |
"Gradio": {"emoji": "π‘", "details": "gradio"},
|
239 |
"File Handling & Serialization": {"emoji": "π", "details": "PyPDF2, Pytz, Json, Base64, Zipfile, Random, Glob, IO"},
|
240 |
"Machine Learning & AI": {"emoji": "π€", "details": "OpenAI, LangChain, HuggingFace"},
|
241 |
"Text & Data Extraction": {"emoji": "π", "details": "TikToken, Textract, SQLAlchemy, Pillow"},
|
242 |
"XML & Collections Libraries": {"emoji": "π", "details": "XML, Collections"},
|
243 |
-
"
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
"
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
"
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
}
|
254 |
|
255 |
|
256 |
response_placeholders = {}
|
257 |
example_placeholders = {}
|
258 |
|
259 |
-
def display_python_parts_old2():
|
260 |
-
st.title("Python Interactive Learning Platform")
|
261 |
-
|
262 |
-
for part, content in python_parts.items():
|
263 |
-
with st.expander(f"{content['emoji']} {part} - {content['details']}", expanded=False):
|
264 |
-
if st.button(f"Show Example for {part}", key=f"example_{part}"):
|
265 |
-
example = "Write short python script examples with mock data in python list dictionary for inputs for " + part
|
266 |
-
example_placeholders[part] = example
|
267 |
-
st.code(example_placeholders[part], language="python")
|
268 |
-
response = chat_with_model(f'Write python script with short code examples for: {content["details"]}', part)
|
269 |
-
response_placeholders[part] = response
|
270 |
-
st.write(f"#### {content['emoji']} {part} Example")
|
271 |
-
st.code(response_placeholders[part], language="python")
|
272 |
-
|
273 |
-
if st.button(f"Take Quiz on {part}", key=f"quiz_{part}"):
|
274 |
-
quiz = "Write Python script quiz examples with mock static data inputs for " + part
|
275 |
-
response = chat_with_model(f'Write python code blocks for quiz program: {quiz}', part)
|
276 |
-
response_placeholders[part] = response
|
277 |
-
st.write(f"#### {content['emoji']} {part} Quiz")
|
278 |
-
st.code(response_placeholders[part], language="python")
|
279 |
-
|
280 |
-
prompt = f"Write python script with a few advanced coding examples using mock data input for {content['details']}"
|
281 |
-
if st.button(f"Explore {part}", key=part):
|
282 |
-
response = chat_with_model(prompt, part)
|
283 |
-
response_placeholders[part] = response
|
284 |
-
st.write(f"#### {content['emoji']} {part} Details")
|
285 |
-
st.code(response_placeholders[part], language="python")
|
286 |
-
|
287 |
-
|
288 |
def display_python_parts():
|
289 |
st.title("Python Interactive Learning Platform")
|
290 |
for part, content in python_parts.items():
|
291 |
with st.expander(f"{content['emoji']} {part} - {content['details']}", expanded=False):
|
292 |
if st.button(f"Show Example for {part}", key=f"example_{part}"):
|
293 |
-
example = "Python script
|
294 |
example_placeholders[part] = example
|
295 |
-
response = chat_with_model('Create detailed
|
296 |
st.code(response, language="python")
|
297 |
if st.button(f"Take Quiz on {part}", key=f"quiz_{part}"):
|
298 |
-
quiz = "Python script quiz
|
299 |
response = chat_with_model(quiz, part)
|
300 |
st.code(response, language="python")
|
301 |
-
prompt = f"Learn about advanced coding examples using mock example inputs for {content['details']}"
|
302 |
if st.button(f"Explore {part}", key=part):
|
303 |
response = chat_with_model(prompt, part)
|
304 |
response_placeholders[part] = response
|
|
|
217 |
"Functions": {"emoji": "π§", "details": "Defining, Calling, Parameters, Return Values"},
|
218 |
"Classes": {"emoji": "ποΈ", "details": "Creating, Inheritance, Methods, Properties"},
|
219 |
"API Interaction": {"emoji": "π", "details": "Requests, JSON Parsing, HTTP Methods"},
|
220 |
+
"Data Visualization Libraries1": {"emoji": "π", "details": "matplotlib, seaborn, plotly, altair, bokeh, pydeck"},
|
221 |
+
"Data Visualization Libraries2": {"emoji": "π", "details": "holoviews, plotnine, graphviz"},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
"Error Handling": {"emoji": "β οΈ", "details": "Try, Except, Finally, Raising"},
|
223 |
+
"Azure Cloud Libraries": {"emoji": "βοΈ", "details": "azure-sdk, azure-cosmos, azure-storage-blob, azure-storage-file-share, azure-storage-queue, azure-mgmt-containerinstance, azure-mgmt-containerregistry, azure-mgmt-cosmosdb, azure-mgmt-resource, azure-functions"},
|
224 |
+
"Azure Development Tools": {"emoji": "π οΈ", "details": "azure-devtools, azure-cli-core, azure-cli, vscode-python"},
|
225 |
+
"HTML5 Graphics Libraries": {
|
226 |
+
"emoji": "π",
|
227 |
+
"details": "aframe, threejs, p5.js, pixi.js, paper.js, babylonjs, d3.js, vis.js"
|
228 |
+
},
|
229 |
+
"HTML5 UI Interaction Libraries": {
|
230 |
+
"emoji": "π»",
|
231 |
+
"details": "react, vue.js, angular, svelte, polymer, lit-element"
|
232 |
+
},
|
233 |
+
"3D Molecule Visualization Libraries": {
|
234 |
+
"emoji": "π¬",
|
235 |
+
"details": "rdkit, openbabel, py3Dmol, chemspipy, pymol"
|
236 |
+
},
|
237 |
+
"Python Mapping Libraries": {
|
238 |
+
"emoji": "π",
|
239 |
+
"details": "folium, geopandas, plotly, basemap, cartopy, leaflet, mapboxgl"
|
240 |
+
},
|
241 |
+
"Data Analysis Libraries": {
|
242 |
+
"emoji": "π",
|
243 |
+
"details": "pandas, numpy, scipy, matplotlib, seaborn, plotly, scikit-learn, statsmodels, pyarrow"
|
244 |
+
},
|
245 |
+
"File and Directory Libraries": {
|
246 |
+
"emoji": "π",
|
247 |
+
"details": "os, pathlib, shutil, tempfile, glob, fnmatch"
|
248 |
+
},
|
249 |
+
"Filesystem Interaction Libraries": {
|
250 |
+
"emoji": "πΎ",
|
251 |
+
"details": "fs, pyfilesystem2, watchdog, scandir, pyftpdlib, fusepy"
|
252 |
+
},
|
253 |
"Scientific & Data Analysis Libraries": {"emoji": "π§ͺ", "details": "Numpy, Pandas, Scikit-Learn, TensorFlow, SciPy, Pillow"},
|
254 |
"Advanced Concepts": {"emoji": "π§ ", "details": "Decorators, Generators, Context Managers, Metaclasses, Asynchronous Programming"},
|
255 |
"Web & Network Libraries": {"emoji": "πΈοΈ", "details": "Flask, Django, Requests, BeautifulSoup, HTTPX, Asyncio"},
|
256 |
+
"Streamlit & Extensions": {"emoji": "π‘", "details": "Streamli, Streamlit-AgGrid, Streamlit-Folium, Streamlit-Pandas-Profiling, Streamlit-Vega-Lite"},
|
|
|
|
|
|
|
|
|
257 |
"Gradio": {"emoji": "π‘", "details": "gradio"},
|
258 |
"File Handling & Serialization": {"emoji": "π", "details": "PyPDF2, Pytz, Json, Base64, Zipfile, Random, Glob, IO"},
|
259 |
"Machine Learning & AI": {"emoji": "π€", "details": "OpenAI, LangChain, HuggingFace"},
|
260 |
"Text & Data Extraction": {"emoji": "π", "details": "TikToken, Textract, SQLAlchemy, Pillow"},
|
261 |
"XML & Collections Libraries": {"emoji": "π", "details": "XML, Collections"},
|
262 |
+
"Web Development & Data Handling": {
|
263 |
+
"emoji": "π",
|
264 |
+
"details": "Requests, Pillow, SQLAlchemy, Flask, Django, SciPy, Beautiful Soup, PyTest, PyGame, Twisted"
|
265 |
+
},
|
266 |
+
"Data Science & Visualization": {
|
267 |
+
"emoji": "π",
|
268 |
+
"details": "numpy, pandas, matplotlib, requests, beautifulsoup4"
|
269 |
+
},
|
270 |
+
"PDF & Time Management": {
|
271 |
+
"emoji": "π",
|
272 |
+
"details": "langchain, openai, PyPDF2, pytz"
|
273 |
+
},
|
274 |
+
"Interactive Apps & Streaming": {
|
275 |
+
"emoji": "π»",
|
276 |
+
"details": "streamlit, audio_recorder_streamlit, gradio"
|
277 |
+
},
|
278 |
+
"File & IO Operations": {
|
279 |
+
"emoji": "π",
|
280 |
+
"details": "tiktoken, textract, glob, io"
|
281 |
+
},
|
282 |
+
"Advanced Visualization": {
|
283 |
+
"emoji": "π¨",
|
284 |
+
"details": "matplotlib, seaborn, plotly, altair, bokeh, pydeck"
|
285 |
+
},
|
286 |
+
"Streamlit Extensions": {
|
287 |
+
"emoji": "βοΈ",
|
288 |
+
"details": "streamlit, streamlit-aggrid, streamlit-folium, streamlit-pandas-profiling, streamlit-vega-lite"
|
289 |
+
},
|
290 |
+
"Graph & Diagram Libraries": {
|
291 |
+
"emoji": "π",
|
292 |
+
"details": "holoviews, plotnine, graphviz"
|
293 |
+
},
|
294 |
+
"Data Encoding & Compression": {
|
295 |
+
"emoji": "π",
|
296 |
+
"details": "json, base64, zipfile, random"
|
297 |
+
},
|
298 |
+
"Networking & Asynchronous Operations": {
|
299 |
+
"emoji": "π©οΈ",
|
300 |
+
"details": "httpx, asyncio, xml, collections, huggingface"
|
301 |
+
},
|
302 |
+
|
303 |
}
|
304 |
|
305 |
|
306 |
response_placeholders = {}
|
307 |
example_placeholders = {}
|
308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
def display_python_parts():
|
310 |
st.title("Python Interactive Learning Platform")
|
311 |
for part, content in python_parts.items():
|
312 |
with st.expander(f"{content['emoji']} {part} - {content['details']}", expanded=False):
|
313 |
if st.button(f"Show Example for {part}", key=f"example_{part}"):
|
314 |
+
example = "Python script examples without functions with mock example inputs for " + part
|
315 |
example_placeholders[part] = example
|
316 |
+
response = chat_with_model('Create detailed python script code example scripts without functions for:' + example_placeholders[part], part)
|
317 |
st.code(response, language="python")
|
318 |
if st.button(f"Take Quiz on {part}", key=f"quiz_{part}"):
|
319 |
+
quiz = "Python script quiz examples without functions with mock example inputs for " + part
|
320 |
response = chat_with_model(quiz, part)
|
321 |
st.code(response, language="python")
|
322 |
+
prompt = f"Learn about advanced python script coding examples using mock example inputs for {content['details']}"
|
323 |
if st.button(f"Explore {part}", key=part):
|
324 |
response = chat_with_model(prompt, part)
|
325 |
response_placeholders[part] = response
|