- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在处理我的代码,因为我在 sqlite3 数据库中搜索匹配的字符串,并与数组中的字符串列表进行比较。
我在编写代码时需要一些帮助,因为在比较名为 prog_id
的数组中的字符串列表时,我不知道如何在数据库中找到匹配的字符串。
当我尝试这样做时:
#get access to the database
profilePath = xbmc.translatePath(os.path.join('special://userdata/addon_data/script.tvguide', 'source.db'))
con = database.connect(profilePath)
cur = con.cursor()
cur.execute('SELECT button_ids, button_width FROM buttons')
buttonList = list()
buttons = cur.fetchall()
for pos_X, pos_Y, prog_id, prog_width in zip(positions_X, positions_Y, programs_id, program_width):
if CurrentRow == 375:
if int(CurrentWidth) > 342:
if int(pos_X) == 375:
for buttons_id in zip(buttonList):
if int(buttons_id) == int(prog_id):
print buttons_id
print button_width
这是数组中 buttons_id
的字符串列表:
22:25:58 T:5624 NOTICE: ('3002',)
22:25:58 T:5624 NOTICE: ('3003',)
22:25:58 T:5624 NOTICE: ('3004',)
22:25:58 T:5624 NOTICE: ('3005',)
22:25:58 T:5624 NOTICE: ('3006',)
22:25:58 T:5624 NOTICE: ('3007',)
22:25:58 T:5624 NOTICE: ('3008',)
22:25:58 T:5624 NOTICE: ('3009',)
22:25:58 T:5624 NOTICE: ('3010',)
22:25:58 T:5624 NOTICE: ('3011',)
22:25:58 T:5624 NOTICE: ('3012',)
22:25:58 T:5624 NOTICE: ('3013',)
22:25:58 T:5624 NOTICE: ('3014',)
22:25:58 T:5624 NOTICE: ('3015',)
22:25:58 T:5624 NOTICE: ('3016',)
22:25:58 T:5624 NOTICE: ('3017',)
22:25:58 T:5624 NOTICE: ('3018',)
22:25:58 T:5624 NOTICE: ('3019',)
22:25:58 T:5624 NOTICE: ('3020',)
22:25:58 T:5624 NOTICE: ('3021',)
22:25:58 T:5624 NOTICE: ('3022',)
22:25:58 T:5624 NOTICE: ('3023',)
22:25:58 T:5624 NOTICE: ('3024',)
22:25:58 T:5624 NOTICE: ('3025',)
22:25:58 T:5624 NOTICE: ('3026',)
22:25:58 T:5624 NOTICE: ('3027',)
22:25:58 T:5624 NOTICE: ('3028',)
22:25:58 T:5624 NOTICE: ('3029',)
22:25:58 T:5624 NOTICE: ('3030',)
22:25:58 T:5624 NOTICE: ('3031',)
22:25:58 T:5624 NOTICE: ('3032',)
22:25:58 T:5624 NOTICE: ('3033',)
22:25:58 T:5624 NOTICE: ('3034',)
22:25:58 T:5624 NOTICE: ('3035',)
22:25:58 T:5624 NOTICE: ('3036',)
22:25:58 T:5624 NOTICE: ('3037',)
22:25:58 T:5624 NOTICE: ('3038',)
22:25:58 T:5624 NOTICE: ('3039',)
22:25:58 T:5624 NOTICE: ('3040',)
22:25:58 T:5624 NOTICE: ('3041',)
22:25:58 T:5624 NOTICE: ('3042',)
22:25:58 T:5624 NOTICE: ('3043',)
22:25:58 T:5624 NOTICE: ('3044',)
22:25:58 T:5624 NOTICE: ('3045',)
22:25:58 T:5624 NOTICE: ('3046',)
22:25:58 T:5624 NOTICE: ('3047',)
22:25:58 T:5624 NOTICE: ('3048',)
22:25:58 T:5624 NOTICE: ('3049',)
22:25:58 T:5624 NOTICE: ('3050',)
22:25:58 T:5624 NOTICE: ('3051',)
22:25:58 T:5624 NOTICE: ('3052',)
22:25:58 T:5624 NOTICE: ('3053',)
22:25:58 T:5624 NOTICE: ('3054',)
22:25:58 T:5624 NOTICE: ('3055',)
22:25:58 T:5624 NOTICE: ('3056',)
22:25:58 T:5624 NOTICE: ('3057',)
22:25:58 T:5624 NOTICE: ('3058',)
22:25:58 T:5624 NOTICE: ('3059',)
22:25:58 T:5624 NOTICE: ('3060',)
22:25:58 T:5624 NOTICE: ('3061',)
22:25:58 T:5624 NOTICE: ('3062',)
22:25:58 T:5624 NOTICE: ('3063',)
22:25:58 T:5624 NOTICE: ('3064',)
22:25:58 T:5624 NOTICE: ('3065',)
22:25:58 T:5624 NOTICE: ('3066',)
22:25:58 T:5624 NOTICE: ('3067',)
22:25:58 T:5624 NOTICE: ('3068',)
22:25:58 T:5624 NOTICE: ('3069',)
22:25:58 T:5624 NOTICE: ('3070',)
22:25:58 T:5624 NOTICE: ('3071',)
22:25:58 T:5624 NOTICE: ('3072',)
22:25:58 T:5624 NOTICE: ('3073',)
22:25:58 T:5624 NOTICE: ('3074',)
22:25:58 T:5624 NOTICE: ('3075',)
22:25:58 T:5624 NOTICE: ('3076',)
22:25:58 T:5624 NOTICE: ('3077',)
22:25:58 T:5624 NOTICE: ('3078',)
22:25:58 T:5624 NOTICE: ('3079',)
22:25:58 T:5624 NOTICE: ('3080',)
22:25:58 T:5624 NOTICE: ('3081',)
22:25:58 T:5624 NOTICE: ('3082',)
22:25:58 T:5624 NOTICE: ('3083',)
22:25:58 T:5624 NOTICE: ('3084',)
22:25:58 T:5624 NOTICE: ('3085',)
22:25:58 T:5624 NOTICE: ('3086',)
22:25:58 T:5624 NOTICE: ('3087',)
22:25:58 T:5624 NOTICE: ('3088',)
22:25:58 T:5624 NOTICE: ('3089',)
22:25:58 T:5624 NOTICE: ('3090',)
22:25:58 T:5624 NOTICE: ('3091',)
22:25:58 T:5624 NOTICE: ('3092',)
22:25:58 T:5624 NOTICE: ('3093',)
22:25:58 T:5624 NOTICE: ('3094',)
22:25:58 T:5624 NOTICE: ('3095',)
22:25:58 T:5624 NOTICE: ('3096',)
22:25:58 T:5624 NOTICE: ('3097',)
22:25:58 T:5624 NOTICE: ('3098',)
22:25:58 T:5624 NOTICE: ('3099',)
22:25:58 T:5624 NOTICE: ('3100',)
22:25:58 T:5624 NOTICE: ('3101',)
22:25:58 T:5624 NOTICE: ('3102',)
22:25:58 T:5624 NOTICE: ('3103',)
22:25:58 T:5624 NOTICE: ('3104',)
22:25:58 T:5624 NOTICE: ('3105',)
22:25:58 T:5624 NOTICE: ('3106',)
22:25:58 T:5624 NOTICE: ('3107',)
22:25:58 T:5624 NOTICE: ('3108',)
22:25:58 T:5624 NOTICE: ('3109',)
22:25:58 T:5624 NOTICE: ('3110',)
22:25:58 T:5624 NOTICE: ('3111',)
22:25:58 T:5624 NOTICE: ('3112',)
22:25:58 T:5624 NOTICE: ('3113',)
22:25:58 T:5624 NOTICE: ('3114',)
22:25:58 T:5624 NOTICE: ('3115',)
22:25:58 T:5624 NOTICE: ('3116',)
22:25:58 T:5624 NOTICE: ('3117',)
22:25:58 T:5624 NOTICE: ('3118',)
22:25:58 T:5624 NOTICE: ('3119',)
22:25:58 T:5624 NOTICE: ('3120',)
22:25:58 T:5624 NOTICE: ('3121',)
22:25:58 T:5624 NOTICE: ('3122',)
22:25:58 T:5624 NOTICE: ('3123',)
22:25:58 T:5624 NOTICE: ('3124',)
22:25:58 T:5624 NOTICE: ('3125',)
22:25:58 T:5624 NOTICE: ('3126',)
22:25:58 T:5624 NOTICE: ('3127',)
22:25:58 T:5624 NOTICE: ('3128',)
22:25:58 T:5624 NOTICE: ('3129',)
22:25:58 T:5624 NOTICE: ('3130',)
22:25:58 T:5624 NOTICE: ('3131',)
22:25:58 T:5624 NOTICE: ('3132',)
22:25:58 T:5624 NOTICE: ('3133',)
22:25:58 T:5624 NOTICE: ('3134',)
22:25:58 T:5624 NOTICE: ('3135',)
22:25:58 T:5624 NOTICE: ('3136',)
22:25:58 T:5624 NOTICE: ('3137',)
22:25:58 T:5624 NOTICE: ('3138',)
22:25:58 T:5624 NOTICE: ('3139',)
22:25:58 T:5624 NOTICE: ('3140',)
22:25:58 T:5624 NOTICE: ('3141',)
22:25:58 T:5624 NOTICE: ('3142',)
22:25:58 T:5624 NOTICE: ('3143',)
22:25:58 T:5624 NOTICE: ('3144',)
22:25:58 T:5624 NOTICE: ('3145',)
22:25:58 T:5624 NOTICE: ('3146',)
22:25:58 T:5624 NOTICE: ('3147',)
22:25:58 T:5624 NOTICE: ('3148',)
22:25:58 T:5624 NOTICE: ('3149',)
22:25:58 T:5624 NOTICE: ('3150',)
22:25:58 T:5624 NOTICE: ('3151',)
22:25:58 T:5624 NOTICE: ('3152',)
22:25:58 T:5624 NOTICE: ('3153',)
22:25:58 T:5624 NOTICE: ('3154',)
22:25:58 T:5624 NOTICE: ('3155',)
22:25:58 T:5624 NOTICE: ('3156',)
22:25:58 T:5624 NOTICE: ('3157',)
22:25:58 T:5624 NOTICE: ('3158',)
22:25:58 T:5624 NOTICE: ('3159',)
22:25:58 T:5624 NOTICE: ('3160',)
22:25:58 T:5624 NOTICE: ('3161',)
22:25:58 T:5624 NOTICE: ('3162',)
22:25:58 T:5624 NOTICE: ('3163',)
22:25:58 T:5624 NOTICE: ('3164',)
22:25:58 T:5624 NOTICE: ('3165',)
22:25:58 T:5624 NOTICE: ('3166',)
22:25:58 T:5624 NOTICE: ('3167',)
22:25:58 T:5624 NOTICE: ('3168',)
22:25:58 T:5624 NOTICE: ('3169',)
22:25:58 T:5624 NOTICE: ('3170',)
22:25:58 T:5624 NOTICE: ('3171',)
22:25:58 T:5624 NOTICE: ('3172',)
22:25:58 T:5624 NOTICE: ('3173',)
22:25:58 T:5624 NOTICE: ('3174',)
22:25:58 T:5624 NOTICE: ('3175',)
22:25:58 T:5624 NOTICE: ('3176',)
22:25:58 T:5624 NOTICE: ('3177',)
22:25:58 T:5624 NOTICE: ('3178',)
22:25:58 T:5624 NOTICE: ('3179',)
22:25:58 T:5624 NOTICE: ('3180',)
22:25:58 T:5624 NOTICE: ('3181',)
22:25:58 T:5624 NOTICE: ('3182',)
22:25:58 T:5624 NOTICE: ('3183',)
22:25:58 T:5624 NOTICE: ('3184',)
22:25:58 T:5624 NOTICE: ('3185',)
22:25:58 T:5624 NOTICE: ('3186',)
22:25:58 T:5624 NOTICE: ('3187',)
22:25:58 T:5624 NOTICE: ('3188',)
22:25:58 T:5624 NOTICE: ('3189',)
22:25:58 T:5624 NOTICE: ('3190',)
22:25:58 T:5624 NOTICE: ('3191',)
22:25:58 T:5624 NOTICE: ('3192',)
22:25:58 T:5624 NOTICE: ('3193',)
22:25:58 T:5624 NOTICE: ('3194',)
22:25:58 T:5624 NOTICE: ('3195',)
22:25:58 T:5624 NOTICE: ('3196',)
22:25:58 T:5624 NOTICE: ('3197',)
22:25:58 T:5624 NOTICE: ('3198',)
22:25:58 T:5624 NOTICE: ('3199',)
22:25:58 T:5624 NOTICE: ('3200',)
22:25:58 T:5624 NOTICE: ('3201',)
22:25:58 T:5624 NOTICE: ('3202',)
22:25:58 T:5624 NOTICE: ('3203',)
22:25:58 T:5624 NOTICE: ('3204',)
22:25:58 T:5624 NOTICE: ('3205',)
22:25:58 T:5624 NOTICE: ('3206',)
22:25:58 T:5624 NOTICE: ('3207',)
22:25:58 T:5624 NOTICE: ('3208',)
22:25:58 T:5624 NOTICE: ('3209',)
22:25:58 T:5624 NOTICE: ('3210',)
22:25:58 T:5624 NOTICE: ('3211',)
22:25:58 T:5624 NOTICE: ('3212',)
22:25:58 T:5624 NOTICE: ('3213',)
22:25:58 T:5624 NOTICE: ('3214',)
22:25:58 T:5624 NOTICE: ('3215',)
22:25:58 T:5624 NOTICE: ('3216',)
22:25:58 T:5624 NOTICE: ('3217',)
22:25:58 T:5624 NOTICE: ('3218',)
22:25:58 T:5624 NOTICE: ('3219',)
22:25:58 T:5624 NOTICE: ('3220',)
22:25:58 T:5624 NOTICE: ('3221',)
22:25:58 T:5624 NOTICE: ('3222',)
22:25:58 T:5624 NOTICE: ('3223',)
22:25:58 T:5624 NOTICE: ('3224',)
22:25:58 T:5624 NOTICE: ('3225',)
22:25:58 T:5624 NOTICE: ('3226',)
22:25:58 T:5624 NOTICE: ('3227',)
22:25:58 T:5624 NOTICE: ('3228',)
22:25:58 T:5624 NOTICE: ('3229',)
22:25:58 T:5624 NOTICE: ('3230',)
22:25:58 T:5624 NOTICE: ('3231',)
22:25:58 T:5624 NOTICE: ('3232',)
22:25:58 T:5624 NOTICE: ('3233',)
22:25:58 T:5624 NOTICE: ('3234',)
22:25:58 T:5624 NOTICE: ('3235',)
22:25:58 T:5624 NOTICE: ('3236',)
22:25:58 T:5624 NOTICE: ('3237',)
22:25:58 T:5624 NOTICE: ('3238',)
22:25:58 T:5624 NOTICE: ('3239',)
22:25:58 T:5624 NOTICE: ('3240',)
22:25:58 T:5624 NOTICE: ('3241',)
22:25:58 T:5624 NOTICE: ('3242',)
22:25:58 T:5624 NOTICE: ('3243',)
22:25:58 T:5624 NOTICE: ('3244',)
22:25:58 T:5624 NOTICE: ('3245',)
22:25:58 T:5624 NOTICE: ('3246',)
22:25:58 T:5624 NOTICE: ('3247',)
22:25:58 T:5624 NOTICE: ('3248',)
22:25:58 T:5624 NOTICE: ('3249',)
22:25:58 T:5624 NOTICE: ('3250',)
22:25:58 T:5624 NOTICE: ('3251',)
22:25:58 T:5624 NOTICE: ('3252',)
22:25:58 T:5624 NOTICE: ('3253',)
22:25:58 T:5624 NOTICE: ('3254',)
22:25:58 T:5624 NOTICE: ('3255',)
22:25:58 T:5624 NOTICE: ('3256',)
22:25:58 T:5624 NOTICE: ('3257',)
22:25:58 T:5624 NOTICE: ('3258',)
22:25:58 T:5624 NOTICE: ('3259',)
22:25:58 T:5624 NOTICE: ('3260',)
22:25:58 T:5624 NOTICE: ('3261',)
22:25:58 T:5624 NOTICE: ('3262',)
22:25:58 T:5624 NOTICE: ('3263',)
22:25:58 T:5624 NOTICE: ('3264',)
22:25:58 T:5624 NOTICE: ('3265',)
22:25:58 T:5624 NOTICE: ('3266',)
22:25:58 T:5624 NOTICE: ('3267',)
22:25:58 T:5624 NOTICE: ('3268',)
22:25:58 T:5624 NOTICE: ('3269',)
22:25:58 T:5624 NOTICE: ('3270',)
22:25:58 T:5624 NOTICE: ('3271',)
22:25:58 T:5624 NOTICE: ('3272',)
22:25:58 T:5624 NOTICE: ('3273',)
22:25:58 T:5624 NOTICE: ('3274',)
22:25:58 T:5624 NOTICE: ('3275',)
22:25:58 T:5624 NOTICE: ('3276',)
22:25:58 T:5624 NOTICE: ('3277',)
22:25:58 T:5624 NOTICE: ('3278',)
22:25:58 T:5624 NOTICE: ('3279',)
22:25:58 T:5624 NOTICE: ('3280',)
22:25:58 T:5624 NOTICE: ('3281',)
22:25:58 T:5624 NOTICE: ('3282',)
22:25:58 T:5624 NOTICE: ('3283',)
22:25:58 T:5624 NOTICE: ('3284',)
22:25:58 T:5624 NOTICE: ('3285',)
22:25:58 T:5624 NOTICE: ('3286',)
22:25:58 T:5624 NOTICE: ('3287',)
22:25:58 T:5624 NOTICE: ('3288',)
22:25:58 T:5624 NOTICE: ('3289',)
22:25:58 T:5624 NOTICE: ('3290',)
22:25:58 T:5624 NOTICE: ('3291',)
22:25:58 T:5624 NOTICE: ('3292',)
22:25:58 T:5624 NOTICE: ('3293',)
22:25:58 T:5624 NOTICE: ('3294',)
22:25:58 T:5624 NOTICE: ('3295',)
22:25:58 T:5624 NOTICE: ('3296',)
22:25:58 T:5624 NOTICE: ('3297',)
22:25:58 T:5624 NOTICE: ('3298',)
22:25:58 T:5624 NOTICE: ('3299',)
22:25:58 T:5624 NOTICE: ('3300',)
22:25:58 T:5624 NOTICE: ('3301',)
22:25:58 T:5624 NOTICE: ('3302',)
22:25:58 T:5624 NOTICE: ('3303',)
22:25:58 T:5624 NOTICE: ('3304',)
22:25:58 T:5624 NOTICE: ('3305',)
22:25:58 T:5624 NOTICE: ('3306',)
22:25:58 T:5624 NOTICE: ('3307',)
22:25:58 T:5624 NOTICE: ('3308',)
22:25:58 T:5624 NOTICE: ('3309',)
22:25:58 T:5624 NOTICE: ('3310',)
22:25:58 T:5624 NOTICE: ('3311',)
22:25:58 T:5624 NOTICE: ('3312',)
22:25:58 T:5624 NOTICE: ('3313',)
22:25:58 T:5624 NOTICE: ('3314',)
22:25:58 T:5624 NOTICE: ('3315',)
22:25:58 T:5624 NOTICE: ('3316',)
22:25:58 T:5624 NOTICE: ('3317',)
22:25:58 T:5624 NOTICE: ('3318',)
22:25:58 T:5624 NOTICE: ('3319',)
22:25:58 T:5624 NOTICE: ('3320',)
22:25:58 T:5624 NOTICE: ('3321',)
22:25:58 T:5624 NOTICE: ('3322',)
22:25:58 T:5624 NOTICE: ('3323',)
22:25:58 T:5624 NOTICE: ('3324',)
22:25:58 T:5624 NOTICE: ('3325',)
22:25:58 T:5624 NOTICE: ('3326',)
22:25:58 T:5624 NOTICE: ('3327',)
22:25:58 T:5624 NOTICE: ('3328',)
22:25:58 T:5624 NOTICE: ('3329',)
22:25:58 T:5624 NOTICE: ('3330',)
22:25:58 T:5624 NOTICE: ('3331',)
22:25:58 T:5624 NOTICE: ('3332',)
22:25:58 T:5624 NOTICE: ('3333',)
22:25:58 T:5624 NOTICE: ('3334',)
22:25:58 T:5624 NOTICE: ('3335',)
22:25:58 T:5624 NOTICE: ('3336',)
22:25:58 T:5624 NOTICE: ('3337',)
22:25:58 T:5624 NOTICE: ('3338',)
22:25:58 T:5624 NOTICE: ('3339',)
22:25:58 T:5624 NOTICE: ('3340',)
22:25:58 T:5624 NOTICE: ('3341',)
22:25:58 T:5624 NOTICE: ('3342',)
22:25:58 T:5624 NOTICE: ('3343',)
22:25:58 T:5624 NOTICE: ('3344',)
22:25:58 T:5624 NOTICE: ('3345',)
22:25:58 T:5624 NOTICE: ('3346',)
22:25:58 T:5624 NOTICE: ('3347',)
22:25:58 T:5624 NOTICE: ('3348',)
22:25:58 T:5624 NOTICE: ('3349',)
22:25:58 T:5624 NOTICE: ('3350',)
22:25:58 T:5624 NOTICE: ('3351',)
22:25:58 T:5624 NOTICE: ('3352',)
22:25:58 T:5624 NOTICE: ('3353',)
22:25:58 T:5624 NOTICE: ('3354',)
22:25:58 T:5624 NOTICE: ('3355',)
22:25:58 T:5624 NOTICE: ('3356',)
22:25:58 T:5624 NOTICE: ('3357',)
22:25:58 T:5624 NOTICE: ('3358',)
22:25:58 T:5624 NOTICE: ('3359',)
22:25:58 T:5624 NOTICE: ('3360',)
22:25:58 T:5624 NOTICE: ('3361',)
22:25:58 T:5624 NOTICE: ('3362',)
22:25:58 T:5624 NOTICE: ('3363',)
22:25:58 T:5624 NOTICE: ('3364',)
22:25:58 T:5624 NOTICE: ('3365',)
22:25:58 T:5624 NOTICE: ('3366',)
22:25:58 T:5624 NOTICE: ('3367',)
22:25:58 T:5624 NOTICE: ('3368',)
22:25:58 T:5624 NOTICE: ('3369',)
22:25:58 T:5624 NOTICE: ('3370',)
22:25:58 T:5624 NOTICE: ('3371',)
22:25:58 T:5624 NOTICE: ('3372',)
22:25:58 T:5624 NOTICE: ('3373',)
22:25:58 T:5624 NOTICE: ('3374',)
22:25:58 T:5624 NOTICE: ('3375',)
22:25:58 T:5624 NOTICE: ('3376',)
22:25:58 T:5624 NOTICE: ('3377',)
22:25:58 T:5624 NOTICE: ('3378',)
22:25:58 T:5624 NOTICE: ('3379',)
22:25:58 T:5624 NOTICE: ('3380',)
22:25:58 T:5624 NOTICE: ('3381',)
22:25:58 T:5624 NOTICE: ('3382',)
22:25:58 T:5624 NOTICE: ('3383',)
22:25:58 T:5624 NOTICE: ('3384',)
22:25:58 T:5624 NOTICE: ('3385',)
22:25:58 T:5624 NOTICE: ('3386',)
22:25:58 T:5624 NOTICE: ('3387',)
22:25:58 T:5624 NOTICE: ('3388',)
22:25:58 T:5624 NOTICE: ('3389',)
22:25:58 T:5624 NOTICE: ('3390',)
22:25:58 T:5624 NOTICE: ('3391',)
22:25:58 T:5624 NOTICE: ('3392',)
22:25:58 T:5624 NOTICE: ('3393',)
22:25:58 T:5624 NOTICE: ('3394',)
22:25:58 T:5624 NOTICE: ('3395',)
22:25:58 T:5624 NOTICE: ('3396',)
22:25:58 T:5624 NOTICE: ('3397',)
22:25:58 T:5624 NOTICE: ('3398',)
22:25:58 T:5624 NOTICE: ('3399',)
22:25:58 T:5624 NOTICE: ('3400',)
22:25:58 T:5624 NOTICE: ('3401',)
22:25:58 T:5624 NOTICE: ('3402',)
22:25:58 T:5624 NOTICE: ('3403',)
22:25:58 T:5624 NOTICE: ('3404',)
22:25:58 T:5624 NOTICE: ('3405',)
22:25:58 T:5624 NOTICE: ('3406',)
22:25:58 T:5624 NOTICE: ('3407',)
22:25:58 T:5624 NOTICE: ('3408',)
22:25:58 T:5624 NOTICE: ('3409',)
22:25:58 T:5624 NOTICE: ('3410',)
22:25:58 T:5624 NOTICE: ('3411',)
22:25:58 T:5624 NOTICE: ('3412',)
22:25:58 T:5624 NOTICE: ('3413',)
22:25:58 T:5624 NOTICE: ('3414',)
22:25:58 T:5624 NOTICE: ('3415',)
22:25:58 T:5624 NOTICE: ('3416',)
22:25:58 T:5624 NOTICE: ('3417',)
22:25:58 T:5624 NOTICE: ('3418',)
22:25:58 T:5624 NOTICE: ('3419',)
22:25:58 T:5624 NOTICE: ('3420',)
22:25:58 T:5624 NOTICE: ('3421',)
22:25:58 T:5624 NOTICE: ('3422',)
22:25:58 T:5624 NOTICE: ('3423',)
22:25:58 T:5624 NOTICE: ('3424',)
22:25:58 T:5624 NOTICE: ('3425',)
22:25:58 T:5624 NOTICE: ('3426',)
22:25:58 T:5624 NOTICE: ('3427',)
22:25:58 T:5624 NOTICE: ('3428',)
22:25:58 T:5624 NOTICE: ('3429',)
22:25:58 T:5624 NOTICE: ('3430',)
22:25:58 T:5624 NOTICE: ('3431',)
22:25:58 T:5624 NOTICE: ('3432',)
22:25:58 T:5624 NOTICE: ('3433',)
22:25:58 T:5624 NOTICE: ('3434',)
22:25:58 T:5624 NOTICE: ('3435',)
22:25:58 T:5624 NOTICE: ('3436',)
22:25:58 T:5624 NOTICE: ('3437',)
22:25:58 T:5624 NOTICE: ('3438',)
22:25:58 T:5624 NOTICE: ('3439',)
22:25:58 T:5624 NOTICE: ('3440',)
22:25:58 T:5624 NOTICE: ('3441',)
22:25:58 T:5624 NOTICE: ('3442',)
22:25:58 T:5624 NOTICE: ('3443',)
22:25:58 T:5624 NOTICE: ('3444',)
22:25:58 T:5624 NOTICE: ('3445',)
22:25:58 T:5624 NOTICE: ('3446',)
22:25:58 T:5624 NOTICE: ('3447',)
22:25:58 T:5624 NOTICE: ('3448',)
22:25:58 T:5624 NOTICE: ('3449',)
22:25:58 T:5624 NOTICE: ('3450',)
22:25:58 T:5624 NOTICE: ('3451',)
22:25:58 T:5624 NOTICE: ('3452',)
22:25:58 T:5624 NOTICE: ('3453',)
22:25:58 T:5624 NOTICE: ('3454',)
22:25:58 T:5624 NOTICE: ('3455',)
22:25:58 T:5624 NOTICE: ('3456',)
22:25:58 T:5624 NOTICE: ('3457',)
22:25:58 T:5624 NOTICE: ('3458',)
22:25:58 T:5624 NOTICE: ('3459',)
22:25:58 T:5624 NOTICE: ('3460',)
22:25:58 T:5624 NOTICE: ('3461',)
22:25:58 T:5624 NOTICE: ('3462',)
22:25:58 T:5624 NOTICE: ('3463',)
22:25:58 T:5624 NOTICE: ('3464',)
22:25:58 T:5624 NOTICE: ('3465',)
22:25:58 T:5624 NOTICE: ('3466',)
22:25:58 T:5624 NOTICE: ('3467',)
22:25:58 T:5624 NOTICE: ('3468',)
22:25:58 T:5624 NOTICE: ('3469',)
22:25:58 T:5624 NOTICE: ('3470',)
22:25:58 T:5624 NOTICE: ('3471',)
22:25:58 T:5624 NOTICE: ('3472',)
22:25:58 T:5624 NOTICE: ('3473',)
22:25:58 T:5624 NOTICE: ('3474',)
22:25:58 T:5624 NOTICE: ('3475',)
22:25:58 T:5624 NOTICE: ('3476',)
22:25:58 T:5624 NOTICE: ('3477',)
22:25:58 T:5624 NOTICE: ('3478',)
22:25:58 T:5624 NOTICE: ('3479',)
22:25:58 T:5624 NOTICE: ('3480',)
22:25:58 T:5624 NOTICE: ('3481',)
22:25:58 T:5624 NOTICE: ('3482',)
22:25:58 T:5624 NOTICE: ('3483',)
22:25:58 T:5624 NOTICE: ('3484',)
这是 prog_id
数组中的字符串列表:
22:29:34 T:488 NOTICE: 3140
22:29:34 T:488 NOTICE: 3209
22:29:34 T:488 NOTICE: 3278
22:29:34 T:488 NOTICE: 3347
22:29:34 T:488 NOTICE: 3416
在我编写的代码中,我试图比较 prog_id
数组中的字符串,看看它是否可以在名为 buttons_id< 的数组的数据库中找到匹配的字符串
.
你能不能给我一个例子,说明我如何在与 prog_id
和 buttons_id
比较时在数组中找到匹配的字符串,看看我是否能找到匹配的字符串获取匹配的程序 ID?
最佳答案
如果要对 button_id 行进行分组,请使用 prog
行作为键,并检查翻译后的行是否在字典中,如果是,则将其附加到列表中:
d = {k:[] for k in prog}
for line in button_ids:
trans = line.translate(None,"',()")
if trans in d:
d[trans].append(line)
或者使 prog_id 成为一个集合并检查翻译后的行是否在集合中:
d = set(prog_id)
for line in button_ids:
if line.translate(None,"',()"):
print(line)
在 str.translating 之后,您的行将采用与 prog_id 行相同的格式:
button_ids = ["22:25:58 T:5624 NOTICE: ('3002',)", "22:25:58 T:5624 NOTICE: ('3003',)", "22:25:58 T:5624 NOTICE: ('3004',)", "22:25:58 T:5624 NOTICE: ('3005',)", "22:25:58 T:5624 NOTICE: ('3006',)", "22:25:58 T:5624 NOTICE: ('3007',)", "22:25:58 T:5624 NOTICE: ('3008',)", "22:25:58 T:5624 NOTICE: ('3009',)", "22:25:58 T:5624 NOTICE: ('3010',)", "22:25:58 T:5624 NOTICE: ('3484',)"]
for line in button_ids:
print line.translate(None,"',()")
22:25:58 T:5624 NOTICE: 3002
22:25:58 T:5624 NOTICE: 3003
22:25:58 T:5624 NOTICE: 3004
22:25:58 T:5624 NOTICE: 3005
22:25:58 T:5624 NOTICE: 3006
22:25:58 T:5624 NOTICE: 3007
22:25:58 T:5624 NOTICE: 3008
22:25:58 T:5624 NOTICE: 3009
22:25:58 T:5624 NOTICE: 3010
22:25:58 T:5624 NOTICE: 3484
因此您将能够进行比较,这将比使用嵌套 for 循环更有效。
如果您想要所有匹配项的列表:
st = set(prod_id)
matched = [line for line in button_ids if line.translate(None,"',()") in st]
如果您只是在最后一个值上匹配元组中的数字,您可以将这些数字提取到一个集合中:
st = {line.rsplit(None,1)[1] for line in prog_id}
matched = [line for line in button_ids if line.rsplit(None,1)[1].translate(None,"',()") in st]
print(matched)
根据您提供的输入输出以下内容:
["22:25:58 T:5624 NOTICE: ('3140',)", "22:25:58 T:5624 NOTICE: ('3209',)", "22:25:58 T:5624 NOTICE: ('3278',)", "22:25:58 T:5624 NOTICE: ('3347',)", "22:25:58 T:5624 NOTICE: ('3416',)"
关于python - 比较两个字符串以找到匹配的字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30336557/
我想使用 NetworkX Graph 对象作为 Python dict 中的键。但是,我不希望默认的比较行为(即通过对象的地址)。相反,我希望同构图是 dict 中相同元素的键。 此行为是否已在某处
这个问题已经有答案了: What is the most effective way for float and double comparison? (33 个回答) 已关闭 7 年前。 在您认为我
我正在学习 C 编程,为了练习,我找到了一个需要解决的任务。这有点像一个游戏,有人选择一个单词,其他人猜测字母。我必须检查有多少给定的单词可能是所选单词的正确答案。 输入: 3 3//数字 n 和 m
我两天前开始学习C,在做作业时遇到了问题。我们的目的是从字符数组中获取字符列表,并通过计算连续字符并将其替换为数字来缩短它。对“a4b5c5”说“aaaabbbbbccccc”。这是我到目前为止的代码
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
为什么我在 if 中的比较不起作用?答案应该是 8 但它返回 0。 function findMissing(missingArray){ var getArray = missing
我想知道为什么以下 JavaScript 比较会给出不同的结果。 (1==true==1) true (2==true==2) false (0==false==0) false (0==false)
我想知道是否有人可以帮助我完成这个程序。编写一个接受两个字符串的函数。该函数应该将这两个字符串与字典顺序上排在第一位的字符串组合起来。两个字符串之间应该有一个空格。在一行上打印结果字符串。在一行上打印
有谁知道一个免费的开源库(实用程序类),它允许您比较一个 Java bean 的两个实例并返回一个属性列表/数组,这两个实例的值不同?请发布一个小样本。 干杯 托马斯 最佳答案 BeanCompara
我是java新手。任何人都可以给出以下类声明的含义 public class ListNode, V> { K key; V value; ListNode next;
我需要用 C 语言计算和比较 3 种不同大小(100 * 100、1000 * 1000 和 10000 * 10000)的 2 个矩阵相乘的执行时间。我编写了以下简单代码来为 1000 * 1000
当我在 ACCESS 2007 中运行以下 SQL 时 Select Location, COUNT(ApartmentBuildings) AS TotalIBuildingsManaged Fro
根据我对互斥锁的了解——它们通常提供对共享资源的锁定功能。因此,如果一个新线程想要访问这个锁定的共享资源——它要么退出,要么必须不断轮询锁(并在等待锁时浪费处理器周期)。 但是,监视器具有条件变量,它
通常在编程中,不应该比较浮点数据类型是否相等,因为存储的值通常是近似值。 由于两个非整数 Oracle NUMBER 值的存储方式不同(以 10 为基数),是否可以可靠地比较它们是否相等? 最佳答案
使用 PowerShell 时,我们偶尔会比较不同类型的对象。一个常见的场景是 $int -eq $bool (即其中 0 -eq $false 、 0 -ne $true 和任何非零值仅等于真,但不
#include #define MAX 1000 void any(char s1[], char s2[], char s3[]); int main() { char string1[
我想比较两个日期。 从这两个日期中,我只使用 ToShortDateString() 获取日期组件, 如下所示。现在的问题是当我比较两个日期时。它的 throw 错误—— "Operator >= c
用户输入一个数字( float 或整数),并且它必须大于下限。 这是从 UITextField 获取数字的代码: NSNumberFormatter * f = [[NSNumberFormatter
我已经摆弄这段代码大约一个小时了,它让我难以置信。我认为解决方案相当简单,但我似乎无法弄清楚。无论如何,这里去。我制作了一个 javascript 函数来检查用户输入的字符,以便它只能接受 7 个字符
我不太明白为什么当我们在不覆盖 equals 的情况下比较具有相同类属性的两个实例时方法,它将给出 false .但它会给出 true当我们比较一个案例类的两个实例时。例如 class A(val
我是一名优秀的程序员,十分优秀!