How do I fix a bug where when I put my combination in a list like this ([ address )] , it says it’s empty and doesn’t print anything?

I’m using python to generate combinations of a 74 character string and I’m using two combinations strings which are “0123456789abcdef” and “QQQQQQ33”. I want the QQQQQQ33 to be in brackets [] so that when it is used, it uses the full string instead of generating all combinations of the string with 0123456789abcdef.

Whenever I use the brackets, which is like the only way to make it print the strings in full instead of each combination, it doesn’t print anything to console. It just finishes the code with a checkmark in replit without printing anything.

The reason I’m using brackets is because I want the character mapping to be able to map the full string so that when I change my code to be other strings that are similar to QQQQQQ33 like AAAAAA9898, it can choose those characters first and map them first.

My code so far is:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import itertools
class MyIterator:
def __init__(self, full_iterable, hex_string, repeat, mapping_function=None):
self.full_iterable = full_iterable
self.hex_string = hex_string
self.repeat = repeat
self.mapping_function = mapping_function
if self.mapping_function:
self.full_iterable = self.mapping_function(self.full_iterable)
self.combinations = iter(self._generate_combinations())
self.current = next(self.combinations, None)
def _generate_combinations(self):
# Use full_iterable and hex_string in itertools.product
return itertools.product(self.full_iterable,self.hex_string, repeat=self.repeat)
def __iter__(self):
return self
def __next__(self):
if self.current is not None:
private_key = ''.join(self.current)
self.current = next(self.combinations, None)
return private_key
else:
raise StopIteration
def custom_mapping(hex_string):
# Define the custom mapping here
char_to_number = {
'0': 9,
'1': 1,
'2': 2,
'3': 3,
'4': 4,
'5': 5,
'6': 6,
'7': 7,
'8': 8,
'9': 0,
'a': 10,
'b': 11,
'c': 12,
'd': 13,
'e': 14,
'f': 15,
'A': 16,
'B': 17,
'C': 18,
'D': 19,
'E': 20,
'F': 21,
'0xF977814e90dA44bFA03b6295A0616a897441aceC': -2,
}
filtered_chars = [char for char in hex_string if char in char_to_number]
# Sort the filtered characters based on the custom mapping
sorted_chars = sorted(filtered_chars,
key=lambda char: char_to_number[char])
return ''.join(sorted_chars)
full_iterable = ["QQQQQQ33"]
hex_string = '0123456789abcdef'
repeat = 74
my_iterator = MyIterator(full_iterable,
hex_string,
repeat,
mapping_function=custom_mapping)
for private_key in my_iterator:
account = private_key
print(account + "n")
</code>
<code>import itertools class MyIterator: def __init__(self, full_iterable, hex_string, repeat, mapping_function=None): self.full_iterable = full_iterable self.hex_string = hex_string self.repeat = repeat self.mapping_function = mapping_function if self.mapping_function: self.full_iterable = self.mapping_function(self.full_iterable) self.combinations = iter(self._generate_combinations()) self.current = next(self.combinations, None) def _generate_combinations(self): # Use full_iterable and hex_string in itertools.product return itertools.product(self.full_iterable,self.hex_string, repeat=self.repeat) def __iter__(self): return self def __next__(self): if self.current is not None: private_key = ''.join(self.current) self.current = next(self.combinations, None) return private_key else: raise StopIteration def custom_mapping(hex_string): # Define the custom mapping here char_to_number = { '0': 9, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 0, 'a': 10, 'b': 11, 'c': 12, 'd': 13, 'e': 14, 'f': 15, 'A': 16, 'B': 17, 'C': 18, 'D': 19, 'E': 20, 'F': 21, '0xF977814e90dA44bFA03b6295A0616a897441aceC': -2, } filtered_chars = [char for char in hex_string if char in char_to_number] # Sort the filtered characters based on the custom mapping sorted_chars = sorted(filtered_chars, key=lambda char: char_to_number[char]) return ''.join(sorted_chars) full_iterable = ["QQQQQQ33"] hex_string = '0123456789abcdef' repeat = 74 my_iterator = MyIterator(full_iterable, hex_string, repeat, mapping_function=custom_mapping) for private_key in my_iterator: account = private_key print(account + "n") </code>
import itertools

class MyIterator:
    def __init__(self, full_iterable, hex_string, repeat, mapping_function=None):
        self.full_iterable = full_iterable
        self.hex_string = hex_string
        self.repeat = repeat
        self.mapping_function = mapping_function

        if self.mapping_function:
            self.full_iterable = self.mapping_function(self.full_iterable)

        self.combinations = iter(self._generate_combinations())
        self.current = next(self.combinations, None)

    def _generate_combinations(self):
        # Use full_iterable and hex_string in itertools.product
        return itertools.product(self.full_iterable,self.hex_string, repeat=self.repeat)


    def __iter__(self):
        return self

    def __next__(self):
        if self.current is not None:
            private_key = ''.join(self.current)
            self.current = next(self.combinations, None)
            return private_key
        else:
            raise StopIteration


def custom_mapping(hex_string):

    # Define the custom mapping here
    char_to_number = {
        '0': 9,
        '1': 1,
        '2': 2,
        '3': 3,
        '4': 4,
        '5': 5,
        '6': 6,
        '7': 7,
        '8': 8,
        '9': 0,
        'a': 10,
        'b': 11,
        'c': 12,
        'd': 13,
        'e': 14,
        'f': 15,
        'A': 16,
        'B': 17,
        'C': 18,
        'D': 19,
        'E': 20,
        'F': 21,
        '0xF977814e90dA44bFA03b6295A0616a897441aceC': -2,
    }
    
    filtered_chars = [char for char in hex_string if char in char_to_number]
    
    # Sort the filtered characters based on the custom mapping
    sorted_chars = sorted(filtered_chars,
                          key=lambda char: char_to_number[char])
    
    return ''.join(sorted_chars)


full_iterable = ["QQQQQQ33"]

hex_string = '0123456789abcdef'
repeat = 74

my_iterator = MyIterator(full_iterable,
                         hex_string,
                         repeat,
                         mapping_function=custom_mapping)
for private_key in my_iterator:
    account = private_key 
    print(account + "n")

In full_iterable that is where I used the brackets to set it to [ ]. Right now, when I take out the brackets, it works and prints combinations but not the type of combinations I want. The combinations it prints without brackets is,

30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030

30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303031

30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303032

30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303033

30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303034

30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303035

I don’t want it to generate the combinations like this. I want it to generate combinations with QQQQ… in there like this:

QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ331QQQQQQ332QQQQQQ33d

QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ331QQQQQQ332QQQQQQ33e

QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ330QQQQQQ331QQQQQQ332QQQQQQ33f

Keep in mind that the character mapping needs to also map
QQQQQQ33 while it’s being printed like this. I will be setting full_iterable to be numerous strings that are similar to that so I will need to use the mapping to map the full strings first and second and so on.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật