我无法用python找到重复的字符串

时间:2017-01-13 06:57:00

标签: python string python-3.x

我想从json文件中通过print resrc_lst[i]找到来自2文件的重复字符串,并从文本文件中找到line.split(' ' ,2)[2]拆分字符串。这是我的代码。

for i in range(len(resrc_lst)):
    print(resrc_lst[i])

    if(resrc_lst[i] != ""):   

        with open("clicker_out.txt", "r", encoding="utf8") as search_lst: 
            for line in search_lst:

                if resrc_lst[i].strip() in line.split(' ' ,2)[2]:
                    print(line.split(' ' ,2)[2])

我确定当我运行像这样显示的代码时,2个文件都有重复的字符串。

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\4

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nshhttp

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\(Default)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\wshelper

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\wwancfg

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\p2pnetsh

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\hnetmon

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nettrace

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\rpc

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\wlancfg

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nshipsec

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\whhelper

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\netiohlp

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\napmontr

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\WcnNetsh

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\dot3cfg

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\fwcfg

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\authfwcfg

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nshwfp

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\2

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\dhcpclient

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\(Default)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\(Default)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\Roaming\RefreshProcName

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HandleMgr

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\Service\Enable

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache\TransportDllPath

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DownloadManager\CryptoAlgo

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\Roaming

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache\MaxPendingDownloads

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\Service\PolicyRefreshInProgress

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\CacheMgr\Publication

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\SecurityManager

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache\MaxSimultaneousDownloads

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\SecurityManager\BlockSize

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\CooperativeCaching

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DiscoveryManager

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\Publisher

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache\MaxPendingOffers

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserenvDebugLevel

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache\MaxSimultaneousUploads

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\SecurityManager\Restricted\Seed

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DownloadManager\Download

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\CacheMgr\Republication

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache\Connection

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\SecurityManager\Restricted

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\Roaming\RefreshDllName

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache\ServerRole

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DownloadManager\Protocol

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DiscoveryManager\DiscoveryProviderDllPath

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DiscoveryManager\MinBackoffWindow

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache\DoNotUseSSL

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\HostedCache\ClientAuth

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DownloadManager\Peers\Connection

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DownloadManager\TransportDllPath

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\Service

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DownloadManager\Discovery

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\PolicyProvider

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DownloadManager\Upload

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DownloadManager

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\SecurityManager\NumBlocksPerSegment

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DownloadManager\UtilityIndex

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\Roaming\ForceRoamingDetect

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PeerDist\DiscoveryManager\RepubQuorumSize

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\4
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\4

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nshwfp
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nshwfp

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\dhcpclient
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\dhcpclient

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\wshelper
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\wshelper

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nshhttp
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nshhttp

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\fwcfg
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\fwcfg

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\authfwcfg
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\authfwcfg

C:\Windows\system32
C:\Windows\system32

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SourcePath

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DevicePath
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DevicePath

HKEY_LOCAL_MACHINE\System\Setup
HKEY_LOCAL_MACHINE\System\Setup

HKEY_LOCAL_MACHINE\SYSTEM\Setup\Upgrade
HKEY_LOCAL_MACHINE\SYSTEM\Setup\Upgrade

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\2
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\2

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\netiohlp
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\netiohlp

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\whhelper
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\whhelper

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\hnetmon
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\hnetmon

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\rpc
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\rpc

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\dot3cfg
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\dot3cfg

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\ldap\LdapClientIntegrity
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\ldap\LdapClientIntegrity

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\ldap\UseOldHostResolutionOrder
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\ldap\UseOldHostResolutionOrder

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\ldap\UseHostnameAsAlias
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\ldap\UseHostnameAsAlias

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\napmontr
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\napmontr

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\IPSEC\Policy\Local
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\IPSEC\Policy\Local

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nshipsec
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nshipsec

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nettrace
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\nettrace

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\WcnNetsh
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\WcnNetsh

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\p2pnetsh
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\p2pnetsh

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\wlancfg
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\wlancfg

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\wwancfg
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NetSh\wwancfg

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\iphlpsvc\Config
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\iphlpsvc\Config

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\iphlpsvc\config\Connectivity_Platform_Enabled
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\iphlpsvc\config\Connectivity_Platform_Enabled

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.44.3.4!7\캰=谘=齎
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.44.3.4!7\캰=谘=齎

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.44.3.4!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.44.3.4!7\Name

C:\Windows\System32\p2pcollab.dll
C:\Windows\System32\p2pcollab.dll

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.44.3.4!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.44.3.4!7\Name

C:\Windows\System32\p2pcollab.dll
C:\Windows\System32\p2pcollab.dll

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.47.1.1!7\(Default)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.47.1.1!7\(Default)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.47.1.1!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.47.1.1!7\Name

C:\Windows\System32\QAGENTRT.DLL
C:\Windows\System32\QAGENTRT.DLL

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.47.1.1!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.47.1.1!7\Name

C:\Windows\System32\QAGENTRT.DLL
C:\Windows\System32\QAGENTRT.DLL

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.64.1.1!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.64.1.1!7\Name

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.64.1.1!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.64.1.1!7\Name

C:\Windows\System32\dnsapi.dll
C:\Windows\System32\dnsapi.dll

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.64.1.1!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.64.1.1!7\Name

C:\Windows\System32\dnsapi.dll
C:\Windows\System32\dnsapi.dll

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.1!7\ 0\Cryptﮐ
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.1!7\ 0\Cryptﮐ

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.1!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.1!7\Name

C:\Windows\System32\fveui.dll
C:\Windows\System32\fveui.dll

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.1!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.1!7\Name

C:\Windows\System32\fveui.dll
C:\Windows\System32\fveui.dll

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.2!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.2!7\Name

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.2!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.2!7\Name

C:\Windows\System32\fveui.dll
C:\Windows\System32\fveui.dll

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.2!7\Name
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\OID\EncodingType 0\CryptDllFindOIDInfo\1.3.6.1.4.1.311.67.1.2!7\Name

C:\Windows\System32\fveui.dll
C:\Windows\System32\fveui.dll

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NapAgent\LocalConfig
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NapAgent\LocalConfig

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\(Default)
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\(Default)

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\Enroll\HcsGroups
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\Enroll\HcsGroups

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\Enroll\HcsGroups\(Default)

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\Enroll\HcsGroups\(Default)
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\Enroll\HcsGroups\(Default)

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\Enable Tracing
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\Enable Tracing

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\Tracing Level
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\LocalConfig\Tracing Level

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\Qecs\79617
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\Qecs\79617\Description

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\Qecs\79617\Registration Date

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\napagent\Qecs\79617\Validator Clsid

...

我在代码中打印2个值,它应该在2行中显示相同的字符串。为什么某些行不显示重复的字符串。

1 个答案:

答案 0 :(得分:0)

因为您使用的是 运算符,而不是用于检查重复的字符串。

下面:

HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 \服务\ napagent \ Qecs \ 79617 HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 \服务\ napagent \ Qecs \ 79617 \描述

字符串HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 \ services \ napagent \ Qecs \ 79617出现在字符串HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 \ services \ napagent \ Qecs \ 79617 \ Description但不重复

您可以尝试:

if resrc_lst[i].strip() == line.split(' ' ,2)[2]: