有时,我的老板会向我们抱怨:
为什么我们需要这么长的时间来实现一个功能?
实际上,该功能之前已经在另一个应用程序中实现,您只需要从那里复制和粘贴代码.成本应该很低.
这真的是一个难题,因为在我看来,复制和粘贴代码并不是一件简单的事情.
你有什么理由向你的非技术老板解释这个吗?
我正在研究学习Python的艰难之路,并试图理解它,而不仅仅是锤击.我在练习16上遇到了困难,正如在SO上所讨论的那样:
但我仍然想弄清楚为什么这种方法不起作用:
from sys import argv
script, filename = argv
print "Attempting to open the file now."
print open(filename).read()
print "We're going to erase %r." % filename
print "If you don't want that, hit CTRL-C."
print "If you do want that, hit RETURN."
raw_input("?")
print "Opening the file..."
target = open(filename, 'w')
print "Truncating the file. Goodbye!"
target.truncate()
print "Now I'm going to ask you for three lines."
line1 = raw_input("line 1: ")
line2 = raw_input("line 2: …Run Code Online (Sandbox Code Playgroud)