Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list index out of range #73

Open
DawoodKMasood opened this issue Oct 9, 2021 · 4 comments
Open

list index out of range #73

DawoodKMasood opened this issue Oct 9, 2021 · 4 comments

Comments

@DawoodKMasood
Copy link

DawoodKMasood commented Oct 9, 2021

I am getting this error for some reason:

user@instance-3:~/binance-trading-bot-new-coins$ python3 main.py
working...
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/home/tkcartofficial/binance-trading-bot-new-coins/new_listings_scraper.py", line 70, in search_and_update
    latest_coin = get_last_coin()
  File "/home/tkcartofficial/binance-trading-bot-new-coins/new_listings_scraper.py", line 34, in get_last_coin
    uppers = ''.join(item[1] for item in enum if item[1].isupper() and (enum[enum.index(item)+1][1].isupper() or enum[enum.index(item)+1][1]==' ' or enum[enum.index(item)+1][1]==')') )
  File "/home/tkcartofficial/binance-trading-bot-new-coins/new_listings_scraper.py", line 34, in <genexpr>
    uppers = ''.join(item[1] for item in enum if item[1].isupper() and (enum[enum.index(item)+1][1].isupper() or enum[enum.index(item)+1][1]==' ' or enum[enum.index(item)+1][1]==')') )
IndexError: list index out of range
@sbhadade
Copy link

sbhadade commented Oct 9, 2021

i got the same issues . can anyone helps ?

@oularrea
Copy link

oularrea commented Oct 9, 2021

Any solution for this issue?

Thanks

@mmehrle
Copy link

mmehrle commented Oct 21, 2021

Same here - running it on OS X with python 3.10

@ericlighthofmann
Copy link

ericlighthofmann commented Oct 30, 2021

Hi - I rewrote get it working and be a little simpler/cleaner. It looks for all caps letters between parenthesis - let me know if this helps:

    symbols = re.findall('\(.*?\)', latest_announcement)
    uppers = []
    for symbol in symbols:
        symbol_without_parentheses = symbol.replace('(', '').replace(')', '')
        if symbol_without_parentheses.isupper():
            uppers.append(symbol_without_parentheses + 'USDT')

    return uppers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants