« first day (3533 days earlier)      last day (1398 days later) » 
01:00 - 21:0021:00 - 23:00

1:57 AM
why are there praying hand things under downvote?
.....nevermind, found the meta. its just SE trying hard to be a social media platform
 
2:23 AM
Hi fellow Pythonistas!
Glad we have got a chat room.
 
 
4 hours later…
6:28 AM
Helllo
async def hello():
    uri = "..."
    async with websockets.connect(uri=uri, ssl=0) as websocket:
How do I pass header argument?
 
 
1 hour later…
7:43 AM
@cs95 Can we close which into which? Just post a request here with the URL, and I'll follow whatever you do.
 
@smci Sorry, I retracted that comment. Realised the post fit better in the uber dropna post, so moved it there
you could still close as dupe but we should probably not close a more specific post as a dupe of a general one.
Ah nvm, even there, we have a rows v/s columns distinction. Yea this is very annoying, just like all the different sub-qs for merging, it's all related to the same topic but extremely fragmented
 
IIUC, the only issue is that the accepted post doesn't use inplace?
 
8:03 AM
@cs95 Uhuh. Please post requests here, clearly state which one is source and which is target. Rather than long protracted discussions in the question comments itself, which I find hard to follow, and of course are always liable to disappear so there's no permanent record of who said and did what, and why; also comments aren't indexed or searchable, so we can't easily find things laster on.
 
I don't typically do much cv-plzing anymore, but I'll keep that in mind
@rogan onice, grats on making RO
 
@cs95 Thanks :)
What are you working on nowadays? You'd pretty-much switched to front-end when we last spoke, I think?
 
yes, have you heard of closure templates?
 
I haven't
 
