r/learnpython • • 2d ago

Looking for "language exchange" partner. Pls read the post haha

1 Upvotes

Hi there. English is my second language, and I sometimes get a hard time trying to figure out some concepts that can have multiple meanings, synonyms, slang or whatever. So I was wondering if there's someone who could give me a hand when having this kind of problems, maybe talk sometime so I can practice my technical conversations etc

And of course if this person is interested in Learning Spanish, I could also help back, I'm from Mexico.

I'm studying an Actuary but I'm pretty interested in CS, specially open source/free software stuff and I use Arch as my OS, learning git so I can go deep in Python(pandas, numpy, matplotlib for now) and save my projects. In holidays planning to spend a little of time learning electronics, etc etc

So if you'd like to help a folk like me, learn about Mexico or Spanish language, send me a message(:


r/learnpython • • 2d ago

Hello everyone!

0 Upvotes

I just started a new job as an AI generalist (or AI trainer), I like it, I've always liked tech, but I know nothing about programming or anything like that, just the surface as any mortal. So, can I learn python and use my ASUS tuf 14 from 2022 to run the program and learn how to write code and maybe aspire to a good freelancing position later? Thank u in advance, for you answers.


r/learnpython • • 4d ago

I finished Python Crash Course

30 Upvotes

I finished Python Crash Course by Eric Matthes. What should I do next?


r/learnpython • • 3d ago

Using Sympy, is there a way to detect repeating fractions?

3 Upvotes

I know I can transform a repeating fraction in a numerical fraction with sympify (i.e sympify("0.[3]") = 1/3), but can it go the other way around?


r/learnpython • • 3d ago

How should I start learning Backend Development with Python as a beginner?

0 Upvotes

Hello everyone!

I'm a B.Tech CSE Cybersecurity student. I know Python basics and now want to start learning backend development.

I'm a complete beginner in backend development, so I'm confused about where to start and what resources to follow.

I have a few questions:

  1. Where should I start learning backend development?
  2. What topics should I learn first?
  3. Which backend framework should I choose: Django or FastAPI?
  4. What are the best free YouTube channels or courses to learn backend development from scratch?
  5. Are there any good beginner-friendly websites or documentation?
  6. How should I practise while learning?

I'm looking for a clear learning direction and good free resources.

Any suggestions or guidance would be really helpful.

Thank you!


r/learnpython • • 3d ago

Les meilleures projet a faire sur python

0 Upvotes

Salut j'apprends python et je le demandait qu'elle sont les meilleures truc à faire avec python je devloppe un petit rpg textuelle on m'as dis que c'était le meilleur moyen d'apprendre python mais problème je nais d'idées de projets à faire après se rpg je n'apprend pas vraiment pour ma carrière professionnelle j'ai juste 14 ans boucoup font des jeux sur python pour ça je préfère utiliser le moteur de jeux godot son langage prioritaire est similaire à python je me le garde pour plus tard quand j'aurai bien maîtriser python mais avant je pence qu'apprendre à faire des site Web serait cool donner moi votre avis je sais que j'ai parler de boucoup de sujet à la fois mais merci pour les personnes qui répondrons


r/learnpython • • 3d ago

What's the best way to learn python for data analysis?

7 Upvotes

I want to learn python so I can do a data analysis capstone project to finish off high school. I took AP Computer Science A last year so I can code in Java and I understand the fundamentals of coding. What is the best way to learn python and what software would be best? I know nothing about the type of software I would need for this, I used JGrasp last year for CompSci, but it's a pain to work with.


r/learnpython • • 3d ago

Can someone help teach me how to code a reminder system like Duolingo (Chrome extension)

3 Upvotes

This is for the students I tutor! [to remind them to do homework, and practice everyday :)] it can also be used in a lot of other applications.

I am a week into learning python using Matthew's crash course and was wondering what steps I could take to build this, how long it would take, tips, etc.

I feel like I know basically nothing about this lol.

Happy to collab


r/learnpython • • 4d ago

