#off-topic-lounge-text

1 messages · Page 29 of 1

wispy lantern
#

Pyside2 with maya i think

#

Yep

#

Maya

#

Gui

#

yep

#

Alright

#

Yep

#

I don't know and I'm sorry I am having a hard time typing fast enough to answer you

#

Okay thank you :3

#

Have a good one

terse forum
#

hello is anyone free at the moment ! 🙂

jolly crown
#

yup

primal bison
#

anyone here atm to assist?

craggy pasture
#

hi

amber musk
#

Hi

#

in visual studio or pycharm?

primal bison
night lily
#

@novel canyon Might I be of any assistance at this time, or are you just browsing?

terse forum
#

may i poop in

#

xd

novel canyon
terse forum
#

oof im patiently wait for this to be resovled first then !

night lily
#

There are other threshold conditions in addition to the messaging requirement.

#

!voice

timid fjordBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

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.

night lily
#

!paste

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.

novel canyon
young imp
#

btw you can send more than 2000 characters since discord has implemented a new thing to view files within discord

timid fjordBOT
#

Hey @novel canyon!

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

young imp
#

ah, this server ain't allowing that

#

yes

#

its python 2.x

novel canyon
young imp
#

it is totally upto you to put it in a variable or not

night lily
#

!e py my_list = [1,2,3] print(my_list.pop(-1)) print(my_list) 

timid fjordBOT
#

@night lily :white_check_mark: Your eval job has completed with return code 0.

001 | 3
002 | [1, 2]
night lily
#

Youtuber, Corey Schafer

novel canyon
#

Thanks a lot Opal

#

I really appreciate it.

night lily
#

@terse forum

primal bison
#

алё

#

включите мне микрофон

#

аж

#

пж

#

врубте микрофон мне

rugged isle
#

i am trying to make a thing that pastes a number presses enter the selects it all deletes it and writes the next number...```py
import time
import pynput
from pynput.keyboard import *

keyboard = Controller()
press = 100000
time.sleep(4)
while True:
str(press)
keyboard.type(press)

time.sleep(2)

keyboard.press(Key.enter)
keyboard.releash(Key.enter)

time.sleep(4)

keyboard.press(Key.ctrl)
keyboard.releash(Key.ctrl)
keyboard.press("a")
keyboard.releash("a")
keyboard.press(Key.backspace)
keyboard.releash(Key.backspace)

time.sleep(2)
int(press)
press + 1```
#

Traceback (most recent call last):
File "C:\Users\argyr\PycharmProjects\zoomhost\claim_host.py", line 10, in <module>
keyboard.type(press)
File "C:\Users\argyr\AppData\Local\Programs\Python\Python39\lib\site-packages\pynput\keyboard_base.py", line 488, in type
for i, character in enumerate(string):
TypeError: 'int' object is not iterable

#

in short i am trying to make a brute force that only types passwords from 6-10 numbers

undone yoke
#

@rugged isle

#

str(press)

#

doesnt do anything

#

you have to re-set the variable

rugged isle
#

how do i re-set the variable

undone yoke
#

same with int(press)

#

ok can you tell me what press is?

#

what does it hold

#

what does it mean

rugged isle
#

it holds the numbers 10000 and after the loop there is a +1 that adds and for exaple sets it to 100001

undone yoke
#

alright

rugged isle
#

i am trying to make a password brute force tool for a program that i have forgot my password

undone yoke
#
import time
from pynput.keyboard import *

keyboard = Controller()
press = 100000
time.sleep(4)
while True:

    keyboard.type(str(press))

    time.sleep(2)

    keyboard.press(Key.enter)
    keyboard.releash(Key.enter)

    time.sleep(4)

    keyboard.press(Key.ctrl)
    keyboard.releash(Key.ctrl)
    keyboard.press("a")
    keyboard.releash("a")
    keyboard.press(Key.backspace)
    keyboard.releash(Key.backspace)

    time.sleep(2)
    press + 1
#

so basically i input the string version of press

#

into keyboard.type

rugged isle
#

i remember that my password was between 6 and 10 degits

#

ok let me try

undone yoke
#

wait do you understand

#

if you want to change the value/type of a variable

#

you have to reset it with press = str(press)

rugged isle
#

yeah thanks it works

undone yoke
#

or press = int(press)

rugged isle
#

kk

undone yoke
rugged isle
#

thanks so much

#

i understand now

undone yoke
#

ok coolz

#

:)

#

ping me if you have any doubts

rugged isle
#

kk thanks

#

@undone yoke i have 3 questions

#
  1. everytime the loop reruns the press vuriable gets reset
  2. how can i make the program stop by pressing a button
  3. how can i make the proggram show the last 100 numbers it tried
#

the first i fixed it

undone yoke
#

ill take a look now @rugged isle

rugged isle
#

kk

undone yoke
#

"how can i make the program stop by pressing a button" - you'll have to use a GUI for that - i would suggest taking a look at PyQT5

#

"everytime the loop reruns the press vuriable gets reset " - can you repaste your code here?

#

!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.

undone yoke
#

how can i make the proggram show the last 100 numbers it tried
@ Argyris i dont know what your program does

#

so i wouldnt know...

rugged isle
#

it just writes a number

ember light
#

hey is anyone free to help me with something?

undone yoke
#

@drifting cave in code/help 1 vc if you're free and still need help

#

same with @primal bison

drifting cave
#

@undone yoke

#

coming

undone yoke
#

cool

velvet lagoon
#

hi

buoyant kestrel
#

Hey there, how goes it

primal bison
#
import random
import string

def random_char(y):
       return ''.join(random.choice(string.ascii_letters) for x in range(y))

ez= random_char(5)

print(ez)


driver = webdriver.Chrome()
driverr = 'https://prnt.sc/' + ez

