我使用pycharm到2018.3.4来开发python脚本,在这种语言中我还是个新手,我通常编写PowerShell代码。我有一个关于调试的问题。以这个未完成的代码为例。
#! python3
# phoneAndEmail.py - Finds phone numbers and email addresses on the clipboard.
import pyperclip, re, sys
phoneRegex = re.compile(r'''(
(\(?([\d \-\)\â\+\/\(]+)\)?([ .-â\/]?)([\d]+))
)''', re.VERBOSE)
mailRegex = re.compile(r'''(
\w+@\w+\.\w+
)''', re.VERBOSE)
text = pyperclip.paste()
def getMatches(text, regex) :
return regex.findall(text)
Emails = getMatches(text,mailRegex) #I want to play with this variable at runtime
phone = getMatches(text,phoneRegex)
我正处于一个阶段,我想在运行时分析变量电子邮件。所以我设置了一个断点,可以很好地查看变量的内容。不过,我还想运行一些方法,并在运行时使用它们的输入参数。有人知道这怎么可能吗?如果可以使用另一个IDE,那么也可以。