#voice-chat-text-0
1 messages · Page 732 of 1
Hi guys
Sure follow instructions
ok
nice
channel Client.get_channel(79895740261######)
@rugged root
is this correct?
cz its giving me Syntax error
Why are you sending message?
line 33
channel Client.get_channel(798957402619117568)
^
SyntaxError: invalid syntax
@reef stratus.event
async def on_member_join(member):
print(f"{member} has joined !")
channel Client.get_channel(79895740261911####8)
await channel.send("")
@Client.event
channel = Client.get...
What's PyDIS?
Sys
This server and supporting elements
ah
That's sounds amazing
Thanks! Glad to have you on the server. Looking to start learning Python or are you pretty familiar with it?
How so?
os.execl(sys.executable, sys.executable, *sys.argv)
what are the advantages of JetBrains range of IDEs
@versed island They're well made, plugins that work for one will generally work for all others since they're based on the same engine, good support, etc. Just depends on your preference, though. It's not for everyone
you can generate servers which have code using openapi
you can also very easily generate api documentation for your api using the specification
also sorry for the ping i forgot to turn it off lmao
khhay
i just downloaded CLion ... and it seems like an overkill
more of a distraction
hmm
its just so easy to zip files on mac and linux
via terminal
you would need open source build of android
to get root access
maybe its doable in future
with 5G
os.execl(sys.executable, os.path.abspath(__file__), *sys.argv)
Hi Mr. Hemlock, I am a bit familiar with basic concepts like the loops, lists etc but yes, I am looking to continue learning python
I came here with the intention to not just learn but also share and have fun with other programmers like you
Also, where I am from, not a lot of people actually care about programming
(at least from my friend group)
./file_name
yup
Very awesome. Well let me point you to our big ol' page of resources. The two books I usually suggest are "Automate the Boring Stuff" and "A Byte of Python", both of which are free on their respective sites. If videos are more your jam, we also have some YouTube playlists that are absolutely solid.
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Beyond that, I'm always happy to explain concepts you might be stuck on or just to hang out and chat
Anytime!
super wholesome
Hey @warped saffron!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
mutable changes vs immutable changes @ vc bois
@warped saffron Ah right, for Python files, we request you use our paste bin. Keeps people from potentially downloading something malicious and also makes it so that we don't have to download something to help look it over
ah ok
an example would be
mutable:
myList = [10, 20, 30]
myList.append(40)
immutable:
yourListmyList = myList + [40]
What's the specific question about them?
Immutable things can't be modified once created
which is better
Only overwritten
They have different use cases
Strings are immutable and lists are mutable, now you can understand the need for both of them
Ok, so I saved it on hastebin, can I post it in this channel?
It's just a pong.py game that I made from a youtube tutorial
Yep, you can paste the link here
K
Hey guys, I'm here after quite some time, how's everyone doing?
Good! How've you been?
So, the point is if you want you could go checkout the code, see if it runs and tell me if there is anything I could do to improve the game or my own knowledge.
We haven't changed it in quite a while
hmm....i thought i saw some changes
@warped saffron I'll give it a once over when I get a chance. Unfortunately I'm dealing with some technical issues at work, so I'm bouncing back and forth between things
No sweat. This database is the one stressing me out. Looking over folks code is calming
Glad to hear
@severe pulsar
First thing that jumps out to me is that you have the same file being used multiple times. You might want to set the file path as a constant near the top of your code so that you don't have to have the full file path elsewhere in the code. Helps keep it cleaner
what can I replace, py __file__ with?
@warped saffron Honestly other than that your code is very clean. Nothing else is really coming to mind at the moment.
you have to pass in the file name here
there is no file in jupyter
i think
thats why its failing
it has to be a local python file
example:
import os.path
print(os.path.abspath("some_file.txt"))
the output will be like
/home/user/some_directory/some_file.txt```
is there some issue with the code?
oh okay sorry
hello everyone
@uncut meteor my phone died
mic switched to local loopback
the battery was empty
🤦

nitro flexer
I mean, if it's not on the internet it doesn't really matter....
@tiny seal
I gtg
cya
hey
hey friends
got my car detailed today and now i won't get arrested if i get pulled over probably 🙂
Sorry, I had to go.
No worries
Also @limber blaze I chill in #esoteric-python. Do you think I rly care about pep8?
Although people consider putt-putt and mini-golf as the same, in reality, they are not. There are some fundamental distinctions between these two though both types' target is putting the ball into the hole.Building a mini-golf course in your backyard or purchasing indoor mini-golf equipment might enable you to play both putt-putt and miniature g...
@potent summit Check out the #voice-verification channel. That will tell you what you need to know
thanks mate
nonzero number -> truthy
nonempty collection (things that hold things) -> truthy
@fierce summit Hello
Hello
!e
class test: pass
print(bool(test))
@honest pier :white_check_mark: Your eval job has completed with return code 0.
True
bacon = "ham"
if bacon:
!e
colors = ['red', 'green', 'blue']
while colors:
print(colors.pop())
@shut goblet example of using truthiness of a collection. the loop runs while the collection has things in it so i don't get an error from popping an empty list
@honest pier :white_check_mark: Your eval job has completed with return code 0.
001 | blue
002 | green
003 | red
!resources @shut goblet
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
wym
not in python lol
if you're going for general then do a programming course not a python course
@somber heath https://www.reddit.com/r/therewasanattempt/comments/ksk8x8/to_get_rid_of_a_kookaburra/
@vagrant cradle https://pythondiscord.com/
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
@honest pier i have checked out some vids and i think w3schools is still the best. its staight to the point. Is there any reason why you dont think w3schools is good for learning?
there are slight errors that certainly should be caught during proofreading, and some pages are just wrong, (e.g. their python arrays page)
Python does not have built-in support for Arrays, but Python Lists can be used instead.
and it refers to lists as arrays the entire rest of the article
Also, as a side note, arrays are neat
!e
print(10 // 3)
print(10 / 3)
@honest pier :white_check_mark: Your eval job has completed with return code 0.
001 | 3
002 | 3.3333333333333335
thanks for that @rugged root
!e
print(10 % 3)
print(9 % 3)
@honest pier :white_check_mark: Your eval job has completed with return code 0.
001 | 1
002 | 0
!e
i = 0
while i < 50:
if i % 2 == 0:
print("hemlock's turn")
else:
print("my turn")
i += 1
@honest pier :white_check_mark: Your eval job has completed with return code 0.
001 | hemlock's turn
002 | my turn
003 | hemlock's turn
004 | my turn
005 | hemlock's turn
006 | my turn
007 | hemlock's turn
008 | my turn
009 | hemlock's turn
010 | my turn
011 | hemlock's turn
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/wekululaja.txt
it's a bit confusing
!e
x = 3
a = x * 2
print(a)
@honest pier :white_check_mark: Your eval job has completed with return code 0.
6
this makes sense right?
@honest pier :white_check_mark: Your eval job has completed with return code 0.
6
yep
so i still dont understandd x*=3
hop into code / help 1
x *= 3 is the same as x = x * 3
very good explanation
someone send me there site
Sorry one sec, my Discord is crashing
@gentle flint u got a site
no
How about
from time import time
now = time()
future = now + 1
while True:
if now >= future:
print("a second has passed")
future += 1
else:
now = time()
Back in a bit
ok :D
just don't make it a byte
;)
lmao
swiftal was like, "NOOO", oh wait, my mic is unmuted
mutes
unmutes after 2 seconds
"uuuuhhhh"
mutes
:)))
i'm laughing so hard xD
in my mind, of course, because it's night and i don't wanna wake up my grandma :P
bc i need ideas
just mute :P
can i see it
thank you so much
so u own this https://heimdall.site/
The Heimdall Application Dashboard makes managing your websites and applications much easier.
or u used this to make urs
LaTeX
LaTeX -> LAY-tekh
LaTeX ( LAH-tekh or LAY-tekh, often stylized as LaTeX) is a software system for document preparation. When writing, the writer uses plain text as opposed to the formatted text found in "What You See Is What You Get" word processors like Microsoft Word, LibreOffice Writer and Apple Pages. The writer uses markup tagging conventions to define the ...
sorry guys i'm not a native, i'm just coming here to get used to your accents
you could say i'm abusing you, but dw, we're friends
:)
@faint ermine is this ur site blog.yadamiel.com
i cant afford a mic
fair enough
wait, is there a problem with me staying here on mute to listen to u?
wasn't paying attention
oh ok, ty xD
oh ok :D
i understand
am i not aloud to ask to view peoples projects here
so what have you guys been up to?
damn
ok ty :D
feelsbad
also, i think you're just asking multiple times after he said no and that's the "problem" here
so what have you guys been up to today?
Im sorry sir i dont think i offended anyone
sure
yo ur site is down anyways doesnt matter sorry to "disturb" u
thanks for telling them that :))
no worries haha
im not
didn't expect to meet another romanian here
i just cant even ask a question
me neither
lol xD
but i've met one more in the past haha
nice :D, how many years old are you? you seem to be above 20
nice, i'm 16 :))
are you a programmer/into programming?
dw it happens to all of us :))
@faint ermine can i see ur github
yess i'm a web dev, have been for about 7 years
pls
you?
looool, nice
i wanna get serious about programming, go to college then find a job
:P
He linked his github here: #voice-chat-text-0 message
ok
yeh, it's a good idea
i wanna study at the Babes Bolyai university in Cluj
lots of money in romania from programming jobs
but it's hard to get in :(
you live in cluj?
no, I live in toplita :))
lolls
i mean, close to
was what my doing
was it hard?
i'm very* scared tbh :))
eeeh it was ez, but hard for me cuz i'm lazy and haven't learned anything
lol rly
so now im just getting blamed
but the university in Brasov sucked, i think Cluj is better
isn't it stressful to be a web developer though?
lmbo!!!
for a guys site being down
i mean, my options are in this order: Cluj, Bucharest, Iasi, Brasov
or something like that
depends on your attitude. i was stressed out at first but now it's better
why don't you guys just turn DM's off for this server/
might as well swap Iasi with Brasov
i'm acting calm, yet freaking out at the same time
also, what have you studied? and I'll say this in romanian since I don't know how to name it in english
info-poli?
no i mean if you're high in neuroticism and have high anxiety, you'll be stressed out. but otherwise you'll be fine
why am i getting blamed for this stuff
oh nice
<- this guy
i aim for info-cluj, then poli-cluj, info -bucharest, poli-bucharest and so on
not my fault he cant keep a site up so yall can stop judging and blaming me thanks
🤔
wait
we have two Romanians now
noice
haven't done too much research when i went to uni
yesss
@steep flare join us haha
had to search what neuroticism was, and i can say i can manage a stressful situation honestly
how am i supposed to ddos a cloudflare site
romanian party haha
ur mad
me neither
i mean i haven't gone yet
wait
you don't
:))
lol
exactly
yes xD
when you said my names like 3-4 times i was confused, shocked and was excited at the same time btw :))
Teaches traitors to get fucked
with the right accent, of course xD
yeah lol
lots of chicks tell me they're excited when i say their names haha
jk i'm lonely
:((
lmao :))
@rugged root i love you
just name your hand after the girl you like
then it's up to your imagination
i guess
no u
lmao :))
bye bye
unlucky for him
Glad you feel big
ty bbs
Yeah that's not really appropriate
but the problem with that is
ok sorry i won't do it again :P
im gay so i get bullied for everything
Uh huh
thats why i was blamed
and it's not appropriate even to say it, imagine doing it
@vagrant cradle What happened to you leaving?
bc im not straight
Still waiting on that bit
i have no way of knowing your sexual orientation just as you have no way of knowing mine, ryan
bro just shut up and leave
plz kick him
!tempban 799000198655377448 1w Harassing our users, "slamming" their sites and intentionally trying to incite and argument aren't really the best ways to make friends here in the server. I would ask that you take this time to read our Rules and Code of Conduct. If you decide to return and this behavior continues, your ban will become permanent.
:incoming_envelope: :ok_hand: applied ban to @vagrant cradle until 2021-01-20 21:30 (6 days and 23 hours).
What a butt
Damn it. It's not an infraction without a typo
lol
how many arguments does .insert() need in the () ? for lists
should be 2, the index and the item
what ordder?
!e help(list.insert)
@honest pier :x: Your eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'help' is not defined
does it matter?
wack
@honest pier :warning: Your eval job has completed with return code 0.
[No output]
yeah, index is first
so .insert() is always 2 arguments:
.insert(index, item)
never more, never less??
!e
from collections import ChainMap
population = dict(italy=60, japan=127, uk=65)
changes = dict()
editable_pop = ChainMap(changes, population)
print('population of Japan from ChainMap: ', editable_pop['japan'])
editable_pop['japan'] += 1
print('population of Japan from ChainMap after +1:', editable_pop['japan'])
print('population of Japan from original dict: ', population['japan'])
print('changes is saved in the first dict of the chain: ', changes.keys())
@dire folio :white_check_mark: Your eval job has completed with return code 0.
001 | population of Japan from ChainMap: 127
002 | population of Japan from ChainMap after +1: 128
003 | population of Japan from original dict: 127
004 | changes is saved in the first dict of the chain: dict_keys(['japan'])
or is there special cases?
so its always 2 ?
yes
never more or less?
never
!e
import os
from collections import ChainMap, defaultdict
command_line_options = dict() # just imagine what it does
config_file_options = dict() # just imagine what it does
options = ChainMap(command_line_options, os.environ, config_file_options,
defaultdict(lambda: 'default_value'))
value = options['optname']
value2 = options['other-options']
print(value, value2)
@dire folio :white_check_mark: Your eval job has completed with return code 0.
default_value default_value
not really, it was a DDOS
mostly fail, since that server only has static content and cloudflare caches that
enough to trip my hosts anti-ddos tho
nah the host is fine
bruh hemlock
Really out of it, apologies
Mon, 22 Jun 2020 04:08:27 UTC
can't you !user him?
print(chr(27) + "[2J")
intuit
If so, Backup software VSS call didn't put database into crash consistent state
i have a question
or "What is shitty programmers who don't understand Windows File System?"
num = int(input("Please input a number.\n"))
if num > 1:
for divisor in range(2, num):
if (num % divisor) == 0:
print(num, "is a prime number.")
print(divisor, "times", num//divisor, "is", num)
break
else:
print(num, "is not a prime number")
else:
print(num, "is not an applicable number.")
how do i get this function to take in values like 2^63 -1
i guess i need some line of code that calculates what that is should it be that type
2**63 - 1 is far too large for a primality test like that
I'm just impressed by the solid use of for/else
are we debating how to pronounce SQLite OR why it's named of SQLite?
what test would i use then?
probably a heuristic test instead of division
I've always called it Sequel Lite
what does that mean
GIF
gift...clearly sounds like jist
JIFF
yiff?
wind
i think there's a technique based on FFT, but i have no idea how it works
Learn more about Aaron Alon's music, writing, and films at aaronalon.com.
cya
maybe when they solve the reiman hypothesis then we'll know lol
Corpseman
corpsman
Corps /kɔːr/
it's a French term i think
It's properly pronounced "My Ass Rides In Navy Equipment"
touche
touchy
ways to make Marines angry
coloring time is over
why, did they eat them all?
a way to make marines angry
generally they are full after coloring time
yeah i mean i'm learning chinese and you should see how americans pronounce chinese names lol
it's very difficult, a lot of the sounds just don't exist in english
like tl
tl isn't a sound though....
in Nahuatl it is
there's ts
server is going crazy this evening
that's not chinese though
crazy?
i was responding to public static void main
oh my bad
how do you say tl
in what language
idk, the language of origin
ya with trolls
i don't know
but i know that ts is hard to pronounce
the u with the two dots is also hard
and q
also you should look up cursive chinese it's really a pain in the ass
cursive anything is a pain in the ass
cursive is good
cursive in code go BRRRR
hey void man, couldd u join help 1 i got a question
what is it?
for loops
what about them?
x is the loop variable, on each iteration of the loop, it's assigned to the next element in the list
!e
colors = ['red', 'green', 'blue', 'yellow']
for color in colors:
print(color)
@honest pier :white_check_mark: Your eval job has completed with return code 0.
001 | red
002 | green
003 | blue
004 | yellow
so x = each item in the list 1 by 1? left to right?
yep
Putt's Law: "Technology is dominated by two types of people, those who understand what they do not manage and those who manage what they do not understand."
it can be anything, but you want to use a good name
gotchu
voice
like how i used color for my loop variable when i was looping over the colors
gotchu
!source
i dont understand what this means
do you understand the first line
yes
that is dumb as hell
good
second i dont
that's an antipattern
^
len gets you the amount of elements in array
whats an array?
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
start here 😉
@honest pier Hi
it's a stupid way of going through each element in the list
it's a list @shut goblet @willow drift
who is boomers
a better way would be
for i in thislist:
print(i)
what does range and len have to do ?
so, range essentially gives you a sequence of numbers [0, n)
!e print(len(["hi", "there"]))
@gentle flint :white_check_mark: Your eval job has completed with return code 0.
2
len gives you the length of a list
@shut goblet start with python basics. Check resources everything is there quick and easy to start with
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
@shut gobletlen() gives the length and range() gives you sequences of numbers
!e
for i in range(2):
print(i)
@gentle flint :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
so for i in range(len(list)) will loop over the indices of a list
!e ```python
for i in range(10):
print('hahahahah')
@whole bear :white_check_mark: Your eval job has completed with return code 0.
001 | hahahahah
002 | hahahahah
003 | hahahahah
004 | hahahahah
005 | hahahahah
006 | hahahahah
007 | hahahahah
008 | hahahahah
009 | hahahahah
010 | hahahahah
but it stop at 9
it starts at 0
hmm
!e print(len([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))
@gentle flint :white_check_mark: Your eval job has completed with return code 0.
10
^
i still dont understand how the range and length got me the names of each item in the list
so for i in range(len(list)) gives you the indices
So
woah i'm green
Okay
wym indices?
so then you access the elements in the list with list indexing list[i]
Uhm
it's for creating our own content for pydis
Woah
m
an index is how you refer to an object's position in a list
yes i know that
indices is the plural
ohh
some people say indexes, but they're the same
@honest pier can u explain what the range() does?
range essentially creates a sequence of numbers
so range(10) creates a sequence 0 1 2 3 4 5 6 7 8 9
it's more like a generator than a list in a way
well yes, but also, that's not important right now
true
yeah, range returns a range object
you can turn it into a list
u forgot a )
@gentle flint :white_check_mark: Your eval job has completed with return code 0.
range(0, 10)
lmao
!e
print(list(range(10)))
@gentle flint :white_check_mark: Your eval job has completed with return code 0.
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
there
you can edit the message
oh
ok i see
so when u make it into a list it unravels it all up?
!e [print(x) for x in range(10)]
@limber blaze :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
!e [print(x) for x in range(10) if not x % 2]
@limber blaze :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 2
003 | 4
004 | 6
005 | 8
!e
the_list = [str(x) for x in range(10) if not x % 2]
print("\n".join(the_list))
@faint ermine :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 2
003 | 4
004 | 6
005 | 8
@warm axle :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
!e
print(*(x for x in range(10) if x % 2 == 0), sep="\n")
@honest pier :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 2
003 | 4
004 | 6
005 | 8
is there a difference between this and ...
this
!e c = 0 while (c := c + 1) < 20: print(c)
@limber blaze :x: Your eval job has completed with return code 1.
001 | File "<string>", line 1
002 | c = 0
003 | IndentationError: unexpected indent
!e python for x in range(0,10): print(x)
@amber raptor :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
!e c = 0 while (c := c + 1) < 20: print(c)
@limber blaze :white_check_mark: Your eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
006 | 6
007 | 7
008 | 8
009 | 9
010 | 10
011 | 11
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/agasilozaw.txt
!e
print(range(10))
@willow drift :white_check_mark: Your eval job has completed with return code 0.
range(0, 10)
!e
print(type(range(10)))
@willow drift :white_check_mark: Your eval job has completed with return code 0.
<class 'range'>
!e list(range(10))
@limber blaze :warning: Your eval job has completed with return code 0.
[No output]
oh
!e python for x in range(3): print(x)
@amber raptor :white_check_mark: Your eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
!e
mylist = ["hi", "there"]
for i in mylist:
print(i)
@gentle flint :white_check_mark: Your eval job has completed with return code 0.
001 | hi
002 | there
!e ```python
import timeit
def a():
l = [*range(0,10)]
for x in l:
print(x)
def b():
l = [*range(0,10)]
for x in range(len(l)):
print(l[x])
timeit(a())
timeit(b())```
!e ```python
import timeit
def a():
l = [*range(0,10)]
for x in l:
print(x)
def b():
l = [*range(0,10)]
for x in range(len(l)):
print(l[x])
timeit(a())
timeit(b())```
@amber raptor :x: Your eval job has completed with return code 1.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
011 | Traceback (most recent call last):
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/ruvaxeveko.txt
!e python x = 10 y = 0 while x > y: y += 1 print(f"X: {x} Y: {y}")
"
@amber raptor :white_check_mark: Your eval job has completed with return code 0.
001 | X: 10 Y: 1
002 | X: 10 Y: 2
003 | X: 10 Y: 3
004 | X: 10 Y: 4
005 | X: 10 Y: 5
006 | X: 10 Y: 6
007 | X: 10 Y: 7
008 | X: 10 Y: 8
009 | X: 10 Y: 9
010 | X: 10 Y: 10
!fstring
In Python, there are several ways to do string interpolation, including using %s's and by using the + operator to concatenate strings together. However, because some of these methods offer poor readability and require typecasting to prevent errors, you should for the most part be using a feature called format strings.
In Python 3.6 or later, we can use f-strings like this:
snake = "Pythons"
print(f"{snake} are some of the largest snakes in the world")
In earlier versions of Python or in projects where backwards compatibility is very important, use str.format() like this:
snake = "Pythons"
# With str.format() you can either use indexes
print("{0} are some of the largest snakes in the world".format(snake))
# Or keyword arguments
print("{family} are some of the largest snakes in the world".format(family=snake))
How to detect APNGs sent in Discord using discord.py - Detect.py
that is the dumbest example i have ever seen @shut goblet
yes. bbut why is there brackets
set builder notation isn't related to python, but i digress
I've been doing python for 3 years now the hell is builder notation xD?
😂
The reason the video crashes is because the video after the 8 seconds proceeds to extend passed 255, 255, 255 on the RGB scale, as well as switching the resolution causing it to fail at playing it, leaving it to crash because the color and resolution cannot be handled.
This is also the case with the sound, it exceeds the sound limit causing it to crash because it can't be handled.
!e
L = []
for i in range(10):
if i % 2 == 0:
L.append(i)
print(L)
@honest pier :white_check_mark: Your eval job has completed with return code 0.
[0, 2, 4, 6, 8]
!e
L = [i for i in range(10) if i % 2 == 0]
print(L)
@honest pier :white_check_mark: Your eval job has completed with return code 0.
[0, 2, 4, 6, 8]
v
for i in range(10):
if i % 2 == 0:
L.append(i)
v
for i in range(10) if i % 2 == 0
L = [for i in range(10) if i % 2 == 0]
print(L)
!e
L = [i * 2 for i in range(10) if i % 2 == 0]
print(L)
@honest pier :white_check_mark: Your eval job has completed with return code 0.
[0, 4, 8, 12, 16]
@honest pier i got it
unless there's also an else
Theia is an open-source cloud desktop IDE framework implemented in TypeScript.
if os.path.exists("json/airports.json"):
with open('json/airports.json', 'rt') as airports_json:
airports = json.loads(airports_json.read())
elif os.path.exists("airports.json"):
with open('airports.json', 'rt') as airports_json:
airports = json.loads(airports_json.read())
elif os.path.exists(os.path.expanduser("~")+"/Downloads/"+"airports.json"):
with open(os.path.expanduser("~")+"/Downloads/"+"airports.json", 'rt') as airports_json:
airports = json.loads(airports_json.read())
airportspathslist = ["json/airports.json",
"airports.json",
os.path.expanduser("~")+"/Downloads/"+"airports.json"]
for i in airportspathslist:
if os.path.exists(i):
with open(i, 'rt') as airports_json:
airports = json.loads(airports_json.read())
break
!d pathlib
New in version 3.4.
Source code: Lib/pathlib.py
This module offers classes representing filesystem paths with semantics appropriate for different operating systems. Path classes are divided between pure paths, which provide purely computational operations without I/O, and concrete paths, which inherit from pure paths but also provide I/O operations.
If you’ve never used this module before or just aren’t sure which class is right for your task, Path is most likely what you need. It instantiates a concrete path for the platform the code is running on.
Pure paths are useful in some special cases; for example:... read more
from pathlib import Path
p = Path(".") / "data" / "file.txt"
lemon in vc 👀
What are we doing with airports?
all sorts of stuff
Landing taking off?
identifiying locations
A whistle is an instrument which produces sound from a stream of gas, most commonly air. It may be mouth-operated, or powered by air pressure, steam, or other means. Whistles vary in size from a small slide whistle or nose flute type to a large multi-piped church organ.
Whistles have been around since early humans first carved out a gourd or bra...
@gentle flint Hey, Im new to the server so i cant voice.:\
How is laundmo in staff.
got dragged
Lol
I'll be off soon, it's 6 to 2 am
What do you mean by "dragged"? Come back to the Off-Topic VC. I need to speak with you.
lemon pulled him in
sweet
@whole bear some guy overloaded his website and was harassing him
and another guy came in attempting thr ssme
Help me
k
here
import serial #Serial imported for Serial communication
import time #Required to use delay functions
ArduinoUnoSerial = serial.Serial('com9',9600) #Create Serial port object called ArduinoUnoSerialData time.sleep(2) #wait for 2 secounds for the communication to get established
print (ArduinoUnoSerial.readline)() #read the serial data and print it as line
print ("You have new message from Arduino")
while 1: #Do this forever
var = raw_input() #get input from user
if (var == '1'): #if the value is 1
ArduinoUnoSerial.write('1') #send 1 to the arduino's Data code
print ("LED turned ON")
time.sleep(1)
if (var == '0'): #if the value is 0
ArduinoUnoSerial.write('0') #send 0 to the arduino's Data code
print ("LED turned OFF")
time.sleep(1)
if (var == 'fine and you'): #if the answer is (fine and you)
ArduinoUnoSerial.write('0') #send 0 to the arduino's Data code
print ("I'm fine too,Are you Ready to !!!")
print ("Type 1 to turn ON LED and 0 to turn OFF LED")
tHANKS
Hey @glass kettle!
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:
int data;
int LED=13;
void setup() {
Serial.begin(9600); //initialize serial COM at 9600 baudrate
pinMode(LED, OUTPUT); //declare the LED pin (13) as output
digitalWrite (LED, LOW); //Turn OFF the Led in the beginning
Serial.println("Hello!,How are you Python ?");
}
void loop() {
while (Serial.available()) //whatever the data that is coming in serially and assigning the value to the variable “data”
{
data = Serial.read();
}
if (data == '1')
digitalWrite (LED, HIGH); //Turn On the L ed
else if (data == '0')
digitalWrite (LED, LOW); //Turn OFF the Led
}
this is giving errors
that and this is connected
towards the end i think u forgot opening and closing {}s in ur if and else if statements
hey i need help plz
@young panther Hm?
i have a project in python but i don't know how to manipulate tuple
like i would verificate that an element isnt in the tuple
but it say its not everytime
even when he's in
>>>apple = 1,2,3
>>>apple
(1, 2, 3)
>>>4 not in apple
True```
yea thx but i need to do it with if
like i tryed:
if not (o, x) in ot:
ot += (o, x)
but it does the 'if' part everytime
like if the verification isnt working
and ot is the tuple
so how are we supposed to do
ok so its an zip, unzip huffman projet
and first we need to compress the text
to do that we create a tuple with every caracters of the text
with their occurence
ex:
tuple = [(4, "e"), (2, "r")]
so the functions are working but when theirs 2 times a letter in the text
it duplicate the letter
in the tuple
like for "NSINF"
the tuple =
0 1 2 3 4 5 6 7
2 "N" 1 "S" 1 "I" 2 "N"
@young panther Look at collections.Counter
what is that
ok i see
@young panther I've amended the capitalisation.
okok
i see we can have something that looks like what i want but not exactly
Counter('abracadabra').most_common(3)
[('a', 5), ('b', 2), ('r', 2)]
it does the most common caracters but i would like to have the occurences of every car
@somber heath
Have you tried not having .most_common(3)?
yes but it return only the most common caracters
i would like to return EVERY caracters
with their occurence
That's what collections.Counter() does.
thx u so much my brudda
import os
try:
os.mkdir('root')
except FileExistsError:
pass
os.chdir('root')
for each in ('apples', 'pears', 'grapes'):
try:
os.mkdir(each)
except FileExistsError:
pass```
I'll restate that you probably should use the pathlib module.
@whole bear check if the directory exists before creating it `if not os.path.exists(each)
if not seems cleaner
It's often not.
The syntax of the Python programming language is the set of rules that defines how a Python program will be written and interpreted (by both the runtime system and by human readers). The Python language has many similarities to Perl, C, and Java. However, there are some definite differences between the languages.
@somber heath I see your point thanks for sharing
I guess this is in line with the zen of python: explicit is better than implicit
I would say so in the chat but I'm yet to be voice verified
Pep8, zen, other style guide stuff. They're really good for untying knots you can work yourself into.
@whole bear You can upload it here.
what the hell
can anyone help me to voice verified on this channel
@whole bear yes??
how do i get permission to speak on this channel
Keep sending messages. You upload it here as well.
50 msg
3 days on server
thanks @fiery hearth @whole bear
No problem. Welcome to the server big dwag.
@fiery hearth Are you from Bangalore?
@glacial osprey you are from there
yep
and you?
i am from banglore too
Where in Banglore?
guys with the packages such as pandas_datatreader they get their data from yahoo.....how does it work
like if i get the api i only get 500 requests for free is it unlimited via pakcage
Yahoo finance API isn’t public technically
There are companies who offer cheap API for stock market access
like we can only make certain 5000 api calls for mnth right
This is likely something that may be a better fit in #community-meta
no it really isnt, #community-meta is about suggestions for this community
It’s not technically public period. Unless something changed, they can cut you off at any time.
what about #ot0-psvm’s-eternal-disapproval ?
!warn 465621072365092867 Posting a headline about a sexually related topic isn't acceptable here.
:incoming_envelope: :ok_hand: applied warning to @glacial osprey.
and theres your answer 
Hey guy's does enyone use Windows 10 for programming?
yep, loads
i try to install a package
@rugged root Do these warnings expire?
@rugged root then can you remove the warning. I just share it when i read and thought it's just a news article and nobody will have any issue.
👌 Hello, possums!
This is what i get
search for microsoft visual c+++ and install it
Hi OpalMist
@olive siren 'lo
They forced me install 6,5gb
yea do it....it worked for me
i mean this is Visual Studio 2019 right?
i think its microsoft visual c++ 2019
isn't it a whole IDE
You only need the build tools
1 sec
It'd be using the same Visual Studio Installer thing but there should be a specific option in there for the Build Tools for Visual Studio
!build-tools
Microsoft Visual C++ Build Tools
When you install a library through pip on Windows, sometimes you may encounter this error:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
This means the library you're installing has code written in other languages and needs additional tools to install. To install these tools, follow the following steps: (Requires 6GB+ disk space)
1. Open https://visualstudio.microsoft.com/visual-cpp-build-tools/.
2. Click Download Build Tools >. A file named vs_BuildTools or vs_BuildTools.exe should start downloading. If no downloads start after a few seconds, click click here to retry.
3. Run the downloaded file. Click Continue to proceed.
4. Choose C++ build tools and press Install. You may need a reboot after the installation.
5. Try installing the library via pip again.
!warn 657307376860528652 Next burp on your mic is going to result in a mute. I literally just told you to cut it out
:incoming_envelope: :ok_hand: applied warning to @whole bear.
I can't talk
@tight valley check out #voice-verification to see how to get voice access
True but we typically are watching the text channel to talk to people in there
i need to send 50 msgs to verify I'm human ? that's odd ?
like i see there is no other solution than installing 6,5gb
ok, atleast i can chat,
so is this pre scheduled discussion on some topic or just random chat
random chat
Linux typically has the build tools either already on the machine or downloadable through that distro's package manager
okay, great I will join you guys, once discord verify my 50 msgs
meanwhile is there any pre scheduled python meetup also happening somewhere in this server ?
not really, sometimes there are events like the Advent of Code last year
So this part is easier for developer right?
Sort of. Both Linux and Windows have their quirks. In both cases, once you get it up and running it becomes a moot point. It's just which OS you prefer, what your job needs you to use, what you're programming for, etc
curious to know linux quirks,
also i dont like window cmd, never able to access command history there
They've cleaned it up a fair bit, but that's a fair complaint. Linux quirks vary from inconsistent versions between distros, less unified support should you have issues, occasional issues building for Windows (which in fairness is still the most used OS)
From the perspective of an general user is no issue i think exept of the funny updates
i am really confused about the amount of data you have to install to install a package
Windows is very common. In corporate environments for development
i heard about it
This is how it looks
@lyric kraken If you're wondering why you can't talk, check out the #voice-verification channel. That'll tell you what you need to know
Guys I'm sorry to interrupt in between
can anyone suggest me any python weekly meetup
i read it all
why take 3 days to open voice
@tight valley I don't know of any off the top of my head unfortunately
yes
uh will this look better if I know the context
I'm just looking a way to connect with community, if we dont have any we can start one, If people are agree on.
What do you mean?
lol
I mean the context is all right there, in fairness
A burp happened, I told them to stop, it happened again
So i've been using python since the start of the current year and am just wondering if there's a tool like puppeteer for nodejs in python
I've heard of selinium but i dont think its like puppeteer
yea its headless chrome instance
Why is that?
My use case is to login to a websit that uses js for buttons and stuff
Ah okay
thanks
Lmao
pi[-10:]
what you guys doing
WHY I SHOULD SENT 50 MESSAGE FOR TALKING
WHO CAME UP WITH THIS IDEA
ooh
but like put a general voice chat that anyone can join
but i have to wait 3 days for talking?
hmmmm
There are some people who communicate well through writing, there are others, like me who are very bad at writing, but good at public speaking.
!charinfo ʊ
\u028a : LATIN SMALL LETTER UPSILON - ʊ
𝛀
!e ```py
import string; print(string.printable)
wassup guys I'm back after like 3 months
@whole bear :white_check_mark: Your eval job has completed with return code 0.
001 | 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
002 |
003 |
^_`
lmao
ℱ
I'm bad at public speaking but i still want to talk😂
ö -> oe
ä -> ae ...
I've been gud Hemlock
ß -> ss
hbu?
ü -> ue
god dammet
gosh darnit
HOWWW'S EVERYYYYONEEEEEE
Been more or less good
Other than that aforementioned database issue
gud
oof
it should be changed to 666
voice chat active today