it's a somewhat obscure open source software for templating HTML and JS. I work with the internal equiv of this
Daily languages involve java, JS, and TS amongst others. No python :-(
 
8:11 AM
but... but there's a folder in that repo called python :P
 
haha, my stack involves exactly 0 LOC of python, sadly :p
well, that's not true, there is some python component to the testing infra, but I don't work on that
As for hobby projects outside work. Not much. I'm usually outdoors when I'm not working. I considered making a python poker AI with minimax to learn the rules of poker, but I haven't gotten around to it yet
I spend diminishing amounts of time on social media these days because everything I see is either memes or depressing news
 
Or adverts
 
ugh
especially when they're targeted. Like, dude that ad makes it totally obvious
 
I'm inclined to think that they're not targeted to the likes of chat regulars. I keep getting told that Data Science is the new hot topic and I could learn it in a month. It's a good job that the £1000+ course on Udemy happens to be going for £9 this week
One of my colleagues that I've shepherded into coding actually bought it before speaking to me. In the bit I saw, they copy/pasted the documentation on strings so he's probably more familiar with them than me :(
 
8:49 AM
@roganjosh so you're saying it works? :P
 
I appear to have painted myself into a corner :P
I'll counter with mentally replacing "data science" with "strings" in every advert going forwards. "Did you know that strings are the the hot new topic? Employers are crying out for people that know strings"
 
I'm sure there's a Holy Grail joke in there with "bytes or unicode?"
 
@roganjosh do you mean character strings or byte strings? Is it a UTF-8 encoded swallow or an ASCII swallow?
 
I. Just. Don't. Know. :'( I missed the golden opportunity to buy the course and get the "edge"
Although my mental parser thinks that "painting oneself into a corner" doesn't make much sense as a phrase since I don't believe I've ever painted the floor. "Mopped oneself into a corner" seems more realistic
@MisterMiyagi my google foo failed on "text encoding laden" to find any pun to be had as a follow-up. My apologies
 
9:05 AM
It's alright. The joke also works if you don't know an answer. :P
 
just wear your helmet
 
 
2 hours later…
11:03 AM
Cbg-ning
 
Hi guys, silly questions. Sometimes I have a list of objects (classes, django models, whatever) that each have a value. Every now and then I need to find the object that has the highest/lowest value of these objects.

Normally, for a list of ints or flots, I'd of course just do `min(arr)` but this doesn't work on these objects. If I was just trying to find the lowest value, I would probably use list comprehension to get a list of the values, and then use `min`.

But when I need to actually find the object, I write something like this
 
If you have control over the class, you can implement __lt__ on it, that will make the built-in min max functions work on them.
 
A couple of things to start: please see the formatting guide for code in chat. Secondly, I do something similar but the approach is naive so I start with math.inf as a minimum
You might be able to use min([item.value for item in list_of_objects])
 
note that min takes a key function... ;)
min(objects, key=lambda obj: obj.value)
 
I was looking at key but I wasn't sure it trumped the list comprehension in this case. I'm genuinely unsure on that one
 
11:19 AM
depends on whether one wants the object or its value, I'd say
though I feel that I use disproportionally many functional patterns. might be biased.
 
:P I think it's a fair distinction
 
quick question
is there a way to simplity this list comprehension , pls?
numbers = [numbers[idx]*-1 if idx>0 else numbers[idx] for idx,val in enumerate(numbers)]
 
-abs(numbers[idx])
And I have deja vu ;)
 
Thanks for the answers guys. I didn't realize that min actually takes a key function. That's super useful. And I like the idea of math.inf
 
@AndrasDeak -abs(numbers[idx]) you mean that replace my whole list comprehension above ...?
 
11:32 AM
Mar 23 at 12:19, by Andras Deak
@Pherdindy -df['a'].abs()...
 
if idx>0 huh?
 
@AndyK just the conditional expression inside it
@MisterMiyagi ha!
 
@AndrasDeak lemme check
 
Yeah, we have to clarify that... @AndyK your code might be broken, please clarify what it should be doing before rewriting it
Did you really mean idx > 0? Flip the sign of the first item only?
I misread your code and I thought you wanted to do something else
This is why an MCVE includes expected behaviour, which you should very much know...
 
@AndrasDeak indeed code was broken
 
11:37 AM
Regardless of what you want to do, numbers[idx] is usually a bad sign. You are already iterating over the numbers, just use vals instead.
 
I have a list
I want all the terms of the list to be multiplied by -1 except the first one
 
huh...
 
As in numbers = numbers[0], *map(operator.inv, numbers[1:]) ?
 
@MisterMiyagi lol
You need some sleep, or less coffee ;)
 
I'm covariant on sleep and contravariant on coffee.
 
11:41 AM
Tea is the only answer to that
 
I'd probably use something like numbers[:1] + [-val for val in numbers[1:]]
And leave a comment
obfuscation contest: [(-1)**(i == 0) * val for i,val in numbers]
 
Why's the first number different from the rest anyway?
 
4-vectors?
 
@AndrasDeak thing is if you do that, you end up starting with the second term, the first term being left out of the new list
 
nah, he adds that
 
11:44 AM
@MisterMiyagi unlikely, but good call
 
I'm just randomly guessing things today.
@AndrasDeak (i == 0) => (not not i)
 
Thanks Andras
 
@MisterMiyagi now I want something with 1j
Maybe throw in the fft of a constant signal
 
Remember kids: The best way to let your user know they must register for your service is to tell them they are a NullPointer.
 
12:10 PM
Bonus points if your PYTHON program deadlocks after mishandling its JAVA child program.
 
GM Guys, I am trying to create a regex expression, to replace any text between SELECT & FROM, example, " SOME PRE WORD SELECT COL1, COL2, COL3 FROM TABLE ", My expected output is "SOME PRE WORD SELECT FROM TABLE"

I came up with (?<=^SELECT\b).*(?=\bFROM) but that seem to work only when the string starts with SELECT.
 
Mate, I'm in a ball pool of bonus points.
 
Ball python pool!
 
Yay!
 
@SaiAstro may I ask why we're doing this?
 
12:16 PM
@SaiAstro matching sql queries with regex sounds unusual. Just to be on the safe side: you're not building query strings with parameters manually, are you?
 