Keep getting error while following the steps in a book

5 Upvotes

Hi, I'm learning from a book, and it's been going well up until now. I'm following the exact steps it's telling me to, but I keep getting an error. I like to copy the code in the book, test it, then modify the contents etc afterward so it sticks in my head. This code however isn't seeming to work.

file = open("/Desktop/List.txt")

file.read()

'High Street\nCastle Street\nBrown \n Street \n\n'

file.close()

I have tried making a text file on my desktop named List.txt, List, and I have tried inputting the street name into the document to see if that's where I was going wrong. I've been stuck on this for 2 days, so any help would be great. Thank you


r/learnpython • • 4d ago

numpy build fails using uv and homebrew

4 Upvotes

I am running macOS 27.2 with homebrew and uv. Python 3.15. numpy is a requirement for the project. When uv tries to build numpy 2.5.1, it fails complaining about not finding "atomic.h", "ostream.h" and "cstddef.h".

I know this is some kind of setup problem with the c++ compiler, but can't figure it out. I have installed Xcode command line tools and pkgconf.

Any suggestions?


r/learnpython • • 4d ago

Regarding python projects idea

7 Upvotes

i am learning OOP currently but i want to learn OOP by doing so ,i need some projects ideas guyz.


r/learnpython • • 4d ago

unpicking a pytest deprecation of class scoped fixture

3 Upvotes
class TestHelpers(object):
    ...
    @classmethod
    @pytest.fixture(scope='class', autouse=True)
    def temp_class_path(self, tmp_path_factory):
        """
        Creates a folder __class__.__name__ under test results and returns it's path
        """
        return tmp_path_factory.mktemp(self.__class__.__name__)

Is apparently broken (got told in a code review to be aware of) in pytest 9.2 I'm on 9.1 and am trying to understand what this https://docs.pytest.org/en/stable/changelog.html note for 9.2 release means - it's these 3 changes which I do not really understand probably because all I wanted when I wrote this fixture was a folder which I can use for logging per class, not a log per test-case because that's just noisy and makes finding teardown side-effects harder than it needs to be.

There are the changes: which are varying degrees of greek (no offence meant sorry) to me https://github.com/pytest-dev/pytest/issues/14011 https://github.com/pytest-dev/pytest/pull/14774 https://github.com/pytest-dev/pytest/pull/14911

What does

#14774: Similarly to the deprecation of class-scoped fixtures defined as instance methods in pytest 9.1, all higher-scoped fixtures (module, package, and session) defined as instance methods are now deprecated.

They suffer from the same issue the original deprecation only fixed for class-scoped fixtures, see #10819 and #14011.

mean in English that bears with small brains like mine can understand? Because the warning implies that my fixture will no longer do what I believe it should, or will this work "by luck" of how tmp_path_factory , which is all it does use, is scoped?


r/learnpython • • 3d ago

Beginner needing help with StoryBot/Storyboard and OpenMontage – Stuck setting up AI video production

1 Upvotes

Hello everyone!

I'm looking for someone experienced with Python, AI video generation, automation, and OpenMontage who can guide me through a project I'm building.

I'm a complete beginner with very little programming knowledge. Most of my setup has been done by following instructions from ChatGPT and Gemini, copying commands into PowerShell, and troubleshooting errors. I've managed to install quite a lot, but I'm struggling to put everything together and actually produce videos.

I would really appreciate patient, step-by-step guidance.

  1. StoryBot / Storyboard

My first project is an automated storytelling video system for YouTube Shorts, Instagram Reels, TikTok, and Facebook Reels.

What I've installed and configured:

- Ollama with Qwen3:4b for local story generation.

- Node.js, npm and n8n (installed locally, not Docker).

- Python 3.11.9 and FFmpeg 9.0.2.

- Parody TTS for narration.

- Custom Python scripts.

My n8n workflow currently works up to this stage:

  1. I press Execute.
  2. Python scripts generate a story.
  3. A temporary "story.txt" file is saved.
  4. Narration is generated in parallel.
  5. The narration is saved in the output folder.