driver.get(driverr)
 it just displays two ran```  it just displays two random letters instead of 5
#

Actually what are you trying to do?

primal bison
buoyant kestrel
fathom plank
#

Morning

primal bison
#

hi

fathom plank
#

so how long you guys been writing Python for

#

thats the plan

#

you do it as a hobby or occupation ?

#

check .py Extension in windows settings

winged jacinth
terse forum
#

hello was wondering if anybody is familiar with the text -processing had a question 🙂

fathom plank
#

yo

fathom plank
#

any suggestions on some cool beginner projects ?

rotund beacon
#

hello

rain onyx
#

Hay

fathom plank
#

Heyo

open rover
#

Hi! Can you help me please?
Why my discord bot all time skip this part of code?

@Bot.event
async def on_meassage(meassage):
  with open('economy.json','r') as f:
      money = json.load(f)
  async def free(ctx):
    if not str(ctx.author.id) in money:
        money[str(ctx.author.id)] = {}
        money[str(ctx.author.id)]['Money'] = 0
    if str(ctx.author.id) in money:
      money[str(ctx.author.id)]['Money'] += 1
      with open("economy.json", "w") as f:
              json.dump(money,f)
primal bison
formal estuary
#

Hello If anyone is able to hop in a vc and help me out with my GUI tkinter project I would rly appreciate it

#

atm im stuck and idk how to advance

woeful bramble
fathom plank
#

Morning

open rover
open rover
# woeful bramble you don't call function "free" maybe

i change some, but still nothing

@Bot.event
async def on_meassage(message):
  with open('economy.json','r') as f:
      money = json.load(f)
  if str(message.author.id) in money:
      money[str(message.author.id)]['Money'] += 1
      with open('economy.json','w') as f:
          json.dump(money,f)
  await Bot.process_commands(message)
woeful bramble
open rover
# woeful bramble oh... Try to rename func in "on_message"))

i did, but nothing

@Bot.event
async def on_message(message):
  with open('economy.json','r') as f:
      money = json.load(f)
  async def update_data(money,ctx):
        if str(ctx.author.id) in money:
            money[str(ctx.author.id)]['Money'] += 1
            with open('economy.json','w') as f:
              json.dump(money,f)
        if not str(ctx.author.id) in money:
          money[str(ctx.author.id)] = {}
          money[str(ctx.author.id)]['Money'] = 0
  await Bot.process_commands(message)
woeful bramble
open rover
woeful bramble
#

Не за что

open rover
#

пон

open rover
#

@woeful bramble
Скажи пожалуйста, почему бот морозит ответы а не добавление значения (отмена фарма)

@Bot.event
async def on_message(ctx):
    with open('economy.json', 'r') as f:
        money = json.load(f)
    if not str(ctx.author.id) in queuer:
      if not str(ctx.author.id) in money:
          money[str(ctx.author.id)] = {}
          money[str(ctx.author.id)]['Money'] = 0
      money[str(ctx.author.id)]['Money'] += 0.5
      queuer.append(str(ctx.author.id))
      with open('economy.json', 'w') as f:
          json.dump(money, f)
      await asyncio.sleep(10)
      queuer.remove(str(ctx.author.id))
    await Bot.process_commands(ctx)
woeful bramble
open rover
woeful bramble
#

ща

cold lintel
#

@late agate, can I see?

#

Ah right.

#

Are you using PyCharm?

#

Oh right.

#

Because PyCharm has a 'code with me' feature, which allows two people to see and edit the same code remotely.

trail shard
#

can i ask a question of python from you guys

boreal lance
#

@fiery prawn what do u need?

fiery prawn
#

I need help related to celery. Is this the proper channel for this?

primal bison
#

does anyone know how to save this

primal bison
#

yes

#

i need help

#

how can i voice chat?

night lily
#

!voice

timid fjordBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

primal bison
#

i would like that

night lily
#

@buoyant kestrel Can we please have temp voice for @primal bison ?

primal bison
#

ok

#

ok

#

i havent been on this server for more than 3 day

#

so im trying to make my python project an exe but im coming into some trouble when im try to put it on a flash drive and use it on a different computer it says its a trojan virus

#

funny?

#

hahahaha

#

ok ok i see so im making software for a small computer to run servos and stepper motors so i probably need to make sure i can just use it on that computer

#

im sure ill figure it out

#

ig so thanks for your time

#

pog

#

see ya

#

💋

buoyant kestrel
cold lintel
#

Hello 👋

#

Yep

#

But I don't speak on mic @vocal narwhal

primal bison
#

@cold lintel

#

can you unmite me

#

I need to ask for help

#

://

cold lintel
#

Hey, sorry @primal bison, I don't think we grant exceptions to the voice-gate.

#

But you can type out your question here (or in a help channel) and we will help you with it 🙂

primal bison
#

its a simple question

cold lintel
#

As neither of us can speak, should we head over to your help channel?

primal bison
#

here is fine

cold lintel
primal bison
#

ok

cold lintel
#

Then others who see the channel can join in to help 👍

night lily
#

@oak slate Thought I'd swing by to ask if you were needing assistance, or if you were just hanging out.

#

Okay, well, I haven't heard back from you, but I'll be around. 🙂

night lily
#

Hello, @dull shadow. Are you in need of any assistance at this time?

dull shadow
#

Nope just hanging around, thx~

night lily
#

@merry peak

#

!voice

timid fjordBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

merry peak
#

!voice

timid fjordBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

merry peak
#

hi

#

I have a requirement where I need to get a lot of manipulation done on google sheets

#

My company isnt okay with me using vscode and everything is to be online

#

so google colab fits this reqirement

#

stuff is being done manually

#

which makes my head hurt

#

can you point me in the direction of getting a full end to end workflow on google colab and google sheets

#

I have worked with pandas json crawling and mining

#

theres not a lot of documentation on it

#

thats why

#

okay

#

yea they are document savvy but somehow this is missing

#

colab is more towards ml and tensorflow

#

no one has a weird requiremnt as i do

#

I only deal with data manipulation

#

validation

#

cool okay

#

thanks mate

#

no issues

#

pls get the mods to create a sensible way to get access on the voice channel

#

Its confusing

#

makes sense

dull shadow
#

np~ does this help?

distant patrol
#

Hi guys, I have problem with code, I need make alhoritm on Python:
Make tabulate function y = x
[a,b]

On section a from b

I know I need do
a = int(input())
b = int(input())
And don't know what to do next, any ideas?

trail shard
#
def number_word1converter(x):
    number = f"{x}"

    y = len(number)

    # LISTS

    digits = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]

    teenline = ["ten", "eleven", "twelwe", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen","nineteen"]

    tenline = ["twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety"]

    symbols = [" Thousand ", " Million ", " Billion ", " Trillion "]
    if y > 0:
        digit1 = digits[int(number[-1])]
        if int(number[-1]) > 0:
            digit2 = digit1
        else:
            digit2 = ""
    if y > 1:
        if int(number[-2]) == 1:
            tens1 = teenline[int(number[-1])]
        elif int(number[-2]) == 0:
            tens1 = digit2
        else:
            tens1 = tenline[int(number[-2]) - 2] + " " + digit2
    if y > 2:
        hundreds1 = digits[int(number[-3])] + " hundred "
        if int(number[-3]) > 0:
            hundreds2 = hundreds1
        else:
            hundreds2 = ""
    if y == 1:
        print(digit1.title())

    if y == 2:
        print(tens1.title())

    if y == 3:
        print((hundreds2 + tens1).title())
x=1000

list1 = []
n=f"{x}"
y=len(n)
if y%3==2:
    n="0"+n
elif y%3==1:
    n="00"+n
#001 000
for i in range(0, len(n), 3):
     b=f"{n[i:i + 3]}"

     while b[0]=="0":
         if b=="000":
             b="0"
         b=b.lstrip("0")
     list1+=b
for i in list1:
    if i == None:
        print(" ")
    if ```
lusty lantern
#
l1 = [1,23,312]
lenl1 = len(l1)
if lenl1 == 0:
  print(" ")
else:
  print(l1[lenl1-1])
autumn wave
#

any of u familiar with PyQt5 ui designing?

buoyant kestrel
willow totem
#
if any(np.array_equal(palletcolor, x) for x in colors):
#
def getcolors(palletarea):
    image = get_screen(palletarea);
    colors = np.empty((0,3),dtype=np.int16)
    places = []
    pickheight,pickwidth = dimentions(palletarea)
    for i in range(pickheight):
        for j in range(pickwidth):
            screenPoint = (palletarea[0][0]+j,palletarea[0][1]+i)
            palletcolor = [image[i][j]]
            if any(np.array_equal(palletcolor, x) for x in colors):
                colors = np.append(colors,palletcolor,axis = 0)
                places.append(screenPoint)
    return colors,places
#
def isWhite(color):
    distance = sqrt((255 - color[0])**2 + (255 - color[1])**2 + (255 - color[2])**2)
    return distance < 60
#
def getDistance(collor1,collor2):
    c1b, c1g, c1r = collor1
    c2b, c2g, c2r = collor2
    return sqrt(abs(c2r - c1r)**2 + abs(c2g - c1g)**2 + abs(c2b - c1b)**2)```
meager kiln
#

Please have a look if you are free, I think it is something stupid that I haven't included in my code.

primal bison
#

Can someone help me deploy my django project to heroku?

buoyant kestrel
#

Back in a sec, work

warm hedge
#
file.write(f"You entered:{ISBN}\n")
#

!f-strings

timid fjordBOT
#

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

warm hedge
#

!eval

x = True
print(f"something: {'its true' if x else 'its not true'}")```
timid fjordBOT
#

@warm hedge :white_check_mark: Your eval job has completed with return code 0.

something: its true
warm hedge
#

!ternary

warm hedge
#

!paste

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.

warm hedge
#

while len(str(ISBN)) != 13:

hybrid gust
#
while True:
    # print text for main menu loop
    inp = input()
    if inp == "1":
        pass # do the 1
    if inp == "2":
        pass # do the 2
    if inp == "3":
        pass # do the 3
    if inp == "4":
        pass # do the 4
    if inp == "5":
        pass # do the 5
    else:
        pass # return to main menu or break.
warm hedge
#

I think I will hop out now, hope I solved your previous issues

hybrid gust
#
global q
with open("output.txt", "w") as f:
    if q == 1:
        f.write("1")
    elif q == 2:
        f.write("2")
    ...
#

do not forget to call the output() function from main().

#

meaning:

def main():
  # run functions you need
  output()
