def check_the_input_only_allows_digits_only(inp):
# A function for validating the input, the purpose of this is to let
# the user enter only digits.
if inp.isdigit() or inp is "" or inp == "\b" or inp is None:
return True
else:
return False
reg = creditor.register(check_the_input_only_allows_digits_only)
amount.config(validate = "key",validatecommand = (reg,"%P"))
Run Code Online (Sandbox Code Playgroud)
我知道该函数 check_the_input_only_allows_digits_only已注册,并且对于用户输入的每个字符,都会调用该函数并验证输入。但是为什么每次用户输入内容时.register都不能调用该函数.register?引擎盖下到底发生了什么?
我正在使用 Ubuntu 20.04 。我按照这个 博客安装了 pyenv 。
如何停用激活的 pyenv - virtualenv 我尝试了以下操作
停用
pyenv-virtualenv: deactivate must be sourced. Run 'source deactivate' instead of 'deactivate'
Run Code Online (Sandbox Code Playgroud)
源停用
pyenv-virtualenv: deactivate 3.6.9/envs/word_embedding
Run Code Online (Sandbox Code Playgroud)
在 ~/.bashrc 中我附加了以下内容
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Run Code Online (Sandbox Code Playgroud) 如何识别不同颜色的相同表情符号?
示例:应该被认为是相同的
编辑:目前我正在使用表情包
import regex
import emoji
exm = "poli kariku fans adi like sub tharamo"
characters = regex.findall("\X",exm)
for char in character:
if char in emoji.UNICODE_EMOJI:
#do something
Run Code Online (Sandbox Code Playgroud)