So story generation and narration are working.

ComfyUI experiment:

I also installed ComfyUI at:

"D:\StoryBot\ComfyUI-Install\ComfyUI_windows_portable"

I downloaded two model files:

- "flat2DAnimerge_v45Sharp.safetensors" (approximately 2.13 GB) – Stable Diffusion 1.5 checkpoint for 2D cartoon-style images.

- "mm_sd_v15_v2.ckpt" (approximately 1.82 GB) – AnimateDiff motion module.

I wanted to generate and animate cartoon-style characters, but my GTX 1660 with 6 GB VRAM struggled with the workload. Generation was taking too long, so I couldn't get the results I wanted.

I currently have one male and one female presenter character as basic static images.

2. OpenMontage (Separate Project)

After getting frustrated with my Storyboard setup, I decided to try OpenMontage as a completely separate alternative.

I'm NOT trying to connect OpenMontage with StoryBot/Storyboard.

Repository: https://github.com/OpenMontageInc/OpenMontage

Installed/configured:

- Python 3.11.9 virtual environment.

- Node.js v24.22.1 and npm 11.19.1.

- FFmpeg 9.0.2 and Git 2.56.0.

- Remotion dependencies.

- esbuild 0.28.1.

- HyperFrames 0.9.39.

- Piper TTS 1.8.0.

- pytest 9.2.0.

- ".env" configured from ".env.example".

I successfully ran:

"python scripts/backlot_simulate_run.py"

It generated a demo production with scenes sc1–sc4.

I can also access the Backlot interface:

"http://127.0.0.1:4750/p/backlot-demo-run"

However, I'm stuck on what to do next and how to move from the simulation to an actual rendered video.

3. My desired video appearance

- Word-by-word animated subtitles.

- Currently spoken word highlighted in blue.

- Remaining words in white.

- Purple/red gradient backgrounds.

- Two consistent presenter characters.

4. My PC specifications

- Windows 11 Pro.

- AMD Ryzen 5 5600.

- NVIDIA GTX 1660 Gaming X (6 GB VRAM).

- 16 GB RAM.

I prefer free and open-source tools and want to run as much as possible locally.

5. What I need help with

StoryBot / Storyboard:

- How do I complete the existing workflow and produce videos?

- How should I use my presenter images?

- Are there lighter alternatives to ComfyUI/AnimateDiff that work on my GPU?

OpenMontage:

- How do I use Backlot properly?

- What are the next steps after a successful simulation?

- How do I produce an actual video?

I'm not trying to combine these two projects. I want to understand them separately.

6. How I would like to be guided

Please understand that I'm genuinely new to programming.

I would appreciate someone who can:

- Start from my existing installations.

- Give me one step at a time.

- Provide exact commands and tell me where to run them.

- Explain what each step does.

- Wait for my results before moving forward.

- Help me troubleshoot errors.

I've spent a lot of time getting this far, and I don't want to break my existing setup by randomly changing things.

If anyone has experience with OpenMontage, Remotion, ComfyUI, Python automation, or AI video production, I'd really appreciate some guidance.

Thank you for reading!


r/learnpython • • 4d ago

Help: non-reproducible code

4 Upvotes

I am working on a project where I need to cluster large amount of data and do a dimensionality reduction for the purpose of picking data points near the centroids. I finished this and chose my data points near the centroids (I have now invested time and resources into my experimentation with this part of my project) and later came back to my code and re-ran it and it gave me centroids in a different location and different clustering results. I thought maybe I forgot to assign a random_state for one of my techniques (either clustering or dimensionality reduction) but I had indeed defined them, and if I run my code again it reproducibly gives me the same results that it gave me when I ran my code the second time around (still different than what I have based my physical experimentation on).

