« first day (3127 days earlier)      last day (1821 days later) » 
01:00 - 15:0015:00 - 00:00

1:55 AM
hmm... i wonder if there is a good way to handle long chains of if isinstance(expr, blah) such as here: github.com/mathics/Mathics/blob/master/mathics/core/convert.py
 
 
1 hour later…
3:01 AM
@Dair sure, use a dict.
for builtintype, mappedtype in typemap.items():
    if isinstance(expr, builtintype):
        return mappedtype(expr)
and maybe mappedtype is actually mappedtypefactory so you can have functions which transforms the expr into whatever is needed to instantiate the object.
 
@alkasm Thanks, I'll look to getting that to see if it works, seems like a lot of people do the if chains when creating languages.
It's also used pretty extensively in the Pyth project as well...
I think this is partly because Norvig's how to write a lisp interpreter problem in python does this lol.
 
at the end of the day, if you have thirty factory functions to customize instantiation, and put those in a dict with each type that maps to it, its not really much different.
it saves not that much when this much stuff needs to be customized. if its as simple as i did it, sure...but when every type needs a unique transform to create it, its kinda a wash
 
3:43 AM
@alkasm I see your reasoning. I don't think it would be that helpful, but I think that since there are a few functions (at least in the file I linked to), it seems like it might be nice to move the dictionaries to an external file thus allowing for (possibly) easier interpretation of what each function is supposed to do.
 
4:16 AM
anyone knows how to solve the problem of Windows WSL lines overwriting the first line? (the line that includes the bash prompt and the command)
 
4:41 AM
some people enjoy romance... others prefer NECromance
 
4:54 AM
@cs95 a+ pun
 
5:25 AM
@cs95 like vampires?
No wait, they were neck-romancers
 
ha
 
Whew, phone formatting nearly screwed up that joke for me
 
the additional context was helpful but not required to understand the joke :p
 
6:15 AM
Cbg
Is it possible to have a table with multiple name or alias ?
 
noo.. it's not possible
 
┬ಠ_ಠ┬ This is Robert. He is a table. AKA, little bobby tables
 
OK.. I think so, I look up on google but i didn't find of such
Our architect mention the falsethy
 
 
1 hour later…
7:30 AM
opinions please: What is in your experience worse, hard to test or hard to read?
 
hard to read
you have to come up with a test once, but reading happens again and again
 
that's a good point
now i only need to convince my colleagues that fragmenting a routine into 7 sub-functions makes it harder to read
 
cbg
 
Morning guys, trying to save multiple PNG files as layered PSD. Is this possible ? Any thouhts ?
 
7:37 AM
@Arne You can also try playing the "coupling tests to implementation is a sin" card
@Andie31 did you try the psd-tools or pytoshop libraries?
 
@MisterMiyagi yes ... it works only when you try to read from a psd...I'm working with png's and trying to save them as a separate layer in psd or tiff
 
@MisterMiyagi I have my reservations about uncle bob but this one looks fine, thanks =)
 
8:04 AM
cbg
Wow, buncha peopole here now
 
8:36 AM
I'm trying to read the raw contents of a text file: content = open(input_file, "rb").read()
This just outputs b'hello, world!'
How do I get the actuals 0s and 1s?
 
@akinuri What you mean by 0s and 1s
 
get the contents of the files as strings and then parse them to binary...
@akinuri use encode and decode funcions
 
Well, I might be wrong, but I always assumed text is stored as binary, and text editors parse and show them. Is that not the case? o.O
 
@akinuri indeed... but python open library will do all the work you. it will genrate human readable content from binary data of the file....
 
@akinuri python's file reading functions need some encoding with which to interpret the bytes from the file
 
8:42 AM
I might not be always reading text files. So if I use encode/decode functions, will I lose data?
I just want to get the original binary data.
 
"I might not be always reading text files [...]" what else will you read?
 
Hmm, idk. Images, PDFs, etc. This is not for a project or anything. I'm kind of experimenting.
 