fathom plank
#

what issue is this ?

ripe pewter
#

for p in dico["features"]:
    code = p["properties"]["cca2"].upper()
    if code in mesCodes :
        pays = dicoCode[code]
        zones = p["geometry"]["coordinates"]
        print(zones)
        for poly in zones :
            for liste in poly :
                coord = [coor_wgs84_to_web_mercator(c[0], c[1]) for c in liste]
                coordx.append([c[0] for c in coord])
                coordy.append([c[1] for c in coord])
                nom.append(pays)


#

aPES_PogSpin ```
coord = [coor_wgs84_to_web_mercator(c[0], c[1]) for c in liste]

File "C:\Users\Zakaria\OneDrive - Université de Rennes 1\Bureau\mes cours S2\visu\visu\TD5\cours5_3.py", line 92, in <listcomp>
coord = [coor_wgs84_to_web_mercator(c[0], c[1]) for c in liste]

TypeError: 'float' object is not subscriptable

#
    k = 6378137
    x = (lon) * (k * np.pi/180.0)
    y = np.log(np.tan((90 + (lat))* np.pi/360.0)) * k
    return (x,y)
#

need help please I had trouble all day with this

thin kite
#

@warm hedge Plz help us with our code

primal bison
#

does anyone needs help I cant talk tho

#

ah

ripe pewter
#

yes please

#

I'm stuck

#

with the problem above

ripe pewter
#

notice me please monkAS

merry meadow
#

sup

sweet wasp
#

!paste

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.

sweet wasp
olive vessel
#

Usually the easiest is Dijkstra Shortest Path Algorithm

#

you need to have your data in form of Graph

#

with nodes/edges to run it

#

Essentially do you wish for zombie just walking into direction of player
regardless of present walls?

hybrid gust
olive vessel
#

I think I just lack understanding how your map data organized
and which zombie behavior you expect to achieve

sand gulch
#
import os
files = os.listdir(path)
php_files = [_ for _ in files if _[-4:] == ".php"]
night lily
#
from pathlib import Path
start_path = Path('startfolder')
php_files =  [*start_path.iterdir('**/*.php')]```
odd roost
sand gulch
#

is this qualify as a dragon name??

#

@main root

main root
#

Honura

#

Aworu

#

Mangura

sand gulch
#

ziura

main root
#

Aworu

sand gulch
#
import random
x = int(input())

vowel = ["a", "e", "i", "o", "u"]
conso = ['B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z']

choose_list = ["vowel", "conso"]

name = ""
vowel_time = 0
conso_time = 0

for i in range(x-3):
    str_1 = random.choice(choose_list)
    if vowel_time == 2:
        str_1 = "conso"
    elif conso_time == 1:
        str_1 = "vowel"
    if str_1 == "vowel":
        vowel_time += 1
        conso_time = 0
        addable_val = random.choice(vowel)
    elif str_1 == "conso":
        addable_val = random.choice(conso)
        conso_time += 1
        vowel_time = 0
    name += addable_val
syb_list = ["ura", "mon", "oru", "ret"]
name += random.choice(syb_list)
print(name.lower())

night lily
#
import random

alpha = 2
beta = 2

with open('./cheeses.txt', 'r') as file:
   cheeses = file.read().splitlines()
ends = [each[-beta:] for each in cheeses]

data = {}


for cheese in cheeses:
   for i,v in enumerate(cheese):

       try:
           alpha_string = cheese[i:i+alpha]
           beta_string = cheese[i+alpha:i+alpha+beta]
   
           if alpha_string not in data:
               data[alpha_string] = {}
   
           elif beta_string not in data[alpha_string]:
               data[alpha_string][beta_string] = 1
           else:
               data[alpha_string][beta_string] += 1
       except IndexError:
           break

starters = [each for each in data if each[0].isupper()]

def invent_cheese():
   while True:
       cheese = random.choice(starters)
       while True:
           alpha_string = cheese[-2:]
           candidates = []
           for candidate in data[alpha_string]:
               for i in range(data[alpha_string][candidate]):
                   candidates.append(candidate)
           if len(candidates) == 0:
               break
           choice = random.choice(candidates)
           cheese += choice

           if cheese[-2:] in ends:
               if random.uniform(0,1) < .1:
                   break
       cheese = cheese.replace('(','').replace(')','')
       if len(cheese) in range(4, 18):
           break
   
   return cheese

output = '\n'.join([invent_cheese() for i in range(30)])

print(output) ```
#

This code is not robust and is a little buggy.

#

But I have used it to do this sort of thing, given cheese names.

#
Dunbery Stronnes
Sardalet Cenalan
Wens
Hushirene
Royalp Tau
Yarre a l'Aubbe
Dieur deddanchees
Dieuilla Feuille
Striege Druffe
Bano
Neuffalotte Gex
Estraliano Richk
Anne
La Valleno
Yarra l'Autu
Fermignollette
Raclet Ber j
Yarre-V
Style Ageddano
Austeriche
Kadc
Coldt Fouries
Meyeng Che
Buch
Aveynierit
Gueratyrintalette
Serreg
Adoberda
L'Ec```
sand gulch
#

да

night lily
#

@main root

main root
#

I'm looking, I'm looking

tender arch
#

cool

night lily
#

Wasn't sure. You might have had your face buried in code elsewhere. 😏

sand gulch
main root
runic crow
#

whats the issue

#

??

sand gulch
#

now i cant join the channel cause its full

odd roost
#

@main root

runic crow
#

@main root did u post the question on stackoverflow?

#

if so, dm me the link and i will upvote it

main root
cold lintel
#

Alright 😄

#

Erm, so what does the betuvalasztas_sulyozottan function do exactly? What does it take as input, and what does it output?

#

Oh, you did, but I just went with the original name sorry 😄

#

What are each of the arguments?

#

Like, their types and what they represent.

#

If the problem is with a specific function, you really want to narrow in on that function when debugging (rather than run the whole program).

#

Mhm

#

Right.

#

So the error is definitely in choosing_letter_weighted

#

It's returning '' when it shouldn't?

#

I think I see what the issue could be...

#

Did you learn another language before Python, by any chance?

#

Oh right.

#

Erm, so this line: ```py
f_letter = ''

#

I think if you delete that line you should get an exception.

#

choosing_letter_weighted just returns a single letter right?

#

It generally isn't necessary to declare variables in python.

#

Ah right. So that line was obscuring the error.

#

The problem is probably that neither the if nor the elif clauses are run.

#

So f_letter never gets a value.

#

But because you set its value to '', you didn't get an error.

#

Erm, I'm not 100% sure either.

#

So what does this function do exactly?

#

Ah right. So the goal is to generate a word that doesn't have more that two vowels or consonants in a row?

#

Hmm 🤔

#

Ah right 😄

#

Alright. There are some important principles you can use to both prevent bugs from occurring in your code and to find them if they do.

#

Have you heard of DRY?

#

Erm, so it stands for "don't repeat yourself".

#

See how in the choosing_letter_weighted function there are two blocks of code with a very similar structure.

#

You might be able to simplify that to avoid repetition.

#

Here's what I'm thinking: you could first decide whether you are choosing a vowel or a consonant, and then choose the letter.

#

I.e. these are two separate tasks, if you separate the logic for them you could make it simpler.

#
if f_word[f_i-1] in f_vowel_list:
    last = 'vowel'
else:
    last = 'consonant'

if f_word[f_i-2] in f_vowel_list:
    second_last = 'vowel'
else:
    second_last = 'consonant'

...

#

Then you might do: ```py
if last != second_last:
letter_type = random.choices(types, weights=types_weights)
elif last == 'consonant':
letter_type = 'vowel'
else:
letter_type = 'consonant'

#

Then finally, ```py
if letter_type == 'vowel':
return random.choice(f_vowel_list)
else:
return random.choices(f_conso_list[0], weights=f_conso_list[1])[0]

#

I wrote this out just to illustrate what I mean about separating the logic of different tasks.

#

As a rule-of-thumb, flatter code (code with fewer levels of indentation) tends to be better... I'm not 100% sure why 😄

#

Hmm, I think there's a slight issue with the logic there...

#

Instead of doing py if x: if y: ... else: ... I think you meant to do ```py
if x and y:
...
else:
...

