#code-help-voice-text

5 messages ยท Page 2 of 1

pulsar basin
#

I can

#

I do not see the install package control option, I'm not sure if I may have installed it in the past, is there a way to check if I have done so?

#

should I type install package, click on package control: install package, and type in sublime repl?

#

Alright, I think I have installed it now

#

do I have to restart sublime for the extension to take effect?

#

So I have installed the sublimerepl extension, but it doesn't seem to work when I run a simple ```py
print("Hello World!")

#

@finite grove

keen onyxBOT
pulsar basin
#

yeah, I'm not sure if you answered my previous question

#

let me restart sublime

#

when I eval with repl, eval the file, it says sublime REPL not found

#

that's really weird, do you have any other suggestions for text editors or ides?

#

@finite grove I might just use another ide/text editor or just stick to pycharm, I asked because I wanted to switch things up since I have lots of things stored in pycharm currently

#

do you have any good suggestions for other ides/text editors

still lagoon
#

from tkinter import *
import os
import json

root = Tk()
root.geometry('370x210')
root.title('Bill By ~# Silicon Brains')
data = open('data/api.json', 'r')
js = json.load(data)
print(js["name"])
print(js["version"])
title = Label(root, text='Customer Billing', bg='gold', fg='green')
root.resizable(None)

title.grid(row=1, column=1)

save bill in file

def bill():
with open('data/user_data.txt', 'a') as f:
print(f.write(f"Bill name : {userName.get()}\n"))
print(f.write(f"Bill number : +91 {number.get()}\n"))
print(f.write(f"Bill address : {address.get()}\n"))
print(f.write(f"Bill pay value : {pay.get()}\n\n"))
userName.delete(0, END)
number.delete(0, END)
address.delete(0, END)
pay.delete(0, END)

input all bill data

Label(root, text='Enter Bill Name :').grid(row=2, column=0)
userName = Entry(root)
userName.grid(row=2, column=1)

Label(root, text='Enter Bill number :').grid(row=3, column=0)
number = Entry(root)
number.grid(row=3, column=1)

var = StringVar(root)

var.set('state_in_india')

menu_data = js["state_in_india"]

Label(root, text='cause city : ').grid(row=4, column=0)

menu = OptionMenu(root, var, *menu_data)

menu.grid(row=4, column=1)

Label(root, text='Enter bill Address :').grid(row=5, column=0)
address = Entry(root)
address.grid(row=5, column=1)

Label(root, text='Enter Pay Amount :').grid(row=6, column=0)
pay = Entry(root)
pay.grid(row=6, column=1)

Label(root, text='gender :').grid(row=7, column=0)
g1 = Checkbutton(root, text='male').grid(row=7, column=1)

bt = Button(root, text='Bill Now', bg='sky blue', fg='green', command=bill)
bt.grid(row=8, column=1)

def close():
# bill()
root.destroy()

bt1 = Button(root, text='close', bg='red', fg='white', command=close)
bt1.grid(row=1, column=2)

root.mainloop()
os.system('clear')

#

hey this my project bro

pulsar basin
#

yeah, but for some reason it's not really working, vsc isn't working for me either. lmao this kinda sucks for me

#

vscode works wonders when it works, but when it doesn't, it is a nightmare to deal with

#

@finite grove do you have any good resources on django, since I am trying to get better with python and I feel that django will help me improve

#

how would you recommend learning django for the first tiem?

#

Could I dm you since this way I don't have to keep pinging you?

finite grove
#
{
"target": "run_existing_window_command",
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}
pulsar basin
#

copied it

#

yes

#

it opened it

main solar
#

but different name then the default build system names

pulsar basin
#

does it have to end in .sublime-build?

main solar
#

ya

pulsar basin
#

Okay, I saved the file

still lagoon
#

okay

pulsar basin
#

I ran it using my file, and it isn't working still

#

doesn't show a command line like yours does

#

oh okay

#

my bad

main solar
#

one another think u wohnt be able to enter input through the build system as it is not interactive

pulsar basin
#

yes I see it

#

yep it does

finite grove
#

repl_python_run

pulsar basin
#

wait I searched it and it highlighted that line, and what should I do next?

#

alright, I added it

#

uh I am trying to run the file using control b, but it is saying that there is no such file or directory, and it is listing out the current file that i have opened, and it is not returning what it should

#

it says unable to save file read only file system

#

yep, now it works

#

oh that is cool

main solar
pulsar basin
#

how can I install packages or modules, I am trying to import a module called pyinputplus, and it's returning ImportError

#

it says I already installed pyinputplus through python3 -m pip install pyinputplus, and it's saying that I already have installed it, but when I run it through sublime, it doens't work