Python's bytes type defaults to representing valid ASCII characters as such
it is still fundamentally raw bytes data
so you can load arbitrary files in bytes mode
The ASCII characters and their respective byte values mean the same
b'\x41' == b'A'
The bytes type just is a bytes string that is convenient to represent as ASCII, but the number are all there: b'A'[0] == 65
 
@akinuri You mean:
print(''.join(format(ord(x), 'b') for x in content))
 
I've never worked with binary before. What op/else should I be doing/adding to this:
content = open(input_file, "rb").read()
pprint(content)
 
8:52 AM
This:
print(''.join(format(ord(x), 'b') for x in content))
 
@MisterMiyagi but any ascii might be encoded by an arbitrary amount of bytes, won't it? Seeing an 'A' in a file doesn't mean there's a 01000001 in the file
if it's a unicode 32 file it will be a different byte sequence from one in a unicode 16 file
@U9-Forward this will give the unicode encoding of the characters, which is only related to the original bytes in the file over the encoding used to decode it
If you really want to have a look at the original bytes in the file, you won't get around decoding them again
a step that python actively tries to hide from you, because it's cumbersome, bug prone, and confusing
 
@Arne Yah
 
I'm getting an error: ord() expected string of length 1, but int found
import sys

input_file = sys.argv[1]

content = open(input_file, "rb").read()

print("".join(format(ord(x), "b") for x in content))

input()
 
@akinuri yeah, ord() expects a character
 
I have a text file and a text ("Hello, World!") in it
 
8:58 AM
@akinuri Probably should change:
content = open(input_file, "rb").read()
To:
content = open(input_file, "r").read()
 
    Hello, World!
                ^
SyntaxError: invalid syntax
 
As well
 
Oh. Changed it to "r" and it worked :)
 
@akinuri Lol, one character is a big deal :-)
 
@akinuri now you're wrong.
@akinuri what do you want to do?
 
9:03 AM
@akinuri using bin instead of ord would have worked in this case with open(..., 'rb')
 
Lol, i just searched something on google and the first question that came up was my question...
And my highest voted one...
 
My little sister asked about if/else structure last night, and then I started talking about binary. I wanted to show her that text is actually 0s and 1s and that they get converted.
@Arne Hmm. Tried it, but didn't work.
content = open(input_file, "rb").read()
print("".join(format(bin(x), "b") for x in content))
This, to be exact.
Says "ValueError: Unknown format code 'b' for object of type 'str'"
 
>>> ''.join(format(byte, 'b').rjust(8, '0') for byte in b'foobar')
'011001100110111101101111011000100110000101110010'
 
content
Out[19]: b'a'

type(content)
Out[20]: bytes

content[0]
Out[21]: 97

type(content[0])
Out[22]: int
might be a more "in your face" explanation, easier to digest
 
@Arne since ASCII is an 7-bit encoding itself, the bytes to ASCII mapping is robust
a utf-32 A is not the same as an ASCII A
It would not give an b'A', just b'\xff\xfe\x00\x00A\x00\x00\x00'
choosing ASCII A is just one arbitrary representation, just as 65, x41, 01000001 or any other
 
9:23 AM
@MisterMiyagi I think i was trying to make a similar point.
The point being that seven bits will probably not be a truthful representation of a file's content, since most editors (or python's write function) will create utf and not ascii encoded files by default
but if they're trying to explain a concept to their sister, we should probably leave encoding messiness out of the discussion =D
 
Python defaults to utf-8, which represents ASCII characters the same as ASCII
 
oh, I thought it was utf 16
 
@Aran-Fey @akinuri ^that
@U9-Forward did you try to upvote
 
@Arne well, sometimes ^^
 
does python really default to utf 16 in some systems?
 
9:27 AM
>>> ''.join(f'{byte:08b}' for byte in b'foobar')
 
"UTF-8 is one of the most commonly used encodings, and Python often defaults to using it."
 
even in windows here, it defaults to utf8 for me
 
@ParitoshSingh yes. no. Internally.
 