#

Do you see what I mean?

#

Sorry if I'm throwing a lot at you at once.

#

Ah right ok

cold lintel
#

If you think about it, if the types differ (one is a vowel and the other is a consonant), then it doesn't matter which is which.

#

So those two cases can be combined into one.

main root
#

aareo

#

aerao

cold lintel
#

Oh, I mean it doesn't make a difference whether the word is ax or xa

#

Not sure if I explained that very well sorry.

#

abcax and abcxa are the same case.

#

Only if the types of the last two letters are equal do you need to know if they are vowels or consonants.

#

For reference, this is my version of the function in its entirety: ```py
if f_word[f_i-1] in f_vowel_list:
last = 'vowel'
else:
last = 'consonant'

if f_word[f_i-2] in f_vowel_list:
second_last = 'vowel'
else:
second_last = 'consonant'

if last != second_last:
letter_type = random.choices(types, weights=types_weights)
elif last == 'consonant':
letter_type = 'vowel'
else:
letter_type = 'consonant'

if letter_type == 'vowel':
return random.choice(f_vowel_list)
else:
return random.choices(f_conso_list[0], weights=f_conso_list[1])[0]

#

Feel free to use it if you want to 👍

#

It may still have bugs 😄

#

Did that work?

#

You could add in an additional check to make sure that the set of vowels and consonants cover all the possible letters.

main root
#

So I'm not sure if my checking works

#

I haven't run it yet

#

How it should work is in line 105 the comment

cold lintel
#

Ah right. So the checking function does all the work here?

main root
#

yes?

#

or whet do you mean?

cold lintel
#

Erm, you just want to repeatedly generate words until checking(word, voweldb, consodb, vowels) returns True?

main root
#

I think yes

#

but as I see, it creates an (almost) infinite loop

cold lintel
#

Ah right.

#

It might help to first move the code that generates the word into a function.

#

Erm, just into a new function like ```py
def generate_word(length, vowels, consonants, consonant_weights, weighted=False):
...

#

Yep, from word = [].

#

Just all the code that generates a word.

#

Ah right.

#

You could have a prefix argument.

#

I mean, it would be quite a lot of arguments but...

main root
#

a what?

cold lintel
#
def generate_word(prefix, length, vowels, consonants, consonant_weights, weighted=False):
    ...
main root
#

okay, and what would that do?

cold lintel
#

Then you pass in generate_word('ab', 10, ...)

#

To generate a 10 letter word starting with ab.

#
  • all the other arguments instead of ...
main root
#

?

cold lintel
#

'prefix' just means the start of a word.

main root
#

okay

cold lintel
#

You said that you're manually selecting the word prefix?

main root
#

yes

#

I mean it generates

#

but the order matters

#

well, the first letter is what matters most

#

from there it's the same, in all ot them

#

oh wait

cold lintel
#

Erm, gtg for a bit to have dinner.

main root
#

okay

cold lintel
#

Do you think you're on a good footing to continue from here?

main root
#

ohm...

#

I still don't know how to escape the infinite loop problem

#

And I need that checking, otherwise the words gonna be not pretty gibberish

cold lintel
#

Erm, so two tips:

  • Use the break keyword instead of the db != 0 flag that you're currently using.
  • Write some tests for the checking function to make sure that it works properly.
#

A simple way to write tests is to do something like this:

def test_checking():
    vowels = ['a', 'e', 'i', 'o', 'u']
    assert checking('aabb', 2, 2, vowels) == True
    assert checking('aabb', 1, 3, vowels) == False
    assert checking('a', 1, 0, vowels) == True
    ... # etc.

test_checking()
#

Ah right.

#

So you can break out of a loop immediately with break.

#
while True:
    x = input()
    if x == 'exit':
        break
#

this for example.

#

Oh, so you want to count the number of words generated?

#

Not sure I understand.

#

Oh, I see.

#

Sorry, I thought you were using db as a flag to break out of the loop.

#

Hmm, it's either that invalid words are always being generated or that the checking function is wrong.

#

Writing test cases would be the way to go in either case I think.

#

I really have to go now sorry!

#

Good luck with the rest of your project!

#

👋

main root
surreal rain
#

i am new so dont laugh at me but i have a html website and i want to make it a real website so ican share it some1 help

fathom plank
#

hey

amber cypress
#

may i ask how to make a command that pastes a file in a chat on discord

brittle gale
#

hi

hard sphinx
graceful elk
wide moss
#

Hi is there anybody here to help?

graceful elk
wide moss
#

Yeah hi I need help with my code with output you think you hop on vc?

graceful elk
#

hello

wide moss
graceful elk
#

so u trying to convert denary to binary?

#

show the output part

#

actually,

#

i gtg

#

sry

wide moss
graceful elk
wide moss
#

when the menu starts again its needs a space

graceful elk
#

\n = new line

odd roost
#

Pandas Python, Matplotlib

#

easy

daring escarp
#

hi guys, could someone help me make the adidas logo?

odd roost
#

addidas

#

logo just like that?

daring escarp
#

yes

odd roost
#

hwy

#

why

daring escarp
#

for school

buoyant kestrel
#

Like.... With Python?

#

I'm confused

odd roost
#

if isn't

#

ain't up about that

#

xD

inland iron
buoyant kestrel
#

Can you show the prompt they gave you?

#

Like what all it needs to do, what libraries it should use, etc.

odd roost
#

the prompt

buoyant kestrel
#

We won't do it for you, but we can at least guide you in the right direction

inland iron
daring escarp
#

plsss help me

buoyant kestrel
#

It's hard to without more context

daring escarp
#

these are the measures

odd roost
#

you wanna make addidas

#

boy

daring escarp
#

yes bro

odd roost
#

are you a pirate

#

?

#

🏴‍☠️

daring escarp
#

no

#

i am just a student

odd roost
#

😄

#

suffer mortal

daring escarp
#

Why are you bulling me

buoyant kestrel
# odd roost suffer mortal

If you don't have anything helpful to say, don't say it. If people want help, then ideally we don't sass them.

#

@daring escarp What libraries are they wanting you to use? Turtle or something?

buoyant kestrel
#

What have you tried thus far

odd roost
#

@buoyant kestrel

#

this is one of big company in my country

buoyant kestrel
#

Huh, I'll be damned

odd roost
#

😄

daring escarp
buoyant kestrel
#

I need more information. What errors is it giving you, what is it doing vs what you're expecting it to do, can you show your current code, etc.

#

The more information you have, the easier it becomes to help

odd roost
#

i need infos

radiant cave
#

Is it possible to find a solution for this using python?

fossil scarab
#

i dont think theres a way to solve this in the first place

#

someone sent an explanation

#

check the vc chats

boreal wing
#

yes

#

i sent one in the other vc

fossil scarab
#

exactly yea

boreal wing
#

yes

primal bison
#

hi

remote wolf
#

how can I turn off the microphone

fleet ether
#

I cannot speak on the chat

#

it says i do not have permission to speak

fossil scarab
#

oh

fleet ether
#

i guess i have to be on this server for 3 days in order to speak

fleet ether
#

honestly that guy was rude

fossil scarab
#

yea idc tbh

fleet ether
#

but i came on the voice chat because i need help with a python project

fossil scarab
#

oh

#

well then lets help u

#

what do u need help in

fleet ether
#

since i cannot speak i will type it on here

fossil scarab
#

sure

#

thats what the chat is for lmao

timid fjordBOT
fossil scarab
#

send it in dms

fleet ether
#

okay

radiant cave
tender tangle
#

py -m pip install -U pip
py -m pip install -U setuptools
py -m pip install -U wheel

#

try running these, one after the other

#

you have reinstalled using the proper python installer, right?

#

@turbid totem

royal lily
#

I like this one,.

#

I went through it all.

odd roost
#

thank you bro

open mountain
#

sdsd

graceful elk
#

0_0

toxic marlin
#

hey boys i have that list, and i need to print all the sub lists to a one bigger list, the issue its i cant use loops or functions.

#