#
no module named pyinputplus ```
pulsar basin
#

I'm on mac os x btw

naive terrace
#

ooof wait

pulsar basin
#

yeah I did python3.9 -m pip install pyinputplus and it's saying that the requirements are already met, but it's not working through sublime

#

yes

#

venv?

#

okay

#

so maybe I have to install it inside of venv?

#

oh okay

#

yep

#
python --version
naive terrace
pulsar basin
#

wait how do you get to that settings page or file you are in again?

#

oh wait

#

I remember now

#

dang discord while watching streams takes up 40% cpu

#

so I can just simply save this config file, and I can run it and it should work now?

#

@finite grove thank you so much for your help, at least now I have something similar to vscode!

#

can you install theme extensions or packages to change the theme of your workspace in sublime?

#

oh I already know how to lol

#

I just used command pallete

#

install packages

#

and installed some theme

naive terrace
pulsar basin
# naive terrace which ide u use?

mainly pycharm currently, the reason why I wanted to have something else to use is because I want to make more things and store them on a different application, instead of cramming tons of stuff onto pycharm itself

pulsar basin
# naive terrace nice I use Vscodes

nice, vscode was being a bully for me, was giving me lots of problems whenever I even tried to create a new file and create something new, which was annoying

naive terrace
white sparrow
finite grove
#

!voice

keen onyxBOT
#

Voice verification

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

rain ember
#

@finite grove I am unable to join
Due as the channel is full
Please drage me in voice channel

#

@finite grove once again

#

Please

finite grove
white sparrow
#
Ministerul Educa
iei Na
ionale 
Centrul Na
ional de Evaluare 
i Examinare 
Prob
 scris
 la Fizic
 1 
A. Mecanic
 Filiera teoretic
 ล’ profilul real, Filiera voca
ional
 ล’ profilul militar 
 Examenul de bacalaureat na
ional 2014 
Proba E. d) ล’ 4 iulie 2014 
Fizic
 Filiera teoretic
 ล’ profilul real, Filiera voca
main solar
#

have a nice sublime text day

still lagoon
#

okay

rain ember
#

Channel is full ๐Ÿ˜ฉ

#

Sorry to say
But can @finite grove please drag me once more

main solar
#

pssibleto letme in @finite grove

finite grove
#

sure,

white sparrow
still lagoon
#

import os

fileName = input('Enter your file name : ')
os.system(f'touch {fileName}')
with open(f'{fileName}', 'a') as f:
print(f.write('hello i am CEO OF THE Silicon Brains'))
print(f'{fileName} created my master')

#

File operation code

finite grove
#

I crashed

white sparrow
#

Sad

main solar
#

I fucked my project by renaming my src folder. Now it's all scuffed and I'm not sure how to fix. Renaming it back only helped a bit. Send help please ๐Ÿ˜ญ

tranquil sparrow
#

I think more people will see

indigo vortex
#

Can anyone teach me on how to use the queue python functions

#

The documentation doesn't help me or I just can't figure out on how to use it

tranquil sparrow
dapper bear
#

yo can someone help me convert a py into a exe i alr looked at yt stil cant

main solar
#

how i remove this?

#

Text file:

cedar onyx
#
with open("combo.txt") as file:
    lines = [line.strip() for line in file]
    combo = [line.split(':') for line in lines]
    combor = [line.split() for line in lines]
tender hill
#

@candid birch

#

do you need help?

#

!resources

keen onyxBOT
#
Resources

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

candid birch
#

ya hi

tender hill
#

alright

#

where do you need help?

candid birch
#

def medium(li,x):
low = 0
mid = 0
high = len(li) - 1
while low <= high:
mid = (low + high)//2

    if li[mid] < x:
        low = mid + 1
    elif li[mid] > x:
        high = mid - 1
    else:
        return mid
    
return -1

li = [int(a) for a in input().split(" ")]
x = int(input())
result = medium(li,x)
if result != -1:
print(str(result))
else:
print(" element is not present")

#

so can you help me understand why we used print(str(result))

#

in third last line

#

?

tender hill
#

result was earlier a float type variable

#

str(result) this basically typecastes it to string

#

it basically wouldnt have made a difference

#

but if the typecasting was to a int then it would have made a litle difference

#

!e

a = 2
print(a)
print(str(a))
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

001 | 2
002 | 2
tender hill
#

you see here it didnt make a diffrence

#

but it would make a difference when

#

!e

a = 2
print(a)
print(int(a))
print(float(a))
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

001 | 2
002 | 2
003 | 2.0
tender hill
#

converting it to a float makes it a decimal type number(mathematical definition of decimal is used here)

#

@candid birch

#

so you get it?

candid birch
#

ya

#

thanks very helpful

tender hill
#

so anything else i can help in

candid birch
#

no just this one

#

thanks

tender hill
#

ok so bye!

candid birch
#

๐Ÿ‘

river hare
#

@tender hill here?

#

oh

tender hill
#

yea join vc

river hare
#

thats it

#
import requests
import pandas as pd
from bs4 import BeautifulSoup

response = requests.get('https://neoxscans.net/manga/the-player-that-cant-level-up')
site = BeautifulSoup(response.content, 'html.parser')
found_obj = site.find_all('li', {'class': 'wp-manga-chapter'})[0]
print(find_obj.find('a')['href'])
#

what?

#

ye

#

but look the link

#

i need search an more links

#

wait

#

can u repeat?

#

ye

#

hm its the same site

#

after manga/

#

i need change

#

i have a list

tender hill
#

'https://neoxscans.net/manga/x-page

river hare
#

ye

#

and

#

when acess the page

#

the code need get this text

#

can u write?

#

english isnt my native language

#

i not so good listening

#

@tender hill

#

what?

#

ok

tender hill
river hare
#

i cant do this with class

#

because the element dont have class

tender hill
river hare
#

no

#

just href

tender hill
#

thats good then

river hare
#

and css

#

style

#

look in this page

#

ok

#

but how i do it?

#

its possible use a webhook with python?

tender hill
#
def parse(soup_: Bs):
    for html_link_tag in soup_.find_all('a'):
        yield html_link_tag.get('href'
river hare
#

after parser

tender hill
river hare
#

?

tender hill
#

the site dosent opens for me

river hare
#

try use vpn

#

;-;

#

its a brazilian site

tender hill
river hare
#

do u use firefox?

tender hill
#

brave

river hare
#

hm

#

i dont know how do this on brave

#

but change your proxy brownser

#

to SOCKS Domain

#

and select SOCKS4

tender hill
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

response = requests.get('https://neoxscans.net/manga/the-player-that-cant-level-up')
site = BeautifulSoup(response.content, 'html.parser')
a_tags = [a_tags for a_tags in site.find_all('a')]
print(a_tags)
river hare
#

ok

tender hill
#

check it

river hare
#

im running

river hare
#

and the port 5678

tender hill
#

i will just tell you the directions

river hare
#

ok

tender hill
#

dont want to mess up my networks on ubuntu

tender hill
#

?

keen onyxBOT
#

Hey @river hare!

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 hare
#

;-

tender hill
#

just show the screenshot of the output

river hare
#

It's there

#

Cap. 39

#

no

#

i want the content

#

the text

#

Cap. 39

#

ye

#

but i have others links to get the cap

#

i will back

#

wait a second

#

im back

tender hill
#

alright

river hare
#

wait

#

what?

#

no

#

no link

#

what?

tender hill
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

response = requests.get('https://neoxscans.net/manga/the-player-that-cant-level-up')
site = BeautifulSoup(response.content, 'html.parser')
a_tags = [a_tags for a_tags in site.find_all('a')]
for a_tag in a_tags:
  if "C" in a_tag.text:
    print(a_tag.text, a_tag['href'])
river hare
#

im running

#

thats so much things

keen onyxBOT
#

Hey @river hare!

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 hare
#

of what?

#

thats so much

#

no

#

Ye

#

just he cap 39

tender hill
#
import requests
import pandas as pd
from bs4 import BeautifulSoup
link = 'https://neoxscans.net/manga/the-player-that-cant-level-up'
response = requests.get(link)
site = BeautifulSoup(response.content, 'html.parser')
a_tags = [a_tags for a_tags in site.find_all('a')]
for a_tag in a_tags:
  if a_tag['href'] == link + "/cap-39/":
    print(a_tag.text)
river hare
#

running

#

ye

#

not all

#

i need change the link

#

bug-player
doctors-rebirth
dungeons-artifacts
fff-class-trashero
omniscient-readers-viewpoint
overgeared
return-of-the-frozen-player
second-life-ranker
solo leveling
survival-story-of-a-sword-king-in-a-fantasy-world
Taming-Master
The-Book-Eating-Magician
The-Beginning-After-The-End
the-great-mage-returns-after-4000-years
the-player-that-cant-level-up
White-Blood

#

yes

#

https://neoxscans.net/manga/{manhwa}

#

thats possible?

#

manhwa is comics from south korea

#

...

#

i will back
wait a second

tender hill
#
def get_cap(link):
  link = "https://neoxscans.net/manga/" + link
  response = requests.get(link)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  for a_tag in a_tags:
    if a_tag['href'] == link + "/cap-39/":
      print(a_tag.text)


links = ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood',]

for link in links:
  get_cap(link)
#

tell me if it works

river hare
#

ok

tender hill
#

add colon

river hare
#

running

#

e

#

ok

#

its wrong

#

just exist one cap 39

#

bug player?

#

oh yea, the dont have on the site

#

i forgot

#

sorry

#

but the code keep showing cap 39

#

for all

#

i want the last cap

#

what

#

?

#

hm

#

the exactly cap?

tender hill
#

does it mean chapter?

river hare
#

ye

#

chapter

tender hill
#
def get_cap(link):
  link = "https://neoxscans.net/manga/" + link
  response = requests.get(link)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      chap_nums.append(int(a_tag.text.split('Cap. ')[1]))
  return f"Cap. {str(max(chap_nums))}"
river hare
#

what?

tender hill
#

@river hare

river hare
#

whitout output

#

thats it the code?

#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link = "https://neoxscans.net/manga/" + link
  response = requests.get(link)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      chap_nums.append(int(a_tag.text.split('Cap. ')[1]))
  return f"Cap. {str(max(chap_nums))}"

links = ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood',]

for link in links:
  get_cap(link)
tender hill
#

oh wait

#

sorry

#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link = "https://neoxscans.net/manga/" + link
  response = requests.get(link)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      chap_nums.append(int(a_tag.text.split('Cap. ')[1]))
  return f"Cap. {str(max(chap_nums))}"

links = ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood',]

for link in links:
  print(get_cap(link))
#

here

river hare
#

running

#

Cap. 62 Cap. 36 Cap. 36 Cap. 92 Cap. 59 Traceback (most recent call last): File "c:\Users\Tyn\Desktop\ManwhaPing\Ping.py", line 19, in <module> print(get_cap(link)) File "c:\Users\Tyn\Desktop\ManwhaPing\Ping.py", line 13, in get_cap chap_nums.append(int(a_tag.text.split('Cap. ')[1])) IndexError: list index out of range

#

what you want?

#

bug-player?

#

ok

tender hill
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      print(f'debug statement: name:{link} chapter numbers:{a_tag.text.split("Cap. ")}')
      chap_nums.append(int(a_tag.text.split("Cap. ")[1]))
  return f"Cap. {str(max(chap_nums))}"

links = ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood',]

for link in links:
  print(get_cap(link))
#

show me the output of this

#

from overgeared

river hare
#

something its wrong

#

line 13

#

wait

#

running

#

whatahell

tender hill
#

show me the output

keen onyxBOT
#

Hey @river hare!

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

tender hill
#

from overgeared

#

just from overgeared

river hare
#

ok

#

ok

tender hill
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      return a_tag.text

links = ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood',]

for link in links:
  print(get_cap(link))
white sparrow
#

what are you trying to do

river hare
#

running

river hare
#

Cap. 62

Cap. 36

Cap. 36

Cap. 92

Cap. 59

Cap. 91

Cap. 37

Cap. 94
None

Cap. 94

Cap. 55

Cap. 23
None

Cap. 91

Cap. 39

Cap. 80

tender hill
#

this is expected output right?

river hare
#

ye

tender hill
#

:)

river hare
#

None

tender hill
#

i think the site wouldnt have had a specified one for the nones

#

anyways is your problem solved?

#

@river hare

river hare
#

its wrong

#

none its a cap with 3 digits

#

like solo leveling

#

didnt appear

tender hill
#

can you show a eg

river hare
#

ok

tender hill
#

of what it looks like

#

screenshot

river hare
river hare
tender hill
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      return a_tag.text

links = ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood',]

for link in links:
  print(get_cap(link))
river hare
#

oh wait

tender hill
#

replace the whole code with this

river hare
#

the beginning after the end

#

its o-comeco-depois-do-fim

#

they translate the title

tender hill
river hare
#

and solo leveling dont have -

tender hill
#

oh yea

#

fix the links and it would work

#

:)

river hare
#

ok

#

running

#

working

#

:)

tender hill
#

yoo

river hare
#

thanks dude

tender hill
#

bye ig!

river hare
#

@tender hill its possible put the manhwa list in a dictionary?

river hare
#

how can i do that?

#

o manhwa list no, the output

#

the chapters

tender hill
#
links = {"book_names" : ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood']}
for link in links.values():
  ...
river hare
tender hill
#

might want to look what .values()

#

to a dict does

#

!e

dict_ = {"a" : [1,2], "b": 3, "c" : {"4"}}
print(dict_.values())
keen onyxBOT
#

@tender hill :white_check_mark: Your eval job has completed with return code 0.

dict_values([[1, 2], 3, {'4'}])
river hare
#

what

#

?

river hare
tender hill
#

it returns the values from the dict

river hare
tender hill
#

so

#

becuase the code i sent is diffrent

#

from the screenshot

river hare
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      return a_tag.text

links = {"book_names" : ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood']}
for link in links.values():

for link in links:
  print(get_cap(link))
tender hill
#

see

#

remove the other for-loop

#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      return a_tag.text

links = {"book_names" : ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood']}
for link in links.values():
  print(get_cap(link))
river hare
#

oh

tender hill
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      return a_tag.text

links = {"book_names" : ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood']}
for link in links.values():
  print(link)
  print(get_cap(link))
#

show me the output of this

river hare
tender hill
#

can you show the code whic you are using

river hare
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      return a_tag.text

links = {"book_names" : ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood']}
for link in links.values():
  print(link)
  print(get_cap(link))
tender hill
#

oh sorry

#

oof

#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      return a_tag.text

links = {"book_names" : ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood']}
for link in links['book_names']:
  print(get_cap(link))
river hare
#

its the result

#

?

#

in a dict list

#

@tender hill

tender hill
#

i mean you can configure the output type by your own

river hare
#

so

river hare
#

i want make a table with pandas

#

so simple

#
Book Names       | Chapter
Bug-Player       |   62
Doctor's Rebirth |   36
#

like thats

tender hill
#

hmm i get

#

that

river hare
#

i tried this

tender hill
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      return a_tag.text

links = {"book_names" : ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood'], "chapters": []}
for link in links['book_names']:
  links['chapter'] = get_cap(link)
river hare
#

ugh

#

@tender hill do u know pandas?

tender hill
#

yep

#

now try making it a df

#

in the same script it owuld work

river hare
#

with pd.DataFrame(links)

#

_ _

#

with pd.DataFrame(link)

#

@tender hill

tender hill
#
import requests
import pandas as pd
from bs4 import BeautifulSoup

def get_cap(link):
  link_ = "https://neoxscans.net/manga/" + link
  response = requests.get(link_)
  site = BeautifulSoup(response.content, 'html.parser')
  a_tags = [a_tags for a_tags in site.find_all('a')]
  chap_nums = []
  for a_tag in a_tags:
    if "Cap" in a_tag.text:
      return a_tag.text

links = {"book_names" : ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','The-Beginning-After-The-End','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood'], "chapters": []}
for link in links['book_names']:
  links['chapter'] = get_cap(link)

print(len(links['book_names']),len(links['chapter']))
#

show output of this

river hare
tender hill
#

i edited code

#

show me output of this

river hare
#

ok

#

@tender hill

tender hill
#

i have to goto sleep in like 10mins

#

so i wont be able to completly help

river hare
#

ok

#

good sleep

tender hill
river hare
little badger
#

ok which variable in your code contains that data? can you send your latest working code

#

i'll be back in 5-10 min

river hare
keen onyxBOT
#

Hey @river hare!

It looks like you tried to attach file type(s) that we do not allow (.ipynb). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.

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

little badger
#

!paste use a hastepin, or use a code block. don't upload/DM files.

keen onyxBOT
#

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.

little badger
#

i'll be waiting. up to you

river hare
river hare
#

i will lunch

#

max 15min

#

i guess

little badger
#
{'book_names': ['bug-player', 'doctors-rebirth', 'dungeons-artifacts', 'fff-class-trashero', 'omniscient-readers-viewpoint', 'overgeared', 'return-of-the-frozen-player', 'second-life-ranker', 'solo leveling', 'survival-story-of-a-sword-king-in-a-fantasy-world', 'Taming-Master', 'The-Book-Eating-Magician', 'The-Beginning-After-The-End', 'the-great-mage-returns-after-4000-years', 'the-player-that-cant-level-up', 'White-Blood'], 'chapters': [], 'chapter': '\nCap. 80 '}```