@roganjosh I am trying to extract source tables in a SQL query, due to some coding pattern, I am trying to avoid pitfalls by replacing any text between SELECT & FROM.
 
@SaiAstro so why don't you write a query that extracts the table names?
 
@AndrasDeak based on my response to Rogan, i dont think so, ( unless i am unable to underst your question )
@roganjosh long story short, I have a bunch of 200 sql scripts in python wrapper and i have extract, this is the only way
 
The long-story-short being that you have no access to the db?
 
@SaiAstro OK :)
 
12:22 PM
Yes, and basically i need to depict the flow of source table to target table, Since it has temp tables and so on.. It wont be 100% perfect I know but I am tasked to do this, ( by the way it is pointless exercise, my boss is an idiot :p )
 
Someone in this is an idiot (it could be me). What is the RDBMS you're using? You're saying you can see all the queries but you can't access the DB?
 
I only get access the code in Git, since the DB access is not permitted for my team.
 
This is nonsense. There is someone in the company that can give you the schema. I've gone through a lot of BS with different teams but you should raise this with whoever is asking you to do this
 
yea, right wish it was that easy lel
 
Trying to parse a github download to get the SQL schema is silly. I appreciate that I don't know anything about the actual situation but this is an XY problem that is easily fixed by people
 
12:35 PM
* silly and difficult
 
@SaiAstro what are your blockers?
 
the regex expression ques i posted
 
I have a feeling that we're not going to be able to move forward on the angle I expected
 
user13682510
cbg
 
cbg
Just stopping by to say Hello! Miss you guys a ton never forget the fun I had here, might be getting back into the game here soon <3 Take care all! @roganjosh Hope you are doing great!
 
12:49 PM
@vash_the_stampede cabbages :) I'm not doing too bad, thanks :) Hope you're well
 
Ha its been a wild ride, I imagine for yourself as well, I think we will be in touch again soon!
 
1:00 PM
@vash_the_stampede could you not?
 
@SaiAstro Can you give as a short MCVE so that we can see what you're doing? Just dump the query into a string variable, and show how you use re to get what you want.
It could be that you are just using the wrong re function.
 
cbg
 
Note that string/list methods should also work for this case, since you are looking for fixed words.
 
qq, whats cbg
 
recbg
 
1:12 PM
@SaiAstro - there is also a SELECT statement parser included in pyparsing's examples, which may be more robust than regexing.
 
@SaiAstro it's Salad
 
Salad is the Esperanto of Room 6.
 
well then CBG :D
string = " SOME WORD SELECT COL1, COL2 FROM TABLE1 "
Expected Output = " SOME WORD SELECT FROM TABLE1 "

Code I tried,
ouput = re.sub(r'SELECT\s(. *)\sFROM',' ', string)
@MisterMiyagi i hope that good enough info
 
Ah, we are discussing stackoverflow.com/questions/62014584/… (which was posted a couple of weeks ago, so fair game for follow up in chat)
 
If that's the case it's a fatal mistake not to post that info here
 
1:18 PM
yup, but this is completely diff
 
And the source -> target relations are something that is not gleanable from the schema, so parsing the scripts is the only recourse.
 
yep, but my current question to replace text is different from the post
 
@SaiAstro you can get almost what you want if you drop the space between . and *.
So just to get this working, you can use re.sub(r'SELECT\s.*\sFROM','SELECT FROM', string)
 
1:35 PM
@joshua don't do that
 
user13682510
.
 
Don't ping random people who aren't even here
 
1:49 PM
Is Slack down for everyone or is it just me
 
Working for me
 
Works here too
 
I can ping slack.com but not groupNameGoesHere.slack.com
 
quick question: I want to use a counter in that function, issue is I need to explicitly initiate a variable. Is there another way to do that e.g to make it less explicit (not used good=0) ?
 