oh, i..am confused
do you mean to say the .py files themselves are possibly written in utf 16?
 
9:28 AM
and that is why Python hides it from you ^^
 
@MisterMiyagi =/
appreciating python3 even more
 
@Arne: " ...we should probably leave encoding messiness out of the discussion "
No, please. Continue with your discussion involving encoding, others are learning too.
 
hm, no okay. so something changed somewhere. python 3.6 uses utf-8 on windows
> Notably, this does not impact the encoding of the contents of files. These will continue to default to locale.getpreferredencoding() (for text files) or plain bytes (for binary files). This only affects the encoding used when users pass a bytes object to Python where it is then passed to the operating system as a path name. Source
yeah no, im done diving down this rabbit hole for now.
 
Mar 28 at 8:57, by tripleee
obligatory reading Joel Ned deceze
 
^ highly recommended. I read the Ned one personally, and everything suddenly made sense
 
9:36 AM
Text file (content: Hellö, Wörld!) produces two different output in ANSI and UTF-8:
100100011001011101100110110011110110101100100000101011111110110111001011011001100100100001
1001000110010111011001101100110000111011011010110010000010101111100001110110110111001011011001100100100001
How can I seperate these so that I can compare them?
Currenty, I'm using print("".join(format(ord(x), "b") for x in content))
 
maybe join with a space instead
or a newline perhaps
 
@akinuri decode them with the right encoding, compare their unicode values
ah sorry, i misunderstood
 
note though, that you wont get much out of comparing like this
different encodings may use different number of bytes for the same char
so, 3 group of numbers may mean a character in one set, while the other uses only 1 group of numbers
at that point, it might be just easier to compare one character at a time
 
nah, that breaks with some unicode encodings... :D
 
I also tried Aran-Fay's suggestion ''.join(format(byte, 'b').rjust(8, '0') for byte in b'foobar'). I almost forgot about padding the bytes. This proposed abother problem (for me). I want to seperate bytes.
 
9:40 AM
some encodings need normalisation, because you can represent the same thing in different ways
like this? ''.join(format(byte, ' b').rjust(8, '0') for byte in b'foobar')
 
python utf16.py
  File "foo16.py", line 1
SyntaxError: Non-UTF-8 code starting with '\xff' in file foo16.py on line 1, but no encoding declared; see python.org/dev/peps/pep-0263 for details
 
' 1100110 1101111 1101111 1100010 1100001 1110010'
 
@MisterMiyagi easier:
 
@MisterMiyagi That helped :)
 
@AnttiHaapala what caused this? what os/python version is this?
 
where's your vote? :P
 
@akinuri please don't call anything "ANSI", it just confuses matters. State which actual code page you are using
 
@ParitoshSingh python3. utf-16 isn't permitted then. It complains aobut the bom already.
 
@AndrasDeak thanks for the reminder, I honestly thought I had voted
 
@AnttiHaapala okay perfect, so im good to presume utf8 is expected yeah?
 
9:57 AM
@AndrasDeak if even the len assignment was there it would have been almost mcve
 
@Arne Thanks, I'll print them. Reading Ned @ParitoshSingh
 
>>> text = "Hellö Wörld"
>>> for char in text:
...   print('CP1252 {0!r}   UTF-8 {1!r}'.format(char.encode('cp1252'), char.encode('utf-8')))
...
CP1252 b'H'   UTF-8 b'H'
CP1252 b'e'   UTF-8 b'e'
CP1252 b'l'   UTF-8 b'l'
CP1252 b'l'   UTF-8 b'l'
CP1252 b'\xf6'   UTF-8 b'\xc3\xb6'
CP1252 b' '   UTF-8 b' '
CP1252 b'W'   UTF-8 b'W'
CP1252 b'\xf6'   UTF-8 b'\xc3\xb6'
CP1252 b'r'   UTF-8 b'r'
CP1252 b'l'   UTF-8 b'l'
CP1252 b'd'   UTF-8 b'd'
 