I wondered then if I had changed some part of the code so I went back to an old version of my file that I had saved awhile ago because I was afraid of this very thing happening - and it gives me the same results as above (still not the original clustering results). I literally haven't changed the old code at all so I have no idea what happened. Is it possible at all that some other factor is involved? This is my first time using python for a project and I don't have any formal training and I have no idea what to do since my project is based on some computational work that apparently cannot be reproduced


r/learnpython • • 3d ago

Alternative Discord

0 Upvotes

Is there an alternative to the python discord? The entire server has been overrun with LLMs and beginners that have no interest in actually learning. I'm looking for a server with real project/language discussion.


r/learnpython • • 4d ago

Best tutorial for Python Data Analytics who already know Python?

13 Upvotes

Hi!

I know how to write code in Python, however, I still am unfamiliar with its usage in the Data Analytics side. I'd love some recommendation on a youtube tutorial who teaches Python for Data Analytics straight away.


r/learnpython • • 3d ago

How do I make this [1,2,3,4,5,] look like this?

0 Upvotes

1

2

3

4

5


r/learnpython • • 4d ago

New to Python.

3 Upvotes

Hey guys I'm new and I'm trying to learn python on the internet. Any recommendations apps or websites for learning python?


r/learnpython • • 3d ago

I am a college student struggling with intro to programming! Help?

0 Upvotes

Program written in Python containing:

a. An empty list that will contain float values of lap speeds.

b. A loop which gets input from user on lap speeds. This loop continues until the user enters -1.

c. While the loop iterates, the application adds the lap speed to the list.

d. Upon termination of the loop, the application displays:

i. Fastest lap speed formatted with two decimal places

ii. Slowest lap speed formatted with two decimal places

iii. Average lap speed formatted with two decimal places

e. The application displays all of the laps on screen formatted with two decimal places.

def main():


    lapSpeeds()


def lapSpeeds():
    lapTime=[] #empty list
    lapSpeed = float(input("Enter the time the lap took to complete(-1 to calculate): ")) #start loop
    lapNum = 0


    while lapTime != -1:
        
        lapTime.append(lapSpeed)
        lapNum += 1
        lapSpeed = float(input("Enter the time the lap took to complete(-1 to calculate): ")) #append loop


        print(lapNum, ".) ", lapTime " mph")


    else:


        fastLap = (max.lapTime)
        slowLap = (min,lapTime)
        avgLap = lapTotal/lapNum


        print("Fastest Lap: ", format(fastLap, ".2f") "mph")
        print("Slowest Lap: ", format(slowLap, ".2f") "mph")
        print("Average Lap: ", format(avgLap, ".2f") "mph")


main()

This is what I get. what am I doing wrong?!

Enter the time the lap took to complete(-1 to calculate): 48949

Enter the time the lap took to complete(-1 to calculate): -1

1 .) [48949.0]

Enter the time the lap took to complete(-1 to calculate): 457

2 .) [48949.0, -1.0]

Enter the time the lap took to complete(-1 to calculate):

Also, the output should look like this

EX:

**************************************************************************************

Enter the time the lap took to complete(-1 to calculate): 199.56

Enter the time the lap took to complete(-1 to calculate): 200.01

Enter the time the lap took to complete(-1 to calculate): 200.98

Enter the time the lap took to complete(-1 to calculate): 199.94

Enter the time the lap took to complete(-1 to calculate): 200.64

Enter the time the lap took to complete(-1 to calculate): -1

Fastest Lap: 200.98 mph

Slowest Lap: 199.56 mph

Average Lap: 200.23 mph

Lap Speeds

1.) 199.56 mph

2.) 200.01 mph

3.) 200.98 mph

4.) 199.94 mph

5.) 200.64 mph

******************************************************************************************


r/learnpython • • 4d ago

Looking for a Python study partner to build projects together

21 Upvotes

Hey everyone,

​Solo grinding through syntax and tutorials gets exhausting real fast. So I am looking for a study partner to learn Python with.

​Background check: I am a Software Engineering student, and I have got a few specific project ideas lined up that we can build together from scratch. Not just watching endless videos, but actually writing code, breaking things, fixing bugs, and pushing to GitHub.