@joshua I'm curious about your name change and the fact that you now have my first name, and my gravitar that is shifted upwards. I don't think gravitars can be asymmetric so this would be an odd coincidence
 
2:03 PM
@AndyK what's wrong with initiating a variable?
 
I'm tempted to propose something involving list comprehensions but I doubt it would be worth the trouble. Nothing wrong with good = 0.
 
@MisterMiyagi just asking, if there is another way instead of doing it e.g less explicitly
@Kevin Thanks Kevin.
 
2:15 PM
Sometimes I find that I'm able to refactor whatever = 0 and whatever += 1 into whatever = sum(1 for A in B if C) but that basically only works when you're not doing anything else inside the loop besides checking conditionals and incrementing whatever
 
@AndyK if you're mindful about code length, good, bad = 0, 0 can be appropriate. Helps to show that both work the same.
Avoid mixing different things in one assignment, though. count, name, conn = 0, "Kevin", socket.socket() is a recipe for unreadable code.
 
Now let's bikeshed about whether you should have a bad variable, or a total variable
 
@MisterMiyagi great one!
 
morning cbg
 
@Kevin the bad variable is just to count the wrong answer.
 
2:25 PM
@MisterMiyagi or even good = bad = 0
 
Continuing a long gone discussion about being familiar with debuggers: Today was finally a moment in which I felt using PDB was appropriate. Some app deadlocked when it failed to authenticate, blocked all signals. Not our code, only reproducible in situ, so PDB it was.
 
Tried pudb yet?
 
Sneaky little buggers just auth'ed the host right as I was through the fitfth layer of indirection. :/
Now I don't feel like intentionally breaking the app again, just to debug it. Back to not using a debugger it is for me.
@AndrasDeak I've read 1984. You won't fool me with your doublethink!
 
@AndyK Right, but you never actually use the value of bad by itself. You only use good+bad, in other words the total. So why not just track the total instead, and save yourself an addition?
 
@AndrasDeak I'll be sure to try it next year, when they switch from Python2 to Python3.
 
2:31 PM
@MisterMiyagi you might even run your own code in it. Just the tip of your dev branch, see how it feels
 
@Kevin indeed. I need to have a look
 
@SaiAstro don't do that: talk to your DBA. If they are using 2-tier for a good reason they will get mad at you trying to bypass that and stupidity will instill. If they are doing it for a less good personal reason it will be worse when you try to bypass it
 
@Kevin But that makes for more bytecode instructions! ghasp
 
Getting a schema if you have to select from a DB should be a given or easily asked for
also cbg all
 
@AndrasDeak I might just do that indeed once I find some parts that are large enough not be trivial and small enough not to be overwhelming. The ETA for that is definitely better than for our backends switching to Python3.
 
2:35 PM
@LinkBerest Exactly what I said before that message :) Circumstances are odd here. Also, cbg :)
 
@Kevin Slack was down for one of my teams this morning too
@roganjosh the "something before select" makes the DBA in me go - this is T-SQL and there's some complex WITH sales_total (employee, sales, fiscal_qtr) AS .... or other CTE - and you don't want to start messing with those type of SELECT if you don't know exactly what your doing
 
Probably settles your mind as a previous DBA but doesn't fix this issue :)
 
Yeah, which is why I said tier-2 (its either some pre-built based SELECTs, based on CTEs, or they are suppose to be using the stored procedures provided) -> meaning "if you try and go around your DBA - your going to have a bad time" ;)
note: I love when people say "we don't have access to the database" but they can run selects........
 
2:51 PM
@LinkBerest I was in the mood to pump them up for a fight but gave up
 
yeah, I caught that eventually. whelp, consider my comment just an encore - the shows over folks :P :)
 
hello
 
3:29 PM
hi anyone knows pygame?
 
In passing.
 
Hello Python
I have just installed python through Anaconda
To do so I picked up the gui installer for python 3.7
All is well, I open e.g. jupyter notebook to run some code
I then figure: hmm I forgot to install a package. I'm on macOS so I decided to go to terminal
I upgraded pip and installed my package
Going back to jupyter the package is not recognised. So I figured I would go back to terminal
I run: python --version
What does it say? Python 2.7
????/?
 
