本文介绍了Python Doc问题示例:os.path.split的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! Python Doc问题示例 引自: http://docs.python.org/lib/module-os.path.html ------- --- 拆分(路径) 将路径名路径拆分成一对,(头部,尾部),其中尾部是 最后一个路径名组件和头部是导致这一切的一切。 尾部将永远不会包含斜线;如果路径以斜线结尾,则尾部 将为空。如果路径中没有斜杠,则head将为空。如果 路径为空,则head和tail都为空。尾随斜杠是从头部剥离的,除非它是根(仅限一个或多个斜杠)。在 几乎所有情况下,join(head,tail)等于path(唯一的例外是,当有多个斜线将头部与尾部分开时)。 ---------- 谁能告诉我这个措辞是什么样的他妈的说什么? 什么他妈的是头和尾的东西? 是文档作家,试图写一些严谨的文档,但 对此感到困惑分裂的行为,还是混淆表达 呢?他的假装是否让他搞砸了? 我正在制作一个程序,我需要将路径拆分为dirname, corename和后缀。但是这个他妈的蟒蛇博士转移了我的工作,并且浪费了我的时间。除了他妈的OpenSourcers和他妈的他妈的他妈的他妈的和他们他妈的懒散地宣传他们他妈的谎言之外,通常没有什么问题可以找到这个世界的不完美之处。 和愚蠢。死。 建议改写: 拆分(路径) 返回一对(dirname,filename),其中dirname是路径的一部分 到最后一个斜杠,而filename是 最后斜杠之后的其余字符串。 特殊情况是: a?¢如果路径是单斜杠(或重复),则路径== dirname和 文件名为空。 a?¢如果a ?? lasta ??斜线重复,它们被处理为单个 斜线。 ------------ 他妈的混合OpenSourcing头衔。 (注意:我在这里使用OpenSource不包括GNU 社区的人。) 有关Python Doc问题的更多信息,请参阅 http: //xahlee.org/Periodic_dosage_di...ami_cukta.html Xah xa *@xahlee.org a ?? http://xahlee.org/Python Doc Problem ExampleQuote from: http://docs.python.org/lib/module-os.path.html----------split( path)Split the pathname path into a pair, (head, tail) where tail is thelast pathname component and head is everything leading up to that. Thetail part will never contain a slash; if path ends in a slash, tailwill be empty. If there is no slash in path, head will be empty. Ifpath is empty, both head and tail are empty. Trailing slashes arestripped from head unless it is the root (one or more slashes only). Innearly all cases, join(head, tail) equals path (the only exceptionbeing when there were multiple slashes separating head from tail).----------Can anyone tell me what this verbiage is trying to fucking say?what the fuck is with the head and tail thing?is the doc writer, trying to write the doc with some austereness, butis confused about the behavior of split, or confused about expressingit? Did his pretension fucked him up?i was working on a program where i needed to split a path into dirname,corename, and suffix. But this fucking python doc diverted my work andwasted my time. It normally isn''t a problem to find imperfections inthe world except the fucking OpenSourcers fuck with their fuckingmoronicity and moronitude and propagate haughtily their fucking liesand stupidity. Die.Suggested rewrite:split(path)returns a pair (dirname,filename), where dirname is the part of pathup to the last slash, and filename is the rest of the string after thelast slash.Exceptional cases are:a?¢ if path is a single slash (or repeated), then path == dirnameandfilename is empty.a?¢ If the a??lasta?? slash is repeated, they are treatedas one singleslash.------------Fuck the motherfucking liers of OpenSourcing fuckheads.(Note: my use of OpenSource here does not include people of GNUcommunity.)For more about Python Doc problems, see http://xahlee.org/Periodic_dosage_di...ami_cukta.htmlXah xa*@xahlee.orga?? http://xahlee.org/推荐答案 请不要喂巨魔。 换句话说,如果每个人都忽略这个失败者,他可能会回到他来自的岩石下面。 - 史蒂文。Please don''t feed the trolls.In other words, if everybody ignores this loser, he might crawl back underthe rock he came from.--Steven. 亲爱的Xah Lee, Python社区非常抱歉因为我们有一个非常抱歉坏了 文档。你是对的。文档很糟糕,语言 是坏的等等。邮件列表本身没有帮助,你不能使用 的任何东西。我们将尝试遵循你所有的光荣建议。 但是我们有很多事情要做,我很害怕你需要等到 Python 5000发布了。在此之前,我可以向您推荐Visual 基本语言。它的文档更完美。 MSDN真的很好 非常结构化且易于使用!这是商业性的,而且 - 正如你所期望的那样...... b $ b预期 - 你会在做出这样的建议之后立即得到修复。 这样的建议。我认为这是你能做的最好的事情。 欲了解更多关于这个FabOLous ClosedSource商业广告 产品的信息,请访问此链接: http://msdn.microsoft.com/vbasic/ 祝你好运! LesDear Xah Lee,The Python community is very sorry because we have a very baddocumentation. You are right. The documentation is bad, and the languageis bad etc. The mailing list itself is not helpful and you cannot use itfor anything. We will try to follow all of your glorious suggestions.But we have so many things to do, I''m affraid you need to wait untilPython 5000 is released. Until that, I can recommend you the VisualBasic language. Its documentation is much more perfect. MSDN is reallyreally well structured and easy to use! It is commercial, and - as youwould expect - you will get immediate fixes after you make a kindsuggestion like this. I think this is the best thing you can do.For more information about this fabolous ClosedSource commercialproduct, please visit this link: http://msdn.microsoft.com/vbasic/Good Luck!Les 是什么让你确定这个问题对于 $ b $旁边的群体会很有趣b clpython?你乞求皈依真正的宗教吗? :-) - Matijawhat makes you sure that this problem would be interesting for groups besidec.l.python? are you begging to be converted to a true religion? :-)--Matija 这篇关于Python Doc问题示例:os.path.split的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 10:58