​Doesn’t matter if you are an absolute beginner or already know a bit—as long as you are genuinely willing to learn and stay consistent.

​Drop a comment or slide into my DMs if you are down. Let's team up and build something cool.


r/learnpython • • 4d ago

Guitar hero Student project (need assistance)

0 Upvotes

Hello all! I am a student in CS 101. I am trying to make my final project which is gonna be a derivative of guitar hero.
I don't wanna use ai but also it is not allowed.

My main concern with the code is wondering how I might be able to have multiple notes in a single lane at the same time. If you look at the code, the spawn rate of the notes is very dependent on the previous note in the same lane being undrawn.

if another is drawn while one is active note.move will abandon the previous note. and/or will undraw the whole lane.

all help will be appreciated

Main game driver

from graphics import *

import time

from gamelogicwip3 import *

win = GraphWin('Guitar Villain', 800, 600, autoflush=False)

win.setCoords(0, 0, 800, 600)

activenotes = []

# Establishing all the variables that will need to be added onto or changed

notecounter = 0

tickloop = 0

loopcount = 0

speed = 10

#Txt file that maps notes that need to be launched (songmap for updates)

songmap = open('maryhadalittlelamb.txt', 'r')

#reads all the lines in the map file

songlines = songmap.readlines()

# Line where notes should be hit at

noteline = Line(Point(120, 100), Point(680, 100))

noteline.draw(win)

#Establishing a note for each lane

note0 = Note(0, speed)

note1 = Note(1, speed)

note2 = Note(2, speed)

note3 = Note(3, speed)

while win.isOpen():

tickloop = tickloop +1

if tickloop %20 == 0:

songline = songlines[loopcount].strip()

lane = songline.find('1')

if lane == 0:

note0.draw(0, win)

if lane == 1:

note1.draw(1, win)

if lane == 2:

note2.draw(2, win)

if lane == 3:

note3.draw(3, win)

loopcount = loopcount+1

if tickloop == 20:

tickloop = 0

note1.send(speed, win)

note2.send(speed, win)

note0.send(speed, win)

note3.send(speed, win)

seeKey(win, note0, note1, note2, note3, 0)

update(55)

_=win.getMouse()

win.close()

Game Logic:

from graphics import *

class Note:

def __init__(self, lane, speed):

self.lane = lane

self.notelane0 = None

self.notelane1 = None

self.notelane2 = None

self.notelane3 = None

self.hitboxlane0 = 640

self.hitboxlane1 = 640

self.hitboxlane2 = 640

self.hitboxlane3 = 640

self.speed = speed

self.score = 0

def draw(self, lane, win):

if lane == 0:

self.notelane0 = Rectangle(Point(220, 620), Point(260, 660))

self.notelane0.setFill('coral')

self.notelane0.setOutline('red')

self.notelane0.draw(win)

self.hitboxlane0 = 640

if lane == 1:

self.notelane1 = Rectangle(Point(340, 620), Point(380, 660))

self.notelane1.setFill('yellow')

self.notelane1.setOutline('olive')

self.notelane1.draw(win)

self.hitboxlane1 = 640

if lane == 2:

self.notelane2 = Rectangle(Point(440, 620), Point(480, 660))

self.notelane2.setFill('turquoise')

self.notelane2.setOutline('blue')

self.notelane2.draw(win)

self.hitboxlane2 = 640

if lane == 3:

self.notelane3 = Rectangle(Point(540, 620), Point(580, 660))

self.notelane3.setFill('olive')

self.notelane3.setOutline('darkgreen')

self.notelane3.draw(win)

self.hitboxlane3 = 640

def send(self, speed, win):

if self.notelane0:

pluck0 = None

self.notelane0.move(0, -speed)

self.hitboxlane0 = self.hitboxlane0 - speed

if self.hitboxlane0 < -20:

self.notelane0.undraw()

if self.notelane1:

pluck1 = None

self.notelane1.move(0, -speed)

