Python Forum

Full Version: Debugger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using PyCharm to run my Python code.

When I place a breakpoint on a line, the whole code runs through to the end? What can I be doing wrong. Note, I am a newbie.
Are you running in debug mode? If so, maybe your code is not reaching the breakpoint.
I'm running it on Run mode. The breakpoint is on line 7.

import openpyxl
from openpyxl import load_workbook

folder = 'D:/Power BI & Python/'
file = 'Test_Data.xlsx'

wb = openpyxl.load_workbook(folder + file)
wss = wb.sheetnames
ws = wss[0]
wsmaxRow = wb[ws].max_row

print(ws)
print(wsmaxRow)
Breakpoints don't work in run mode. You need to run it in debug mode.
When I select the Debug tab at the bottom, it automatically jumps to the Run tab!
Thanks will repost if I still have an issue.