More precisely, 0xED is 0b11101101 which is a starting byte of a 3-byte code point. — Antti Haapala 7 secs ago
 
10:11 AM
Is there a way to avoid a SettingWithCopyWarning or straight up improve performance when doing regex computations on a dataframe column like:
df['column'] = df['column'].str.replace('someregexstuff','')
It suggests using .loc but how would that work with the str.replace?
 
@AnttiHaapala hmm?
 
the warnings are sometimes overzealous, they link the caveats whenever that warning comes up
in this instance, i think you're perfectly fine.
 
So nothing to be gained here?
 
df.str.replace doesn't have an inplace kwarg so I don't think so
you create a full new column and reassign it to the old one, seems straightforward enough
 
yep, you're working on a column, and assigning back to it. cs can probably correct me if im wrong, but without an inplace arg, there's really no other choice i can see here
 
10:19 AM
Alright thanks!
 
Today's programming challenge (not a puzzle for a change) is rated "super / 10":
# Implement the `super` function in pure python! (Specifically, the
# `super(class, instance)` form.)

class my_super:
    ...  # YOUR CODE HERE
here are a couple of test cases
 
format please. There is a link to formatting guide in chat in the starred links.
 
we've told them a dozen times, no use
 
and there's no indentation there
just output from a weird repl
 
10:36 AM
hey , i got a question .
if y = [Table('test1', MetaData(bind=None), Column('id', INTEGER(), table=<test1>, nullable=False, server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object at 0x00000291F730BB38>, for_update=False)), Column('name', VARCHAR(), table=<test1>, nullable=False), schema=None), Table('test2', MetaData(bind=None), Column('id2', INTEGER(), table=<test2>, nullable=False, server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object at 0x00000291F732DAC8>, for_update=False)), Column('name2', VARCHAR(length=200), table=<test2>, nullable=False), schema=N
my bad
i did make ctrl+k this time , that is the result
 
thank you
 
next time practice in the sandbox
 
what is that ?
 
its a nice place to test out how things will look in the chatrooms here
 
10:41 AM
it's also linked from the formatting guide to which you must have been pointed already
 
well it's first time honstly but it's kinda funny with all those social media stuff we still need some training to use a simple chat page.
 
it's a fickle chat page
 
@AndrasDeak bc it would be 100 % because it cuts a character in half.
 
hmm? :P
 
ok thank you for pointing that out for me
 
10:53 AM
OK, so please read the formatting guide in the pinned message now.
you can't mix text and code
 
ah ok
t = db.session.query(y[0].filter_by(id=1).first())
>>> t = db.session.query(y[0].filter_by(id=1).first())
AttributeError: 'Table' object has no attribute 'filter_by'
 
weird, I can't read
OK, so the error is clear enough. Either you shouldn't have a Table object or you shouldn't try to .filter_by it.
 
@AndrasDeak well the whole point is for me to read that table and i have finally got it after 2 days of researching and now i'm trying to figure out how to query as the regular method doesn't work ( use FLask_SQLAlchemy which requires class for every column with definition , but this method doesn't requires the definition nor creating any class which is code and make sense that the query method should change i just don't know how to do so )
i was able to read it though that is like 50% the problem being solved .
 
11:13 AM
@JRick I know nothing about SQLAlchemy but common sense would suggest query(thing).filter_by(other_thing) rather than query(thing.filter_by(other_thing)) and quick googling seems to bear this out; stackoverflow.com/a/31560897/874188
 
@tripleee thanks , i have tried that too , if u scroll up 2 few messages you would see that i have tried that first and i got a -ve result as well
 
I've been tinkering with the binary script I've posted earlier, and I'm wondering something. When I switch the encoding between UTF-8 and ANSI (in Notepad++), I see that bytes get rewritten. When I open the text file with the editor (Notepad++), the editor tells me the encoding of the file (at the bottom right, or at the Encoding menu).
How does the editor know the encoding? Does it scan all bytes and check if there are multi byte chars? If there are multi byte chars, it's UTF, if there are not, it's ANSI; something like that?
 