docs.python.org/3/using/… tells me that Python 2.7 comes preinstalled on Mac OS X 10.8 (and, presumably, beyond)
I'm not acquainted with Mac terminals, but I expect there's some way to tell it that you want to run 3.7's pip, not 2.7's pip
e.g. by specifying the absolute path of the 3.7 pip executable
disclaimer: I have no idea whether Macs have executables or paths.
 
@Euryris You should have a python3 executable, can you please check? python3 --version should yield the 3.7 version you just installed.
 
3:44 PM
quick question: I'm trying to create a switch case with enum. However, it seems that enum only works by calling values. What I would like is something like that :
 
Please do not use bare pip, it belongs to the system Python (the 2.7 you discovered). Fiddling with it too much can mess up your system.
 
I think I figured it out, I called the other pip using a hint described in one of the pages
on this website
 
    if val == 1:
        run_fun(1)
    elif val == 2:
       run_func(2)
   else:
      run_func(3)
 
@Euryris "python" will not be changed to something other than the system version python. Not sure where you are at with what you've configured right now, but I would suggest not changing that python symlink. I suggest getting accustomed to using virtual environments, so within that virtual environment you can then in fact use the "python" command assuring the intended version is being used.
 
@AndyK I'm not seeing an enum anywhere in there.
 
3:48 PM
Confession: I've never used Enum for a practical purpose. I'll either use strings like "widget", "sprocket", or integer constants like WIDGET=0, SPROCKET=1
 
@Kevin ew. You should give Enum a try.
 
I wish to emulate the if with an enum , the only examples I was able to find are that one:
class Season(Enum):
    SPRING = 1
    SUMMER = 2
    AUTUMN = 3
    WINTER = 3
    # WINTER = 4
I'm not even sure what to do with that...
::facepalm::
hey @idjaw
 
@AndyK Hey! :) How have you been?
 
I'm happy to use enums in statically/explicitly typed languages. But it seems less worthwhile in Python, because the big selling point of them for me is that the compiler will notice illegal values at compile time
 
@idjaw not too bad, busy; keep going with python, from knows not much to a bit more now
hbu?
 
3:51 PM
if product.widgetKind == WidgetKind.WUDGET: would fail to compile in C#, but Python happily runs the code right up until the second half of the condition
 
@Kevin You are using an IDE, right?
 
Notepad++ :-)
 
@Kevin ah, those were the times... :)
 
@AndyK Python is still my main language at work. But, I'm more heavily involved in infrastructure now and CI/CD optimizations.
 
@AndyK you would do something like if val is Season.SPRING: and so on.
 
3:53 PM
None of this is to say that enums are worthless in Python. Getting an AttributeError in that condition is still better than Python happilly executing if product.widgetKind == "wudget", potentially ruining state in a very hard-to-debug way
 
@MisterMiyagi yes but with enum
 
@MisterMiyagi If comparing Enums, use is
 
^ ty for the reminder
 
@idjaw I've started to learn Rust to gain other perspective. Slow but learning new things
 
@AndyK that is with enum, unless I'm seriously misunderstanding your setup.
 
3:54 PM
@AndyK umm... not sure what you mean about emulating it with an enum?
 
On the other hand, the argument of "enums crash on typos faster than other approaches, and that's good" isn't true for integer constants. if product.widgetKind == WUDGET crashes just as quickly.
 
@JonClements I want to have the equivalent of a case in C++ like CASE WHEN var1 = 2 DO Zyx WHEN var2 = 3 DO Uyt ELSE
 
Okay... so why an enum and not a dictionary dispatch or something?
 
And enums are still okay for keys in a dictionary dispatch, btw. I like them in my IDE since it is easier to find references to them, vs. globally searching for specific strings, plus I get autocomplete too.
 