so that's what `links` is. a dictionary
#

what dataframe do you want out of that data?

#

you just have to get your data in the way that you want, then use
pd.DataFrame.from_dict()

river hare
#

what?

river hare
little badger
#

!e ```py
import pandas as pd

data_dict = {
'books': ['bug_player', 'doctors_rebirth'],
'chapters': [62, 36]
}

df = pd.DataFrame.from_dict(data_dict)
print(df)

keen onyxBOT
#

@little badger :white_check_mark: Your eval job has completed with return code 0.

001 |              books  chapters
002 | 0       bug_player        62
003 | 1  doctors_rebirth        36
river hare
#

ye

#

but without 001

#

002

little badger
#

if you get your data into THAT structure data_dict then you can easily get that dataframe

#

that's just the index, it's not actually part of the data

river hare
#

...

little badger
#

oh sorry, the 001, 002 is just the line #

river hare
#

oh

little badger
#

0 and 1 are the index.

river hare
#

how i get the output

#

and put in chapter?

#
links = {"book_names" : ['bug-player','doctors-rebirth','dungeons-artifacts','fff-class-trashero','omniscient-readers-viewpoint','overgeared','return-of-the-frozen-player','second-life-ranker','solo-leveling','survival-story-of-a-sword-king-in-a-fantasy-world','Taming-Master','The-Book-Eating-Magician','o-comeco-depois-do-fim','the-great-mage-returns-after-4000-years','the-player-that-cant-level-up','White-Blood']}
for link in links['book_names']:
  print(get_cap(link))```
