#off-topic-lounge-text

1 messages · Page 25 of 1

spark bridge
#

!e

while True:
    print('cool')

@meager anvil no

meager anvil
#

simplified it a bit

#

removed two last two lines from your code cuz they did nothing

primal bane
#

pets

#

thank you so much

#

sincerely

#

u saved some hours of my life. ill use these extra hours for the humanity

meager anvil
#

I also added __iter__ and __str__ for debugging

#

you can remove them if you dont need them

primal bane
#

oh actually i needed to do str as well hahaha

#

thanks man

meager anvil
#

👍

spark bridge
#

please help me

meager anvil
#

I dont understand what you need

spark bridge
#

wait

#


def main():
    y = input("\n hello welcome to smart boom: ")
    x = "hello"
    c = "help"
    e = "open notepad"
    g = "open cmd"


    def hello():
        if y == x:
            input("\n hello to u ")

    def helpp():
        if y == c:
            input("\n ((this is the list of comments)):\n hello \n open cmd \n open notepad \n ")

    def openn():
        if y == e:
            input(os.system('notepad'))
    
    def cmd():
        if y == g:
            input(os.system('cmd'))

            
    

    cmd()
    openn()
    hello()
    helpp()


main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
os.system('cls' or 'clear')
main()
#

can you help me now?

meager anvil
#

dont use single letter variables

#
while True:
    main()
    os.system('cls')
spark bridge
#

Thank you soooo much

#

🌹

primal bison
#
def pascal_level(a_list):
    print("this is into the function")
    print(a_list, "this is a_list's starting value")
    next_line= []
    for i in range (len(a_list)):
        print("works or not", "this is i", i)
        if len(a_list)== 1:
            print("a_list==1, executing second line")
            next_line= a_list
            next_line.append(1)
        elif i < len(a_list)-1:
            next_line.append(a_list[i]+a_list[i+1])
    print(a_list, "re-checking a_list")
    if len(a_list) > 1:
        print(a_list, "this is a_list")
        print("inserting the standard ones")
        next_line.insert(0,1)
        next_line.append(1)
        print("this is the next_line")
    print("this is the var next_line (still in function)")
    print(next_line)
    return next_line
    """
    :param a_list: a list represents the previous level in the pascal's triangl\
\
e construction
    :return: a new list with the previous elements summed
    """
    pass

if __name__ == '__main__':
    print("------------START---------------------")
    next_line = [1]
    print("moving into for loop")
    for i in range(10):
        print(next_line)
        print("printed next line")
        next_line = pascal_level(next_line)
        print("updating")
    print("out of the for loop now")
    print("                        ")
    print("                        ")
    print("printing the other stuff near the end now")
    print(pascal_level([1, 2, 3, 4, 5]))
    print(pascal_level([1, 1, 2, 3, 5, 8]))
    print(pascal_level([1, 1, 2, 3, 5, 8, 13, 1]))
    print("---------------End----------------")

#

moving into for loop
[1]
printed next line
this is into the function
[1] this is a_list's starting value
works or not this is i 0
a_list==1, executing second line
[1, 1] re-checking a_list
[1, 1] this is a_list
inserting the standard ones
this is the next_line
this is the var next_line (still in function)
[1, 1, 1, 1]
updating
[1, 1, 1, 1]
printed next line

#