l = [["name", "dinner"], ["Abraham", "Avi"], ["Hello", "Tree", "Door"], ["Name", "Glass", "Two", "am"]]

#

lambda its fine

#

i try to command like that print(*l) but the delete just one parenthesis

#

yep

#

just list of the

#

that*

#

hahahaha

#

that annoying

night lily
#

Okay. So here's a stupid way.

toxic marlin
#

print(*x,sep=' ') try that but again that delete just one parenthesis

#

output = ['name', 'dinner'] ['Abraham', 'Avi'] ['Hello', 'Tree', 'Door'] ['Name', 'Glass', 'Two', 'am']

#

just a sec

#

that is the task

#

Write a python script which takes the following list as an input:

l = [["name", "dinner"], ["Abraham", "Avi"], ["Hello", "Tree", "Door"], ["Name", "Glass", "Two", "am"]]

  1. Unify all the sub lists to a one bigger list.
#

and the note was You are not allowed to use: for loop, while loop and functions (def) in any of the exercises! lambda is allowed.

night lily
#
a = ['apple', 'sauce']
assert a[0] == 'apple'```
toxic marlin
#

can u explain again about assert?

#

when i try to using that i get AssertionError

#

yea yea i know

boreal wing
#
list1 = [["name", "dinner"], ["Abraham", "Avi"], ["Hello", "Tree", "Door"], ["Name", "Glass", "Two", "am"]]
line = str(list1).replace('[', '').replace(']', '').replace("'", '')
line = line.split(', ')
print(line)
night lily
#

!e py a = ['apple', 'sauce'] print(a[0]) 

timid fjordBOT
#

@night lily :white_check_mark: Your eval job has completed with return code 0.

apple
night lily
#

!e

a = [0,1] + [2,3]
print(a)```
timid fjordBOT
#

@night lily :white_check_mark: Your eval job has completed with return code 0.

[0, 1, 2, 3]
toxic marlin
#

yo @boreal wing i think its work

boreal wing
#
list1 = [["name", "dinner"], ["Abraham", "Avi"], ["Hello", "Tree", "Door"], ["Name", "Glass", "Two", "am"]]
final = list1[0]+ list1[1]+ list1[2]+ list1[3]
print(final)
toxic marlin
#

guys i think its fine like that

#

i have 2 more tasks

#

remove all the duplicates from the bigger list.

night lily
#

set

toxic marlin
#

set its a funcation?

#

ohh ok

night lily
#

!e py my_list = [6, 6, 3, 1, 0 ,0, 0] my_set = set(my_list) print(my_set)

timid fjordBOT
#

@night lily :white_check_mark: Your eval job has completed with return code 0.

{0, 1, 3, 6}
night lily
#
list(my_set)```
toxic marlin
#

ok im trying that

night lily
#

Or, if you wanted to be a fancypants, py [*my_set]

toxic marlin
#

if that my code

#

l = [["name", "dinner"], ["Abraham", "Avi"], ["Hello", "Tree", "Door"], ["Name", "Glass", "Two", "am"]]
final = l[0]+ l[1]+ l[2]+ l[3]

my_set = set(final)
print(my_set)

#

{'Door', 'am', 'Tree', 'dinner', 'Abraham', 'Avi', 'Hello', 'Name', 'Glass', 'Two', 'name'}

#

idk

#

the order its not metter

#

the issue its remove all the duplicates from the bigger list.

night lily
#

For sorting, you can use sorted.

#

Inventive use of sorted's key parameter and a lambda which employs list's index method can help recreate the order of the list.

toxic marlin
#

!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!*

toxic marlin
#

Print all the strings that have more than two characters in the middle of them.

night lily
#

len

#

!e py print(len('apple'))

timid fjordBOT
#

@night lily :white_check_mark: Your eval job has completed with return code 0.

5
toxic marlin
#

yea but len its a func...

#

i think i cant use it

#

😆

#

yea its basic

#

what is that?

night lily
#
def my_func():
    ...

class MyClass:
    def my_method(self):
        ...```
toxic marlin
#

hahah dude its like cheating

#

idk if its fine

#

hahahaha

#

im gonna use len

#

fk them

night lily
#

!e py print('apple'.upper())

timid fjordBOT
#

@night lily :white_check_mark: Your eval job has completed with return code 0.

APPLE
night lily
#

!e py print('apple'.__len__())

timid fjordBOT
#

@night lily :white_check_mark: Your eval job has completed with return code 0.

5
toxic marlin
#

hahaahahah

#

hahahaha

#

can u show me how to do it with len?

#

all the issue im not developer im devops so really bad at code

night lily
toxic marlin
#

how i do that Print all the strings that have more than two characters in the middle of them

#

filter its a pure funcation

night lily
#

filter

toxic marlin
#

