-1
@app.route('/')
def explorer():
    
    output = ls()
    
    return render_template('home.html',len = len(output), ls = output, folder_name = os.path.basename(os.getcwd()))

here the output is : ['a.out', 'deneme bosluk', 'script.py', 'silme_deneme (copy)', 'Stack.cpp', 'stack.py', 'templates', 'test.py'] deneme bosluk is folder name

{%for i in range(0, len)-%}
            
    <input name = {{ls[i]}} type="submit" value={{ls[i]}}>
    <input for = {{ls[i]}} name = {{ls[i]}}_rm type="submit" value=rm>
    <br>
            
{%endfor%}

here is my html code. in here its not showing up spaces in folder name. deneme bosluk is turned to deneme.enter image description here

Fquer
  • 19
  • 2

1 Answers1

-1
  1. Your variable names should not be a keyword in the programming language you're using. This means you shouldn't use len as a variable name.

  2. Try using {{{ i.e. {{{ls[i]}}}

NoCommandLine
  • 5,044
  • 2
  • 4
  • 15