An if-elif-else block is a perfectly cromulent substitute for switch case as long as you don't need fallthrough
 
3:58 PM
And all the examples look like dict-dispatch would work just fine.
 
(but yes, use dict dispatch over if-elif-else where practical)
 
@JonClements that's the thing. I could not find any examples.
 
@AndyK oh yes. That's gaining a lot of traction here as well. It's on my list too
 
The FAQ entry discusses both dict dispatch and if-elif-else. High fives all around for our foresight.
 
fn_map = {Season.SPRING: spring_fn,
          Season.SUMMER: summer_fn,
          etc.}
fn_to_do = fn_map[val]
fn_to_do()
 
4:01 PM
@PaulMcG got it. Thanks Paul and @JonClements
 
Fourteenth time's the charm...
 
half-serious solution: write your own domain specific language that contains the switch case semantics that you want, and embed that within your python program
 
umm... does enum have a missing/default/whatever kind of method?
(I admit - I've never used it)
 
@JonClements no. with a dict, one just uses fn_map.get(val, default_action)
 
Not sure what you want that to do. I'm pretty sure the answer is 'no'.
 
4:05 PM
Ahhh: _missing_ – a lookup function used when a value is not found; may be overridden
 
sunder names? What is this witchcraft
What's next, triunder names?
 
Probably a typo, dunder missing is a protocol
 
@idjaw it is not too difficult. I was expecting somerhing very harsh but not that much actuallly.
 
@Kevin D:
 
4:09 PM
@AndrasDeak nope, the enum specific parts are all sunder methods.
beats polluting the dunder namespace like typing does.
_missing_ behaves more like __getitem__ though. I'd not use it as a default factory.
though I vaguely remember having seen it for wraparound .
 
hmm...even with Java (at least 8+) I only find myself using Enums when I need int constants or something (which is pretty rare for me)
 
as PaulMcG said, the autocompletion, findability and refactoring in an IDE is really nice. Annotating something as an Enum also works much better for documentation than "this is an int. have fun."
 
4:28 PM
Today I learned "enums are good for reasons X, Y, and Z" and "enums have sunder names" and those two facts canceled out and I'm back where I started.
 
user13682510
@roganjosh I didn't know your first name is joshua, and I shifted my pic so not to look so much like yours.
 
oh, there are a lot of use cases for Enum (esp. in Java/C++/etc) I just don't have those cases often in my code (when I do its the same use-case in Java or Python....which I find odd as that's not often the case)
@Kevin 2 steps forward and one leap back
 
@LinkBerest They're great for state machines. I have them often in DevOps to describe the state of some resource.
 
I may not have changed my mind today, but I did increment my count of "times people told me I was wrong", which is like, the derivative of changing my mind.
5
Teaching me anything is less like a battle and more like a siege
 
oh, and when I setup annotations but I always forget that is using enum (when inhereting the pre-defined annotation class....I think its enum methods not regular - actually I'll have to look at that....stupid memory)
@MisterMiyagi definitely, I just haven't done any event programming (or non-functional, Spark based analytic stuff) in a while. When I have to build another executable dashboard I'll probably love enums again :)
actually I might try that for something, might be an interesting approach for some parallel processing I need to do
// something like
public enum State { ... blah here ... }
public enum Event { abstract State dispatch(State state); ... more code here ... }
or an interface with default...hmmm
 
4:55 PM
Pyparsing's examples include an embeddable statemachine syntax for defining states and transitions for your Python code. Uses import hooks to permit importing a my_state_model.pystate file, or use the more conventional "define the statemachine as a string, parse/transform it to Python, and then compile/exec it".
 
Voted no MCVE
 
5:19 PM
Hi guys,

I'm afraid I also have a question on hooks:

I've created a file called hook-data.py and inside put a line of hiddenimports = ['Upload', 'InTransporter', 'Functions', 'FRED', 'EmailReports', 'DownloadFullExport'] which are the names of all of the hidden imports I want to import. I've then given the directory that the file hook-data.py is in to Auto-py-to-exe, as described on Stack but unfortunatly it's still not importing the hidden imports :/
17
Q: How to properly create a pyinstaller hook, or maybe hidden import?

