pyperclip.copy函数提供了大量不需要的输出

2024-10-02 16:28:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我跟着艾尔的《用python自动化无聊的东西》。我是python的相对新手,并且阅读了回溯。当我第一次执行pyperclip.copy()函数时,我得到了一些我甚至无法理解的东西的大量读数。该函数起作用,不再起作用,但有人能解释发生了什么以及如何读取/理解这种类型的输出吗? 注意:当我第一次开始编程时,我感到很高兴,并安装了Anaconda3和类似的数据科学工具。我已经删除了anaconda3,但不记得我在开始使用python编程时安装了什么(大约2017年)

这是为了自动化。我以前从来没有这样做过,所以这只是为了寻找更多的知识来理解正在发生的事情

import pyperclip

pyperclip.copy('Hello!!!!!!!')

在复制字符串之后,应该直接跳转到python空闲shell中的下一个输入行

这是pyperclip.copy()函数后面紧跟的输出(应该有0个输出)。。。它相当长,但看起来主要引用了三个东西:ivar点路径、CFXML文件和NS文件。不确定这些是什么,但这是总输出:

bool b'B' char b'c' int b'i' short b's' long b'l' long_long b'q' unsigned_char b'C' unsigned_int b'I' unsigned_short b'S' unsigned_long b'L' unsigned_long_long b'Q' float b'f' double b'd' BOOL b'Z' UniChar b'T' char_text b't' char_int b'z' CFXMLEntityInfo b'{_CFXMLEntityInfo=q^{__CFString=}{_CFXMLExternalID=^{__CFURL=}^{__CFString=}}^{__CFString=}}' CFXMLElementInfo b'{_CFXMLElementInfo=^{__CFDictionary=}^{__CFArray=}Z[3c]}' CFXMLAttributeListDeclarationInfo b'{_CFXMLAttributeListDeclarationInfo=q^{_CFXMLAttributeDeclarationInfo=^{__CFString=}^{__CFString=}^{__CFString=}}}' CFXMLElementTypeDeclarationInfo b'{_CFXMLElementTypeDeclarationInfo=^{__CFString=}}' CFGregorianDate b'{_CFGregorianDate=iccccd}' CFXMLExternalID b'{_CFXMLExternalID=^{__CFURL=}^{__CFString=}}' CFUUIDBytes b'{_CFUUIDBytes=CCCCCCCCCCCCCCCC}' CFXMLAttributeDeclarationInfo b'{_CFXMLAttributeDeclarationInfo=^{__CFString=}^{__CFString=}^{__CFString=}}' CFSwappedFloat32 b'{_CFSwappedFloat32=I}' CFSwappedFloat64 b'{_CFSwappedFloat64=Q}' CFXMLDocumentTypeInfo b'{_CFXMLDocumentTypeInfo={_CFXMLExternalID=^{__CFURL=}^{__CFString=}}}' CFStreamError b'{_CFStreamError=qi}' CFXMLEntityReferenceInfo b'{_CFXMLEntityReferenceInfo=q}' CFXMLProcessingInstructionInfo b'{_CFXMLProcessingInstructionInfo=^{__CFString=}}' CFRange b'{_CFRange=qq}' CFSocketSignature b'{_CFSocketSignature=iii^{__CFData=}}' CFXMLDocumentInfo b'{_CFXMLDocumentInfo=^{__CFURL=}I}' CFGregorianUnits b'{_CFGregorianUnits=iiiiid}' CFXMLNotationInfo b'{_CFXMLNotationInfo={_CFXMLExternalID=^{__CFURL=}^{__CFString=}}}' NSEdgeInsets b'{NSEdgeInsets=dddd}' NSHashEnumerator b'{_NSHashEnumerator=QQ^v}' NSAffineTransformStruct b'{_NSAffineTransformStruct=dddddd}' NSRect b'{CGRect={CGPoint=dd}{CGSize=dd}}' NSOperatingSystemVersion b'{_NSOperatingSystemVersion=qqq}' NSZone b'{_NSZone=}' NSDecimal b'{_NSDecimal=b8b4b1b1b18[8S]}' NSSize b'{CGSize=dd}' NSPoint b'{CGPoint=dd}' NSSwappedDouble b'{_NSSwappedDouble=Q}' NSMapEnumerator b'{_NSMapEnumerator=QQ^v}' NSSwappedFloat b'{_NSSwappedFloat=I}' NSRange b'{_NSRange=QQ}' NSDirectionalEdgeInsets b'{NSDirectionalEdgeInsets=dddd}' NSOpenGLPixelFormatAuxiliary b'{_CGLPixelFormatObject=}' NSScreenAuxiliaryOpaque b'{NSScreenAuxiliary=}' NSOpenGLContextAuxiliary b'{_CGLContextObject=}'


Tags: 文件函数编程ddlongintqqcopy