All Questions
Tagged with code-snippets python
48 questions
2
votes
0
answers
156
views
How Can I Make Kate Properly Indent Snippets with Multiple Lines
I enjoy using Kate snippets for quick Python scripts, but I'm having a hard time getting them to properly inherit or detect indentation levels after the first line. Consider the following snippet:
...
1
vote
1
answer
983
views
Jupyter Notebook Extension: Snippets menu is not working after enabling nbextensions
After I have installed nbextensions, I have enabled a few extensions such as Hinterland, Snippets, and Snippets Menu. The other extensions are working pretty fine, except for Snippets Menu.
I am not ...
0
votes
0
answers
38
views
Can you give me feedback on a small python refactor
I've a small snippet of python code and i'm trying to refactor a block, how could i approach this problem?
def function():
samples = []
for i in samples:
if i == 1:
# ...
0
votes
0
answers
321
views
scrape google search snippet results with arabic query in python
I need to extract the google search result snippets for Arabic queries. I am using serpapi in Python.
My code is as follows:
from serpapi import GoogleSearch
import os
params = {
"engine&...
0
votes
0
answers
209
views
Is there a way for a user to make a file that has boilerplate or precoded code?
I am trying to make an extension that has the ability to, by GUI or by command, create a python file that has code in it upon creation. I know you can make snippet that allows you to type in a command ...
0
votes
1
answer
730
views
Django CKEditor Code Snippet not rendered correctly
I am building a Django blog that supports code snippets for both post and comments. The following is my CKEditor config in settings.py
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'full',
...
0
votes
1
answer
579
views
How to Format Python code as Python snippets on stack overflow? [closed]
How to format Python code as Python snippets on stack overflow since we can only do it as JavaScript or HTML or CSS snippets?
0
votes
0
answers
294
views
VS Code Snippets - How to Add List of Files to Choice Variable
I have a snippet that imports a library that I use often.
I would like to add a choice variable based on the files in the library.
So in the example below ${1:Package} would fill with all the files in ...
-2
votes
1
answer
357
views
How can I import two or more packages in jupyter notebook?
I want to import the following packages with snippets in jupyter notebook:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import yfinance as yf
I tried ...
-6
votes
2
answers
1k
views
1
vote
1
answer
108
views
Remove $TM_CURRENT_LINE after inserting snippet
Trying to create a snippet in sublime Text 4 where the tab trigger is .print
eg: a.print results in print(a)
The current code for the snippet is
<snippet>
<content><![CDATA[print($...
0
votes
0
answers
1k
views
Adding code snippet to a HTML page made using Tailwind CSS
I am making an HTML page using Tailwind CSS and want to add (python) code snippets to it. is there a way to do it?
0
votes
1
answer
73
views
Sublime Text x Python - @property
I'm new to sublime text and would like to disable the auto-fill when I enter @pro... for @property and choose the suggestion.
It fills in a function using the private variable syntax, which I rarely ...
2
votes
1
answer
1k
views
VS Code not showing useful Python code snippets
Visual Studio Code is not showing Python code snippets anymore. I don't know if this is a bug from Python Language Server (which I have already tried Jedi, Microsoft and Pylance) or a VSCode problem.
...
12
votes
2
answers
8k
views
VS Code No Longer Shows Default Code Snippet for Python
For some unknown reasons, my VS code no longer shows the default code snippets for Python.
Below is what I see when I type for in the editor (to write the for loop)
I'm expecting to see something ...