Python修复了导入键盘模块时打印出来的奇怪东西

Python修复了导入键盘模块时打印出来的奇怪东西,python,printing,import,keyboard,Python,Printing,Import,Keyboard,我正在用键盘模块()编写一些代码,但是当我的代码导入模块时,会打印出一些奇怪的东西。我正在使用python 3.7 守则: import keyboard i = 0 while True: key = keyboard.is_pressed("p") if key == True: print("breaking") break else: print("not breaking", i) i += 1

我正在用键盘模块()编写一些代码,但是当我的代码导入模块时,会打印出一些奇怪的东西。我正在使用python 3.7

守则:

import keyboard

i = 0
while True:
    key = keyboard.is_pressed("p")
    if key == True:
        print("breaking")
        break
    else:
        print("not breaking", i)
        i += 1
奇怪的输出:

bool b'B' <classmethod object at 0x106d633c8> <function ivar.bool at 0x107dd28c8>
char b'c' <classmethod object at 0x106d63470> <function ivar.char at 0x107dd2950>
int b'i' <classmethod object at 0x106e28898> <function ivar.int at 0x107dd29d8>
short b's' <classmethod object at 0x106d86dd8> <function ivar.short at 0x107dd2a60>
long b'l' <classmethod object at 0x106daa710> <function ivar.long at 0x107dd2ae8>
long_long b'q' <classmethod object at 0x106db1828> <function ivar.long_long at 0x107dd2b70>
unsigned_char b'C' <classmethod object at 0x106e1ea90> <function ivar.unsigned_char at 0x107dd2bf8>
unsigned_int b'I' <classmethod object at 0x106e1eda0> <function ivar.unsigned_int at 0x107dd2c80>
unsigned_short b'S' <classmethod object at 0x107d96fd0> <function ivar.unsigned_short at 0x107dd2d08>
unsigned_long b'L' <classmethod object at 0x107da41d0> <function ivar.unsigned_long at 0x107dd2d90>
unsigned_long_long b'Q' <classmethod object at 0x107da4dd8> <function ivar.unsigned_long_long at 0x107dd2e18>
float b'f' <classmethod object at 0x107dbc4a8> <function ivar.float at 0x107dd2ea0>
double b'd' <classmethod object at 0x107dbc438> <function ivar.double at 0x107dd2f28>
BOOL b'Z' <classmethod object at 0x107dbcd68> <function ivar.BOOL at 0x107e19048>
UniChar b'T' <classmethod object at 0x107dbccf8> <function ivar.UniChar at 0x107e190d0>
char_text b't' <classmethod object at 0x107dbca90> <function ivar.char_text at 0x107e19158>
char_int b'z' <classmethod object at 0x107dbc7f0> <function ivar.char_int at 0x107e191e0>
CFXMLEntityInfo b'{_CFXMLEntityInfo=q^{__CFString=}{_CFXMLExternalID=^{__CFURL=}^{__CFString=}}^{__CFString=}}' <classmethod object at 0x107ea8208> <function ivar.CFXMLEntityInfo at 0x107e7a598>
CFXMLElementInfo b'{_CFXMLElementInfo=^{__CFDictionary=}^{__CFArray=}Z[3c]}' <classmethod object at 0x107ea82e8> <function ivar.CFXMLElementInfo at 0x107e7a620>
CFXMLAttributeListDeclarationInfo b'{_CFXMLAttributeListDeclarationInfo=q^{_CFXMLAttributeDeclarationInfo=^{__CFString=}^{__CFString=}^{__CFString=}}}' <classmethod object at 0x107ea8390> <function ivar.CFXMLAttributeListDeclarationInfo at 0x107e7a6a8>
CFXMLElementTypeDeclarationInfo b'{_CFXMLElementTypeDeclarationInfo=^{__CFString=}}' <classmethod object at 0x107ea84e0> <function ivar.CFXMLElementTypeDeclarationInfo at 0x107e7a730>
CFGregorianDate b'{_CFGregorianDate=iccccd}' <classmethod object at 0x107ea86d8> <function ivar.CFGregorianDate at 0x107e7a840>
CFXMLExternalID b'{_CFXMLExternalID=^{__CFURL=}^{__CFString=}}' <classmethod object at 0x107ea8780> <function ivar.CFXMLExternalID at 0x107e7a8c8>
CFUUIDBytes b'{_CFUUIDBytes=CCCCCCCCCCCCCCCC}' <classmethod object at 0x107ea8ba8> <function ivar.CFUUIDBytes at 0x107e7a950>
CFXMLAttributeDeclarationInfo b'{_CFXMLAttributeDeclarationInfo=^{__CFString=}^{__CFString=}^{__CFString=}}' <classmethod object at 0x107ea8c50> <function ivar.CFXMLAttributeDeclarationInfo at 0x107e7a9d8>
CFSwappedFloat32 b'{_CFSwappedFloat32=I}' <classmethod object at 0x107ea8d68> <function ivar.CFSwappedFloat32 at 0x107e7aa60>
CFSwappedFloat64 b'{_CFSwappedFloat64=Q}' <classmethod object at 0x107ea8e80> <function ivar.CFSwappedFloat64 at 0x107e7aae8>
CFXMLDocumentTypeInfo b'{_CFXMLDocumentTypeInfo={_CFXMLExternalID=^{__CFURL=}^{__CFString=}}}' <classmethod object at 0x107ea8f60> <function ivar.CFXMLDocumentTypeInfo at 0x107e7ab70>
CFStreamError b'{_CFStreamError=qi}' <classmethod object at 0x107f100f0> <function ivar.CFStreamError at 0x107e7abf8>
CFXMLEntityReferenceInfo b'{_CFXMLEntityReferenceInfo=q}' <classmethod object at 0x107f101d0> <function ivar.CFXMLEntityReferenceInfo at 0x107e7ac80>
CFXMLProcessingInstructionInfo b'{_CFXMLProcessingInstructionInfo=^{__CFString=}}' <classmethod object at 0x107f10320> <function ivar.CFXMLProcessingInstructionInfo at 0x107e7ad08>
CFRange b'{_CFRange=qq}' <classmethod object at 0x107f10400> <function ivar.CFRange at 0x107e7ae18>
CFSocketSignature b'{_CFSocketSignature=iii^{__CFData=}}' <classmethod object at 0x107f104e0> <function ivar.CFSocketSignature at 0x107e7aea0>
CFXMLDocumentInfo b'{_CFXMLDocumentInfo=^{__CFURL=}I}' <classmethod object at 0x107f10588> <function ivar.CFXMLDocumentInfo at 0x107e7af28>
CFGregorianUnits b'{_CFGregorianUnits=iiiiid}' <classmethod object at 0x107f10780> <function ivar.CFGregorianUnits at 0x107f15048>
CFXMLNotationInfo b'{_CFXMLNotationInfo={_CFXMLExternalID=^{__CFURL=}^{__CFString=}}}' <classmethod object at 0x107f10860> <function ivar.CFXMLNotationInfo at 0x107f150d0>
NSEdgeInsets b'{NSEdgeInsets=dddd}' <classmethod object at 0x107fea0f0> <function ivar.NSEdgeInsets at 0x107f7d598>
NSHashEnumerator b'{_NSHashEnumerator=QQ^v}' <classmethod object at 0x107fea240> <function ivar.NSHashEnumerator at 0x107f7d620>
NSAffineTransformStruct b'{_NSAffineTransformStruct=dddddd}' <classmethod object at 0x107fea438> <function ivar.NSAffineTransformStruct at 0x107f7d6a8>
NSRect b'{CGRect={CGPoint=dd}{CGSize=dd}}' <classmethod object at 0x107fea550> <function ivar.NSRect at 0x107f7d730>
NSOperatingSystemVersion b'{_NSOperatingSystemVersion=qqq}' <classmethod object at 0x107fea5f8> <function ivar.NSOperatingSystemVersion at 0x107f7d7b8>
NSZone b'{_NSZone=}' <classmethod object at 0x107fea6a0> <function ivar.NSZone at 0x107f7d840>
NSDecimal b'{_NSDecimal=b8b4b1b1b18[8S]}' <classmethod object at 0x107fea780> <function ivar.NSDecimal at 0x107f7d8c8>
NSSize b'{CGSize=dd}' <classmethod object at 0x107fea898> <function ivar.NSSize at 0x107f7d950>
NSPoint b'{CGPoint=dd}' <classmethod object at 0x107fea940> <function ivar.NSPoint at 0x107f7d9d8>
NSSwappedDouble b'{_NSSwappedDouble=Q}' <classmethod object at 0x107feaa58> <function ivar.NSSwappedDouble at 0x107f7da60>
NSMapEnumerator b'{_NSMapEnumerator=QQ^v}' <classmethod object at 0x107feabe0> <function ivar.NSMapEnumerator at 0x107f7dae8>
NSSwappedFloat b'{_NSSwappedFloat=I}' <classmethod object at 0x107feacf8> <function ivar.NSSwappedFloat at 0x107f7db70>
NSRange b'{_NSRange=QQ}' <classmethod object at 0x107feadd8> <function ivar.NSRange at 0x107f7dbf8>
NSDirectionalEdgeInsets b'{NSDirectionalEdgeInsets=dddd}' <classmethod object at 0x108133ac8> <function ivar.NSDirectionalEdgeInsets at 0x1080ff268>
NSOpenGLPixelFormatAuxiliary b'{_CGLPixelFormatObject=}' <classmethod object at 0x108133b70> <function ivar.NSOpenGLPixelFormatAuxiliary at 0x1080ff2f0>
NSScreenAuxiliaryOpaque b'{NSScreenAuxiliary=}' <classmethod object at 0x108133c50> <function ivar.NSScreenAuxiliaryOpaque at 0x1080ff378>
NSOpenGLContextAuxiliary b'{_CGLContextObject=}' <classmethod object at 0x108133d30> <function ivar.NSOpenGLContextAuxiliary at 0x1080ff400>
CGFunctionCallbacks b'{CGFunctionCallbacks=I^?^?}' <classmethod object at 0x108288320> <function ivar.CGFunctionCallbacks at 0x10826c1e0>
CGDeviceByteColor b'{CGDeviceByteColor=CCC}' <classmethod object at 0x1082884a8> <function ivar.CGDeviceByteColor at 0x10826c268>
CGPoint b'{CGPoint=dd}' <classmethod object at 0x108288518> <function ivar.CGPoint at 0x10826c2f0>
CGDataProviderCallbacks b'{CGDataProviderCallbacks=^?^?^?^?}' <classmethod object at 0x1082885f8> <function ivar.CGDataProviderCallbacks at 0x10826c378>
CGDataProviderSequentialCallbacks b'{CGDataProviderSequentialCallbacks=I^?^?^?^?}' <classmethod object at 0x1082886a0> <function ivar.CGDataProviderSequentialCallbacks at 0x10826c400>
CGPatternCallbacks b'{CGPatternCallbacks=I^?^?}' <classmethod object at 0x108288748> <function ivar.CGPatternCallbacks at 0x10826c510>
CGSize b'{CGSize=dd}' <classmethod object at 0x1082887b8> <function ivar.CGSize at 0x10826c598>
CGDeviceColor b'{CGDeviceColor=fff}' <classmethod object at 0x108288978> <function ivar.CGDeviceColor at 0x10826c620>
CGDataProviderDirectAccessCallbacks b'{CGDataProviderDirectAccessCallbacks=^?^?^?^?}' <classmethod object at 0x108288a20> <function ivar.CGDataProviderDirectAccessCallbacks at 0x10826c6a8>
CGAffineTransform b'{CGAffineTransform=dddddd}' <classmethod object at 0x108288b38> <function ivar.CGAffineTransform at 0x10826c7b8>
CGDataConsumerCallbacks b'{CGDataConsumerCallbacks=^?^?}' <classmethod object at 0x108288be0> <function ivar.CGDataConsumerCallbacks at 0x10826c840>
CGVector b'{CGVector=dd}' <classmethod object at 0x108288cf8> <function ivar.CGVector at 0x10826c8c8>
CGPathElement b'{CGPathElement=i^{CGPoint=dd}}' <classmethod object at 0x108288e10> <function ivar.CGPathElement at 0x10826c950>
CGScreenUpdateMoveDelta b'{CGScreenUpdateMoveDelta=ii}' <classmethod object at 0x108288f28> <function ivar.CGScreenUpdateMoveDelta at 0x10826c9d8>
CGEventTapInformation b'{__CGEventTapInformation=IIIQiiBfff}' <classmethod object at 0x108295080> <function ivar.CGEventTapInformation at 0x10826ca60>
CGPSConverterCallbacks b'{CGPSConverterCallbacks=I^?^?^?^?^?^?^?}' <classmethod object at 0x108295128> <function ivar.CGPSConverterCallbacks at 0x10826cae8>
CGRect b'{CGRect={CGPoint=dd}{CGSize=dd}}' <classmethod object at 0x108295198> <function ivar.CGRect at 0x10826cb70>
CVTimeStamp b'{_CVTimeStamp=IiqQdq{CVSMPTETime=ssIIIssss}QQ}' <classmethod object at 0x10831c2e8> <function ivar.CVTimeStamp at 0x1083000d0>
CVPlanarPixelBufferInfo_YCbCrBiPlanar b'{CVPlanarPixelBufferInfo_YCbCrBiPlanar={CVPlanarComponentInfo=iI}{CVPlanarComponentInfo=iI}}' <classmethod object at 0x10831c390> <function ivar.CVPlanarPixelBufferInfo_YCbCrBiPlanar at 0x1083002f0>
CVPlanarPixelBufferInfo_YCbCrPlanar b'{CVPlanarPixelBufferInfo_YCbCrPlanar={CVPlanarComponentInfo=iI}{CVPlanarComponentInfo=iI}{CVPlanarComponentInfo=iI}}' <classmethod object at 0x10831c438> <function ivar.CVPlanarPixelBufferInfo_YCbCrPlanar at 0x108300378>
CVPlanarComponentInfo b'{CVPlanarComponentInfo=iI}' <classmethod object at 0x10831c518> <function ivar.CVPlanarComponentInfo at 0x108300400>
CVTime b'{_CVTime=qii}' <classmethod object at 0x10831c5f8> <function ivar.CVTime at 0x108300488>
CVSMPTETime b'{CVSMPTETime=ssIIIssss}' <classmethod object at 0x10831c860> <function ivar.CVSMPTETime at 0x108300510>
CVPlanarPixelBufferInfo b'{CVPlanarPixelBufferInfo=[1{CVPlanarComponentInfo=iI}]}' <classmethod object at 0x10831c9b0> <function ivar.CVPlanarPixelBufferInfo at 0x108300598>
CATransform3D b'{CATransform3D=dddddddddddddddd}' <classmethod object at 0x10833bda0> <function ivar.CATransform3D at 0x108300bf8>
bool b'b'
字符b'c'
int b'i'
短b's'
长b'l'
龙_龙b'q'
未签名字符b'C'
未签名的
未签名的“短b”
未签名的长b'L'
未签名的长b'Q'
浮动b'f'
双b'
布尔布兹
UniChar b'T'
字符文本b't'
char_int b'z'
CFXMLEntityInfo b'{{CFXMLEntityInfo=q^{{cfxmlcstring=}{{CFXMLExternalID=^{{uuuuucfurl=}}}}{{uuucfstring=}}}}
cfxmlementinfo b'{{cfxmlementinfo=^{{cfudiodictionary=}}{{cfudiorary=}Z[3c]}'
CFXMLAttributeListDeclarationInfo b'{{CFXMLAttributeListDeclarationInfo=q^{{CFXMLAttributeDeclarationInfo=^{{UuuCfString=}}^{{UuuCfString=}}
CFXMLElementTypeDeclarationInfo b'{{CFXMLElementTypeDeclarationInfo=^{{CFXMLElementTypeDeclarationInfo=}'
CFGregorianDate b'{{U CFGregorianDate=iccccd}'
CFXMLExternalID b'{{CFXMLExternalID=^{{uuucfurl=}}^{{uuuucfstring=}'
CFUUIDBytes b'{u CFUUIDBytes=cccccc}'
CFXMLAttributeDeclarationInfo b'{{CFXMLAttributeDeclarationInfo=^{{uuuucfstring=}}}}{uuuuucfstring=}}{{uuucfstring=}
CFSwappedFloat32 b'{u CFSwappedFloat32=I}'
CFSwappedFloat64 b'{u CFSwappedFloat64=Q}'
CFXMLDocumentTypeInfo b'{{CFXMLDocumentTypeInfo={{CFXMLExternalID=^{{uuuucfurl=}}{{uuuucfstring=}}'
CFStreamError b'{u CFStreamError=qi}'
cfxmlentyreferenceinfo b'{{cfxmlentyreferenceinfo=q}'
CFXMLProcessingInstructionInfo b'{{U CFXMLProcessingInstructionInfo=^{{U CFString=}}'
CFRange b'{u CFRange=qq}'
CFSocketSignature b'{{CFSocketSignature=iii^{{CfsocketData=}}'
CFXMLDocumentInfo b'{CFXMLDocumentInfo=^{{CFURL=}I}'
CFGregorianUnits b'{CFGregorianUnits=IIIIIIID}'
CFXMLNotationInfo b'{{CFXMLNotationInfo={{CFXMLExternalID=^{{uuucfurl=}}}{uuuucfstring=}}'
NSEdgeInsets b'{NSEdgeInsets=dddd}'
NSHashEnumerator b'{u NSHashEnumerator=QQ^v}'
NSAffinetTransfermStruct b'{u NSAffinetTransfermStruct=dddddd}'
NSRect b'{CGRect={CGPoint=dd}{CGSize=dd}'
NSOperatingSystemVersion b'{u NSOperatingSystemVersion=qqq}'
NSZone b'{u NSZone=}'
NSDecimal b'{NSU DECIMAL=B8B4B18[8S]}'
NSSize b'{CGSize=dd}'
点b'{CGPoint=dd}'
NSSwappedDouble b'{NSSwappedDouble=Q}'
NSMapEnumerator b'{u NSMapEnumerator=QQ^v}'
NSSwappedFloat b'{NSSwappedFloat=I}'
NSRange b'{{u NSRange=QQ}'
NSDirectionalEdgeInsets b'{NSDirectionalEdgeInsets=dddd}'
NSOpenGLPixelFormatB'{U CGLPixelFormatObject=}'
NSScreenAuxiliaryOpaque b'{NSScreenAuxiliary=}'
NSOpenGLContextAssistant b'{CGLContextObject=}'
CGFunctionCallbacks b'{CGFunctionCallbacks=I^?^?}'
CGDeviceByteColor b'{CGDeviceByteColor=CCC}'
CGPoint b'{CGPoint=dd}'
CGDataProviderCallbacks b'{CGDataProviderCallbacks=^?^?^?^?}'
CGDataProviderSequentialCallbacks b'{CGDataProviderSequentialCallbacks=I^?^?^?^?}'
CGPatternCallbacks b'{CGPatternCallbacks=I^?^?}'
CGSize b'{CGSize=dd}'
CGDeviceColor b'{CGDeviceColor=fff}'
CGDataProviderDirectAccessCallbacks b'{CGDataProviderDirectAccessCallbacks=^?^?^?^?}'
CGAffineTransform b'{CGAffineTransform=DDDD}'
CGDataConsumerCallbacks b'{CGDataConsumerCallbacks=^?^?}'
CGVector b'{CGVector=dd}'
CGPathElement b'{CGPathElement=i^{CGPoint=dd}'
CGScreenUpdateMoveDelta b'{CGScreenUpdateMoveDelta=ii}'
CGEventTapInformation b'{{uuuu CGEventTapInformation=IIIQiiBfff}'
CGPSConverterCallbacks b'{CGPSConverterCallbacks=I^?^?^?^?^?^?^?^?}'
CGRect b'{CGRect={CGPoint=dd}{CGSize=dd}'
CVTimeStamp b'{U CVTimeStamp=IiqQdq{CVSMPTETime=SSIISSS}QQ}'
CVPlanarPixelBufferInfo_YCbCrBiPlanar b'{CVPlanarPixelBufferInfo_YCbCrBiPlanar={CVPlanarComponentInfo=iI}{CVPlanarComponentInfo=iI}'
CVPlanarPixelBufferInfo_YCbCrPlanar b'{CVPlanarPixelBufferInfo_YCbCrPlanar={CVPlanarComponentInfo=iI}{CVPlanarComponentInfo=iI}{CVPlanarComponentInfo=iI}'
CVPlanarComponentInfo b'{CVPlanarComponentInfo=iI}'
CVTime b'{u CVTime=qii}'
CVSMPTETime b'{CVSMPTETime=SSIISSSS}'
CVPlanarPixelBufferInfo b'{CVPlanarPixelBufferInfo=[1{CVPlanarComponentInfo=iI}]}'
CATTransferM3D b'{CATTransferM3D=DDDD}'
代码本身的工作方式与我希望的一样,但在我导入模块时,它会一直打印出来。有人知道怎么修吗?任何帮助都将不胜感激

检查我的答案是否有可能的副本检查我的答案是否有可能的副本