swdevI have two packages (say, dataread and datainspector) that were somehow not detected by PyInstaller. Because of this, the application terminates when the running application reaches the point where it needs to import modules from those packages. The easiest solution would be to copy dataread and...

Any ideas where I'm going wrong guys?
 
5:50 PM
I would just use the --hidden-import box but I think you can only put on hidden import in there not multiple unless I'm missing some syntax?
 
Just to say something in this deafening silence, please be aware that not many (any?) of us use pyinstaller. It may take a while until someone responds.
 
Thanks for the heads up MisterMiyagi. Any alternative ideas to using pyinstaller to create an exe or even just creating a stable Python enviroment for production automations?
 
sorry, I don't user pyinstaller or similar tools at all. All my work are regularly installed libraries/applications. The closest I ever get to shipping a self-contained program are executable zip files.
 
which platform? does it have to be cross-platform?...bunch of other questions (i usually just make distros for linux and windows packages for windows)
 
Windows unfortunately and it doesn't need to be cross-platform though I wish we were using Linux
I don't understand what you mean when you say you make distros for linux (like whole linux distrabution OSs e.g. Ubuntu?) and Windows packages for Windows?
My current build is just a straight .exe but I've ended up creating a function using __import__(ImportName) rather than a straight import statment to run my automations using a Run(ImportName) function
I wonder if I just put in a statment which imports the needed scripts into a "while false" stament. That statement would never be true but it would tell Pyinstaller that those modules are needed
 
6:09 PM
I mean I wrap it with another language (at least with windows) and package it (I'm playing around with this package manager now but wouldn't recommend that for your use-case). If its just a single exe - then PyInstaller is still the easiest (and probably best) option (you used to be able to "freeze" applications but the best of those options stopped being maintained)
 
@JamesMcIntyre Out of curousity: Why do you use __import__(something) to run automation? An import should usually run only the barest minimum of code, with functionality contained inside functions/classes until called.
 
Because I've never done a computer science degree and have learned Python on the job and so am still learning the best ways of doing things
 
Ah. Good answer. ;)
Consider to just import all modules, then select from the imported modules which ones to actively trigger.
That may need wrapping code that is currently at the top-level of your modules into functions.
you may want to have a look at the code formatting guide. For long code snippets, please use an external service such as gist.github.com.
 
Sorry yes, that was a long bit of code to put in the chat.

I've fixed it for now (with a hatchet job). I really apricate you guys thinking about it though.

x = 1
if x == 0:
import DownloadFullExport
import EmailReports
import FRED
import InTransporter
import Upload
 
6:24 PM
I'm afraid multiline and code formatting don't work together. Take a look at the sandbox linked in the formatting guide, you can test formatting there.
# usually, you'd do something like this:
import DownloadFullExport
import EmailReports
...
if provide_reports:
   DownloadFullExport.run()
   EmailReports.run()
 
6:35 PM
I will check that out. right now I need to go and eat food. But thanks again for all of your help! Have a good night guys (or morning if you are so geographically persuaded)
 
TIL _ refers to the last printed expression.
 
6:50 PM
@JossieCalderon In the REPL. It doesn't work in scripts.
 
7:02 PM
Thanks for clarifying that
 
7:22 PM
@joshua Thank you. It's not so much that it "looked like" my display picture; it was actually my gravatar and you just edited it a bit. I don't know what that was about but please don't try impersonate others
 
@roganjosh since reading that message, I have learned a lot by randomly browsing wikipedia. Wasn't aware gravatars are such a thing.
 
@MisterMiyagi it helps that I got a re-run and could spell it correctly (after twice using "gravitars") :P Fun fact: I was part of a government experiment on teaching kids to read and I can't spell for poop. It'd be nice if I'd come out of it with superpowers but all I get are red squiggly lines under everything I write.
 