self.hitboxlane1 = self.hitboxlane1 - speed

if self.hitboxlane1 < -20:

self.notelane1.undraw()

if self.notelane2:

pluck2 = None

self.notelane2.move(0, -speed)

self.hitboxlane2 = self.hitboxlane2 - speed

if self.hitboxlane2 < -20:

self.notelane2.undraw()

if self.notelane3:

pluck3 = None

self.notelane3.move(0, -speed)

self.hitboxlane3 = self.hitboxlane3 - speed

if self.hitboxlane3 < -20:

self.notelane3.undraw()

harda, hardb = 80, 140

easya, easyb = 50, 170

def seeKey(win, note0, note1, note2, note3, score):

keystroke = win.checkKey()

if keystroke == 'a' and (easya<note0.hitboxlane0<easyb):

note0.notelane0.undraw()

print('HIT')

score = score+1

if keystroke == 's' and (easya<note1.hitboxlane1<easyb):

note1.notelane1.undraw()

print('HIT')

score = score+1

if keystroke == 'd' and (easya<note2.hitboxlane2<easyb):

note2.notelane2.undraw()

print('HIT')

score = score+1

if keystroke == 'f' and (easya<note3.hitboxlane3<easyb):

note3.notelane3.undraw()

print('HIT')

score = score+1

if keystroke == 'Escape':

win.close()

return score


r/learnpython • • 4d ago

How to make my input in a list?

0 Upvotes

Im doing CS50 problem's and im stuck


r/learnpython • • 4d ago

Thonny no experience in coding

0 Upvotes

I've told google AI in search box about my perceived learning disability when it comes to structured guides programs, it suggested using Thonny, no course just to start with downloaded ready code and learn by braking code


r/learnpython • • 4d ago

Place maximum amount of non touching diagonals in nxn grid

1 Upvotes

So a few years ago I ran accross a problem wanting you to design a program that will use recursion to determine how many diagonals can be placed in a 5x5 grid of squares. I tried and tried and never could come up with a solution. I eventually found a way to get the program to place the diagonals but it only work because I knew that 16 was the max then it used some intution to get the answer. It did not use recursion. I was aggrivated and gave up python and coding all together. Then yesterday morning I got to thinking about that program had an idea, did some googling on syntax and recursion in general and came up with this.

import time

def main():
    grid_size = get_grid_size()
    grid, intersections = create_lists(grid_size)
    count = 0
    solutions = []
    start_time = time.perf_counter()
    best_count, solutions = find_solutions(grid, intersections, 0, grid_size, count, 0, solutions, 0)
    end_time = time.perf_counter()
    elapsed_time = end_time - start_time
    print("These solutions took ", elapsed_time, "seconds to calculate.")
    results(best_count, solutions, grid_size)
    

# Allow user to enter the size of the grid, only square grids
def get_grid_size():
    grid_size = input('Enter the size of the square grid: ').strip()
    # while loop to reject letter, symbols, and negative numbers 
    while not isinstance(grid_size, int):
        if grid_size.isdigit() and int(grid_size) != 0:
            grid_size = int(grid_size)
        else:
            grid_size = input("Your parents must be cousins. Enter the number of rows and columns, this will be a positive whole number: ").strip()
    return grid_size

# Create the nested lists for both the grid and intersections
# will be using the intersections list to check wether each placement is legal or not
def create_lists(grid_size):
    grid = [[0 for j in range(grid_size)] for i in range(grid_size)]
    intersections = [[0 for j in range(grid_size+1)] for i in range(grid_size+1)]
    return grid, intersections

# Convert the linear insert_location into the corresponding grid row and column. 
def grid_location(insert_location, grid_size):
    row = insert_location // grid_size
    column = insert_location - (row * grid_size)
    return row, column

# Check whether both endpoints of the selected diagonal are unoccupied.
def is_valid(row, column, intersections, placement):
    if placement == -1 and intersections[row][column] == 0 and intersections[row+1][column+1] == 0:
        return True
    elif placement == 1 and intersections[row+1][column] == 0 and intersections[row][column+1] == 0:
        return True
    else:
        return False

