AI Bot Challenge

← Back to all posts
18
Chloe

This is a joint project, that my brother (bluemarlin1134) and I worked on together. My bro. named this project after his best friend which the code’s dialogue is modeled after.

It runs best on full screen and, the weather auto-location function works only when it runs on your computer as a program but, the manual input works like a charm. :)

if you haven't seen in the post down below, we updated the calculator and the thermometer so now the thermometer doesn't print out a bunch of decimal places, and the calculator accepts integers.

Commentshotnewtop
2

I got this message after sending exit. I got the scrolling ascii art, which was cool :). But then i got this message that i couldnt understand. You are located at None correct?:

1

@PYer Thanks for the info! The reason why this happened was: (I'm a messy coder) cough, cough Sometimes ... don't know why, ill head over to the weather function, and try to auto-locate you. Thanks!

1

I got that error
it is not a spam

1

This was an error

/home/runner/.site-packages/wikipedia/wikipedia.py:389: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.The code that caused this warning is on line 389 of the file /home/runner/.site-packages/wikipedia/wikipedia.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor. lis = BeautifulSoup(html).find_all('li')Traceback (most recent call last): File "main.py", line 964, in <module>
whattodo() File "main.py", line 746, in whattodo whattodo() File "main.py", line 746, in whattodo whattodo() File "main.py", line 736, in whattodo
wikipediamod()
File "main.py", line 912, in wikipediamod
topray()
File "main.py", line 897, in topray
wikipediamod()
File "main.py", line 911, in wikipediamod
print(wikipedia.summary(search))
File "/home/runner/.site-packages/wikipedia/util.py", line 28, in call
ret = self._cache[key] = self.fn(*args, **kwargs)
File "/home/runner/.site-packages/wikipedia/wikipedia.py", line 231, in summary
page_info = page(title, auto_suggest=auto_suggest, redirect=redirect)
File "/home/runner/.site-packages/wikipedia/wikipedia.py", line 276, in page
return WikipediaPage(title, redirect=redirect, preload=preload)
File "/home/runner/.site-packages/wikipedia/wikipedia.py", line 299, in init
self.load(redirect=redirect, preload=preload)
File "/home/runner/.site-packages/wikipedia/wikipedia.py", line 393, in
load
raise DisambiguationError(getattr(self, 'title', page['title']), may_refer_to)
wikipedia.exceptions.DisambiguationError: "Yes" may refer to:
yes and no
YES Prep Public Schools
YES (Your Extraordinary Saturday)
Young Eisner Scholars
Young Epidemiology Scholars
yes (Unix)
Philips :YES
Yes! Roadster
Yasuj Airport
OLT Express
Yale Entrepreneurial Society
YES Snowboards
The YES! Association
Yes! Youth Movement
Young European Socialists
Youth Empowerment Scheme
Youth Energy Squad (Y.E.S)
Youth Entrepreneurship and Sustainability
YES (Lithuanian political party)
Yes! (Hong Kong magazine)
Yes! (U.S. magazine)
Yes! (Philippine magazine)
Yes (novel)
Daniel Bryan
Yes (film)
yes (Israel)
YES Network
Yes TV
WYEZ
Y.E.S. 93.3FM
Yes (band)
Yes Featuring Jon Anderson, Trevor Rabin, Rick Wakeman
Yes (musical)
Yes (Yes album)
The Yes Album
Yes (Alvin Slaughter album)
Yes! (Chad Brock album)
Yes! (Jason Mraz album)
Yes! (k-os album)
Yes (Mika Nakashima album)
Yes (Morphine album)
Yes (Pet Shop Boys album)
Julie Fuchs
Yes L.A.
Amber
"Yes!" (Chad Brock song)
"Yes" (Coldplay song)
"Yes" (LMFAO song)
"Yes" (McAlmont & Butler song)
"Yes" (Sam Feldt song)
A Wolf In Sheep's Clothing
Confident
Yes
Dirty Dancing film soundtrack
Louisa Johnson
Beyoncé Knowles
Billy Swan
Connie Cato
Cornell Campbell
Dee C. Lee
Demi Lovato
The Family
Grapefruit
Jay & The Americans
Johnny Sandon
Manic Street Preachers
Merry Clayton
Peppino Di Capri
Pet Shop Boys
Roy Orbison
Schaffer the Darklord
Tim Moore
All pages beginning with Yes
Yesss (disambiguation)

1

Edit: We fixed the Weather function from giving you all those decimal places, and now the calculator accepts doubles.

1

Having so many text files as frames is a messy way to do the scrolling ASCII art. A cleaner approach would be to take a single file and iteratively print substring of each line.

import os, time

def cls():  # Clear screen
    os.system('cls' if os.name=='nt' else 'clear')

def marquee(txtart, speed, rtl=True):  # Pepperidge Farm remembers <marquee>.
    '''Display ASCII art scrolling in. Parameters:
    txtart -- path to ASCII art text file
    speed  -- rate of columns per second to display
    rtl    -- default True for right-to-left, set False for left-to-right
    '''
    with open(txtart) as f:
        art = f.read().splitlines()
    
    # Add trailing whitespace to any line shorter than the longest line.
    maxline = max(len(line) for line in art)
    for i in range(len(art)):
        if len(art[i]) < maxline:
            art[i] = art[i] + " " * (maxline - len(art[i]))
    
    artlength = len(art[0])
    for i in range(artlength + 1):
        cls()
        for line in art:
            if rtl:
                print(" " * (artlength - i) + line[0:i])
            else:
                print(line[-i:0 if i==0 else None])
        time.sleep(1 / speed)

marquee("goodbye.txt", 10, False)

Edit: Correct assignment for maxline.

1

@Nanashi thank you for the information

1

Nice. One comment, though, is that your calculator should accept floats. I looked up the weather for my city and tried to converting it into Fahrenheit using the calculator but got an error when your code tried to convert 1.8 to an integer.