little badger
#

so you have to get the chapter into links right?

river hare
#

i dont know

#

maybe?

little badger
#

yes you do, your aim is to get your links dictionary to look like

{
    'books': ['bug_player', 'doctors_rebirth'],
    'chapters': [62, 36]
    }
#

i can see that's what you were trying to do

#

right now your get_cap() returns strings like \nCap. 59

#

do you want the line break \n and 'Cap. ' removed? you want an integer?

#
{'book_names': ['bug-player', 'doctors-rebirth', 'dungeons-artifacts', 'fff-class-trashero'], 'chapter': ['62', '36', '36', '92']}
           book_names chapter
0          bug-player      62
1     doctors-rebirth      36
2  dungeons-artifacts      36
3  fff-class-trashero      92

is this what you want?

#

you need to do 3 things

  1. modify the return value for get_cap() to strip the newline character \n and also the Cap.
  2. modify your for loop to correctly get a list of chapters as a value under links['chapter']
  3. transform the dictionary to a dataframe @river hare
river hare
#

but without the code

#

on the top

little badger
#

yup i got it

little badger
#

can you join code help vc so i can talk to you?

river hare
#

ok

little badger
#

.strip()

river hare
#

kidpepecry what

#

english isnt my native language

little badger
#

return a_tag.text

#

\nCap. 50

river hare
#

yes

little badger
#

return a_tag.text.strip()

#

\n

#

Cap. 50

#
return a_tag.text.strip().replace('Cap. ', '')```
#

'50'

river hare
#

what

#

i dont understand so good

#

listening

#

i understand better reading

little badger
#

so .strip() will remove newline characters \n

river hare
#

ok

little badger
#

because right now your get_cap() function is returning: \nCap. 50 instead of just '50'

river hare
#

ok

little badger
#

so
a_tag.text.strip() will result in Cap. 50

#

bc it gets rid of the newline character

#

and a_tag.text.strip().replace('Cap. ', '') will result in '50'

#

@river hare ?

river hare
#

what?

little badger
#

nvm. ok understand so far?

river hare
#

yes

little badger
#

now we need to look at your for loop py for link in links['book_names']:

#

previously you had

#
for link in links['book_names']:
    links['chapter'] = get_cap(link)
#

but what that does it just puts ONE chapter as a value in your links['chapter'], when you need a whole list of chapters, right?

river hare
#

i dont know

#

oh

#

yes

#

i need the capthers numbers

little badger
#

so previously your code resulted in this:

#
{
  'book_names': [
    'bug-player',
    'doctors-rebirth',
    'dungeons-artifacts',
    'fff-class-trashero',
    'omniscient-readers-viewpoint',
    'overgeared',
    'return-of-the-frozen-player',
    'second-life-ranker',
    'solo leveling',
    'survival-story-of-a-sword-king-in-a-fantasy-world',
    'Taming-Master',
    'The-Book-Eating-Magician',
    'The-Beginning-After-The-End',
    'the-great-mage-returns-after-4000-years',
    'the-player-that-cant-level-up',
    'White-Blood'
  ],
  'chapters': [],
  'chapter': '\nCap. 80 '
}
river hare
#

\nCap. 80

little badger
#

right so

#
chapters_list = [get_cap(link) for link in links['book_names']]
links['chapter'] = chapters_list
#

using a list comprehension, now you can make an actual LIST of chapters, and insert that as the value paired with "chapter" in your links dictionary

river hare
#

df = pd.DataFrame.from_dict(chapter)?

little badger
#

then your links dictionary will look like this (i shortened it)

{
  'book_names': [
    'bug-player',
    'doctors-rebirth',
    'dungeons-artifacts',
    'fff-class-trashero'
  ],
  'chapter': [
    '62',
    '36',
    '36',
    '92'
  ]
}
river hare
#

no

little badger
#

no, we're still going to pass links

#

then finally you can

df = pd.DataFrame.from_dict(links)
print(df)
river hare
little badger
#

yes i know

#

we changed your for loop, it will make a list of chapters and insert it into links automatically, not manualily

little badger
#

ok you have to change your return value in get_cap() which i showed you earlier

#
return a_tag.text.strip().replace('Cap. ', '')```
river hare
#

where

#

ok

little badger
#
return a_tag.text```
river hare
little badger
#
def get_cap(link):
    link_ = "https://neoxscans.net/manga/" + link
    response = requests.get(link_)
    site = BeautifulSoup(response.content, 'html.parser')
    a_tags = [a_tags for a_tags in site.find_all('a')]

    for a_tag in a_tags:
        if "Cap" in a_tag.text:
            return a_tag.text.strip().replace('Cap. ', '')```
river hare
#

hmm

#

im running

#

i code in js

#

so

#

i dont know python

#

i never used python

#

...

#

yes

#

google colab

#

what?

#

not yet

#

did

little badger
#

just so you know, the chapters are stored as strings, not integers

river hare
little badger
#

if you need integers or numerics, you will need an extra step

river hare
#

what need do?

#

????

little badger
#

if the above result is fine, you're fine

#

but just note that the chapter values are all strings, not numerics (floats, integers)

#

so you if you ever need to sort by chapter, you should change it to an int. you can either do that in your get_cap function, or you can do it after your dataframe is made

river hare
#

how i transform to number?

