#code-help-voice-text
5 messages ยท Page 2 of 1
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
Hey @still lagoon!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
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
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
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?
{
"target": "run_existing_window_command",
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}
but different name then the default build system names
does it have to end in .sublime-build?
ya
Okay, I saved the file
okay
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
one another think u wohnt be able to enter input through the build system as it is not interactive
repl_python_run
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
sorry, i was talking about usual build system
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 ```
check ur path of modules.
I'm on mac os x btw
ooof wait
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
do you have installed pandas library?
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
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
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
hahaha lol
Just use commands for that
!voice
Voice verification
Canโt talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
@finite grove I am unable to join
Due as the channel is full
Please drage me in voice channel
@finite grove once again
Please
Simple PDF generation for Python (FPDF PHP port)
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
have a nice sublime text day
okay
pssibleto letme in @finite grove
sure,
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
I crashed
Sad
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 ๐ญ
use a help channel
I think more people will see
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
@indigo vortex use the #โ๏ฝhow-to-get-help
yo can someone help me convert a py into a exe i alr looked at yt stil cant
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]
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
ya hi
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
?
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))
@tender hill :white_check_mark: Your eval job has completed with return code 0.
001 | 2
002 | 2
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))
@tender hill :white_check_mark: Your eval job has completed with return code 0.
001 | 2
002 | 2
003 | 2.0
converting it to a float makes it a decimal type number(mathematical definition of decimal is used here)
@candid birch
so you get it?
so anything else i can help in
ok so bye!
๐
yea join vc
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
'https://neoxscans.net/manga/x-page
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
does it has an id?
thats good then
and css
style
look in this page
ok
but how i do it?
its possible use a webhook with python?
def parse(soup_: Bs):
for html_link_tag in soup_.find_all('a'):
yield html_link_tag.get('href'
where i write this?
after parser
?
the site dosent opens for me
i dont have one
do u use firefox?
brave
hm
i dont know how do this on brave
but change your proxy brownser
to SOCKS Domain
and select SOCKS4
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)
show me the output
of this
im running
eh leavve it
i will just tell you the directions
ok
dont want to mess up my networks on ubuntu
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:
;-
just show the screenshot of the output
It's there
Cap. 39
<a class="btn-reverse-order" href="#" title="Mudar Ordem"><i class="icon ion-md-swap"></i></a>, <a href="https://neoxscans.net/manga/the-player-that-cant-level-up/cap-39/">
Cap. 39 </a>,
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
alright
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'])
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:
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)
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
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
add colon
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?
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))}"
what?
@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)
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
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
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
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:
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))
what are you trying to do
running
web scraping
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
this is expected output right?
ye
:)
None
i think the site wouldnt have had a specified one for the nones
anyways is your problem solved?
@river hare
can you show a eg
ok
and The-Beginning-After-The-End
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))
oh wait
replace the whole code with this
?
and solo leveling dont have -
yoo
thanks dude
bye ig!
@tender hill its possible put the manhwa list in a dictionary?
yea
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():
...
but
did you copy-paste what i snet
might want to look what .values()
to a dict does
!e
dict_ = {"a" : [1,2], "b": 3, "c" : {"4"}}
print(dict_.values())
@tender hill :white_check_mark: Your eval job has completed with return code 0.
dict_values([[1, 2], 3, {'4'}])
yes
where i put this?
i dont think
so
becuase the code i sent is diffrent
from the screenshot
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))
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))
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
can you show the code whic you are using
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))
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))
i mean you can configure the output type by your own
so
how i do that?
i want make a table with pandas
so simple
Book Names | Chapter
Bug-Player | 62
Doctor's Rebirth | 36
like thats
i tried this
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)
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
maybe try asking #voice-chat-text-1
@little badger i want make a table like that
ok which variable in your code contains that data? can you send your latest working code
i'll be back in 5-10 min
im using google colab
ok
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.
!paste use a hastepin, or use a code block. don't upload/DM files.
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.
{'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()
what?
i sayed
!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)
@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
.
ye
but without 001
002
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
...
oh
0 and 1 are the index.
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))```
so you have to get the chapter into links right?
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
- modify the return value for
get_cap()to strip the newline character\nand also theCap. - modify your
forloop to correctly get a list of chapters as a value underlinks['chapter'] - transform the dictionary to a dataframe @river hare
yes
but without the code
on the top
yup i got it
get_cap(\n)?
can you join code help vc so i can talk to you?
ok
.strip()
yes
return a_tag.text.strip()
\n
Cap. 50
return a_tag.text.strip().replace('Cap. ', '')```
'50'
so .strip() will remove newline characters \n
ok
because right now your get_cap() function is returning: \nCap. 50 instead of just '50'
ok
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 ?
what?
nvm. ok understand so far?
yes
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?
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 '
}
\nCap. 80
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
df = pd.DataFrame.from_dict(chapter)?
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'
]
}
no
no, we're still going to pass links
then finally you can
df = pd.DataFrame.from_dict(links)
print(df)
the chapter cant be a result manual
yes i know
we changed your for loop, it will make a list of chapters and insert it into links automatically, not manualily
ok you have to change your return value in get_cap() which i showed you earlier
return a_tag.text.strip().replace('Cap. ', '')```
return a_tag.text```
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. ', '')```
hmm
im running
i code in js
so
i dont know python
i never used python
...
yes
google colab
what?
not yet
did
just so you know, the chapters are stored as strings, not integers
if you need integers or numerics, you will need an extra step
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
how i transform to number?
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
๐
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?
wrong name
number 8
its solo-leveling
number 12
its o-comeco-depois-do-fim
@little badger its possible change columns name position?
yes you can re-order columns
like chapters first, then book name?
aligned to the left
yes
maybe
i think, in the pycharm u can move for right
like that appear arabic language
thats because appear
doesnt equal
...
i will try
so
bye
@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?
remove the first 2 lines and unindent the last 2 lines
thanks
!stream 750025574558335017 30M
โ @thick flower can now stream until <t:1628784723:f>.
!stream 750025574558335017
โ @thick flower can now stream until <t:1628797154:f>.
i think !stream can only be done by moderators
yeah I guess so
you mean in voice chat? you need to get verified for that
you need to go to the voice-verfication channel
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.
it's not that bad at all, and is very effective in discouraging trolls
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
Hey
hello
What's up bro?
i need help
lul
Tell m, maybe I can help ya
๏ปฟ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
1 < pwr < 6 right?
right
does the root must be the same as the power?
i got the solution in #help-honey
sorry no, docker is cursed
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
for x, y in thisdict.items():
print(x, y)
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
a=[0,2000,61600,107360,157696,213065]
for i in range(0 , len.a):
if playerscore <= a[i]:
return f"level a[i]"
osu! for browsers
ive tried this code, but then got headache and went to shower
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
upload the whole file to https://paste.pythondiscord.com
copy paste the code to the site i linked and share the link here
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
not surw who made the docs but its bad advice for beginners
yes
and then replace all the stuff from the library with ursinia.(the thing you need)
thats the proper way to do it
can you send it again with the properly imported methods and objects so i can try fixing it
(makes it much easier for me
)
to all the stuff with orange lines add ursinia.
i didn't get it
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
okh
have you understood that?
(again there is no dumb question so feel free to ask)
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
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()```
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
no
okh
@tidal glacier how experience are you with core python concepts like functions, classes, importing?
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
#bot-commands
@fringe mortar show your code here
yea
sorry i was all over the place
here
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())
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())
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
yea
i cant add another command to the same button which is problamatic
UPDATE table SET a = y WHERE number = 2
do i need to put that in a function though?
as soon as the user clicks the sumbit button
submit_merc = Button(f1, text="submit", padx=50, command = Update_transfer, )?
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
amount
ahh so everytime a user clicks submit it adds 1, so it would need to increment by one each time
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
the cur and curser is underscored yellow
variable not defined
kok
it not updating the table
ok
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)
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>
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)
i never even thought to use set ๐ฉ
set?
replace this with the current and show me the output
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)
so i run the backend script which creates the table
then?
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
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)
[('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
??
i mean here in the output it shows that it is doing the job
are you refreshing the table you are viewing
yeah
it shows here in the output that you are updating it
yeah
are you sure your viewer is updating
like which software are you using to view .db file
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
are you windows?
are you on windows*
no probs, thank you so much - im actually just studing that code you sent me
@fringe mortar
im here
i was just looking at your code ๐
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
one sec
it worked!
yea
can i paypal you somthing?
no
are you sure>?
yea
my friend, i owe you one,
i dont help people for money
yea the problem was that
after executing the command
we didnt commit it
conn.commit()
yea
to get the amount rigth now
rows = [('transfer', 19)]
rows[0] would return ('transfer', 19)
you got mad skills
alright so bye
@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?
yeah
Like I don't understand what is wrong with session auth... I send a session cookie to the user when they login..
Oh ok
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
I just started
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 :(
oh sad
i will join later
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
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
mind if I dm u?
Nope go ahead. I'll not talk in voice chat though. I am ok with text chat :)
No problem. Dm me
ah ok
I'll leave this channel now. Again thanks @clear agate :)
How do I get help in a voice channel?
@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 ๐!
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));
}
}
}
});
anyone very familiar with flask and using poetry ?
Not overly but what's going on with it?
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
can I maybe bug you for 5min in the code help 0 ?
That's beyond me. I haven't futzed with WSGI or what have you, I only know the basics of flask
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...
hey, my os.remove can't remove archives. Why?
"access denied"
Concurrency is the ability to run things at the same time
ahh
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.
Sorry for the noobness
?
click the headphone button to undeafen
it is at bottom left
?= lookhead
does youyube-dl works on android
i tried to make a youtube video donwloader, it work fine on pc but gives error on mobile
Hey guys, any of ye know Django python?
yes
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
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
discord.py guy

what