Why would anyone edit someone else's gravatar? You can practically generate countless unused ones yourself
 
7:38 PM
@roganjosh Just start mumbling after the "being part of a government experiment" part. Wroks evrey sinlge time mumble*mumble*
 
@MisterMiyagi I'm highly trained to read those kind of messages. I ace every one of the facebook posts asking if you can read them
 
I knew you had some superpowers!
 
8:02 PM
@cs95 Good question. I don't believe that gravatar was auto-generated so I'm slightly concerned that I was being impersonated
 
user13682510
@cs95 I don't get your point at "Why would anyone edit someone else's gravatar?".
 
@roganjosh Your tab bar is giving me anxiety
 
user13682510
@Aran-Fey Tab bar?
 
the thing where your browser shows your browser tabs
 
@Aran-Fey Now you know why I asked for a favicon? :P
 
8:05 PM
@joshua Why impersonate someone else when you can impersonate yourself? Identity theft is the most sincere form of flattery
 
user13682510
what does "when you can impersonate yourself?" mean?
 
I don't think we should keep discussing this here.
Just ignore the weirdness for now
 
user13682510
@roganjosh Tie this up with: I never tried to the I word you ;)
 
Sorry? I don't follow
 
user13682510
I never tried to impersonate you
 
8:10 PM
@joshua I'm telling you as a room owner to stop acting weird. Impersonating users and posting confusing things out of the blue are annoying. You are walking a very fine line and I don't feel like cutting you much slack
Try to be a constructive member of the room or you will be removed
 
8:32 PM
@Aran-Fey I can't let this opportunity pass. Andras says he has 800+ tabs and I have no idea how that works. Now you're saying my tab bar gives you anxiety (it does me, too). This is why I occasionally have to clear up with cv-pls. What noob trick am I missing with tab management?
 
Honestly, I don't know. I don't understand why you'd ever need that many tabs. I guess maybe you multi-task too much?
 
but... stuff and things? I need those
 
¯\_(ツ)_/¯
 
The web version of Hoarders is doomed, I guess
 
It helps to be honest with yourself - those 3 tabs you have pinned "for later"? You'll never look at them. Might as well close them now, rather than in 2 weeks.
 
8:46 PM
@roganjosh 800+ tabs open at once?...on the same computer? (I think I have 120 open on about 5 computers right now and I thought I was weird)
 
I'm not the person to be asking :P I'm reaching my limit of manageability; think I'll need to purge
 
for those who wonder "why so many?!": excluding this one and a music playing one; all the others are either references I keep needing to re-look at, running some dashboard I keep needing to recheck, or being used to search for additional resources I found while reading one of the other tabs (mostly from opening a page from the references of the papers I'm reading and still left the reference paper opened)
esp. with those papers which so bork my mind that I end up using three of the papers it referenced to understand what it is doing at all
 
@Aran-Fey I only pin important ones :P
a decimation is way past due...
 
folders helped me reduce the "for later" part of my tabs to zero. Now I got "haystack", "good talks", and "misc", and only have 10 or so ones open I am actively using
 
meanwhile, I need to restart firefox every time I visit reddit. I think I need a RAM upgrade
 
8:53 PM
....I could probably close half of them (I bookmarked the important ones) but I'm busy. I'll get to it eventually, I swear :P ;) (Its not like I wake up and realize I still left up everything and fell asleep in my chair.... that often)
 
woah, stackoverflow got emoji reactions now
is that new? I haven't been very active in a while
 
there's a meta they just started on it yesterday. no its not new - it was on Teams but not the public stack and nobody knew it was coming to public - yes, I've found 3 ways to turn it off with custom scripts or adblockers (the user script is in the meta - created by Samuel Liew as one would expect)
 
I think PM2 recently mentioned a new "hands" button as well, so I guess it's pretty new
 
01:00 - 21:0021:00 - 23:00

« first day (3533 days earlier)      last day (1398 days later) »