Python Forum
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Break Line (For Debugging)
#1
Hi All, First day with Python - I feel so powerful already... Hahaha. But clearly I'm still an noob.

My first question would be:

In VBA i usually use Stop command to check or debug my code, is there an equivalent in python?
Reply
#2
Better - If you download an IDE (PyCharm or Atom)
you can use an interactive debugger.

And, there are always print statements:

I often use something like:

pseudo code:
if condition:
    print('whatever you want to see')
    print('stop')
    input()
There is also a break statement that will break out of a loop
Reply
#3
eventually logging module could be if interest too when debug

https://pymotw.com/2/logging/

https://docs.python.org/3/howto/logging.html
Reply
#4
Thanks those are valuable information, followup question.

@Larz60+,
Pycharm is a promising editor but is the Community version enough even at intermediate level of programming?. I know I'm still a complete noob but I'm a programmer so I know there's no stopping now. I just want to look a little bit in the near future.

@buran,
Just read about the logging tool - I'll do further research/reading.
Reply
#5
(May-07-2017, 06:26 AM)vetabz Wrote: @buran,
Just read about the logging tool - I'll do further research/reading.

Sort of Debug.Print on steroids and a hell more customizable:-) TBH, never used Stop, when I do VBA (add break-point(s) instead if I need to debug)
Reply
#6
The community version is fine, and I believe the only difference is that you are not allowed to sell what you make.
If you need the commercial version, single copy is only around $75 per year
Reply
#7
(May-07-2017, 04:27 PM)Larz60+ Wrote: I believe the only difference is that you are not allowed to sell what you make

community edition is under Apache License 2.0 and can be used for commercial projects. see this link for example

https://intellij-support.jetbrains.com/h...on-License

And there is difference between community and professional editions:

https://www.jetbrains.com/pycharm/featur...atrix.html

I think you mix Community/Professional editions with Commercial/Personal license - there is no difference between Commercial (i.e. for businesses and organisations) and Personal (i.e. for individual developers) license
Reply
#8
good to know
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  break print_format lengthy line akbarza 4 370 Mar-13-2024, 08:35 AM
Last Post: akbarza
  line by line debugging in PyCharm Community astral_travel 2 1,104 Nov-03-2022, 08:33 PM
Last Post: astral_travel
  print a line break in writelines() method leodavinci1990 1 6,466 Oct-12-2020, 06:36 AM
Last Post: DeaD_EyE
  Regex won't replace character with line break Tomf96 2 2,556 Jan-12-2020, 12:14 PM
Last Post: Tomf96

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020