[英]any way to increase speed every time it hits paddle in brick breaker game with pygame
[英]Any way to increase speed of closing a file?
我正在尝试编写一个html文件,然后使用以下代码将其上传到我的网站:
webpage = open('testfile.html',"w")
webpage.write(contents)
webpage.close
server = 'ftp.xxx.be'
username = 'userxxx'
password = 'topsecret'
ftp_connection = ftplib.FTP(server, username, password)
remote_path = "/"
ftp_connection.cwd(remote_path)
fh = open("testfile.html", 'rb')
ftp_connection.storbinary('STOR testfile.html', fh)
fh.close()
问题是.close
命令似乎比ftp连接慢,并且通过ftp发送的文件为空。 执行ftp后几秒钟,我可以在PC上本地正确看到该文件。
有什么提示可以确定.close
在ftp启动之前完成(除了使用time.sleep()
)?
在W7pro上运行Python 3.xx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.