print(len(filter(my_set)) smoething like that?

#

that looks so broken 🙂

#

print(len(filter(my_set,2))

#

like that?

night lily
#

[*filter(lambda each: ......

toxic marlin
#

ok i got it

#

opal

#

thanks man

#

really big thanks

#

❤️

#

i send me error

#

but i undersand 2wghat i need to do

#

again thanks man

#

god bless u

sinful onyx
pine vector
#

Hello OwO

graceful elk
sinful onyx
#

ola @graceful elk

graceful elk
sinful onyx
#

trying to learn setup code

graceful elk
sinful onyx
buoyant kestrel
#

How do you mean setup code?

sinful onyx
#

yeah

sinful onyx
buoyant kestrel
#

I'm

#

Honestly not sure

#

Oh no wait

#

Found the blurb

sinful onyx
stable reef
#

triangles = []
for triangle in self.triangles:
avgZ = -(self.points[triangle[0]][2] + self.points[triangle[1]][2] + self.points[triangle[2]][2]) / 3
triangles.append((coords[triangle[0]], coords[triangle[1]], coords[triangle[2]], avgZ))

triangles = sorted(triangles,key=lambda x: x[3])

def render(self, color='white'):
coords = []
triangles = []

for point in self.points:
    coords.append(self.flattenPoint(point))

for triangle in self.triangles:
    avgZ = -(self.points[triangle[0]][2] + self.points[triangle[1]][2] + self.points[triangle[2]][2]) / 3
    triangles.append((coords[triangle[0]], coords[triangle[1]], coords[triangle[2]], avgZ))

triangles = sorted(triangles, key=lambda x: x[3])
for triangle in triangles:
    self.createTriangle(triangle, color)

def createTriangle(self, points, color):
a, b, c = points[0], points[1], points[2]
coords = [a[0], a[1], b[0], b[1], c[0], c[1]]
self.shapes.append(self.image.create_polygon(coords, fill=color, outline="black"))

def rotateY(self, angle):
    angle = angle / 450 * 180 / math.pi
    sqrt2 = math.sqrt(2)
    for i, point in enumerate(self.points):
        newX = point[0] * math.cos(angle) - point[2] * math.sin(angle)
        newY = point[1]
        newZ = point[2] * math.cos(angle) + point[0] * math.sin(angle)
        self.points[i] = (newX, newY, newZ)
        test = graphics.Engine3D(points, triangles, scale=100)
        test.rotateY(45)
        test.render()
        test = graphics.Engine3D(points, triangles, scale=100)

        def animation():
            test.image.delete('all')
            test.rotateY(0.1)
            test.render('gray')
            test.window.after(1, animation)

        animation()
#

whats wrong help me pls

heavy umbra
buoyant kestrel
#
glengarriff_info = glengarriff.splitlines()
heavy umbra
buoyant kestrel
#

!stream 438985531800551426

timid fjordBOT
#

@heavy umbra

✅ @heavy umbra can now stream.

heavy umbra
buoyant kestrel
#
glengarriff_info = [line.strip().split(',') for line in glengarriff]
wide aurora
#

should glengarriff be glengarriff.read() or glengarriff.readlines()?

#

on the end

buoyant kestrel
#
glengarriff_info = []
for line in glengarriff:
  glengarriff_info.append(line.split(','))
heavy umbra
wide aurora
#

Red = iterable (i.e. a list)
Blue = Variable for each element
Green = Assignment for new element

buoyant kestrel
#
int("123")
#

Sorry, co-worker need to ask a question

wide aurora
#

!e

my_num = 34322 / 60

print(my_num)

my_num = round(my_num, 4)
print(my_num)

my_num = round(my_num, 2)
print(my_num)
timid fjordBOT
#

@wide aurora :white_check_mark: Your eval job has completed with return code 0.

001 | 572.0333333333333
002 | 572.0333
003 | 572.03
wide aurora
#

!stream @heavy umbra 5M

timid fjordBOT
#

@heavy umbra

✅ @heavy umbra can now stream.

heavy umbra
#

thanks for everyones help

austere crag
#

how do i make a website useing python code (for free)

#

plz help meh

cold lintel
brisk crag
#

can some one help me with code while in call

#

it would help me explain it better

shut tree
#

and is really useful when you write python packages

craggy igloo
#

@sinful onyx I am unable to speak here I am new

#

shows this:

sinful onyx
#

!user

timid fjordBOT
#

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

sinful onyx
craggy igloo
#

a while back but I am inactive

#

@sinful onyx See #bot-commands to find out when I joined

heavy hemlock
#

Hey , I need help with my app , can anyone help ?

pulsar canyon
#

yeah what up?

heavy hemlock
# graceful elk ye?

how to find a value in database , using python . I mean isnt there search code or something?

graceful elk
#

like sql, or json or mongo

heavy hemlock
#

postgres (pgadmin)

#

pg admin III

graceful elk
#

Hmm

#

can't u make a query searching for the required data?

heavy hemlock
#

I dont think i can

#

i need a code or function to find for example information that I made in database.

heavy hemlock
#

ok , thanks anyway .

graceful elk
wise lake
#

Hello

final rapids
#
class Menu(tk.Frame):
    def __init__(self, app, *args, **kwargs):
        super().__init__(app.root, *args, **kwargs)
        self.app = app
        self.setupui()
    def setupui(self):
       pass




class testmenu(Menu):
    def setupui(self):
        frame = tk.Frame(self)
        label = tk.Label(frame,text=self.config['task'])
        label.pack()

class MainWindow():
    def __init__(self):
        self.root = tk.Tk()
        self.root.resizable(False, False)
        self.config =   {
                        'test': 'task'
                        }
        self.menus = (testmenu(self))
        self.menus.grid(sticky='nesw')
        self.active_menu = 0
        
        
        
if __name__ == "__main__":                  #Kickstarts the file
    MainWindow().root.mainloop()
#
class testwindow():
    def window():
        print(self.config['test'])

class MainWindow():
    def __init__(self):
        self.config =   {'test': 'task'}
        testwindow.window()
MainWindow()
wide aurora
#

!e

config = {"Test": "Task"}
print(config["Test"])
timid fjordBOT
#

@wide aurora :white_check_mark: Your eval job has completed with return code 0.

Task
wide aurora
#

!e

class TestWindow:
  def __init__(self, config):
    self.config = config

  def window(self):
    print(self.config['test'])

class MainWindow:
  def __init__(self):
    self.config = {'test': 'task'}
    self.test_window = TestWindow(self.config)
    self.test_window.window()

MainWindow()
timid fjordBOT
#

@wide aurora :white_check_mark: Your eval job has completed with return code 0.

task
wide aurora
#

!e

class Example:
  class_var = 5

  def __init__(self):
    self.instance_var = 7


print(Example.class_var)

my_instance = Example()
print(my_instance.instance_var)
print(my_instance.class_var)


print(Example.instance_var)
timid fjordBOT
#

@wide aurora :x: Your eval job has completed with return code 1.

001 | 5
002 | 7
003 | 5
004 | Traceback (most recent call last):
005 |   File "<string>", line 15, in <module>
006 | AttributeError: type object 'Example' has no attribute 'instance_var'
final rapids
#
class Menu(tk.Frame):
    def __init__(self, app, *args, **kwargs):
        super().__init__(app.root, *args, **kwargs)
        self.app = app
        self.setupui()
    def setupui(self):
       pass

class TestWindow(Menu):
    def __init__(self, config):
        self.config = config
    
    def window(self):
        
        #this part is looking for tk

        frame = tk.Frame(self)
        label = tk.Label(frame,text=self.config['test'])
        label.pack()

class MainWindow():
    def __init__(self):
        self.root = tk.Tk()
        self.root.resizable(False, False)
        
        self.config = {'test': 'task'}
        self.test_window = TestWindow(self.config)
        # This part isnt passing tk on
        self.test_window.window()
              
if __name__ == "__main__":                  #Kickstarts the file
    MainWindow().root.mainloop()
#

C:\Users\Antonio Mafera\Desktop\a plus a>py -3.9 -i main.py
Traceback (most recent call last):
File "C:\Users\Antonio Mafera\Desktop\a plus a\main.py", line 105, in <module>
MainWindow().root.mainloop()
File "C:\Users\Antonio Mafera\Desktop\a plus a\main.py", line 100, in init
self.test_window.window()
File "C:\Users\Antonio Mafera\Desktop\a plus a\main.py", line 89, in window
frame = tk.Frame(self)
File "C:\Users\Antonio Mafera\AppData\Local\Programs\Python\Python39\lib\tkinter_init_.py", line 3124, in init
Widget.init(self, master, 'frame', cnf, {}, extra)
File "C:\Users\Antonio Mafera\AppData\Local\Programs\Python\Python39\lib\tkinter_init_.py", line 2566, in init
BaseWidget.setup(self, master, cnf)
File "C:\Users\Antonio Mafera\AppData\Local\Programs\Python\Python39\lib\tkinter_init
.py", line 2535, in _setup
self.tk = master.tk
AttributeError: 'TestWindow' object has no attribute 'tk'

wide aurora
#
   def window(self, parent):
        
        #this part is looking for tk

        frame = tk.Frame(parent)
        label = tk.Label(frame, text=self.config['test'])
        label.pack()
boreal lance
#

@shadow ivy

#

Tell me what you think @shadow ivy

final rapids
#
import tkinter as tk
class Menu(tk.Frame):
    def __init__(self, app, *args, **kwargs):
        super().__init__(app.root, *args, **kwargs)
        self.app = app
        self.setupui()
    def setupui(self):
       pass

class TestWindow(Menu):
    def __init__(self, config):
        self.config = config
    
    def window(self, parent):
        frame = tk.Frame(parent)
        print(self.config['test'])
        label = tk.Label(master=frame,text="asdf") #this is not displaying when the window runs
        label.pack()

class MainWindow():
    def __init__(self):
        self.root = tk.Tk()
        self.root.resizable(False, False)
        
        self.config = {'test': 'task'}
        self.test_window = TestWindow(self.config)
        self.test_window.window(self.root)
              
if __name__ == "__main__":                  #Kickstarts the file
    MainWindow().root.mainloop()
undone yoke
#

I would recommend subclassing the class tk.Tk

marble crow
#

Hey I am new to coding
Would you recommend some app for me where I can learn python

boreal lance
#

Did you listen to it @shadow ivy

shadow ivy
#

yes i was listening along earlier

boreal lance
#

did you like it @shadow ivy

pseudo forge
oak patio
#
while i<100:
    zahl=input("Cklick a buuton")
    i=i+1
    print("you cklicked the Enter- 
    button",i,"Times")```
#

that is a cklick counter

#

for the people that doesnt know this

#

!user

timid fjordBOT
#

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

red hornet
#

Hey dudes I need help with my django Crud project Im having trouble with having multiple tables or forms for my database anyone their to spare some time?

primal bison
#

whole server in VC 1 just bcz of 1 girl

#

lol

buoyant kestrel
#

I mean you're also in here

frank brook
#

I just reached 50 messages. I mean after this message.

#

@buoyant kestrel Hey the vc verify still doesn't work.

buoyant kestrel
#

You have to have been here for 3 days

native orchid
#

hey i need some help regarding web scrapping

oak patio
#

how do i fix this

teal mesa
#

hey, I've just built my first flask restful api and i get a bad request even using CORS, I've tried using @cross_origin but couldn't make my react app to interect with it. Does anyone have an idea?

quaint saffron
languid thistle
#

look up for loops

oak patio
#

i know

primal bison
#

@sturdy geyser can you send me the link of the youtuber that teaches u about python?

unreal eagle
#

Hello

#

@raven knot

raven knot
#

@unreal eagle hello

shell solstice
#

Hello guys.
Please I need assistance with my project. I'm working with Django framework but noticed my CSS isn't loading even whilst I've added the load static tag. Kindly help out. Thanks

twin abyss
#

xd

primal bison
#

Voice Chat 0

copper flame
#

can someone help me out with pygame 😭

steel spruce
#

!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!*

sterile gust
#

Hi, i get an error message saying this on python and i'm using Segmind. I am trying to load load the dataset.:

<ipython-input-47-e6475e144872> in <module>
      4 for fol in range(0,2):
      5     if fol == 0:
----> 6         pneumonia_images = os.listdir(folders[fol])
      7         pneumonia_labels = [1] * len(pneumonia_images)
      8     else:

FileNotFoundError: [Errno 2] No such file or directory: '/Pneumonia/dataset/pneumonia_dataset/train/pneumonia'```
      This is my code that i am working on below:                                                                                                                    ```folders = ['/Pneumonia/dataset/pneumonia_dataset/train/pneumonia', 
            '/Pneumonia/dataset/pneumonia_dataset/train/normal']

for fol in range(0,2):
    if fol == 0:
        pneumonia_images = os.listdir(folders[fol])
        pneumonia_labels = [1] * len(pneumonia_images)
    else:
        normal_images = os.listdir(folders[fol])
        normal_labels = [0] * len(normal_images)```
#

Thanks for any help!

winter bloom
#

@sterile gust , is your Pneumonia dataset on the root of your file system? I'd guess that they are relative to your python script.
Try dropping the / at the beginning of your path names.

minor pasture
#

can anyone suggest me how to solve a sudoku without using recursion..The empty spaces are indicated by 0

night lily
severe sequoia
#

if anyone wants to help me I'm working on this assignment:

10.2 Write a program to read through the mbox-short.txt and figure out the distribution by hour of the day for each of the messages. You can pull the hour out from the 'From ' line by finding the time and then splitting the string a second time using a colon.
From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008
Once you have accumulated the counts for each hour, print out the counts, sorted by hour as shown below.

Here is my code so far

#
name = input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"
handle = open(name)

counts = dict()
lst=[]

for line in handle:
    if line.startswith('From'):
        lst.append(line.rstrip())
   

for line in lst:
    words = line.split()[5]
    words = words.split(":")[0]
    for word in words:
        counts[words]=counts.get(word, 0) +1

lst2 = []    
for k,v in counts:
    lst2.append(k,v)

print(lst2.sorted())
#

I get a traceback on line 14 saying my index is out of range

hearty goblet
#

We dont have permissions

#

Not like you? hehe, that would be weird

#

to not like someone who you don't know

#

You need help with what?

#

It depends on the strategy.

#

What's your strategy?

#

Who's coding a trading bot though?

#

what channel?

dawn spade
#

This is the problem

#

#WITH USE OF IF ELSE STATEMENT

m=[]
n=int(input())
for i in range(n):
imputs = input().split()
if len(imputs)==3:
operation,*num = imputs
i,e=list(map(int,num))
if operation=="insert":
m.insert(i,e)
elif len(imputs)==2:
operation,num= imputs
i=int(num)
if operation=="remove":
m.remove(i)
elif operation=="append":
m.append(i)
elif len(imputs)==1:
if imputs=="sort":
m.sort()
elif imputs =="pop":
m.pop()
elif imputs=="reverse":
m.reverse()
elif imputs=="print":
print (m)

#

here is my solution.. can anyone check what's wrong in my code?

primal bison
swift marten
#

I want help regarding tkinter in python, I m newbie in python

#

Can anyone call me?

candid hearth
#

+++

reef sorrel
#

👍

muted cypress
#

is anyone able to call ?

#

need some help on python

viscid acorn
#

i cant talk yet

#

😦

severe sequoia
#

10.2 Write a program to read through the mbox-short.txt and figure out the distribution by hour of the day for each of the messages. You can pull the hour out from the 'From ' line by finding the time and then splitting the string a second time using a colon.

From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008

Once you have accumulated the counts for each hour, print out the counts, sorted by hour as shown below.


name = input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"
handle = open(name)

counts = dict()
lst=[]



for line in handle:
    if line.startswith('From') and ":" in line:
        lst.append(line.rstrip())
        print(lst)
    else: continue

numbers =list(str(range(1,11)))

for line in lst:
    if any numbers not in line:
        line.remove(lst)

print(lst)
words =[]
for line in lst:
    words.append(line.split()[5])

print(words)
for word in words:
    words2.append(words.split(":")[0])
print(words2)
    #for word in words2:
        #counts[words]=counts.get(word, 0) +1

#lst2 = []
#for k,v in counts:
    #lst2.append(k,v)

#print(lst2.sorted())
severe sequoia
#
for x in numbers:
x = str(x)

late ruin
#

any(_)

fiery sigil
#

hello i am under the water

buoyant kestrel
#

!stream 510863751696613376

timid fjordBOT
#

@quaint saffron

✅ @quaint saffron can now stream.

buoyant kestrel
#

ctx.author.voice.channel

#

ctx.author.voice.channel.connect()

sterile stone
#

Hello, what are you guys creating?

#

seems really cool

buoyant kestrel
#

!stream 510863751696613376 15M

timid fjordBOT
#

@quaint saffron

✅ @quaint saffron can now stream.

quaint saffron
#

@buoyant kestrel To be honset must of these songs I am playing on these bots are free domain and require no license or rights

buoyant kestrel
royal mantle
#

['index1', 'index2', ....]

proven fable
#

hello guys

royal mantle
#

print(key["_source"].keys())

#

['index1', 'index2', ....]

#

@hybrid gust

outer sparrow
#

@royal mantle can you past the output of indexkeys

#

I just need to see the structure so I can help you.

#

you can PM if you feel better about that

hybrid gust
#
for key in indexkeys:
    print(key)
    break
royal mantle
#

Elasticserver > Elasticindexes > index keys (_source is here) > _source.keys (The keys I need)

hybrid gust
outer sparrow
#

the actual JSON response would help more.

#

@hybrid gust yea lol

royal mantle
#

index1

#

index2

#

index3

outer sparrow
#

so the response of indexkeys is a list of keys correct?

#

can you stream what your looking at?

#

paste it then

#

if we had the whole structure we could help you with a generator function

#

Do you have the response?

royal mantle
#

@hybrid gust updated code and Output

outer sparrow
#

These are the keys right?

royal mantle
#

yes

outer sparrow
#

kk

royal mantle
#

these are the keys I need from each index

#

not these SPECIFICALLY, but the keys in general

#

I need the loop to loop over each index, and grab each collection of keys from each index

#

some indexes may need to be further drilled into

outer sparrow
#

hes on a call

royal mantle
#

sorry, got pulled into a datalake meeting 😦

outer sparrow
#

all good

royal mantle
#

yea it looks like that

#

Thats why grabbing _Source is important

#

some tables write their field key:value data into _Source

outer sparrow
#

that's fine I just wanted to know the structure of your json output so I could help you write a generator function 🙂 give me just a bit.

#

What is the end result you want?

royal mantle
#

all of the keys from all of the indexes

#

so inside of your sample

#

you have _Source

#

and inside that you have loco_moco_account_id, authentication token, ciphertext, and hash

#

I want those keys

#

for each index

outer sparrow
#

You want a dictionary format as the output?
I think it would look the best visually

royal mantle
#

you mean, like:

#

key1

#

key2

#

key3

#

etc?

outer sparrow
#

oh ok, you just want to see the output for now right?

#

gotcha. 1 sec

#

let me know when your available again

royal mantle
#

im here

#

sorry, sucked into another meeting >.>

outer sparrow
#

going to make a coffee real quick.

proven fable
#

@hybrid gust I think it works hopefully

#

ty guys for the help really appreciate it

royal mantle
#

meeting almost over -.0

royal mantle
#

@outer sparrow You still on?

#

@hybrid gust finishing up here soon, really sorry for the delays

proven fable
#

the problem here the multiprocessing unit iterate through the same IP adress knowing that it exist more

languid meteor
#

@atomic phoenix

#

!e ```py
s = 'A4, '3
test = f"""
{s}
{s}
{s}
{s}
"""
print(
[e.strip() for e in test.replace(',','').split(',')], sep='\n')

timid fjordBOT
languid meteor
#

@atomic phoenix regex = 🤯 , generator + str methods = 👍

maiden quest
#

how can, i speak on voice chat

spare estuary
#

7

primal bison
#

yes what is problem?

#

@waxen mason what problem

waxen mason
#

i am using a api in india

primal bison
#

yes

waxen mason
#

and its working fine when i am calling it from my pc

primal bison
#

yes

waxen mason
#

but when i am using heroku its giving me 403

#

erroe

#

r

primal bison
#

403 access denied

waxen mason
#

yes

#

its this api:

primal bison
#

is heroku blocking the apis ip address because its in india

primal bison
#

the api is blocking heroku ips

#

you will have to ask the owner of the api to unblock heroku's ips

waxen mason
#

api is geo-locked to india only

primal bison
#

well there you go

waxen mason
#

i an unable to use proxy

primal bison
#

nope unless the proxy is inside india then no

waxen mason
#

so what to do now

#

??

toxic nebula
#

ih

unreal eagle
#

yo

chilly cave
#

help files with the annotation py do not open

primal bison
#

@snow hornet need help?

snow hornet
#

Oh sorry, I forgot to leave the vc, I;m getting help in #help-pretzel . Thank you though! 🙂

keen condor
#

mango

fiery nacelle
maiden wind
thick shale
#

anyone trying to help me with some missing assignments in my python programming class im grade 10 and they're not that hard for people who know how to program its just i need help so i dont fail

wide aurora
#

!stream @shadow mauve 30M

timid fjordBOT
#

@shadow mauve

✅ @shadow mauve can now stream.

boreal lance
#

@sour sentinel do you need help?

glass swift
#

i uses python in rur-ple, and i don't know

#

how to do

#

ah

#

never mind

#

blahblah

#

sorry

#

bye

balmy birch
#

!stream @balmy birch 10m

#

!stream @balmy birch 10M

tacit hare
#

hello! I would like to get some help. 🙂
Im a beginner and would like to understand just how everything works. What things are and stuff like that. If anyone would like to please join code/help 1. Thank you! 🙂

ebon onyx
#

.

dusk burrow
#

guys i need hep with a python code

cunning obsidian
#

aboba

limpid torrent
#

im tryna work on a tile system rn

#

and im having problems with pygame surfaces

#

it keeps cutting off at the middle of the screen

turbid fulcrum
#

can anyone help me with something

naive agate
#

hey !

#

if u see /hey!/ be sure that I love u !

night lily
#

@high charm

limpid torrent
astral mesa
#

Hey guys, anyone got five for a chat/review?

marsh roost
#

no

normal snow
#

Hi, i want to be a mod

#

i've been a mod on a server with 10 People

primal bison
#

true

meager compass
frail mulch
#

Why I am invalid to talk?

primal bison
#

n

naive agate
#

@upbeat fern

#

I love u !

upbeat fern
naive agate
#

YW

upbeat fern
#

why do I get the love?

arctic lichen
#

helo

drifting cave
#

can I get some string manipulation help

random wraith
#

can someone help me

marsh roost
#

f\

wise lake
#

Hello @tender tangle

tender tangle
#

hi

wise lake
#

so whats everyone up to

tender tangle
#

the top floor

wise lake
#

cool

#

wait

#

wat

#

ok

vague monolith
#

Hello guys, i’m working on a algorithm and i’m stuck on one thing it’s about positioning inside a cube and i have function to go left right up down and there’s away to go outside ... so i’m stuck to say to the algorithm that there’s limits ... i can explain more in vocal if some one can help

frail orchid
#

hi how can i print a triangle with py```
s=["", "","", "","", ""]
for i in s:
s.pop()
print(s)

#

am a slow learner

iron cliff
#

Hello, im having trouble using py installer to make an exe file, I keep on getting fatal error detected even though I made sure t he exe file has all the dependencies with it, I tried installing it differently but nothing seems to work. I expect the exe to open without errors and run the program normally

astral jacinth
wispy carbon
#

I'm having this error: NameError: name 'self' is not defined
class MainThread(QThread):
def init(self):
super(MainThread,self).init()
Its kind of urgent, any help please?

viscid kindle
wispy carbon
#

No

#

Pls help me out

#

Anyone?

wispy carbon
#

My code was

#
class MainThread(QThread):
    def __init__():
       super(MainThread,self).__init__()
timid fjordBOT
#

@primal bison Please don't try to ping @everyone or @here. Your message has been removed. If you believe this was a mistake, please let staff know!

primal bison
#

mistake

wispy carbon
wanton dune
#

wassp

spark stream
#

wassas

timid fjordBOT
#

:incoming_envelope: :ok_hand: applied mute to @devout aurora until 2021-06-06 00:37 (9 minutes and 59 seconds) (reason: burst rule: sent 9 messages in 10s).

tough ridge
#

Can anyone help me solving this problem guys?
Find substrings containing an e-mail address
Task:

You are given a set of strings separated with line feed characters. Find the longest substrings that can be considered e-mail addresses.

An e-mail address consists of three parts: the name of the local part, an "@" character, the domain name of the server.

The local part name can contain latin letters, digits and underscore characters "_".

The server domain name consists of the name itself (digits, latin letters and dash symbols "-") and names of all other domain it belongs to, each separated with a period. The fully qualified domain name should not exceed 66 symbols.

In this task, we'll take the top-level domain as a string of latin letters from 2 to 4 (inclusively) characters long.

The local part name should be separated from the domain name with an "@" character.

Input:

A set of strings separated with line feed characters.

Output:

All the longest correct substrings in the order in which they appear in the text, separating each with a line feed character.
Example:

Input
a@b.cde

Va$ya123@shmail.ru
Output
a@b.cde

ya123@shmail.ru

fiery sigil
#

who is from yr9-11 and would be interested joining me in the web design competition

copper raptor
#

which ide is it ?

fiery sigil
#

html

sturdy geyser
#

!e
print("me help")

timid fjordBOT
#

@sturdy geyser :white_check_mark: Your eval job has completed with return code 0.

me help
sturdy geyser
#

@lean sentinel

lean sentinel
#

jake coded me help

sturdy geyser
#

Glad I can help 👍

fiery sigil
#

print ("your mom")

#

!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!*

fiery sigil
#

e print ("your mom")

#

!e print ("your mom")

timid fjordBOT
#

@fiery sigil :white_check_mark: Your eval job has completed with return code 0.

your mom
blissful badger
spark stream
#

l need fucn perm'sson

#

HAHAHAHAHAHAHA

#

LETS GO

#

CAN L WT":":":"../>>>?//>>>...>>........,,,///'';;]][P[PPPPPPP[]';'/.,,,KAAN PE

#

LCAANT WR'TE /.,,';';][][][][[][][][][][[KAANA KUZEY OPER,'N EELLLO HELLOWOORLF

outer stream
#

Not sure if this has been answered yet, but it turns a string to lower case. ("HI People" -> "hi people")

ornate monolith
half gulch
#

!play half mast empire of the sun

#

fail

half gulch
#

not a musical group i guess

primal bison
#

@buoyant kestrelshutup nerd

#

🤓 ☝️ lets see what infractions they have

gaunt epoch
#

Hey

#

i wanted to know if learning kivy is worth it

#

or is there any alternative

#

??

#

@buoyant kestrel

#

can ya ask in vc?

unique thistle
#

i cant speak

#

yes

#

@primal bison

primal bison
#

ok

unique thistle
#

im nuted

primal bison
#

whats the problem

unique thistle
#

um i need help with implementing a A* algo

primal bison
#

ooo

unique thistle
#

im new to python and have biiten more than i can chew

primal bison
#

hmm i see

unique thistle
#

ok how should i go about sharing my code

primal bison
#

paste it

unique thistle
#

i need help from scratch

#

i will post the things needed