little badger
#
df['chapter'] = df['chapter'].astype(int)```
#

we're wrapping the whole return value in an int()

#

you will likely have to add some error handling in either case

river hare
#

๐Ÿ‘€

little badger
#
                                           book_names chapter
0                                          bug-player      62
1                                     doctors-rebirth      36
2                                  dungeons-artifacts      36
3                                  fff-class-trashero      92
4                        omniscient-readers-viewpoint      59
5                                          overgeared      91
6                         return-of-the-frozen-player      37
7                                  second-life-ranker      94
8                                       solo leveling    None
9   survival-story-of-a-sword-king-in-a-fantasy-world      94
10                                      Taming-Master      55
11                           The-Book-Eating-Magician      23
12                        The-Beginning-After-The-End    None
13            the-great-mage-returns-after-4000-years      91
14                      the-player-that-cant-level-up      39
15                                        White-Blood      80

some book names aren't returning any chapter at all, but None
what do you want to do for those?

river hare
#

wrong name

#

number 8

#

its solo-leveling

#

number 12

#

its o-comeco-depois-do-fim

#

@little badger its possible change columns name position?

little badger
#

yes you can re-order columns

river hare
#

or columns itens

#

how i do that

little badger
#

like chapters first, then book name?

river hare
#

like that

#

the red

#

its the position

#

yes

little badger
#

aligned to the left

river hare
#

yes

little badger
#

maybe

lusty hedge
#

i think, in the pycharm u can move for right

river hare
#

i dont want to right

#

i want to left

#

costume

#

thats because

river hare
#

thats because appear

#

doesnt equal

#

...

#

i will try

#

so

little badger
#

ok

river hare
#

bye

river hare
#

@little badger are u there?

#

this is a loop

#
for link in links['Manhwas']:
    chapter = get_cap(link)
    chapters_list = [get_cap(link) for link in links['Manhwas']]
    links['Capitulos'] = chapters_list
#

how i remove him?

little badger
faint hinge
#

!stream 750025574558335017 30M

keen onyxBOT
#

โœ… @thick flower can now stream until <t:1628784723:f>.

faint hinge
#

!stream 750025574558335017

keen onyxBOT
#

โœ… @thick flower can now stream until <t:1628797154:f>.

thick flower
jade raven
#

help

ancient shuttle
#

!stream

#

!stream @silk timber

proven crest
ancient shuttle
#

yeah I guess so

remote zodiac
#

hi

#

I'm still unsure what library to use for a children's text based game

remote zodiac
#

hi

#

I don't have permission to talke

#

how

main solar
#

you need to go to the voice-verfication channel

flint trout
#

Kind of ridiculous verification process for voice, I must say

#

โ€ข You have sent less than 50 messages.
โ€ข You have been active for fewer than 3 ten-minute blocks.

little badger
#

it's not that bad at all, and is very effective in discouraging trolls

main solar
#

sa7aaa

#

aya bon8i

main solar
#

can someone help me with docker+django+postgres?
my api doesn't work

settings.py:
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'junglechallenge',
        'USER': 'jungleuser',
        'PASSWORD': 'challenge',
        'HOST': 'pgdb',
        'PORT': 5432,
    }
}


docker-compose.yml:
version: '3.0'

services:
  django_api:
    build: .
    image: chrisemke/junglechallenge:0.1
    container_name: django
    volumes:
      - django_api:/code
    ports:
      - 8000:8000
    depends_on:
      - pgdb
  pgdb:
    image: postgres:13
    container_name: postgres
    ports:
      - 5432:5432
    environment:
      - POSTGRES_USER=jungleuser
      - POSTGRES_PASSWORD=challenge
      - POSTGRES_DB=junglechallenge
    volumes:
      - postgres_data:/var/lib/postgresql/data/

volumes:
  postgres_data:
  django_api:
#

it stop working when I tryed implement postgresql

fringe sorrel
#

Hey

rapid egret
#

hello

fringe sorrel
#

What's up bro?

rapid egret
#

i need help

fringe sorrel
#

Me too

#

lol

rapid egret
#

lul

fringe sorrel
#

Tell m, maybe I can help ya

rapid egret
#

highlighted question

fringe sorrel
#

You need some math to do it

#

Build your equation

rapid egret
#
๏ปฟx = int(input("please enter an integer: "))

pwr = 2

root = (x**some variable here)**pwr 

for j in range (pwr,6):
    x = x**pwr
    print(x) 
#

this is what i have so far

fringe sorrel
#

1 < pwr < 6 right?

rapid egret
#

right

fringe sorrel
#

does the root must be the same as the power?

rapid egret
main solar
#

thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
for x, y in thisdict.items():
print(x, y)

near gust
#
def level(playerscore):

      x = 0

      for key, value in levels.items():

        if playerscore <= value:

          return f"level {key}"

          global level_up_goal

          level_up_goal = key + 1, value

          break
        
        x = x + 1
      
      print(level_up_goal)

      global xp

      xp = score / level_up_goal

      xp = xp * 100
mild rune
#

what is levels in for loop

#

why there is code after return

near gust
main solar
#

a=[0,2000,61600,107360,157696,213065]

for i in range(0 , len.a):
if playerscore <= a[i]:

      return f"level a[i]"
near gust
#

@mild rune did not mean to reply

main solar
mild rune
near gust
#

yeah

#

there is a lot of stuff your missing for this to work

#

I was just trying to figure out how to call a seperate key

#

but

#

I found an alternate method

main solar
#

idk why texture is not loading here

#

and block_pick is not working

oak jay
main solar
#

okh wait

#

i have posted the code but how to post here the images

oak jay
#

copy paste the code to the site i linked and share the link here

main solar
#

here

oak jay
#

ok so first of all, from ursinia import * while not being wrong, isn't really good practice since it can get pretty confusing

#

if you do just import ursinia you get access to all the same features

main solar
#

okh

#

should i do "import ursina"

oak jay
#

not surw who made the docs but its bad advice for beginners

oak jay
main solar
#

a youtuber called clear code

#

he made a tutorial

oak jay
#

and then replace all the stuff from the library with ursinia.(the thing you need)

#

thats the proper way to do it

main solar
#

okh

#

thanks for helping me

oak jay
#

can you send it again with the properly imported methods and objects so i can try fixing it

#

(makes it much easier for me lemon_sweat)

main solar
#

image here

#

okh i am sending again

oak jay
#

to all the stuff with orange lines add ursinia.

main solar
#

i didn't get it

oak jay
#

so when you import in python you can do two things```py
import lib

lib.func()orpy
from lib import func

func()```

#

the second also works with *

#

which makes stuff very complicated as you dont know what was imported

main solar
#

okh

oak jay
#

have you understood that?

main solar
#

yeah kinda

#

both works

oak jay
#

(again there is no dumb question so feel free to ask)

main solar
#

doing the first thing why am i getting error

#

in ursina

#

i have tried others [pip] i didn't get any error

#

but why i am gettin error in ursina

oak jay
#

so for example before you had```py
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController

app = Ursina() since we're now importing differently we now need to dopy
import ursina
from ursina.prefabs.first_person_controller import FirstPersonController