@tripleee he i have tried it again without .first() and it kinda worked
so that is what i wrote
t = db.session.query(y[0]).filter_by(id=1)
print(f'\n t = {t}\n')
>>t = SELECT test1.id AS test1_id, test1.name AS test1_name
FROM test1
WHERE test1.id = %(id_1)s
 
@akinuri (again, "ANSI" is not well-defined, you should tell us which actual encoding you use if it's pertinent)
@akinuri it guesses, and guesses wrong sometimes, but yeah, in broad terms, something like the heuristics you describe
 
11:21 AM
@tripleee ANSI is well-defined. It is well-defined to not mean anything related to character encodings.
 
@tripleee I was referring to the option in Notepad++ :)
 
it can't tell whether there are multi-byte chars without guessing the encoding, so it's a bit of a chicken and egg problem, but some encodings are well-defined enough that you can try and see if it fails ... other times you have to rely on statistics or pure guesswork
@AnttiHaapala well yeah exactly
 
I read that, filter function takes a function and an iterator. But, how this code works?
 
it's unfortunate that Notepad++ apparently still uses this terminology long after even Microsoft finally abandoned it as flawed
 
Suppose we have a list arr = ["a","","ad","cv","","jh"], and the code below gives the list without the empty strings.
list(filter(None,arr))
 
11:23 AM
> If function is None, return the items that are true.
 
except that some of the stuff in character encodings were standardized by ansi in 19xx including ASCII....
 
from help(filter)
 
So None is a function here?
 
no, it is a palceholder
filter does the equivalent of this:
 
and most of them were adopted by ANSI. In fact I am not sure if ANSI standardized any of the ANSI code pages
 
11:25 AM
def filter(condition, sequence):
    if condition is None:
        condition = bool
    return (item for item in sequence if condition(item))
 
@AnttiHaapala yeah, if you mean ANSI X3.4 aka ASCII then spell out which ANSI standard
@AnttiHaapala no, that's precisely why the term is deeply flawed
@AnttiHaapala they did standardize some screen control codes as well, but that's not pertinent here
 
@MisterMiyagi Ok got it, thanks :)
 
Well, this has been very educational. Gained an insight into encodings and binary.
Back to work now :)
 
@akinuri: Thank you for asking that, I learned a lot as well :)
 
11:57 AM
@Aran-Fey is my_super being a class part of the problem, or can I make it a function?
 
you can make it a function if you want
 
your puzzles/challanges are scary..
learning a lot though =)
 
they're working as intended, then :D
 
A recent question asks whether qt allows you to register a callback that fires when you don't push a button. I like this outside-the-box thinking.
 
"outside the box" what box? im a wild man
 
12:10 PM
kind of like the PLEASE TRY TO NOT COME FROM in INTERCAL
 
A button is a kind of box if you think about it
 
exactly! no buttons allowed here.
> INTERCAL is short for "Computer Language With No Readily Pronouncable Acronym".
This is going to be a fun article to read
okay i have no idea what i just read.
 
12:27 PM
If only KevinScript could be 1% as bold, clear-minded, and performant as INTERCAL.
 
Done
 
 
aw, thats kinda nice
 
I already love KS much in the way a mother loves her ugly child
 
1:08 PM
cbg
 
cbg
 
@Arne in case you aren't aware of it yet - you'll probably find the type.mro() method useful:
>>> bool.mro()
[<class 'bool'>, <class 'int'>, <class 'object'>]
 
Is there a symbol or flag that I can use in a regex pattern so it matches an empty string? For example, let's say I want a pattern that matches "A, followed by either exactly two Bs or exactly two Cs or nothing, followed by D". I could do "A(BB|CC)?D" but I'd rather do "A(BB|CC|ε)D" if possible
"A(BB|CC|.{0})D" works but doesn't communicate my intent super well
 
@Kevin the ? is the way to go but A(BB|CC|)D would do what you ask
 
