本文介绍了Pyhton Interpreter启动时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 你好, 我正在寻找一个小应用程序,它需要一个非常快的启动时间来为Python解释器启动时间。它没有做太多(复制 和文件缓存,没有GUI)但我需要Python解释器以非常快的速度启动 ( ''剥离''Python解释器,它可以在一个 的Windows框中快速启动。我曾经想过的事情是使用PyExe来快速启动它(它是否编译成C代码,因此在运行时不使用 Python解释器?) 。这是一个可能的解决方案吗? 我观察到我第二次启动python它启动得更快 但是我假设这取决于环境并且不能依赖(或类似的东西)。 先谢谢你的帮助。 干杯, Neil - Neil Benn 高级自动化工程师 Cenix BioScience BioInnovations Zentrum Tatzberg 47 D -01307 德累斯顿 德国 电话:+49(0)351 4173 154 电子邮件: be**@cenix-bioscience.com Cenix网站: http://www.cenix-bioscience.com 解决方案 这个Peter的时间变化 来自运行Linux / Debian的5岁250 MHz Compaq 。 .. sk @ cpq1:〜/ c Hello,I''m looking at a small app which would need a very quickstartup time for the Python interpreter. It doesn''t do much (copyingand caching of files, no GUI) but I need the Python interpreter to startup very quickly (<1 second on a Windows box). Is there a way to have a''stripped'' down Python interpreter which can start up very quickly on awindows box. Once thing I was thinking of was to use PyExe to make aquick startup (does it compile down to C code, therefore not using thePython interpreter at runtime?). Is this a possible solution?I observe that the second time I start python it starts up quickerbut I''m assuming that this is dependent on the environment and can''t berelied upon (or something like that).Thanks, in advance for your help.Cheers,Neil--Neil BennSenior Automation EngineerCenix BioScienceBioInnovations ZentrumTatzberg 47D-01307DresdenGermanyTel : +49 (0)351 4173 154e-mail : be**@cenix-bioscience.comCenix Website : http://www.cenix-bioscience.com 解决方案What kind of machine do you have?On mine, Python starts up in about 0.06 seconds...This primitive test shows these results on a Windows XP machine(it won''t work with Windows 98 as it can''t chain commands on thecommand line like that, but you could but it in a batch file).c:\>echo. | time & python -c "import time; print time.time()"The current time is: 8:59:59.67Enter the new time:1092315599.73This is a fairly fast machine (Athlon 2500+) but I reallydoubt slower machines would take much longer than 1 secondunless they are *really* old.-Peter What kind of machine do you have? On mine, Python starts up in about 0.06 seconds... This primitive test shows these results on a Windows XP machine (it won''t work with Windows 98 as it can''t chain commands on the command line like that, but you could but it in a batch file). c:\>echo. | time & python -c "import time; print time.time()" The current time is: 8:59:59.67 Enter the new time: 1092315599.73 This is a fairly fast machine (Athlon 2500+) but I really doubt slower machines would take much longer than 1 second unless they are *really* old. -PeterThis variation on Peter''s timingis from a 5-year-old 250 MHz Compaqrunning Linux/Debian ...sk@cpq1 : ~/c 这篇关于Pyhton Interpreter启动时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!