app = ursinia.Ursina()```

main solar
#

okh

#

but still i am getting error

oak jay
#

you need to repeat what i just for all of the stuff that is underlined

#

because your ide is telling you that you didnt define them anywhere

main solar
#

yeah

#

should i change my IDE

oak jay
#

no

main solar
#

okh

stone breach
#

@tidal glacier how experience are you with core python concepts like functions, classes, importing?

lavish jay
#

Good morning

#

I'm trying to import the requests and bs4 modules, but I can't seem to get it to work

#

I've tried pip installing to the (C:\Users----\AppData\Local\Programs\Python\Python39\Scripts) directory too, and still not working

#

when I import in cmd python it doesn't give me an error

#

I use pycharm

rain pilot
#

#bot-commands

tender hill
#

@fringe mortar show your code here

fringe mortar
#

here?

#

hello

tender hill
#

yea

fringe mortar
#

sorry i was all over the place

tender hill
#

here

fringe mortar
#

sorry - thank you so much buddy

#

ok

#

ok

#

so this is the front end

#

from sqlite3.dbapi2 import Cursor, Row
import tkinter as tk
from tkinter import Button, Label, Pack, ttk
from tkinter import *
import backend
import sqlite3

#############################################################################

root = tk.Tk()

style = ttk.Style(root)
style.configure('lefttab.TNotebook', tabposition='wn')
notebook = ttk.Notebook(root, style='lefttab.TNotebook')
f1 = tk.Frame(notebook, bg='whitesmoke', width=1200, height=868)
notebook.add(f1, text='Types Of Car ')
notebook.grid(row=0, column=0, sticky="nw")
###############################################################################
max_amount = 0
mylabel = 0

def Update_transfer():
global max_amount, label1
max_amount +=1
mylabel.configure(text="Transfer to Cust services:" + str(max_amount))

update_transfer_by_1 =str(max_amount)

mylabel = Label(f1,text="Transfer to Cust services: " + update_transfer_by_1, )
mylabel.place(relx=0.4, rely=0.3, width=300, height=55)
mylabel.config(bg='lightgreen', padx=0, font=("times new roman", 16))

submit_merc = Button(f1, text="submit", padx=50, command = Update_transfer, )
submit_merc.place (relx=0.4, rely=0.4, )

#################################################################################

root.mainloop()

#

and backend:

#

import sqlite3

def connect():
conn=sqlite3.connect("cars.db")
cur=conn.cursor()
cur.execute("CREATE TABLE IF NOT EXISTS car ( name text, amount integer)")
conn.commit()
conn.close()

def insert(name, amount):
conn=sqlite3.connect("cars.db")
cur=conn.cursor()
cur.execute("INSERT INTO car VALUES (?, ?)",(name, amount))
conn.commit()
conn.close()

def view():
conn=sqlite3.connect("cars.db")
cur=conn.cursor()
cur.execute("SELECT * FROM car")
rows=cur.fetchall()
conn.close
return rows

def search(name="", amount=""):
conn=sqlite3.connect("cars.db")
cur=conn.cursor()
cur.execute("SELECT * FROM car WHERE name =? OR amount =?",(name, amount))
rows=cur.fetchall()
conn.close
return rows

connect()
#insert("transfer", "19")
#print(view())

tender hill
#
from sqlite3.dbapi2 import Cursor, Row
import tkinter as tk
from tkinter import Button, Label, Pack, ttk
from tkinter import *
import backend
import sqlite3




#############################################################################




root = tk.Tk()

style = ttk.Style(root)
style.configure('lefttab.TNotebook', tabposition='wn')
notebook = ttk.Notebook(root, style='lefttab.TNotebook')
f1 = tk.Frame(notebook, bg='whitesmoke', width=1200, height=868)
notebook.add(f1, text='Types Of Car ')
notebook.grid(row=0, column=0, sticky="nw")
###############################################################################
max_amount = 0
mylabel = 0



def Update_transfer():
    global max_amount, label1
    max_amount +=1
    mylabel.configure(text="Transfer to Cust services:" + str(max_amount))




update_transfer_by_1 =str(max_amount)

mylabel = Label(f1,text="Transfer to Cust services: " + update_transfer_by_1, )
mylabel.place(relx=0.4, rely=0.3, width=300, height=55)
mylabel.config(bg='lightgreen', padx=0, font=("times new roman", 16))


submit_merc = Button(f1, text="submit", padx=50, command = Update_transfer, )
submit_merc.place (relx=0.4, rely=0.4, )



#################################################################################




root.mainloop()
#
import sqlite3


def connect():
    conn=sqlite3.connect("cars.db")
    cur=conn.cursor()
    cur.execute("CREATE TABLE IF NOT EXISTS car ( name text, amount integer)")
    conn.commit()
    conn.close()


def insert(name, amount):
    conn=sqlite3.connect("cars.db")
    cur=conn.cursor()
    cur.execute("INSERT INTO car VALUES (?, ?)",(name, amount))
    conn.commit()
    conn.close()

def view():
    conn=sqlite3.connect("cars.db")
    cur=conn.cursor()
    cur.execute("SELECT * FROM car")
    rows=cur.fetchall()
    conn.close
    return rows

def search(name="", amount=""):
    conn=sqlite3.connect("cars.db")
    cur=conn.cursor()
    cur.execute("SELECT * FROM car WHERE name =? OR amount =?",(name, amount))
    rows=cur.fetchall()
    conn.close
    return rows



connect()
#insert("transfer", "19")
#print(view())
fringe mortar
#

well it works,

#

but i just dont know how to update the sql row

#

i have been trying for two days

#

im really new thans

#

so when a user presses that button, it updates the amount

tender hill
#

yea

fringe mortar
#

i cant add another command to the same button which is problamatic

tender hill
#

UPDATE table SET a = y WHERE number = 2

fringe mortar
#

do i need to put that in a function though?

#

as soon as the user clicks the sumbit button

tender hill
#

submit_merc = Button(f1, text="submit", padx=50, command = Update_transfer, )?

fringe mortar
#

but the submit button already has a command binded to it - submit_merc = Button(f1, text="submit", padx=50, command = Update_transfer, )

#

that adds one to the label

#

hold on i show you

#

basically it just dosent alow two commands in the same button

#

SyntaxError: keyword argument repeated: command

#

ahh just the interger

#

so whatever the value is in the gui

tender hill
#

name text, amount integer

#

the second one?

fringe mortar
#

amount

#

ahh so everytime a user clicks submit it adds 1, so it would need to increment by one each time

tender hill
#
def Update_transfer():
    global max_amount, label1
    max_amount +=1
    mylabel.configure(text="Transfer to Cust services:" + str(max_amount))
    conn=sqlite3.connect("cars.db")
    cur = conn.cursor()
    cur.execute('UPDATE car SET amount =?', (max_amount))
#

replace it with the current update_transfer function

fringe mortar
#

the cur and curser is underscored yellow

#

variable not defined

#

kok

#

it not updating the table

#

ok

tender hill
#
def Update_transfer():
    global max_amount, label1
    max_amount +=1
    mylabel.configure(text="Transfer to Cust services:" + str(max_amount))
    conn=sqlite3.connect("cars.db")
    cur = conn.cursor()
    cur.execute('SELECT * FROM car')
    rows = cur.fetchall()
    print(rows)
    cur.execute('UPDATE car SET amount =?', (max_amount))
    cur.execute('SELECT * FROM car')
    rows = cur.fetchall()
    print(rows)
fringe mortar
#

ok in a new py file?

#

File "c:\Users\Frank\OneDrive\Desktop\sql lite\frontend.py", line 40, in Update_transfer
cur.execute('UPDATE car SET amount =?', (max_amount))
ValueError: parameters are of unsupported type
PS C:\Users\Frank\OneDrive\Desktop\sql lite>

tender hill
#
def Update_transfer():
    global max_amount, label1
    max_amount +=1
    mylabel.configure(text="Transfer to Cust services:" + str(max_amount))
    conn=sqlite3.connect("cars.db")
    cur = conn.cursor()
    cur.execute('SELECT * FROM car')
    rows = cur.fetchall()
    print(rows)
    cur.execute("UPDATE car SET amount = '%s'" % max_amount)
    cur.execute('SELECT * FROM car')
    rows = cur.fetchall()
    print(rows)
fringe mortar
#

i never even thought to use set ๐Ÿ˜ฉ

tender hill
tender hill
fringe mortar
#

its not updating the table

#

but the output is

#

[]
[]
[]
[]

#

a list?

#

yes

tender hill
#
backend.connect()
def Update_transfer():
    global max_amount, label1
    max_amount +=1
    mylabel.configure(text="Transfer to Cust services:" + str(max_amount))
    conn=sqlite3.connect("cars.db")
    cur = conn.cursor()
    cur.execute('SELECT * FROM car')
    rows = cur.fetchall()
    print(rows)
    cur.execute("UPDATE car SET amount = '%s'" % max_amount)
    cur.execute('SELECT * FROM car')
    rows = cur.fetchall()
    print(rows)
fringe mortar
#

so i run the backend script which creates the table

tender hill
#

then?

fringe mortar
#

thenthats the bit i struggle with

#

is updating it

#

ive been trying variations of cur.execute("INSERT INTO car VALUES (?, ?)",(name, amount))

#

but hold on

#

because in the backend if i do this: #insert("transfer", "19")

#

it adds the values

#

insert("transfer", "19")

#

but that adds an entire row

#

i just need to update the amount in one row

#

ok

#

i have one row in the table now

#

[('transfer', 2), ('transfer', 2)]
[('transfer', 19), ('transfer', 19)]
[('transfer', 3), ('transfer', 3)]
[('transfer', 19), ('transfer', 19)]
[('transfer', 4), ('transfer', 4)]
[('transfer', 19), ('transfer', 19)]
[('transfer', 5), ('transfer', 5)]

#

thats the outut

#

when i click the button 5 times

#

from sqlite3.dbapi2 import Cursor, Row
import tkinter as tk
from tkinter import Button, Label, Pack, ttk
from tkinter import *
import backend
import sqlite3

#############################################################################

root = tk.Tk()

style = ttk.Style(root)
style.configure('lefttab.TNotebook', tabposition='wn')
notebook = ttk.Notebook(root, style='lefttab.TNotebook')
f1 = tk.Frame(notebook, bg='whitesmoke', width=1200, height=868)
notebook.add(f1, text='Types Of Car ')
notebook.grid(row=0, column=0, sticky="nw")
###############################################################################
max_amount = 0
mylabel = 0

def Update_transfer():
global max_amount, label1
max_amount +=1
mylabel.configure(text="Transfer to Cust services:" + str(max_amount))
conn=sqlite3.connect("cars.db")
cur = conn.cursor()
cur.execute('SELECT * FROM car')
rows = cur.fetchall()
print(rows)
cur.execute("UPDATE car SET amount = '%s'" % max_amount)
cur.execute('SELECT * FROM car')
rows = cur.fetchall()
print(rows)

update_transfer_by_1 =str(max_amount)

mylabel = Label(f1,text="Transfer to Cust services: " + update_transfer_by_1, )
mylabel.place(relx=0.4, rely=0.3, width=300, height=55)
mylabel.config(bg='lightgreen', padx=0, font=("times new roman", 16))

submit_merc = Button(f1, text="submit", padx=50, command = Update_transfer)
submit_merc.place (relx=0.4, rely=0.4, )

#################################################################################

root.mainloop()

#

i need this to increase by one every time some clicks the submit button

tender hill
#
def Update_transfer():
    global max_amount, label1
    max_amount +=1
    mylabel.configure(text="Transfer to Cust services:" + str(max_amount))
    conn=sqlite3.connect("cars.db")
    cur = conn.cursor()
    cur.execute("UPDATE car SET amount = '%s' WHERE name='transfer'" % max_amount)
    cur.execute('SELECT * FROM car')
    rows = cur.fetchall()
    print(rows)
fringe mortar
#

[('transfer', 19), ('transfer', 19), ('transfer', 19)]
[('transfer', 19), ('transfer', 19), ('transfer', 19)]
[('transfer', 19), ('transfer', 19), ('transfer', 19)]
[('transfer', 19), ('transfer', 19), ('transfer', 19)]
[('transfer', 19), ('transfer', 19), ('transfer', 19)]
[('transfer', 19), ('transfer', 19), ('transfer', 19)]

#

[('transfer', 1), ('transfer', 1), ('transfer', 1), ('transfer', 1), ('transfer', 1)]
[('transfer', 2), ('transfer', 2), ('transfer', 2), ('transfer', 2), ('transfer', 2)]
[('transfer', 3), ('transfer', 3), ('transfer', 3), ('transfer', 3), ('transfer', 3)]
[('transfer', 4), ('transfer', 4), ('transfer', 4), ('transfer', 4), ('transfer', 4)]
[('transfer', 5), ('transfer', 5), ('transfer', 5), ('transfer', 5), ('transfer', 5)]

#

the table still shows the same number

tender hill
#

i mean here in the output it shows that it is doing the job

#

are you refreshing the table you are viewing

fringe mortar
#

yeah

tender hill
fringe mortar
#

does it update the table?

tender hill
fringe mortar
#

oo

#

i dont know?

tender hill
#

like which software are you using to view .db file

fringe mortar
#

im using visual studio code

#

and a plugin

#

well, i will try another plugi, thank you so much for your help ๐Ÿ™‚

#

i reaally apprecite it

tender hill
#

are you on windows*

fringe mortar
#

its printing out in ther terminal ok so its working

#

yeah windows

tender hill
#

umm wait

#

its not updating

fringe mortar
tender hill
#

yea

#

wait i think i know qa fix

#

a*

fringe mortar
#

no probs, thank you so much - im actually just studing that code you sent me

tender hill
#

@fringe mortar

fringe mortar
#

im here

tender hill
#

are you here wolf?

#

yea

fringe mortar
#

i was just looking at your code ๐Ÿ™‚

tender hill
#
def Update_transfer():
    global max_amount, label1
    max_amount +=1
    mylabel.configure(text="Transfer to Cust services:" + str(max_amount))
    conn=sqlite3.connect("cars.db")
    cur = conn.cursor()
    cur.execute('SELECT * FROM car')
    rows = cur.fetchall()
    print(rows)
    amt_rn = rows[0][1]
    cur.execute("update car set amount ='%s' where name = 'transfer'" % str(amt_rn + 1))
    conn.commit()
    conn.close()
#

here you go

#

@fringe mortar

fringe mortar
#

one sec

tender hill
fringe mortar
#

it worked!

tender hill
#

yea

fringe mortar
#

can i paypal you somthing?

tender hill
#

no

fringe mortar
#

are you sure>?

tender hill
#

yea

fringe mortar
#

my friend, i owe you one,

tender hill
#

i dont help people for money

fringe mortar
#

i spent days trying this

#

i was soo stresed

tender hill
#

yea the problem was that

#

after executing the command

#

we didnt commit it

#

conn.commit()

fringe mortar
#

oooo

#

i see you made a new variable?

tender hill
#

yea

fringe mortar
#

amt_rn = rows[0][1]

#

was that for the tuple?

tender hill
#

to get the amount rigth now

tender hill
fringe mortar
#

ahh yes

#

wow

tender hill
#

rows[0] would return ('transfer', 19)

fringe mortar
#

you got mad skills

tender hill
#

rows[0][1] would return 19

#

:)

fringe mortar
#

yep that makes sense

#

that was hard

#

for me anyway

#

im still vry new

tender hill
#

yea

#

so thats it and i am going bye do you have any other problem?

fringe mortar
#

no thats great - i cant thank you enough,

#

thankyou kindly

tender hill
#

alright so bye

fringe mortar
#

byr friend :-

#

bye

clear agate
#

@burnt birch

burnt birch
#

here?

#

Sorry :)

#
class LoginView(APIView):
    # Logs a user in (the main work is done by EmailCustomAuthentication)
    authentication_classes = [SessionAuthentication,
                              EmailCustomAuthentication]
    permission_classes = [IsAuthenticated]

    def post(self, request):
        data = json.loads(json.dumps(request.data))
        user_email = data.get('email')
        user_password = data.get('password')

        
        
        return JsonResponse({'logged_in': True, 'user_email': user_email})
#

So I created a custom Email backend:

#

Yep

#

And I extended BasicAuthentication

#

Oh

#

But how will the user be authenticated then?

#

Ahh.... Ok I get what you are saying :D

#

Nope I am using Session auth

#

Why is session auth useless here?

#

Yep

#

You mean JWT?

clear agate
#

yeah

burnt birch
#

Like I don't understand what is wrong with session auth... I send a session cookie to the user when they login..

clear agate
burnt birch
#

Oh ok

clear agate
burnt birch
# clear agate

Ah this makes sense to me. My problem was that my view was allowing any email / password... It wasn't actually calling the EmailCustomAuthentication

#

Your english is good :) It is understandable and that is enough :D

#

Yep I just heard them. I fear I too will have a terrible accent

#

Let's see how it turns out when I reach 50 messages

#

Somewhere in Asia :)

#

Yep

#

Yep Indian

#

xD

#

OOOH nepal!

#

I have been to nepal :D

#

Haha yeah Indian accent is hard to understand

#

No problem :)

#

Yep. Can relate xD

#

I am afraid of speaking because of my accent

#

Haha yes you do :p

#

Yep pretty much. You are doing great though. I can understand you just fine :)

#

BTW does is_authenticated mean that a user is logged in?

#

:O

#

Not sure about is_logged_in. Will have to check

agile basalt
#

Any of you guys good in react?

#

I'm stuck

burnt birch
#

I am working on a Chat app

#

I know redux :D

#

(Been a pain in the back :p)

#

I am trying to restructure my redux store. It is hard. Too much boilerplate :(

agile basalt
#

oh sad

clear agate
#

i will join later

burnt birch
#

NP try asking what you had to ask @agile basalt

#

I might not be able to help but still it is worth it

#

BTW thank you very much @clear agate

#

I really appreciate you helping me

agile basalt
#

oh cool

#

but

#

I can't talk rn

#

๐Ÿ˜ฆ

burnt birch
#

Same here.. You must have gotten a custom message from the python discord bot.. It will tell you what to do.. You need to have yourself verified... One of the requirements is that you need 50 messages on the server

agile basalt
#

oh no I can't screen share

#

nah

#

that's not the case

#

I just can't talk rn

burnt birch
#

Oh

#

Oh ok makes sense

agile basalt
#

mind if I dm u?

burnt birch
#

Nope go ahead. I'll not talk in voice chat though. I am ok with text chat :)

agile basalt
#

But I need to screenshare

#

Itd be hard to understand the problem otherwise

burnt birch
#

No problem. Dm me

agile basalt
#

ah ok

burnt birch
#

I'll leave this channel now. Again thanks @clear agate :)

umbral sand
#

How do I get help in a voice channel?

tacit fern
#

@faint hinge can you please give @clear agate streaming perms to help fix his discord.js error?


edit 1: aah you're on phone you probably wont see this until you get on pc
edit 2: we fixed the error yay ๐ŸŽ‰!

clear agate
#
client.on("voiceStateUpdate", async (oldState, newState) => {
  const username = oldState.member.user.username;
  try {
    if (oldState.channel.name === "create") {
    }
  } catch {
    if (newState.channel.name === "create") {
      if (
        newState.guild.channels.cache.find(
          (channel) => channel.name === username
        )
      ) {
      } else {
        const new_channel = await oldState.guild.channels.create(username, {
          type: "voice",
        });
        newState.member.voice
          .setChannel(new_channel.name)
          .then((data) => console.log("user moved"))
          .catch((err) => console.log(err));
      }
    }
  }
});
elfin olive
#

anyone very familiar with flask and using poetry ?

faint hinge
#

Not overly but what's going on with it?

elfin olive
#

uhm so after a lot of crying and googling I have setup an env with pyenv and poetry however when I try run my .py file containing @ancient saffron.route it wont run the WSGI indicating I can flask on 127.0.0.1 port 5000 etc

#

for context this is all happening on ubuntu via vscode

#

I think my issue is that something is not connected correctly

elfin olive
faint hinge
#

That's beyond me. I haven't futzed with WSGI or what have you, I only know the basics of flask

elfin olive
#

so you wont even listen to me rant come on I need that free therapy lol ๐Ÿ˜‚ also maybe I can run past the idea of what I think is the issue and you can tell me if what I say makes any sense...

rocky jetty
#

hey, my os.remove can't remove archives. Why?
"access denied"

little trench
#

Anyone know what concurrency

#

is

#

BRUH

faint hinge
#

Concurrency is the ability to run things at the same time

little trench
#

ahh

lost basin
#

Voice Gate failed
You are not currently eligible to use voice inside Python Discord for the following reasons:

โ€ข You have sent less than 50 messages.
โ€ข You have been active for fewer than 3 ten-minute blocks.

slender flume
tender hill
#

@unborn turtle

#

do you need help

#

?

unborn turtle
#

I do!

#

Can I present to you the problem?

#

@tender hill

tender hill
#

alright i am here

#

@unborn turtle

#

you might want to undeafen

#

?

#

@unborn turtle

unborn turtle
#

Sorry for the noobness

tender hill
#

click the headphone button to undeafen

#

it is at bottom left

#

?= lookhead

vestal veldt
#

does youyube-dl works on android

#

i tried to make a youtube video donwloader, it work fine on pc but gives error on mobile

true pendant
#

Hey guys, any of ye know Django python?

clear agate
graceful kiln
upper wave
#

hey would anyone be able to help me ??

#

i am trying to save to a csv but it dont seen to work and i donno where im going wrong

frozen gull
#

Hello

#

guys how can I learn the python language

#

What are you creating

burnt birch
#
class Chat(models.Model):
    """
        Chat model

        - id: UUID of chat
        - group_name: Name of the chat group
        - owner: Owner of the group
        - participants: People in the chat group
        - messages: Messages shared in the chat group
        - timestamp: Timestamp of group creation
    """
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    group_name = models.CharField(max_length=30, blank=False, default="Chat")
    # chat_owner = models.ForeignKey(
    # User, related_name='chats', on_delete=models.CASCADE)
    participants = models.ManyToManyField(
        userModel, related_name='chats', blank=True)
    messages = models.ManyToManyField(Message, blank=True)
    timestamp = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return self.group_name
main solar