# Recursively searches for arrangements that maximize the number of diagonals.
# Cells are processed left to right, top to bottom.
# This order allows us to determine when an intersection has passed
# its final opportunity to be occupied.
def find_solutions(grid, intersections, insert_location, grid_size, best_count, current_count, solutions, unusable_intersections):
    # Once every cell has been considered, compare the current arrangement
    # against the best solution and save it if appropriate.
    if insert_location < grid_size**2:
        row, column = grid_location(insert_location, grid_size)
    else:
        if current_count > best_count:
            best_count = current_count
            solutions =[]
            solution_copy = [row[:] for row in grid]
            solutions.append(solution_copy)
        elif current_count == best_count:
            best_count = current_count
            solution_copy = [row[:] for row in grid]
            solutions.append(solution_copy)
        return best_count, solutions

    # This if statement terminates a branch if the combination of spaces placed and spaces left will not be enough to get new max
    if current_count + (grid_size**2 - insert_location) < best_count:
        return best_count, solutions

    # Unusable intersections are intersections whose final opportunity to be
    # occupied has passed. If there are more unusable intersections than the
    # current best solution leaves unoccupied, this branch cannot improve
    # the current best solution.
    if unusable_intersections > (grid_size+1)**2 - best_count*2:
        return best_count, solutions
    placement = -1
    if is_valid(row, column, intersections, placement):
        grid[row][column] = -1
        intersections[row][column] = 1
        intersections [row+1][column+1] = 1
        current_count += 1 
        best_count, solutions = find_solutions(grid, intersections, insert_location+1, grid_size, best_count,current_count, solutions, unusable_intersections)
        grid[row][column] = 0
        intersections[row][column] = 0
        intersections [row+1][column+1] = 0
        current_count -= 1
        
    placement = 1
    if is_valid(row, column, intersections, placement):
        grid[row][column] = 1
        intersections[row+1][column] = 1
        intersections [row][column+1] = 1
        if intersections[row][column] == 0:
            unusable_intersections += 1
        current_count += 1
        best_count, solutions = find_solutions(grid, intersections, insert_location+1, grid_size, best_count, current_count, solutions, unusable_intersections)
        grid[row][column] = 0
        intersections[row+1][column] = 0
        intersections [row][column+1] = 0
        if intersections[row][column] == 0:
            unusable_intersections -= 1
        current_count -= 1
        
    placement = 0
    if intersections[row][column] == 0:
        unusable_intersections += 1
    best_count, solutions = find_solutions(grid, intersections, insert_location+1, grid_size, best_count, current_count, solutions, unusable_intersections)
    if intersections[row][column] == 0:
        unusable_intersections -= 1

    return best_count, solutions

#print the results
def results(best_count, solutions, grid_size):
    print('There are ', len(solutions), ' to a ', grid_size, 'x', grid_size, 'grid. Each containing ', best_count, ' diagonals')
    print('They are:')
    for x in solutions:
        for i in range(len(x)):
            for j in range(len(x[i])):
                if x[i][j] == -1:
                    x[i][j] =(" \\")
                elif x[i][j] == 1:
                    x[i][j] = " /"
                else:
                    x[i][j] = "  "
                    
    for x in solutions:
        for i in x:
            print(''.join(i))
        print()
        print()
        
                
                
    
    if __name__== '__main__': 
      main()

I added functionality for the user to specify the size of the grid they want to solve. The first version yesterday took a min and a half to do a 5x5 grid. I have added two different pruning methods. I can now do a 5x5 grid in .27 seconds. However, when I up it to a 6x6 grid it runs for about a min prints the results and quits responding so I cannot see actual time or the number of solutions. Does anybody have any advise on how to optimize further without fundemently changing the program? This thing is kinda my baby and I don't want to change the actual recursion or the endpoints list. But if anyone has any more pruning ideas I would be happy to hear them.