Oh, I'm surprised that's legal.
But it makes sense. A|B is a legal regex pattern if A and B are legal regex patterns, and the empty string is a legal regex pattern.
This also means that |||||||||||||||||||||||||||||||||| is a legal pattern.
 
1:26 PM
So I just got my yearly eval, and apparently "David has the knowledge of computers and is always willing to assist others."
 
Wow
The knowledge of the internet
Good effort
 
@toonarmycaptain now you can help everyone restart their routers
 
@Kevin A(BB|CC|(?# an empty string is permissible here as well))D
 
A humble codesmith stumbles upon a relic known as The Knowledge, and finds himself pursued by a fanatical group that covets the prize he never asked for. Coming to a theater near you Summer 2019.
It's me, I am the fanatical group. Give me The Knowledge, toon
 
@Aran-Fey Thanks, I was aware of it. Just a little low on slacktime today =D
 
1:33 PM
A(BB|CC|(?#this part matches the empty string))D does a good job communicating my intent, certainly
I could do (?:) if I trusted the reader to be familiar with the various flavors of groups. But I'm my reader, and I don't trust me.
 
a = re.compile(r"""A         # It is the letter A
                   (         # followed by:
                       BB    # B and another B...
                     | CC    # or like C and another C
                     |       # or nothing at all
                   )         # and after these choices...
                   D         # letter D should follow
                # thats all folks!""", re.X)
 
Antti must have sampled the medicine cabinet
Adderall? :D
 
To be fully PEP08 compliant, the comments must be in iambic pentameter. In fair three point X where we lay our scene...
 
@Kevin I am from Finland. I can only speak in trochaic tetrameter
 
Ok, you get a special exemption.
 
1:44 PM
@AnttiHaapala gesundheit
 
@Arne danke schön
 
@Kevin "Iamb what iamb!"
 
I was more amused by "THE knowledge" - like, he is no muggle, he has the magick.
 
Secretly I believe that all programmers possess The Knowledge from birth and slowly gain more access to it as they grow, and that some help-seekers evidently do not possess The Knowledge, and we can only gently guide them into another profession such as carpentry. But I do not publicly disclose this belief because it makes me sound super elitist.
 
And as you gather xp you eventually become Dutch?
 
1:59 PM
I don't need more XP, I need the cheat codes that let me start rocket and car companies.
 
it helps if you're both brilliant and a ruthless sociopath
 
We don't know much about people that gain complete access to The Knowledge, because within 24 hours of their epiphany, they quietly retreat to their garage, construct a device of unfathomable complexity, and use it to vanish into a higher dimension.
 
*scribbles down "get a garage" above "unlock The Knowledge"*
5
 
might also note that given that end state, the most intelligent entity you've ever encountered has not yet gained complete access to The Knowledge
 
If you don't have a garage, a kitchen will do, but this is less preferred because in that case the device tends to smear banana smoothie over every visible surface. You don't want to leave a mess for the executor of your estate to clean up, it's rude.
 
Sam
2:13 PM
hey
i have a question
 
You've come to the right place, maybe.
 
Sam
i had to ask it here because i dont have enough rep on super user
but its sorta in the right chatroom as its for a python project
but with dns suffixes and stuff.
my computer hostname is "sam".
 
For those that don't know him, this may seem playful... joyful. But for those that do, they know this is indicative of @AndrasDeak waking up on the wrong side of the bed.
 
Sam
when i host on port 80 and enter localhost i get my php service as requested
same with 127.0.0.1
and same with sam
http://sam
but my dns suffix is home
so why doesnt http://sam.home work
 
How do you know that your dns suffix is home? Is it listed in your HOSTS file, or something similar?
 
2:20 PM
@piRSquared funny you should say that, my head's been hurting all day :(
 
@AndrasDeak sorry to hear that.
 
Guys basic questions here: I have been devving a python script on windows, I pulled it from github on a ubuntu vps with the venv folder too. What do I need to do? pip install?

Also, it needs python 3.7 wich is installed but not the default one on the system but its installed, anything I need to do?
 
we've had really yam weather these few days, today there's a warm weather front going into a cold weather front
 
Hi everyone, is anyone familiar with keras?
 
@JasminParent pulling a venv folder from git sounds like a horrible idea
the symbolic links are probably all broken
 
2:26 PM
@Arne ok I thought I needed that
 
you should probably re-create the venv
 
whats the commands you typically use?
 
virtualenv venv -p path/to/python3.7/bin/python3
 
nice thanks
 
then source venv/bin/activate
and then pip install -r requirements.txt, which is hopefully there
 
2:28 PM
ah its no there
it should have the same stuff that was in my pycharm interpreter?
 
@JasminParent what does that mean?
 
@Arne how about python_you_want -m venv?
 
do you already have an idea what you need?
 
yes just install the dependencies and use python 3.7
 
genuine question
 
2:29 PM
@AndrasDeak right, that's probably better
 
im coming from nodejs, its the first time I pull a python project on linux or that I run it out of the editor
@AndrasDeak so having my venv pulled is fine?
 
Here my issue with keras. I'm just trying to plot a representation of my neural network with the basic function plot_model from keras (keras.io/visualization), but I got an error relative to the lack of pydot library while 'import pydot' works fine> Any idea?
 
@JasminParent venv got vendored into the standard library at some point, so you can just call it directly
 
@JasminParent no
 
2:32 PM
so it doesn't get pulled, it's already there in your basic python
 
You create a 3.7 venv and install the dependencies into it
For that you install 3.7 first
 
ok ill try those brb
Yea I just installed it successfully
 
Yeah I misread that
You need to activate the env before installing stuff into it etc
 
oh yea my venv was in .gitignore so it wasnt pulled hmm
its vendored or something like you said
 
the venv shouldn't be in the repo
what Arne said is that the venv module is vendored by python, if you have python 3.7 you have the venv module
 
2:36 PM
ok
 
Sam
@Kevin it says this: ibb.co/LpCtd3S
oopsie woopsie was that wrong that i posted my ip
imma make another
whatever cmd says my connection specific dns suffix is home
 
Disclosing your IP address is about as bad as disclosing what US state you live in
 
Sam
o
but i have made a smart home and im hosting it on port 80
so you only have to enter my ip and you can turn off my lights
 
I've never heard of the term "connection-specific DNS suffix" before but from ten minutes of googling I gather that it's a property of your router and not your computer. I'm 65% sure that http requests to localhost don't even get sent to your router, so you can't expect router-specific configuration options to have an impact on it
 
Sam
oh ok thanks
is there any other suffix that i <i>can</i> enter?
 
2:50 PM
_can_, and you can edit/delete messages for 2 minutes in chat
 
Or, hmm, maybe requests to sam don't get sent to the router, but requests to sam.home do??? Because the local system knows that sam is localhost but it doesn't know what sam.home is so it sends it to the router, saying "hey can you do a dns lookup for me, thanks"
 
How do I install all dependencies if I dont have a requirements file?
one by one?
 
are the dependencies listed in setup.py?
 
@JasminParent pip install dependency_1 dependency_2 ...
Take care that the venv is activated
 
Yea I typed source
 
2:54 PM
Or else you may install them globally, which is almost never what you want
 
ok so I have many deps and no requirements .txt or setup.py file
I just want to add them to requirements in one go from pycharm
 
You can just open a new text file, call it requirements.txt, and write one dependency per line
 
@Sam I don't know what the "right" way to do it is, but one quick way of making other urls point to localhost is to put an entry in your hosts file (typically located at C:\Windows\System32\drivers\etc) that looks like 127.0.0.1 sam.home
 
Sam
Thanks kevin
 
I think pycharm recognizes that, and will offer to install them. But for pycharm to install it to the right venv you need to tell it the which one to use
You can google something like "pycharm set project interpreter"
Ok gtg, rbrb guys
 
2:59 PM
yea but I have a lot to type ;)
 
01:00 - 15:0015:00 - 00:00

« first day (3127 days earlier)      last day (1821 days later) »