小编ast*_*ack的帖子

将Python脚本导入另一个?

我正在通过Zed Shaw的学习Python艰难的方式,我在第26课.在本课中,我们必须修复一些代码,代码从另一个脚本调用函数.他说我们不必导入它们来通过测试,但我很好奇我们将如何做到这一点.

链接到课程 | 链接到要更正的代码

以下是调用前一个脚本的特定代码行:

words = ex25.break_words(sentence)
sorted_words = ex25.sort_words(words)

print_first_word(words)
print_last_word(words)
print_first_word(sorted_words)
print_last_word(sorted_words)
sorted_words = ex25.sort_sentence(sentence)
print sorted_words
print_first_and_last(sentence)
print_first_a_last_sorted(sentence)
Run Code Online (Sandbox Code Playgroud)

python import python-2.7

53
推荐指数
3
解决办法
15万
查看次数

标签 统计

import ×1

python ×1

python-2.7 ×1