PyCharm breakpoint action

If we want to change a variable value to effect specific code path in debug mode at some break point in PyCharm for Python code, but we do not want to change the code or configuration, and we do not want to do this manually at the break point console window each time it is hit, then we can do it programmingly by using break point condition side effects. For example, if we want to change the varible self.multiprocessing_num_processes to 1 to avoid parallel processing that may crash a test machine with not enough memory, we can use the following break point condition:

(self.multiprocessing_num_processes==1) or (setattr(self, 'multiprocessing_num_processes',1)!=[])


This change will be automatically made if we run and hit the break point, but it will not be triggered if we step through to pass the break point.

要查看或添加评论,请登录

Frank Wang的更多文章

  • Compound Poisson with Uniform Severity Loss Distribution

    Compound Poisson with Uniform Severity Loss Distribution

    The CDF of compound Poisson with Uniform severity distribution is found to be Sum[((-1)^k*(-k +…

  • New Algorithm for Convolution

    New Algorithm for Convolution

    We expect the AI age will be (almost) no-coding-programming, https://dx.doi.

    1 条评论
  • Summarize webpages to form a cover letter

    Summarize webpages to form a cover letter

    LinkedIn and Teal HQ LinkedIn have a function of create resume from your profile, but it focused on certifications from…

  • Double Pareto Distribution

    Double Pareto Distribution

    For given skewness, the maximum shape factor value achievable by GB2 can be attained by a Double Pareto (DP)…

  • Normalized skewness and normalized kurtosis

    Normalized skewness and normalized kurtosis

    Normalized skewness and normalized kurtosis Heuristically, skewness and kurtosis measuring up to the third and fourth…

  • Bing Aided Programming

    Bing Aided Programming

    AI empowered Bing is vastly knowledgeable, apprehensive of human intension, and easy to catch human hint or clue…

  • Python code to pull merge and save to txt from parquet files

    Python code to pull merge and save to txt from parquet files

    Bing now can give sound answers for many questions. Below is the conversation that I have with Bing for pull merge and…

  • EFEP distribution

    EFEP distribution

    We defined Twisted Wang Transform Distribution (TWTD) family, and found for a hurricane reinsurance-portfolio-loss the…

  • Extend Mathematica finance package capability

    Extend Mathematica finance package capability

    Extend Mathematica finance package capability Mathematica can pull end of day trading data, but cannot pull intraday…

    4 条评论
  • Shape factor asymptotic analysis II

    Shape factor asymptotic analysis II

    Probability distribution is the core for stochastic modeling. What type of distribution is more suitable for an…

社区洞察

其他会员也浏览了