我试图在我的 Python 项目上创建一个 Repl.it,当我运行时,它在找不到[tool.poetry]部分时失败。是的,我的项目有一个pyproject.toml文件。
Repl.it: Updating package configuration
--> /usr/local/bin/python3 -m poetry add halo vistir distlib click packaging tomlkit pip-shims pythonfinder python-cfonts appdirs
[RuntimeError]
[tool.poetry] section not found in pyproject.toml
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...
exit status 1
Repl.it: Package operation failed.
Run Code Online (Sandbox Code Playgroud)
问题是,我如何知道初始化阶段发生了什么,它如何知道要安装哪些依赖项以及如何更改行为?你可以试试这个 repo:github/frostming/pdm用于复制。
如果在理解为什么我在 repl.it 上运行下面的代码不会停止时遇到问题。
-- The second argument is meant to be an infinite ascending list, don't bother yourself with any other case
isin :: Int -> [Int] -> (Bool, [Int])
isin n [] = (False, []) -- This case is unnecessary because the list is infinite, but just for completion
isin n l@(x:xs) =
case n `compare` x of
LT -> (False, l)
EQ -> (True, xs)
GT -> isin n xs
>>> isin 2 [1..]
-- prints nothing --Edit …Run Code Online (Sandbox Code Playgroud) 所以我试图在ruby中解决关于repl.it的类问题/作业,这是我得到的错误列表。
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
undefined method `filter' for [{:r=>1, :c=>0}, {:r=>0, :c=>1}]:Array
(repl):61:in `escape'
(repl):79:in `maze_escape'
(repl):82:in `<main>'
Run Code Online (Sandbox Code Playgroud)
我不明白其原因,因为filter显然是为Array类定义的方法,是Ruby核心的一部分,在这里
我知道有一些问题,关于类型,但我忘记了如何更改它。
number = int(input("Which number do you want to check? "))
if number/2 == int + float:
print("This number is an odd number")
else:
print("This number is an even number")
Run Code Online (Sandbox Code Playgroud)