place = str(input("Някое място?: "))
print(f" Тук-{place} ще се видят нашите герой! ")
name =str(input("Име на вълшебен герой: "))
print(f" О, {name}. Това име е добро!Да продължаваме нататък")
name1 = str(input("Име на друг вълшебен герой: "))
print(f"О, {name1} и това име е добро! Да продължаваме към следващият въпрос")
relation = str(input("Какви били те (приятели или нещо друго):"))
print(f" Те били {relation}. Да отидем на следващият въпрос ")
activity = str(input("Какво обичали да правят:"))
print(f"Добре, те обичали да {activity}. Да продължаваме нататък!")
age = int(input("На колко години бил първият герой?: "))
print(f" Той бил на {age}, което е доста добре. Хопити попити към следващият въпрос ")
age2 =int(input("На колко години бил вторият герой?:"))
print(f" Once upon a time in {place}, there were {name} and {name1}. They were{relation}.
They love to do {activity}.
{name} was {age} years old and {name1} was {age 2} years old")

dusty sigil
#

last second line is missing a ")"

#

for "print"

civic lantern
#
print(f"  Тук-{place} ще се видят нашите герой! ")
name =str(input("Име на вълшебен герой: "))
print(f" О,  {name}. Това име е добро!Да продължаваме нататък")
name1 = str(input("Име на друг вълшебен герой: "))
print(f"О, {name1} и това име е добро! Да продължаваме към следващият въпрос")
relation = str(input("Какви били те (приятели или нещо друго):"))
print(f"  Те били {relation}.   Да отидем на следващият въпрос ")
activity = str(input("Какво обичали да правят:"))
print(f"Добре, те обичали да {activity}. Да продължаваме нататък!")
age = int(input("На колко години бил първият герой?: "))
print(f" Той бил на {age}, което е доста добре. Хопити попити към следващият въпрос ")
age2 =int(input("На колко години бил вторият герой?:"))
print(f" Once upon a time in {place}, there were {name} and {name1}. They were{relation}.
They love to do {activity}.
{name} was {age} years old and {name1} was {age 2} years old") ```
primal bison
#

@civic lantern it has error

civic lantern
#

@civic lantern it has error
@primal bison yeah. I was trying to see it in format

dusty sigil
#

place = str(input("Някое място?: "))
print(f" Тук-{place} ще се видят нашите герой! ")
name =str(input("Име на вълшебен герой: "))
print(f" О, {name}. Това име е добро!Да продължаваме нататък")
name1 = str(input("Име на друг вълшебен герой: "))
print(f"О, {name1} и това име е добро! Да продължаваме към следващият въпрос")
relation = str(input("Какви били те (приятели или нещо друго):"))
print(f" Те били {relation}. Да отидем на следващият въпрос ")
activity = str(input("Какво обичали да правят:"))
print(f"Добре, те обичали да {activity}. Да продължаваме нататък!")
age = int(input("На колко години бил първият герой?: "))
print(f" Той бил на {age}, което е доста добре. Хопити попити към следващият въпрос ")
age2 =int(input("На колко години бил вторият герой?:"))
print(f" Once upon a time in {place}, there were {name} and {name1}. They were{relation}.They love to do {activity}.{name} was {age} years old and {name1} was {age2} years old")

primal bison
#

@dusty sigil thank you very much bro

dusty sigil
#

No problem

tranquil parcel
#

No problem
@dusty sigil just wondering, have u got any tips, i just started gcse in computer science

dusty sigil
#

Bruh, what's GCSE?

mild steppe
#

Hey i want to print both in one one line can anyone help me?
print("inch: ") print(inch)

primal bison
#

if anyone here knows some web scrapping please dm me

primal bane
#

print(linked[2])
print(linked[2].get_string())

#

print(linked[2])
print(linked[2].get_string())

#

linked = LinkedList()
linked.add('forward', 1, 'a')
linked.add('forward', 2, 'b')
linked.add('forward', 3, 'c')
linked.add('backward', 1, 'g')
linked.add('backward', 2, 'f')
linked.add('backward', 3, 'e')
linked.add('backward', 4, '1')
print(linked)

crimson laurel
#

Reminder that School Availabilities must be handed in by August 24th. If you do not hand one in your availability will be 3-11 Mon-Fri, and open-close on weekends.

The New Creamy Black Pepper Angus starts on Aug 28th, all staff must be aware of the new product build.

All Service staff, the new digital McCafe rewards program has started, please read the info posted in OurLounge

Here is your schedule for the week of 8/27/2018:

Monday, August 27, 2018 2:00 PM - 9:30 PM, GR

Tuesday, August 28, 2018 11:30 AM - 5:00 PM, GR

Wednesday, August 29, 2018 11:00 AM - 5:00 PM, GR

Thursday, August 30, 2018 11:00 AM - 5:00 PM, GR

Saturday, September 1, 2018 11:00 AM - 5:30 PM, GR

Sunday, September 2, 2018 8:00 AM - 2:00 PM, L/L

You have a total of 37.5 hours, 6 shifts and 0 closes.

If you have any questions about your schedule, please contact me, in person or by phone, as soon as possible.

Regards,

Your manager.

Note: This email account is used for information distribution only. No replies nor email should be sent directly to this account.

shut tree
#

?? @crimson laurel

#

what is this msg

pulsar lava
#

!e

print("How come we can use eval in coode help ??
timid fjordBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

autumn gorge
#

Need help

trail jewel
#

Eval sound now be available in this channel!

crimson laurel
#

@shut tree i was getting some help with my code to calculate my bi weekly pay based off my work schedule

broken talon
#

!e yoink

timid fjordBOT
#

@broken talon :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'yoink' is not defined
primal bison
#

bruh

pulsar lava
#

!e

print("HELLO")
timid fjordBOT
#

@pulsar lava :white_check_mark: Your eval job has completed with return code 0.

HELLO
warped musk
#

@hardy egret check this

hardy egret
#

i saw that link doesnt work

warped musk
#

Really?

hardy egret
#

big come up

warped musk
#

python --version

hardy egret
#

20.2.4

warped musk
#

pip install --upgrade pip

timid fjordBOT
#

Hey @hardy egret!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

hidden hornet
#

@primal bison do you need some help

primal bison
#

Yep

#

I am not able to verify my d
Self in voiceverfy

#

Channel

storm gust
#

@primal bison What's the issue?

night lily
#
for number in [1,2,3]:
   print(number)```
primal bison
#

def swap(the_list, i, j):
    the_list[i],the_list[j] = the_list[j], the_list[i]
    print("The list is now the following:")
    print(the_list)
    print("            ")
    pass


def find_max_index_after(i, the_list):
    j= 0
    num_max=0
    for i in range (len(the_list[i:])):
        print("this is i", i)
        print (the_list[i:])
        for j in the_list[i:]:
            print("this is j", j)
            if j > num_max:

                print("i=",i,"This is the max",max(the_list[i:len(the_list)]))
                j=max(the_list[i:len(the_list)])
                j=the_list.index(j)
                swap(the_list, i, j)
    pass

def reverse_selection_sort(the_list):
    i=0
    find_max_index_after(i,the_list)
    return(the_list)

    pass


plain crescent
#

why am I muted

night lily
#
a = 0
for number in [1,2,3]:
    if number == 2:
        a = number```
#
a = 0
b = -7
if a > b:
    b = a```
#
alpha = [1,7,3]
for each in alpha:
    print(each)```
#

[5,7,8][0] == 5

#

[5,7,8][1] == 7

#

[5,7,8][2] == 8

#
nums = [1,5,8]
_max = nums[0]
_min = nums[0]```
#
number = 5
if number > _max:
    _max = number
if number < _min:
    _min = number```
#
for number in [1,2,7]:
    print(number)```
#

A sneaky way around the problem would have been sorted.

#

index 0 and index -1 of a list of numbers would get you the min and max.

calm cypress
#

hi guys

timid fjordBOT
#

Hey @calm cypress!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

#

Hey @calm cypress!

It looks like you tried to attach file type(s) that we do not allow (.pptx). We currently allow the following file types: .3gp, .3g2, .avi, .bmp, .gif, .h264, .jpg, .jpeg, .mkv, .mov, .mp4, .mpeg, .mpg, .png, .tiff, .wmv, .svg, .psd, .ai, .aep, .xcf, .mp3, .wav, .ogg, .webm, .webp, .flac, .afdesign, .m4a, .csv.

Feel free to ask in #community-meta if you think this is a mistake.

calm cypress
#

in which codes?

#

please help me 🙂

tender tangle
#

start by splitting your file, where each line in the file becomes an element in a list @calm cypress

#

assign the data in your lines to their appropriate variables

misty arrow
#

hi

lofty lynx
#

anyone offering help for a simple loop question?

rigid granite
#

can some one help me plz
its just a small favor
i dont have voice permission so I asked here

primal bison
#

I do! @warm bone

#

It's a simple question. I can hear you.

#

I just can't talk.

#

Do you know anything about HTML and Javascript?

warm bone
#

yeah

primal bison
#

Haha, I can hear you.

#

Ok, so I have a form.

#

How do I access the variable in the form?

#
    <label for="FirstNumber">First Number:</label><br>
    <input type="text" id="FirstNumber" name="FirstNumber"><br><label for="SecondNumber">Second Number:</label><br> <input type="text" id="SecondNumber" name="SecondNumber"><br><input type="submit" value="Multiply!">
</form>```
#

That's the form. Probably not the cleanest.

#

Which is the variable so I can then write the function in Javascript?

#

So for example 'var x=3, var y=4 print(y*x)'

#

How do I find out which is X and Y in the form?

#

I'll BRB. Sorry. My dinner is burning.

warm bone
#

ok

primal bison
#

Ok, sorry.

celest fable
#

bird, what's up

primal bison
#

Hey Coby.

#

Do you know anything about HTML and Javascript?

#

My question is probably pretty easy.

celest fable
#

yes actually, that's my main stack right now

primal bison
#

Convenient!

celest fable
#

very

primal bison
#

So i'm just learning. I know a lot of Python, so I may use pythonic language, sorry about that.

celest fable
#

that's fine

primal bison
#

But in HTML, in a form, how do I get the variable from said form? So if you'll look above, you'll see some code.

#

And in that it basically takes two numbers, and the idea is to multiply them. Here's the javascript form I have after it.

#
    function multiply() {
        alert("You multiplied!")
    }
</script>```
celest fable
#

like, you're trying to get what the user inputs?

primal bison
#

Obviously this doesn't multiply them, it just pops an alert.

#

But the idea is to then call the function to do just that.

#

And yes.

#

So whatever the first number is, then the second.

celest fable
#

ok, so if you wanted to get the text from the text input with id of "FirstNumber", in javascript it would be document.getElementById("FirstNumber").value

primal bison
#

Ok. So would I do something like var x = document.getElementById('FirstNumber').value ?

celest fable
#

so in a function it would be something like

let x = document.getElementById("FirstNumber").value

yeah

#

let, var, whatever

primal bison
#

Great. Then change the function to like...function multiply(x,y) { document.write('Result: '+x*y)?

#

I know in Python code you have to convert the answer to a string to concatenate it. Does JS have that?

#

Or is there a return function like in Python?

celest fable
#

nope, js is dynamicly typed

primal bison
#

Ok. Could you explain that to me?

celest fable
#

wait, I may have read that wrong

#

oooh, nevermind

#

dynamically typed language like JS basically means that when you do console.log("number: " + 5) it auto turns the 5 into a string

primal bison
#

Oh, nice. Very helpful.

celest fable
#

also "console.log()" logs something to the console, if you didn't know

#

I wouldn't recommend ever using document.write() lol

primal bison
#

Oh, haha.

#

Ok.

#

Fair enough.

#

So here's my code that I changed, but when I enter in the numbers, I just get 0 every time.

celest fable
#

because writing text that way after the page is loaded just deletes everything

primal bison
#
    let x= document.getElementById('FirstNumber')
    let y=document.getElementById('SecondNumber')
    function multiply(x,y) {
        alert("Your result is: "+x*y)
    }
</script>

<form onsubmit="multiply(x,y)">
    <label for="FirstNumber">First Number:</label><br>
    <input type="text" id="FirstNumber" name="FirstNumber"><br><label for="SecondNumber">Second Number:</label><br> <input type="text" id="SecondNumber" name="SecondNumber"><br><input type="submit" value="Multiply!">
</form>```
#

When I put the script after the form, it returns 'Your result is: NaN'

celest fable
#

do you know what NaN means?

primal bison
#

Yea. No value, basically. Or Null.

#

I think.

#

Or Error.

celest fable
#

'Not a Number'

primal bison
#

Oh. There you go. Haha.

#

😂

celest fable
#

oooh, I know what's wrong

#

so, there are a lot of things wrong with your code

#

but you're new so It's fine

primal bison
#

I'm not surprised, haha. This is like...My first or second day digging into this.

celest fable
#

I wish I could be voice verified already so I could not have to type it all

primal bison
#

Same.

celest fable
#

wanna join a dm vc?

primal bison
#

I get why they did it, but it was so much easier before.

#

Sure!

bronze ridge
#

hello everyone,
i am working on codeignitor4
but the "<?= $validation->listErrors() >"this function is not working in my code
and i am using it for show the simple error message in my login form
i also try "<? =$validation->showError() >" this function also but its also not working.
please help me

primal bison
#

o

cunning thistle
#

Need someone to review a few lines of code for a school project if anyone is able.

tender tangle
#

@cunning thistle maybe if you post the code

primal bison
#

hi i want to know how to create a luncher in python
to lunch 2 scripts

river verge
#
r = requests.get(URL)
your_data = r.json()

print(your_data)
#

'name': 'ign'

#

'name': 'IGN', 'profileIconId': 3381, 'revisionDate': 1603150848000, 'summonerLevel': 35}

tender tangle
#

your_data['name']

#
myrandomdict = {"firstkey": "firstvalue", "secondkey": "secondvalue"}
#

to print the value corresponding to the key "firstkey"
print(myrandomdict["firstkey"])

#

which will return 'firstvalue'

#
myrandomdict = {"firstkey": {"test1": "value1", "test2": "value2"}, "secondkey": "secondvalue"}
river verge
#
print(myrandomdict["firstkey"["value1"]])
tender tangle
#

print(myrandomdict["firstkey"]["test1"])

broken talon
#

with your fingers

high mirage
#

With your heart. Mind. And soul.

#

just kidding

rustic sleet
#

No

#

most importantly with coffee

primal bison
#

hi

cold sail
#

yo

haughty quiver
buoyant kestrel
earnest fractal
#

@river parrot did you want help with something?

river parrot
#

I do so im working with some hashtables and need help with some overriding of functions .

timid fjordBOT
#

Hey @river parrot!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

river parrot
#

def hashfunction(self, key, size):
""" insert commments (in your words) """
return key % size

def rehash(self, oldhash, size):
    """ insert commments (in your words) """
    return (oldhash + 1) % size

def get(self, key):
    """ insert commments (in your words) """
    startslot = self.hashfunction(key, len(self.slots))

    data = None
    stop = False
    found = False
    position = startslot
    while self.slots[position] != None and not found and not stop:
        if self.slots[position] == key:
            found = True
            data = self.data[position]
        else:
            position = self.rehash(position, len(self.slots))
            if position == startslot:
                stop = True
    return data

def __getitem__(self, key):
    """ insert commments (in your words) """
    return self.get(key)

def __setitem__(self, key, data):
    """ insert commments (in your words) """
    self.put(key, data)

def __len__(self,list):
    res = list(filter(None,TestHashTable))
earnest fractal
#

use '`' 3 times then write python '''python then shift enter to go the next line, and end it with '''

#
print("hello world")
#
def hashfunction(self, key, size):
        """ insert commments (in your words) """
        return key % size

    def rehash(self, oldhash, size):
        """ insert commments (in your words) """
        return (oldhash + 1) % size

    def get(self, key):
        """ insert commments (in your words) """
        startslot = self.hashfunction(key, len(self.slots))

        data = None
        stop = False
        found = False
        position = startslot
        while self.slots[position] != None and not found and not stop:
            if self.slots[position] == key:
                found = True
                data = self.data[position]
            else:
                position = self.rehash(position, len(self.slots))
                if position == startslot:
                    stop = True
        return data

    def getitem(self, key):
        """ insert commments (in your words) """
        return self.get(key)

    def setitem(self, key, data):
        """ insert commments (in your words) """
        self.put(key, data)

    def len(self,list):
        res = list(filter(None,TestHashTable))
river parrot
#

oh okay I see what you mean!

#

so the last function I want it to return the number of items stored in the hash table

#

I wanted to filter out the None variables so it could just count the rest of the variables

earnest fractal
#

so is this a function inside a functin?

#

this isn't a class btw

river parrot
#

yes its a function inside a function

#

the class is there I just didn't paste it because at first it didn't let me paste over 200 characters.

earnest fractal
#

right, so whats your question

#

@river parrot not sure what function you want to override

river parrot
#

I need to override the function to work with HashTable in a specific way - Using def len will override the Python len() function.

earnest fractal
#

right so what behaviour are you looking for?

buoyant kestrel
#
return a, b
#
    return a, b


result_a, result_b = function_2(1, 2)
#
tuple_of_numbers = (1, 2, 3, 4)
#
tuple()
primal bison
#

i want a spambot xddddd

#

dont ban me pls

remote raft
#

@rotund zephyr

def second_function():
    print('yey2') # this will be executed when you call this function
    return None
    print('yey3') # this will not be executed, since `return` caused the function to exit

def first_function():
    print('yey1')     # this will be executed when you call this function
    second_function() # this calls the function, which you've assigned before
    print('yey4')     # this also will be executed since there is no `return` within THIS function

#

!e

def second_function():
    print('yey2') # this will be executed when you call this function
    return None
    print('yey3') # this will not be executed, since `return` caused the function to exit

def first_function():
    print('yey1')     # this will be executed when you call this function
    second_function() # this calls the function, which you've assigned before
    print('yey4')     # this also will be executed since there is no `return` within THIS function

first_function()
timid fjordBOT
#

@remote raft :white_check_mark: Your eval job has completed with return code 0.

001 | yey1
002 | yey2
003 | yey4
remote raft
#

So, as you can see, the third "yey" is missing, while "yey4" is still there

dense dove
#
  flat_charge = 20.00
  
  if weight <= 2:
   return weight * 1.50 + flat_charge
  elif weight > 2 or weight == 6:
   return weight * 3.00 + flat_charge
  else: 
    weight > 6 or weight == 10
    return weight * 4 + flat_charge  


print(ground_shipping (7))```
#

It's only printing the second function why doesn't it print the third?

calm kernel
#

!e

timid fjordBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code
block. Code can be re-evaluated by editing the original message within 10 seconds and
clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an
issue with it!*

tender tangle
#

"John Doe" (for males) and "Jane Doe" (for females) are multiple-use names that are used when the true name of a person is unknown or is being intentionally concealed. In the context of law enforcement in the United States, such names are often used to refer to a corpse whose ...

rustic forge
tender tangle
#

NaMeme

primal bison
#

nah meme

icy sentinel
#

H

frosty spoke
#

Hi

primal bison
#

what is python

shut tree
#

google it

dull shuttle
#

ds

icy fulcrum
#

hi

night lily
#

!code

timid fjordBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

cyan vine
#
seconds = input('Give a number. > ')
while seconds.isnumeric() is False:
#   print ("Please enter how long you would like to play the game")
# else:
  seconds = input('Give a number. > ')
  timer = int(seconds)
#

NameError: name 'seconds' is not defined

#
while seconds.isnumeric() is False:
#   print ("Please enter how long you would like to play the game")
# else:
  seconds = input('Give a number. > ')
  timer = int(seconds)
night lily
#

seconds =5

#

5.isnumeric()

#

Nope.

#

dir(int)

#

help(int)

#

dir(4)

#

dir(str)

#

dir('')

harsh osprey
#

bye guys need to go for english exams 😅

cyan vine
#

ValueError: invalid literal for int() with base 10: 'hi'

#
seconds = "hello"
while seconds.isnumeric() is False:
  seconds = input('Give a number. > ')
timer = int(seconds)
primal bison
#

I cant speaj

#

In the channe

opal socket
#

@primal bison see the voice-verification channel

elder pasture
#

!voiceverify

primal bison
#

nice

#

anyone

#

here

#

know

#

how

#

to

#

nevermind

molten herald
#

@primal bison Ye just look at my DP u'll learn how 8942_PressFinchatRGB

#

Can any1 explain y i get this error in Django Form validation

Traceback (most recent call last):
  ...
ValidationError: ['This field is required.']
molten herald
#

Ye got it thanks for the help

copper parrot
#

your welcome :)

supple ibex
#

help

sand pelican
#

my voice has been seliencyed

buoyant kestrel
#

@sand pelican Look into the #voice-verification channel. That should tell you what you need to know

frosty spoke
#

is anyone there? can someone help me with some codes?

#
def hi_lo_game(high):
    """
    -------------------------------------------------------
    Plays a random higher-lower guessing game.
    Use: count = hi_lo_game(high)
    -------------------------------------------------------
    Parameters:
        high - maximum random value (int > 1)
    Returns:
        count - the number of guesses the user made (int)
    -------------------------------------------------------
    """
    guess = int(input("Guess: "))
    num = randint(1,high)
    count = 0
    while num != guess:
        count += 1
        if guess > num:
            print("Too high, try again")
            guess = int(input("Guess: "))
        else:
            print("Too low, try again")
            guess = int(input("Guess: "))
    print("Congratulations - Good Guess!!!")
    return count 

twin steppe
#
print(hi_lo_game(50))
frosty spoke
#
    """
    -------------------------------------------------------
    Asks a user to enter a series of positive numbers, then calculates
    and returns the minimum, maximum, total, and average of those numbers.
    Stop processing values when the user enters a negative number.
    The first number entered must be positive.
    Use: minimum, maximum, total, average = positive_statistics()
    -------------------------------------------------------
    Returns:
        minimum - smallest of the entered values (float)
        maximum - largest of the entered values (float)
        total - total of the entered values (float)
        average - average of the entered values (float)
    ------------------------------------------------------
    """  

pastel plover
#

mk

#

mk

#

ohh

heavy valve
#

gys

gilded egret
warm hedge
#

I started with java but didn't like it, so went it python, and now I am learning java again to get into minecraft modding

mild steppe
#
X = 1
Y = 1

print ('{:>4}' .format(''), end= '')
for X in range(1, 11):
       print('{:>4}'.format(X), end='`)

print()

for X in range(1,11):
    print('{: >4}'.format(X), end
    while Y <= 10:
        print('{:>4}'.format(X * Y), end= '`)
        Y+=1
    print()
    Y=1```
#

Help please

buoyant kestrel
#

Your ending single quotes aren't the normal ones

#

They seem to be backticks

primal bison
#

i made up alarm code

primal bison
#

python scrapy xpaht Not work for me

https://prnt.sc/veb11l
This is the page source and following are my xpaths.

  • response.xpath("//div[@id='divBannerCont']") - success get
  • response.xpath("//div[@id='divBannerCont']//input[@type='submit']") - Not get.

Please let me fix that if you can help me.
Thanks.

Lightshot

Captured with Lightshot

river hound
#

@night lily thanks for saying what i was thinking

#

can't unmute rightnow

night lily
#

@outer grail Heya. Do you require assistance?

outer grail
#

Is my headphone broken or noone speaking

night lily
#

Nobody was speaking.

outer grail
#

oh

#

@night lily Voice Gate failed

night lily
#

Mm. It looks like you only have three messages.

brittle meteor
#

hi guys i am stuck with my assignment is there some who can help me ?

#

is a ISBN check that i need to make in python i am have 80% fof 100% complete

brittle meteor
#

import sys
ISBN = input('Enter a ISBN: ')
isbn = {'0','1','2','3','4','5','6','7','8','9','10','X'}

def controlNumberCheck():
list1 = []
# this for loop slice every number from the string and multiples it and then adds it
for i in range(0,9):
a = ISBN[i]
list1.append(a)

multiply_list = [10,9,8,7,6,5,4,3,2]
controlNumber = 0
for c in range(0,9):
    multiply = int(multiply_list[c]) * int(list1[c])
    controlNumber = int(controlNumber) + int(multiply)
#print("controlnumber: "+ str(controlNumber))
return int(controlNumber)

#checkDigit
def checkDigitF():
tempDigit = 0
tempDigit = int(controlNumberCheck()) % 11
checkDigit = 11 - tempDigit
#print("CheckDigit: " + str(checkDigit))
return int(checkDigit)
#Test: (control number + check digit) / 11
def Test():
test = (controlNumberCheck() + checkDigitF()) / 11
#test2 = controlNumberCheck() + checkDigitF()
#print("test2:" + str(test2))
#print("Test: " + str(test))
return int(test)

controlNumberCheck()

if not isbn.issuperset(ISBN) or len(ISBN) > 11 or len(ISBN) < 10:
print('INPUT ERROR')
sys.exit()
else:
print('Go On !')
print()
#1853753904

sinful onyx
#

!e
a = [1, 2]
b = [2, 4]
print(c=a*b)

timid fjordBOT
#

@sinful onyx :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | TypeError: can't multiply sequence by non-int of type 'list'
timid fjordBOT
#

Hey @bleak trellis!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

bleak trellis
#

!code-blocks

timid fjordBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

primal bison
#
print('Hello world!')
bleak trellis
brittle meteor
#

sudo apt-get install python3.8

primal bison
#
print("hasmokar na bel chukar")
#

@visual stirrup wtf are you

#

@buoyant kestrel yo man

#

i wanna make an anti spam bot but i cant

#

@hallow jasper how to get mod

#

!mod

timid fjordBOT
#

Contacting the moderation team via ModMail

@subtle palm is a bot that will relay your messages to our moderation team, so that you can start a conversation with the moderation team. Your messages will be relayed to the entire moderator team, who will be able to respond to you via the bot.

It supports attachments, codeblocks, and reactions. As communication happens over direct messages, the conversation will stay between you and the mod team.

To use it, simply send a direct message to the bot.

Should there be an urgent and immediate need for a moderator or admin to look at a channel, feel free to ping the <@&267629731250176001> or <@&267628507062992896> role instead.

visual stirrup
#

@primal bison I'm not sure precisely what you mean by "wtf are you"

primal bison
#

@visual stirrup Idk i just wanted you to know me

visual stirrup
#

okay.

limber adder
#

joi

#

how can i join vc?

odd ermine
#

#voice-verification ?

night lily
#

I may not talk much.

#

and also remembering you're doing something which I have not had a lot of experience with. That is, dual booting within one drive and also working with windows 10.

#

Typing.

#

Not seven.

#

Because I don't want to disturb the other people in my house.

#

Do you need to switch the usb mode to something else before you enable usb tethering?

#

For example, on mine, it can't be on just charge, it has to be on something like usb storage or the fake cd drive thing.

#

@torn halo ^ ?

#

Give it a go.

#

Do you get a popdown when you're plugged in to usb?

#

Saying "Hey, I'm usb connected"

#

Where you tap on it to change the mode

#

Maybe look in the settings

#

Okay.

#

I can.

#

Investigate how to change the usb mode.

#

This is seperate from tethering.

#

There may be a PTP mode and a USB storage mode in the mix.

#

and also a charge only mode

#

You may be set to be on charge only mode

#

Being on something like PTP or USB storage mode may allow you to activate the tethering setting

#

@primal bison Did you need any help, or are you just checking things out? 🙂

primal bison
#

Just checking things out in voice chat for now since I don't have enough exp or whatever to talk lol, but I did post a question in #help-chestnut

night lily
#

I...see.

#

I'm honestly not quite certain where to start with that, I'm afraid. Hopefully there'll be someone who comes along who does. 😅

torn halo
maiden wind
#

hi

timber kayak
#

Hello i have a problem i'm making a battleship game for my school project and im using tkinter we are at a pretty advanced stage but we have a problem, we use random generation for the ships and sometime the ships are overlapping each others does anyone have a solution ? here is the code

timid fjordBOT
#

Hey @timber kayak!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

timber kayak
#

ok i can't post the code its in french anyway no one would understand the var

#

@halcyon coyote

#

psl

#

can you help me

#

,

halcyon coyote
#

Huh?

#

!paste You can use this service to paste the code

timid fjordBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

timber kayak
#

how ok

timid fjordBOT
#

Hey @timber kayak!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

timber kayak
#

ok its done i guess

#

so do anyone have any ideas ?

mild steppe
#

Hey guy's how can i make the "40" an integer bc everytime i do:

int(40)

It doesn't work.
Here is my code:

class Robot:
    def introduce_self(self):
        print("My name is: " + self.name)
        print("My color is: " + self.color)
        print("I weigh: " + self.weight + " " + "killograms")

r1 = Robot()
r1.name = "Tom"
r1.color = "blue"
r1.weight = "40"


r1.introduce_self()
primal bison
#

inside the function

rancid pumice
#

@mild steppe
Just use

print(f"I weigh: {self.weigth} killograms")

with f strings everything inside of {} gets converted to a string

primal bison
#

do str(self.weight)

buoyant kestrel
#
from pathlib import Path

json_file = Path("data.txt")
if not json_file.exists():
  with open("data.txt", "w") as file:
    file.write("[]")
sudden gull
#
async def _add(ctx, arg):
    if ctx.channel.id == int(config.get("bot","channelID")):
        json_file = Path("data.txt")
        if not json_file.exists():
            with open("data.txt", "w") as file:
                file.write("[]")
            with open("data.txt", "r+") as file:

                waitlist = {
                    "username": arg,
                    "time":int(time.time())
                }

            json.dump(waitlist, file)

        #Sends a confirmation message in the discord channel
        await ctx.send(f"> Player **{arg}** has been added to the waitinglist")

    else:
        await ctx.send("This bot is not allowed to be used in this channel!")
#
async def _add(ctx, arg):
    if ctx.channel.id == int(config.get("bot","channelID")):
        json_file = Path("data.txt")
        if not json_file.exists():
            with open("data.txt", "w") as file:
                file.write("[]")
        with open("data.txt", "r") as file:

            waitlist = {
                "username": arg,
                "time":int(time.time())
            }

        with open("data.txt", "w") as file:
            json.dump(waitlist, file)

            #Sends a confirmation message in the discord channel
            await ctx.send(f"> Player **{arg}** has been added to the waitinglist")

    else:
        await ctx.send("This bot is not allowed to be used in this channel!")
#

waitlist.update({

buoyant kestrel
#
with open("data.txt", "r") as file:
    json_loaded = json.load(file)
json_loaded.append({"username": arg, "time":int(time.time())})
sudden gull
#

{'username': 'testttwo', 'time': 1605110201}

buoyant kestrel
#

@rancid pumice I do, just talking to a co-worker

#

But yeah, I see what you mean

merry meadow
#

@rancid pumice what's that program all about?

#

i mean what does it do?

buoyant kestrel
merry meadow
#

hmm

#

oh hi hemlock

#

lol

#

do the mods get rewarded with nitro?

buoyant kestrel
#

Nah

merry meadow
#

oh okay

#

like alot of em have nitro

buoyant kestrel
#

Buddy of mine gifted me some

#

But I normally wouldn't buy it

#

Don't really use the other gifs from other servers

merry meadow
#

ah

buoyant kestrel
#

And we get a lot of perks for the server anyway because we're partnered

merry meadow
#

you can have animated pfp's

buoyant kestrel
#

Yeah but eh

merry meadow
#

lol

buoyant kestrel
#

But then I wouldn't have me looking smug (which is the only face I have, apparently)

merry meadow
#

lol

#

understood

mild steppe
#

Thanks @rancid pumice
And i have an other question if anyone wanna answer that:

    name = float(input("What is you're name?: "))
ValueError: could not convert string to float: 'Rayan'

Why no

merry meadow
#

ehm

#

a float

#

is like 1.0

#

and a string

#

is

mild steppe
#

...?

merry meadow
#

you try making 'Rayan' into numbers

#

basicly

mild steppe
#

Ah lol i tought float was letters but anyways thanks @merry meadow

merry meadow
#

lol

#

yw

buoyant kestrel
#

No worries! Everybody starts somewhere

merry meadow
#

indeed!

#

yee python is from my country!!!

#

lol

#

does python still have a dutch owner?

#

and yes netherlands

#

but is he dutch?

#

cool!

#

hmm

#

what's the best way to study a module?

#

i can't really find help on the ui module in the application pythonista 3 on ios devices

#

yeah but it like doesn't show me the tab function

#

yeahhh

#

repel what?

#

lol

buoyant kestrel
#
merry meadow
#

hmmmm

#

woah

#

sick

#

thank you!

#

is it free?

#

:o

#

wth

#

how do people

#

make that much stuff

#

and they make it free...

#

ah

#

but still

#

lol

#

hmm

#

cool

#

my school should use this

#

to learn us program

buoyant kestrel
#
merry meadow
#

ehm

#

hemlock

#

what is some experience?

#

is that like knowing if statements

#

and while loops?

#

@rancid pumice what you making now?

#

say again pls

#

@rancid pumice could you say it again please?

#

ah hes gone

sudden gull
#
    with open("data.txt","r") as file:
        newlist = [d for d in file if d["username"] != arg]

        with open("data.txt","w") as file:
            print(newfile, file=file)
cold lintel
#

Should that be newlist?

sudden gull
#

still gives the error but yes ty for noticing the type error

#

TypeError: string indices must be integers

cold lintel
#

Is d a string?

sudden gull
#

yes

cold lintel
#

Oh, I didn't look at your code carefully, sorry.

#

Bit scatterbrained today.

sudden gull
#

dw I'm not 100% like ever

#

haha

cold lintel
#

Erm, so d is a line of the file. So it's a string and you can't index it with a string.

#

What does the file look like?

sudden gull
#

[{"username": "testing", "time": 1605120807}, {"username": "testing2", "time": 1605120810}]

cold lintel
#

Sure 😄

sudden gull
#

{}

cold lintel
#

This a json file?

#

Hmm, could you use the json library?

#

yep

#

One sec while I check the docs...

#

Right 😄

#
with open('data.txt', 'r') as file:
    data = json.read(file)

new_data = [
    d
    for d in data
    if d['username'] != ...
]

with open('data.txt', 'w') as file:
    json.dump(new_data, file)
#

The ... is because I wasn't sure what you wanted there.

sudden gull
#

arg

cold lintel
#

Oh yes 😄

#

I'm even looking right at the documentation...

#

Nice 👍

#

Great stuff

#

No problem

sudden gull
#

new_data = [d for d in data if d['username'] != arg]

cold lintel
#

So, you have a list of dictionaries.

#

for d in data just iterates through this list.

#

d is assigned to each dictionary in the list.

#

It's a variable name.

#

This code is equivalent to the following:

sudden gull
#

['username'] for ['username']

cold lintel
#
new_data = []
for d in data:
    if d['username'] != arg:
        new_data.append(d)
sudden gull
#

d = ['username']

cold lintel
#

Erm, d would be something like {"username": "testing", "time": 1605120807}

#

A dictionary.

#

Then you access the username by doing d['username']

#

Which will be 'testing'

#

Alright 😄

#

Making sure...

#

Yep

#

It's definitely worthwhile reading the official python tutorial.

#

It's not bad.

#

!resources

timid fjordBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

cold lintel
#

?

#

Oh yeah, it's overwhelming to get so many suggestions.

#

I would stick to just the tutorial.

#

The official tutorial.

#

Nope, no affiliation 😄

#

Although, Guido does know about us 😄

#

Yeah, stick to one resource...

#

if you get stuck

#

find a video on youtube, or post a question here.

#

It's kind-of a slog, but it's well worth going through most of the tutorial.

#

StackOverflow is... yeah

#

Not bad for professional programmers.

#

But very discouraging for beginners.

#

Oh yeah, I've been through that 😄

#

Yeah, Hemlock's alright

#

Btw, it's better if you think of StackOverflow as being like a Wikipedia for code.

#

Then it doesn't feel so personal

#

When your question gets closed

#

I had one closed within 20 seconds of posting it lemon_pensive

#

I spent like 20 mins writing it as well 😄

#

It's a "lemoji"

#

Erm, I'm kind-of new here

#

But one of the owners of the server is called lemon

#

Yep

#

So we have a load of lemon-themed emojis

#

Love that one 😄

#

Erm, I do have a mic. But I have a thing about talking on mic.

#

Idk, I need to get over it 😄

#

Yep.

#

28

#

Thanks

#

Ohh, ok

#

Hemlock's the same age I think as me.

#

Yep, I'm going to get back to the help channels...

#

See ya!

wanton epoch
#

wow

sudden gull
#

wow

wanton epoch
#

haha

sudden gull
#

hah- nah im not doing that not bored enough

wanton epoch
#

I though that she is talking to herself then I read its vc chat

sudden gull
#

Haha

cold lintel
#

*himself

wanton epoch
#

phh

#

mybad

sudden gull
#

Someone thought I was a gal like 20 sec ago too LXNN

wanton epoch
#

idk can't judge gender with names

sudden gull
wanton epoch
#

I was also thinking same

Someone thought I was a gal like 20 sec ago too LXNN
@sudden gull

#

LMAO

sudden gull
#

Haha

wanton epoch
#

really is your hair too long

sudden gull
#

ouch

wanton epoch
#

or it isn't you in that pfp

sudden gull
#

That's me

#

whats wrong with my hair

wanton epoch
#

oh

#

nah just saying

sudden gull
#

haha

wanton epoch
#

my eyeballs

#

I should sleep

sudden gull
#

goodnight 😂

wanton epoch
#

gn

sudden gull
#

@cold lintel this is your fault

cold lintel
#

I take no responsibility!

sudden gull
#

Hahah

zenith hazel
#

hi, can I get some help with my code? I'm not able to get exactly the output that the problem is looking for

#

how can I adjust my code so that the output doesnt add a bunch of zeros after the decimal point

night lily
#

@zenith hazel Depending on what your program is doing, you may find one or more of the following to be of use. str.rstrip, int, round, float.

dusky spoke
#

@zenith hazel another possible solution could be variableName = "%.2f" % outputVariable

#

where the %.xf is however many spaces you want to round it to

primal bison
#

heyy i am getting this error when i am trying to read through a csv file

#

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 33-34: truncated \uXXXX escape

#

i have tried all the possbile solns given on stackoverflow but it still doesn't work

#

can someone help me with this!!?

soft compass
#

Hi!

#

I am new to Github, I uploaded a repository from Pycharm to Git and now I want to remove the connection

#

Does anyone know how to do that?

tawdry tapir
#

@soft compass, there's not active connection to GitHub, if you want to unlink your project with your remote repository you can remove the remote [1] or just remove the entire .git folder. Have in mind that removing the .git folder is dangerous if you don't want to lose your local repository history
[1] https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emremoveem

soft compass
#

Which one do you recommend?

#

Can you do it manually from pycharm or do you have to use the command prompt?

tawdry tapir
#

depends on your needs. If you want to remove the remote reference to GitHub but keep the local history. Just remove the remote. If you want to remove the the remote reference to GitHub and remove the local history, remove the .git folder. You might do any of both using PyCharm

soft compass
#

If I remove the local history will the files with code in pycharm still be intact?

tawdry tapir
#

yes

soft compass
#

great!

#

With git folder do you mean the repository in Github?

tawdry tapir
#

no

soft compass
#

Where do you find the git folder?

tawdry tapir
#

it should be in your project root

soft compass
#

Do you know where you find it on pycharm?

heavy valve
#

guys for python how do i do the f5 thing

#

i cant find it

buoyant kestrel
#

The f5 thing?

tender tangle
#
def check_input():
    while True:
        try_again = input("Do you want to try to enter a number again? ").lower()
        if try_again not in ("y", "yes", "yeah", "n", "nope", "no"):
            print("Please input: y, yes, or yeah to try again.")
            print("Please input: n, no, or nope to exit.")
            continue
        else:
            # this will make try_again True if it starts with y, otherwise False
            try_again = try_again.startswith("y")
            return try_again
icy sentinel
#

\n

#

\n

drifting jungle
tender tangle
#
            if try_again:
                continue
            else:
                print("See ya later.")
#
            if not try_again:
                print("See ya later.")
drifting jungle
#

Traceback (most recent call last):
File "C:\Users\gabri\PycharmProjects\Turtle things\Shapes.py", line 60, in <module>
start()
File "C:\Users\gabri\PycharmProjects\Turtle things\Shapes.py", line 56, in start
main(number_of_sides)
File "C:\Users\gabri\PycharmProjects\Turtle things\Shapes.py", line 25, in main
distance = int(length)
UnboundLocalError: local variable 'length' referenced before assignment

mild steppe
#

Hey, so i watched a few youtube tutorials about classes and objects in python and i do not understand why there is a return True under this return False:

    def add_student(self, student):
        if len(self.students) < self.max_students:
            self.students.append(student)
            return True
        return False
tender tangle
#
    while True:
        side_length = input("How long are your sides? ")
        try:
            length = int(side_length)
            break
        except ValueError:
            print("I'm sorry, that is not a valid input for length of sides. Please use an integer.")
mild steppe
#

@tender tangle Are u here to show of that code or are u asking help?

tender tangle
#

I'm not asking for any help

#

I'm helping twiitchkicks

#

Why do you ask?

#

do not use the first method

#

it is ugly

dense shoal
#

:3

mild steppe
#

Hey guys!
I am new to python and i just learned "OOP".
But now i want to learn how i can visualize stuff to make stuff more beatifull because i want to make a card game or something.
Does anyone knows a good tutorial or something or just the keyword i need to search to fi

mild steppe
#

Hey guys!
Can someone please help me because i do not understand this error.

  File "C:/Users/rayan/PycharmProjects/pythonProject2/Rly quick.py", line 11
    t1 + t2 + t3 = gg
    ^
SyntaxError: cannot assign to operator

Here is my script:

class Rayan:
    def __init__(self, dw):
        self.dw = dw

    def getdw(self):
        t1 = 50
        t2 = 90
        t3 = 70

    def __add__(self, t1, t2, t3):
        t1 + t2 + t3 = gg

    def divide(self, other):
        return gg / 3
wise zephyr
#

Yeah loud and clear 😄

#

yeah

#

so i've set up a foreign key so far

onyx wyvern
#

chris also look "e-commerce db-design" or "e-commerce db-structure" up

#

there are some simple db diagrams on the internet for free

wise zephyr
#

I see yeah

#

so would a foreign key usually be the user?

wise zephyr
#

I've used django forms when creating the items

#

Ahhh I see

#

Yeah I never actually considered it that way!

#

Ok, that's great

#

thanks very much for your help!

novel rune
#

@mild steppe it seems like some of your definitions don't do anything, do they need to return something? Also, I think the error is that it wants gg = t1 + t2 + t3, but it doesn't seem like you are specifying them in a way that they are going to be updated correctly.

knotty kindle
#

@mild steppe try:
gg = t1 + t2 + t3

mild steppe
#

Oke thanks guys

timid fjordBOT
#

Hey @thick walrus!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

thick walrus
#

oof

#

cant send code

#

can you code in kali linux?

primal bison
#

anybody want to vc with me to help start of k means clustering? im a complete noob at it

#

its just to get me started with my dataset because i have no idea what columns to use for clustering

wet minnow
#

yes i can help

#

@primal bison

sly python
#

Daddy chill

#

🥶🥶🥶👅🌈🥵🥵😤🤡💯❌🙌😩😩😩😩🙌🧢👋🥩🥩🤤😍🤡👌🏻🥵👍🧢🌈🤙😂🧢🙀👁️👁️👌👁️😂👍👍❌🙌❌

stark nacelle
#

guys any help

#

they ask if we can do it without for or while loops

round jasper
primal bison
#

can someone help me

tight scaffold
#

Guys I need help I want to install py audio but i have a eror
Pls help me

primal bison
#

hello at all
how can i use the output of the df linux command in python to make insert to a sql database?
[21:03]
anyone an idea?
[21:04]
df -Ph /dev/sda1 | grep -Po '\d+(?=%)'
this outputs me in linux the percent of the used storage
[21:05]
but how can i get the only the gb size in Numbers as an output ?

karmic delta
#

I can't talk in the channel yet

#

So now I have to wait

#

I guess

#

@sharp marlin U is Uniform

#

@sharp marlin H it Hotel

tender tangle
#
letters = {
    "A": "Alfa",
    "B": "Bravo",
    "C": "Charlie",
    "D": "Delta",
    "E": "Echo",
    "F": "Foxtrot",
    "G": "Golf",
    "H": "Hotel",
    "I": "India",
    "J": "Juliett",
    "K": "Kilo",
    "L": "Lima",
    "M": "Mike​",
    "N": "November",
    "O": "Oscar",
    "P": "Papa",
    "Q": "Quebec",
    "R": "Romeo",
    "S": "Sierra",
    "T": "Tango",
    "U": "Uniform",
    "V": "Victor",
    "W": "Whiskey",
    "X": "X-ray",
    "Y": "Yankee",
    "Z": "Zulu",
    " ": "  ",
    }

input_str = input("Type the sentence you wish to convert:\n")
input_list = list(input_str)

output_list = []

for i in input_list:
    try:
        output_list.append(letters[i.upper()])
    except KeyError:
        output_list.append(i)

output_str = " ".join(output_list)

print(output_str)
karmic delta
#

Damn you actually said my name right

#

That's surprising

#

Because peopel fuck my name up all the time

#

You were bollocking them earlier

#

Nah Peewee

#

Dude

#

FUCK Node and Python

tender tangle
#

he says in a Python server

karmic delta
#

Because you

#

Are like 10?

tender tangle
karmic delta
#

Doom 64

#

Can't even play the latest one

tender tangle
karmic delta
#

He bought it second hand

#

My GPU costs more then 175 euros

#

Later @sharp marlin

#

He sounds like he's 10

#

15!?

tender tangle
karmic delta
#

You're joking bruv!

#

I used wind up my vape coils, that's about as far as I got

tender tangle
karmic delta
#

yooo Sanoske

#

Depending on which language you're using

tight scaffold
#

ERROR: Command errored out with exit status 1:
command: 'c:\program files\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\batuh\AppData\Local\Temp\pip-install-kkml3_6s\pyaudio\setup.py'"'"'; file='"'"'C:\Users\batuh\AppData\Local\Temp\pip-install-kkml3_6s\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\batuh\AppData\Local\Temp\pip-record-p1wrhfgt\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\batuh\AppData\Roaming\Python\Python39\Include\pyaudio

#

pyaudio

#

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: setuptools in c:\program files\python39\lib\site-packages (49.2.1)

night lily
#

python -m pip install wheel

#

How did the installation of the MS C++ 14 library go?

tight scaffold
#

pip install pyaudio

#

pip install pyaudio
Defaulting to user installation because normal site-packages is not writeable
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py) ... error

#

ERROR: Command errored out with exit status 1:
command: 'c:\program files\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\batuh\AppData\Local\Temp\pip-install-gcj6jrm4\pyaudio\setup.py'"'"'; file='"'"'C:\Users\batuh\AppData\Local\Temp\pip-install-gcj6jrm4\pyaudio\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\batuh\AppData\Local\Temp\pip-wheel-rrpcnlh8'
cwd: C:\Users\batuh\AppData\Local\Temp\pip-install-gcj6jrm4\pyaudio\

#

Complete output (9 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
copying src\pyaudio.py -> build\lib.win-amd64-3.9
running build_ext
building '_portaudio' extension

night lily
#

What is in that directory?

tight scaffold
#

I have 516 ms

#

I haven't heard your voice for 5 minutes

night lily
#

Any log files?

tight scaffold
#

no

#

Can you tell me what to do from the beginning

night lily
#

No.

tight scaffold
#

I didn't hear you because

night lily
#

Because I don't know what you need to do.

tight scaffold
#

uhh

night lily
#

Which is why I'm asking questions.

#

Can you please tell me what is in that folder?

lucid trench
#

@tight scaffold Türk telekom mu kulanıyorsun ?

tight scaffold
#

kablonet

night lily
#

Might we focus, please? 🙂

tight scaffold
#

By the way, thank you so much for putting up with me

#

Thanks for everything opal

#

@lucid trench

#

hey

#

I'm here

night lily
#

What is in the folder?

tight scaffold
#

I have 1000 ms

night lily
#

C:\Users\batuh\AppData\Local\Temp\pip-install-gcj6jrm4\pyaudio\

#

python -m pip check pyaudio

tight scaffold
#

No broken requirements found

scenic scarab
#

Hello, who knows about eel? Need help with this library for python.

night lily
#

@tight scaffold What is your IDE?

dire oxide
#

@tight scaffold what language do u speak?

tight scaffold
#

eng

night lily
#

@tight scaffold What is your mother tongue?

lucid trench
#

tony türkçe desene

tight scaffold
#

türkçe

night lily
#

Visual Studio Code, Pycharm, IDLE...?

#

Spyder?

tight scaffold
#

tony türkçe desene
@lucid trench sen türkçe ne kadar biliyorsun

lucid trench
#

baya

#

@floral flicker do you need translater

tight scaffold
#

hayır ben denilenleri anlıyorum ama internetim kötü olduğu için iyi bir şekilde iletişim kuramıyorum

night lily
#

Maybe look at the dependencies for pyaudio on its official page. Look at the section for Windows, specifically.

#

See if it is listing anything that you don't have.

#

Perhaps look at the instructions for a Windows installation of pyaudio.

lucid trench
#

@tight scaffold söyle anlat onlara sesin kötü oldugunu

tight scaffold
#

@dire oxide

#

You should write bcs i have a bad cont

dire oxide
#

@tight scaffold which one

tight scaffold
#

I have 1000 ms

dire oxide
#
#Translator

@client.command(aliases=['tr'])
async def translate(ctx, lang_trans, *args):
    lang_trans = lang_trans.lower()
    if lang_trans not in googletrans.LANGUAGES and lang_trans not in googletrans.LANGCODES:
        raise commands.BadArgument("Invalid language to translate text to")

    text = ' '.join(args)
    translator = googletrans.Translator()
    text_translated = translator.translate(text, dest=lang_trans).text
    await ctx.send(text_translated)
import googletrans
from googletrans import Translator
#

@night lily

night lily
#

@tight scaffold python -m pip install portaudio

#

@tight scaffold Any success?

lucid trench
lucid trench
#

replika

primal bison
primal bison
#

just a min i'll speak in a min

primal bison
keen lily
#

why can't i voice verfy

#

*verify

buoyant kestrel
#

@keen lily The bot should have DM'd you what criteria you're missing

mild steppe
#

Hey guys! How do i make a function that starts with 5 but everytime i want to it does -1 and the number is updated and printed at all times?

tender tangle
#
from datetime import datetime

def not_during_the_night(func):
    def wrapper():
        if 7 <= datetime.now().hour < 22:
            func()
        else:
            pass  # Hush, the neighbors are asleep
    return wrapper

def say_whee():
    print("Whee!")

say_whee = not_during_the_night(say_whee)
#
from datetime import datetime

def not_during_the_night(func):
    def wrapper():
        if 7 <= datetime.now().hour < 22:
            func()
        else:
            pass  # Hush, the neighbors are asleep
    return wrapper

@not_during_the_night
def say_whee():
    print("Whee!")
tender tangle
#

Erdős Pál

main root
#

Erdős Pál

tender tangle
#

Erdős Lajos

candid bison
keen lily
#

k

main root
buoyant kestrel
#

I really need to get back to work

primal bison
#

@broken talon

broken talon
#

alright

#

what's the issue?

primal bison
#

Which would this be?

#

it's a participation thing

#

but I want to understand it

broken talon
#

what do you think?

primal bison
#

well

#

one second

#

what is the point of the program

#

what is it even trying to do?

broken talon
#

read the instructions

primal bison
#

because I'm not even sure about that

#

I did

broken talon
#

it wants to print the number of digits in the parameter num

primal bison
#

print the number of digits

#

yea sooo then

#

would it be D?

#

because it can't equal 0

#

or wait the number of digits can't be less than 0

#

it has to be 1 or greater

#

@broken talon

broken talon
#

so you think the answer is D?

primal bison
#

Hold on

#

I might change

#

what's the diffrence between count and num?

broken talon
#

num is the number you want to count the digits of, count is the amount of digits

primal bison
#

oh so for each digit

#

num increases by 1

broken talon
#

no

primal bison
#

and count is when num finished increasing?

broken talon
#

no

primal bison
#

Oh man 😅

broken talon
#

count is increased once for each iteration of the while loop

primal bison
#

oh alright

#

wait

#

wouldn't that mean per digit right?

broken talon
#

it would

primal bison
#

wait a minute

#

so from what I understand:

#
120

count: 3
num:120
#

Is that correct?

broken talon
#

num doesn't end up as 120

#

the count is correct though

primal bison
#

what would num be then?

#

it's the number right?

#

that you want to count the digits of

broken talon
#

right

#

but it changes

primal bison
#

ohhhh

#

why would it have to change though?

#

sorry i'm not really good at this

broken talon
#

it doesn't have to change

#

but in the function, it changes

primal bison
#

ohhhh

#

you saw it changes

#

in the function

#

🧠💡

#

just going to paste it again so I don;t have to scroll up

#

so it's dividing by 10

#

@broken talon

broken talon
#

yep

primal bison
#

waitttt

#

join vc now

#

i got verified

#

🙂

#

Code/Help 2?

broken talon
#

sure

ripe tiger
#

Hi Lazy Dev, what up

#

I'm refactoring some stuff into different design patterns for a data collator

#

what type of projects do you typically work on

#

not being able to turn mic on in the voice chat is rather hindering

ripe tiger
#

hey guys

#

sup

#

what you working on ROley

#

hey man lol On

#

what you code jammin on Roley?

#

I'm gettin drunk and working on package collators for databases

#

parsers - whatever you may like to call them

#

not being able to speak with voice is rather annoying

#

I think I have actually helped around 10 people solve problems within this discord, but apparently haven't typed enough, so here it is

#

sup

#

Th3Grizly

buoyant kestrel
#

@zinc parcel Check out the #❓|how-to-get-help help channel. That'll tell you what you need to know to use our help system.

#
from pathlib import Path

horse_path = Path(r".\horse\super\mah_horse.jpg")
buoyant kestrel
#
from pathlib import Path

horse_path = Path(r"./horse/")
horse_dict = {}
horse_folders = []

for x in horse_path.iterdir():
  if x.is_dir():
    horse_folders.append(x)

for folder in horse_folders:
  horse_type = folder.parts[-1]
  horse_dict[horse_type] = sorted(image for image in folder.iterdir())
warm hedge
#
horse_path = Path("folder1", "folder2", "file")```
buoyant kestrel
#
from pathlib import Path

horse_path = Path("./horse/")

horse_folders = [x for x in horse_path.iterdir() if x.is_dir()]
horse_dict = {folder.parts[-1]: image for folder in horse_folders for image in folder.iterdir()}
warm hedge
#

I think you can skip the dot

#

actully, depends on the working dir set if you are running the program as a module

buoyant kestrel
warm hedge
#

did you mean

horse_dict = {folder.parts[-1]: sorted(image for image in folder.iterdir()) for folder in horse_folders}```
#

from your first snippet

#

are you able to hear my pc fans?

dreamy merlin
#

not really.

warm hedge
#

alright, I was a lil worried about that

somber lantern
#
   WHERE kind = arabic-black
ivory kernel
#

@edgy mesa

somber lantern
#

@warm hedge that's no longer the case now

JavaScript is everywhere now

You can make backed apps using nodejs

You can develop cross platform moble apps using react-native

You can build cross platform desktop apps using electron.js

You can do machine learning (tensor flow is now available for JS)

warm hedge
warm bone
#

e

#

diophantine

ivory kernel
#

message_input3 = pyautogui.prompt (text =" insert the delay between each sentence( in seconds ")

#

if message_input3 = True:

#

continue

#

else :

#

break

cold lintel
#

Different channel 😄

#

Erm, I've not got any experience with pyautogui sorry

#

Right, so what output were you expecting?

young imp
#

Does anyone know why isn't this thing working?

#
lower = np.array([hue_min, s_min, v_min])
upper = np.array([hue_max, s_max, v_max])

mask = cv2.inRange(hsv_img, lower, upper)        
masked = cv2.bitwise_and(image, image, mask=mask)
#

in mask, I just see pure black output, even having lower = upper, it is still showing black

#

any idea why is it happening?

#

btw it is opencv

#

ping me if ya answer

young imp
#

nvm, figured it out

fossil epoch
#

!voiceverify

#

Damn!

young imp
#

not here

#

there might be some voice verification channel

primal bison
#

c.execute('INSERT INTO transactions VALUES (:Customer_Numb, Customer_N, Invoice_Numb, Invoice_D,Invoice_Am)',
{
'Customer_Numb': Customer_Numb.get(),
'Customer_N': Customer_N.get(),
'Invoice_Numb': Invoice_Numb.get(),
'Invoice_D': Invoice_D.get(),
'Invoice_Am': Invoice_Am.get()
}

#commit changes
base.commit()
#

why is there a syntax error on base.commit()?4

warm hedge
#

what is not working, again?

cold lintel
#

@light jungle

light jungle
#

C:\WINDOWS\system32>pip install pyinstaller
'pip' is not recognized as an internal or external command,
operable program or batch file.

buoyant kestrel
#

py -m pip install pyinstaller

cold lintel
#

Have you tried py -m pip

warm hedge
#

try python -m pip install <>

#

ah windows

#

edited

#

I did not know I could use py 🤔

cold lintel
#

I'll find the relevant info....

buoyant kestrel
cold lintel
#

Alright

#

Although I know very little about Windows tbh 😄

warm hedge
#

I just learnt about the py thing, super useful now

buoyant kestrel
#

py -3.8

cold lintel
#

I think they added it specifically because of people asking for help all the time.

buoyant kestrel
#

py -0

cold lintel
#

Erm, check the link I posted earlier for more info.

#

Do you need a windows license to install it in virtualbox, by the way?

#

It would help me to help out if I could launch windows.

#

Ah right.

#

Oh 😄

#

Alright, going back to the other channel...

odd ivy
#

?

ivory kernel
#

typr here

graceful elk
#

hello

cold lintel
#

Hey, does someone here need help? @lean abyss @ivory kernel @graceful elk

ivory kernel
#

im helping

ivory kernel
#

XD

graceful elk
#

i just came to listen

ivory kernel
#

@lean abyss

#

need help

lean abyss
#
    name = input("Enter the name of the customer you want to delete: ")
    customer = [item for item in registers if item["clientName"] == name]
    if len(customer) > 0:

    else:
        print("Failed on locate customer name" + nome)
    start()
primal bison
#

@lean abyss What is registers?

#

Ohhk

lean abyss
#
    nomeCliente = input("Digite o nome do cliente: ")
    cliente = [item for item in registros if item["nomeCliente"] == nomeCliente]
    if len(cliente) > 0:
        print("Já existe um cliente cadastrado com nome " + cliente["nomeCliente"])
        criarRegistro()
    cidadeCliente = input("Digite a cidade do cliente: ")
    estadoCliente = input("Digite o estado do cliente: ")
    telefoneCliente = input("Telefone do cliente: ")

    if len(nomeCliente) > 0 and len(cidadeCliente) > 0 and len(estadoCliente) > 0 and len(telefoneCliente) > 0:
        print("Nome Cliente: " + nomeCliente)
        print("Cidade Cliente: " + cidadeCliente)
        print("Estado Cliente: " + estadoCliente)
        print("Telefone Cliente: " + telefoneCliente)
        registro = {
            "nomeCliente": nomeCliente,
            "cidadeCliente": cidadeCliente,
            "estadoCliente": estadoCliente,
            "telefoneCliente": telefoneCliente,
        }
        registros.append(registro)
        print("Cliente cadastrado com sucesso!")
        print("------------------------------")
        inicio() 
cold lintel
#

If you know the index of the item you'd like to delete, you can do:

del myarray[index]
#

Be warned, you shouldn't do this multiple times in a loop, as deleting an item will change the indices of the following items.

#

Can you copy and paste the registros array here?

#

So I can show you an example.

ivory kernel
#

pop()

cold lintel
#

Also, what should happen if there are multiple items with the same client name?

ivory kernel
#
a_list = ["a", "b", "c"]

a_list.pop(1)
lean abyss
#

[{'nomeCliente': 'Álvaro', 'cidadeCliente': 'Belo Horizonte', 'estadoCliente': 'Minas Gerais', 'telefoneCliente': '98989898'}, {'nomeCliente': 'Álvaro Pereira', 'cidadeCliente': 'São Paulo', 'estadoCliente': 'São Paulo', 'telefoneCliente': '87878787'}]

cold lintel
#

Alright

#

!eval ```python
data = [
{'nomeCliente': 'Álvaro', 'cidadeCliente': 'Belo Horizonte', 'estadoCliente': 'Minas Gerais', 'telefoneCliente': '98989898'},
{'nomeCliente': 'Álvaro Pereira', 'cidadeCliente': 'São Paulo', 'estadoCliente': 'São Paulo', 'telefoneCliente': '87878787'},
]

data = [
record
for record in data
if record['nomeCliente'] != 'Álvaro'
]

print(data)

timid fjordBOT
#

@cold lintel :white_check_mark: Your eval job has completed with return code 0.

[{'nomeCliente': 'Álvaro Pereira', 'cidadeCliente': 'São Paulo', 'estadoCliente': 'São Paulo', 'telefoneCliente': '87878787'}]
cold lintel
#

Is that the kind of thing you were looking for?

#

Thanks 😄

primal bison
#

@cold lintel thats pretty fast

ivory kernel
#

if data == "Alvaro ":

#

del data[1]

cold lintel
#

Do you need to modify the original array, or is it ok to create a new array with some records removed?

#

Yep.

#

You could find the index like this:

#
index = next(
    i
    for i, record in enumerate(data)
    if record['nomeCliente'] != 'Álvaro'
)
#

Then do:

#
del data[index]
primal bison
#

@cold lintel Yepp thats it

cold lintel
#

Although, it's slightly uncertain what will happen if there are multiple records with the same name.

#

Yep, data is registros

#

Sorry for changing the name 😄

#

If that caused confusion.

#

Sorry, there's a mistake in my code...

#

It should have been:

#
index = next(
    i
    for i, record in enumerate(data)
    if record['nomeCliente'] == 'Álvaro'
)
#

You should only delete one record at a time this way.

ivory kernel
#
index = next(
    i
    for i, record in enumerate(data)
    if record['nomeCliente'] == 'Álvaro'
    del [1]
)
cold lintel
#

Erm, I don't think del is valid syntax there.

ivory kernel
#

oh

#

than record.pop(1)?

lean abyss
#
    nome = input("Digite o nome do cliente no qual você deseja excluir: ")
    cliente = [item for item in registros if item["nomeCliente"] == nome]
    if len(cliente) > 0:
        index = next(i
            for i, registro in enumerate(registros)
            if registro['nomeCliente'] != nome
        )
        del registros[index]
    else:
        print("Não foi possível encontrar nenhum cliente com nome de " + nome)
ivory kernel
#
nome = input("Digite o nome do cliente no qual você deseja excluir: ")
    cliente = [item for item in registros if item["nomeCliente"] == nome]
    if len(cliente) > 0:
        index = next(i
            for i, registro in enumerate(registros)
            if registro['nomeCliente'] != nome
        ):
              del registros[index]
    else:
        print("Não foi possível encontrar nenhum cliente com nome de " + nome)
cold lintel
#
name = input(...)
index = next(
    i
    for i, record in enumerate(data)
    if record['nomeCliente'] == name
)
del registros[index]
#

Oh, sorry, you need to print a message if the name isn't found?

#

One sec...

#

Erm, I'm not sure that's correct.

#

This is what I would do:

primal bison
#

@lean abyss is this language russian?

#

i suppose!

#

Ohh

cold lintel
#
nome = input("Digite o nome do cliente no qual você deseja excluir: ")
try:
    index = next(
        i
        for i, record in enumerate(registros)
        if record['nomeCliente'] == nome
    )
except StopIteration:
    print("Não foi possível encontrar nenhum cliente com nome de", nome)
else:
    del registros[index]
#

Yep

#

It deletes the record if the name is found.

#

next will raise StopIteration if the item isn't found.

primal bison
#

so i think this will work

cold lintel
#

Yep