« first day (3595 days earlier)      last day (1354 days later) » 
01:00 - 21:0022:00 - 00:00

user13415013
1:59 AM
oh yes sorry, I mentioned i talked earlier before. but Is it pointless?
 
2:19 AM
Hello. I'm still somewhat of a beginner in python, but decided to join a community of programmers.
I have a question about learning another programming language. As a sophomore in high school, I have been (and still am) learning python, doing exercises, watching videos, etc. One video I watched in the summer gave four tips on better programming. One of the four tips was "stick with one language." I fully understand why learning two or more languages can make you focus more on syntax (rather than logic). However, in one of my classes (AP Computer Science A), is going to go over Java.
 
2:57 AM
@Leonardo - there must be more context to that tip. Just by itself, I would have to disagree. Every language has tradeoffs and compromises, there is no perfect programming language. Learning more than one will give you more insights about the features of specific languages. In addition, most projects that I've worked on used a blend of languages - my current job is heavy in Python, but the overall project also includes C, Javascript, bash, and SQL, and having in worked in multiple languages,
I understand and appreciate when one is appropriate over the other.
To a certain extent, learning multiple languages makes you more adept at... learning languages. This is true in programming languages just as it is in spoken languages.
 
3:16 AM
@nerd I have to agree with Andras. It is difficult to understand what you want to accomplish with this line of discussion. In fact, there are many concepts in Python that do port directly to C++ (such as iterators, classes, function pointers) - they just look different. The important thing is to learn the language features, instead of complaining that different languages look different.
 
3:28 AM
@Leonardo I'd add to say rather the opposite, learning how to solve similar problems in multiple languages reveals the multiple ways a problem can be solved, and when comparing often seems to force you to more deeply understand the problem and varied solutions...making you focus more on logic (at least when you get past the syntax.
The advice to start with just one language and learning it well is to help get that logic and understanding in a language, of foundational concepts in general, getting past syntax in that language to focus on those higher concepts. Kinda like it's hard to write complex literature in a language you barely know...but possibly easier in a second language (than a first that you don't know well) because you can port the concepts (logic) you learnt the first language if you've learnt that deeply?
 
@Leonardo there's not set rule. you gotta go with what feels good to you and your learning. More important than number of languages is how much you really wish to learn. Like any other language, you gotta know the syntax, but you will really learn by practice. Doing a project is a great way to achieve that, if you're motivated enough. The beggining is always harder, but keep strong. Good luck ;)
 
 
2 hours later…
5:11 AM
@nerd There are tons that are less C'Ish and more Python'Ish. Cython is the obvious example, being a syntactical superset of Python. Boo is explicitly Python-like in syntax. Nim has taken its fair share from Python, but deviated since. Julia was explicitly marketed as having the ease of Python (though it derives from many languages). Rust and Golang are each liked by some Python'istas and disliked by others.
 
 
1 hour later…
user13415013
6:20 AM
thanks for information, I found julia which seems great.
 
Take note that if your criteria is performance, there's a rabbit hole to be aware of.
 
7:15 AM
wow 2 days wasted because super().__init__() was called at the end of the function and not at the beginning, bad documentation. Well I guess I learned it always needs to be called at the beginning
 
7:25 AM
erm, it doesn't.
depends purely on the use-case.
 
(?=) - postive lookahead
(?<=) - postive lookbehind
(?!=) - negative lookahead
(?<!) - negative lookbehind
 
@Leonardo You should stick with one language while learning the very basics. If you try to learn multiple languages without having mastered the fundamentals of programming (variables, loops, conditionals, etc.), then you'll end up confused about the syntax and missing the forest for the trees. Once you have mastered the basics and feel comfortable writing very simple programs in one language, you can and should gradually start learning other languages.
 
@MisterMiyagi my more senior colleague said that, but then I guess that's wrong :P
 
cbg, can anyone explain how you remember the syntax for that in the re module?
 
As others have said, the more languages you learn, the easier it'll be to learn new languages, and the more you'll see your skills improve overall.
 
7:29 AM
@python_learner There's this thing called "documentation". Unless you use regex 24/7, you should not memorise it by heart. If you do use regex 24/7, you should look for something else to do.
6
 
Why is ! sign placed at different positions? shouldn't it be more like adding ! at the beginning? sans ! is positive
 
Using regex 8/5 is usually enough to memorize the syntax. But don't memorize things deliberately; that's just a waste of time.
Print yourself out a cheat sheet if necessary.
 
I did get it from the docs, I am not sure how they came up with that syntax, to me it felt like adding a ! at the beginning of the positive versions may seem easier
 
Pro tip: If you want to learn regex, learn PERL. Twice the fun, and it all makes sense afterwards.
 
I thought perl was not in use anymore, mainstream at least, correct me
 
7:34 AM
That seems a silly reason to learn Perl...
 
I took that as being tongue in cheek @Cody :)
 
You can never tell these days where people's tongues are.
 
@python_learner I wish that were true...
@CodyGray I have yet to find a good reason to learn Perl... :P
Disclaimer: Do not learn PERL just because you want to learn regex.
 
Even if learning regex was a reason to lern Perl, it wouldn't be a good reason.
 
 
2 hours later…
10:12 AM
Cool kids learn Raku
The mascot looks very family-friendly
 
10:24 AM
my Rat $r. Definitely ratical.
FWIW, Larry Wall has some very insightful publications about programming language design. The man knows his linguistics.
Perl has a lot of language design considerations poured into it, most of which sadly gets lost when written as a random gibberish of sigils.
 
10:39 AM
> However, static typing remains optional, so programmers can do most things without any explicit typing at all:
[... shows example about weak typing]
at least I think so
That looks a lot like JS behaviour
 
11:23 AM
Hey @AndrasDeak . It's been a while.
 
hello
 
How's life in your part of the world?
 
Same old, same old
 
Cool.
@AndrasDeak This is embarrassing, but I've been banned from asking questions on stack overflow. I've tried not to rely on stack overflow (anymore) but I still need help understanding some things.
How can I get Stack Overflow to allows me to post again?
 
I'm 99.99% sure the "we no longer accept questions from your account" message includes a link that answers that question
 
11:37 AM
@MyWrathAcademia what Aran said. There's a link to the meta that tells you what you can do.
some of the messages at chat.stackoverflow.com/… link to earlier discussions of the same question
 
53
Q: What can I do when getting “We are no longer accepting questions/answers from this account”?

Robert HarveyDo not repost the question you were about to ask until you have READ EVERYTHING WE ARE ABOUT TO TELL YOU. While trying to ask a question, one could get: We are no longer accepting questions from this account. See the Help Center to learn more. Likewise, for answers: We are no longer acceptin...

 
@Aran-Fey @AndrasDeak thanks. But what if I make changes to my question and none of the people who downvoted me still don't remove their downvotes because my question is old so they don't go back to it?
 
Post better questions every 6 months, I guess
 
Damn, this site can be harsh sometimes. 6 months is a long time.
 
I'm told you get warnings before you get a proper question ban kick in, so it's not exactly out of the blue
 
11:54 AM
Sometimes I think I'm getting downvotes not because my question is particularly bad but because well it's just very easy to hit downvote for some arbitrary reason.
They might not like your user name or something.
@AndrasDeak I got that warning a long time ago, but I've not gotten it for months. It honestly surprised the hell out of me when I got banned.
 
@MyWrathAcademia You probably don't get downvotes for your username but you can get half-deserved or even random downvotes
 
The last one was the 29th July... I wouldn't quite call that "a long time ago" @MyWrathAcademia
 
but I'm certain practically all of those relate to your post, not to your name or avatar or other fluff
 
@JonClements Where did you see that? Can you show me please?
@AndrasDeak I think what I'll start doing is whenever I get back posting permission I will ask someone on chat to review my question before I post it. I'm having PTSD now lol.
 
@MyWrathAcademia that can work
 
11:58 AM
@MyWrathAcademia it's mod only info I think... so there's not something I can "show you" per se... but the last time you would have received a warning would have been when posting this
 
just don't do it too often because patience is mostly a non-renewable resource
 
@MyWrathAcademia You may want to spend some time answering questions as well. This will give you a feel of what works and doesn't work for the volunteers taking care of answering questions. It is also a great way to learn the ropes and advanced topics.
 
@MisterMiyagi it will probably also help with the question ban
 
@AndrasDeak I'll keep that in mind. Chat is the only safe place on stack overflow :).
 
as long as said patience holds out :P
 
12:03 PM
@MisterMiyagi Thanks. I'll look for questions I can answer but so far I haven't found any. I don't have enough experience yet, and 99% of questions seem to need knowledge of frameworks, or stuff that is very advanced.
I can answer some questions on other StackExchange sites though, could I get back my ability to post if I gain some reputation on other StackExchange sites?
 
That seems like a good opportunity to read up on these things.
 
@MyWrathAcademia no
 
@JonClements If I delete a question that received downvotes, then that should recoup those lost reputation, yes or no?
 
@AndrasDeak Fittingly enough, just one hour before that quote someone asked why the yam (...) -> int is allowed to return a string.
 
a typing system as powerful as that of python
Good to see other languages picking up good habits from us :) One day they might even adopt our packaging and asspressions
 
12:09 PM
@MyWrathAcademia yes... But it won't affect the question ban...
 
some of those comments... *sigh*
"Check the rear spoiler" (the car doesn't have a rear spoiler)
 
@CodyGray Thanks for the wisdom. I do know most fundamentals in python and can write many different basic exercises using classes, functions, graphics, etc. While I do have more to learn in python, I'll make sure to learn basic Java while learning in depth python.
 
@AndrasDeak Well, OP insists it's enough for us to look at the tires. Obviously, since these slowed down the most.
 
@MisterMiyagi It was also cool that he would fairly regularly show up on perlmonks and answer people's questions or just chat
 
12:21 PM
@Leonardo Have you considered looking at some programming theory? Lots of things we just take for granted make a lot more sense with a rigorous, general theory framework. Types and type systems are one big blind spot for many Python users.
 
So I tried to ask a question on Chat, and I got told this:
in C#, 2 mins ago, by Hozuki
... I suggest making a SO post.
I am doomed lol.
 
Heh, I always have students comment on Python being a simple language so that's why we teach it first then Java/C++. I always take that as a compliment (they all take it back in Data Engineering when we start Abstracts in Python)
 
@MyWrathAcademia chat has less visibility and depending on the room rules, it might be better to just make a SO post first.
 
@shad0w_wa1k3r You've missed a good chunk of the transcript - they are question-banned :)
 
oops :|
 
12:28 PM
Random wisdom of the day: Python ints are regular numbers in base 4294967296.
^CPython
 
Random wisdom of the day: it's hard to write code (or equations) on your phone
 
@LinkBerest Stylus?
 
I have an ssh client on my phone but I only use it when I'm really desperate
 
@MyWrathAcademia The hard part is finding all the symbols in a standard phone keyboard so stylus wouldn't help much there
 
I still haven't found the markdown code backticks on my iOS keyboard. :/
 
12:41 PM
@AndrasDeak yeah, I wasn't near a computer and thought "ehh, it shouldn't be too hard to reply to a co-worker" o.o
 
@MisterMiyagi hacker's keyboard is great
I can even write Яцssiaи with it
 
@MisterMiyagi numbers keypad then press & hold apostrophe until it changes to backtick
 
@MisterMiyagi I'll definitely consider looking at some programming theory. Where and when do I start? Do you recommend any you tube courses?
 
@MisterMiyagi Speaking of touch screen keyboards. Does anyone have very poor accuracy when typing on their phone? I find myself constantly hitting the wrong keys when using googles gboard or microsoft's swift key, and I don't have big fingers either.
It's where I think touch screen keyboards pale in comparison to physical keyboards.
 
I can't imagine doing any meaningful writing on a touch screen, would be brutal
 
1:01 PM
@MyWrathAcademia what you're missing is tactile feedback. They are working on it...
 
1:18 PM
@Leonardo I'm not much much of a tube course person. There was an incredibly good PhD thesis on subtype inference, which included an exceptionally easy-to-read intro to types. Sadly, I cannot find it anymore – I suspect it is this one but that's not public anymore.
 
@AndrasDeak Yes, that would be great. You learn whats good or bad practice when feedback is given.
@Dodge You've never written an email, or created a post using a mobile phone?
 
@MyWrathAcademia I'm talking about touchpads
 
what is ML in that context?
 
@MyWrathAcademia well it is brutal
 
@MyWrathAcademia yes, that is why I am saying that. It's always problematic and I think posts and phone generated emails do not fall into the "meaningful writing" category.
 
1:24 PM
if I have a python package that wants to read and write from a file, how do I decide where to create that file across operating systems? I just added it to manifest but apparently that's very bad for linux and in general because that would require a global install to use sudo.
on windows it just works™ but on linux it I think I should use .local/share/ and on macOS I'm not sure what's the standard way there
 
@AndrasDeak Oops that went right over my head. It's the PTSD, still having flash backs, haha.
@AndrasDeak Isn't tactile feedback vibration?
@AndrasDeak Try writing one without autocorrect. Such a pain.
 
@aadibajpai Are you looking for data files (e.g. a spash screen image) or configuration files (e.g. save games)?
 
@MisterMiyagi not exactly config, just a txt file to keep track of unsupported stuff. it's written to and from during program execution
 
So a temporary file?
 
AFAIK appdirs is pretty good for application specific storage that survives between program runs.
 
1:35 PM
not exactly temp bc it persists across program runs
sweet I'll check that out
 
1:47 PM
@aadibajpai Why don't you bundle that text file with the program?
 
Uh, I found what ML is, ML sounds cool
 
@aadibajpai that way it doesn't really matter what operating system your program runs on, as long as you have the relative path to your program.
 
@MyWrathAcademia I have, but apparently that's not a very good approach to it because then to access that file on linux if the package is globally installed, the person will have to use sudo
 
@aadibajpai I see, can you install the package locally instead?
 
@aadibajpai if the file is intended to be useable by everybody, the program should set the permissions as such. That means other persons do not need sudo.
 
1:59 PM
@MyWrathAcademia yes, but I can't count on users to be reading the fine print tbh
 
@MisterMiyagi This is correct. If I recall correctly, file/directory permissions can be set for a user, group and others. Just add to the group whoever you want to have execute access to your program.
 
@MisterMiyagi it's for the program only
also I think bundling it with the program would make it harder if I would want to create binaries for different distros for it which I have been looking into, so installing in local app directory seems to be a better idea
 
@aadibajpai If you want to create different binaries for different distros, is it not just a case of passing the appropriate flag to whatever command you are using to build the executable file?
 
Imagine living in a world where programs don't always have write permission for the directory they're installed in
...oh wait
 
@MyWrathAcademia no, just a bump where the buttons are. It would fix 95% of mistyping, but it's difficult to create touchscreens with arbitrary feedback fields. I've read about development for a fixed keyboard pattern, which in itself is non-trivial.
@MyWrathAcademia I don't use autocorrect
I guess "tactile feedback" is a broad term
 
2:08 PM
@PedroSpinola Like I was recommending above, look at some of the videos of talks from SciPy conference on how to rewrite a computation in a matrix formulation and improve its performance. Search for those.
 
Cabbage
what does this mean?
from .foo import Foo
the '.' in front of the import , I am going through python documentation and not getting this part
 
It's a relative import. Basically .foo refers to the foo module in the same directory as the file that contains the import
 
the weird thing is that , I was running pytest on a .py file and that has a import of another file in the same directory , pytest kept failing unless I added that '.' in one of the imports. However, executing the normal .py file works regardless of that '.' , only pytest is demanding it to be there.
all files are in the same directory , the imported file , the base file and the test file
 
It's possible that if you write a standalone .py file and import your module into it you'll see the same error
but pytest does all sorts of magic so it might indeed be more specific to pytest or what it does
 
hmm.. does everyone write unit tests?
total pain
 
2:22 PM
@AndrasDeak I'll have to look into this. Would save me a lot of frustration.
 
@Anarach a lot of people don't, but everyone should ;)
@MyWrathAcademia if that wasn't obvious from what I said, it's probably not existing technology
 
A total pain, and yet totally worth it. Welcome to the wonderful world of programming
 
I dont know what to write at all lol.. scratching my head
I have a file which does CRUD thats it
 
@AndrasDeak Interesting. It's good to know there are other people that also don't use autocorrect.
 
@Anarach It's a relative import.
 
2:23 PM
@AndrasDeak what's your reason for not using autocorrect if you don't mind me asking?
 
@MisterMiyagi I would refer you to my next statement , if you can explain pytest behaviour
 
@MyWrathAcademia I spell better than the predictive text when they started being a thing in cellphones, and I've hated such features ever since. I insist on my own typing mistakes.
 
@Anarach The TLDR is: Don't attempt to treat the same file as a top-level module and sub module.
Do you have an __init__.py in the directory of the normal .py file?
 
Andras makes less mistakes on his phone than I do on an actual keyboard
 
@MisterMiyagi Yes I do
 
2:26 PM
@Anarach Well, then you have told the world that this thing is a package, including sub-modules. pytest acts accordingly.
 
@MisterMiyagi All the files are on the same level, B is importing A and I have written a test in C to test B
 
@Aran-Fey to be fair I mistype a lot, I just usually read what I write before sending :P
 
@Anarach That's nice.
 
@MisterMiyagi Sarcasm? :-P
 
@AndrasDeak Cool. For me I felt autocorrect was encouraging bad habits. After high school you don't really get to practice spelling, foregoing autocorrect allows one to remember how to spell.
 
2:28 PM
@Anarach Just a pinch. ;)
Seriously now, if you have an __init__.py file, treat that folder as a package.
It doesn't matter that you could still execute each file separately.
 
@MisterMiyagi so i REMOVED THE init and it worked.
 
lol
 
moments like these make me feel I should quit programming , basic error
 
broke off the rear-view mirror
 
No, that's spontaneous symmetry breaking at work.
Basically, that directory was captured in a weird state between being a package and not being a package.
 
2:31 PM
@MyWrathAcademia I am pretty sure I tried and it didn't work because of this, will look into it again
 
Erm, Britney Spears has a song on that...
 
@MisterMiyagi and now it's a namespace package?
 
even so, it doesn't seem like a good practice to bundle data files with the program itself
also appdirs looks so oddly simple I'm just thinking of yeeting the function I need
 
@AndrasDeak Honestly, I'm practically convinced by now that namespace packages are a practical joke. "Let's add this nifty feature but break all tooling for it."
It's like those "open here" prints on packaging when it most definitely does not open here.
 
it was an honest question
I've only heard namespace packages being mentioned when they happened by accident, breaking something
 
2:33 PM
@aadibajpai Is the only reason you think it is not good practice because of access permissions?
 
@AndrasDeak Every directory without __init__.py is a namespace package, so yes, it now is one.
 
heh
 
But, you know, tools completely ignoring namespace packages and such...
 
3:00 PM
@MyWrathAcademia that and the fact that I've never seen programs store data files along with the source once I started looking
 
@Dodge Except that you can't simulate the whole universe on anything less complicated than the whole universe, so the "model everything" approach only works in other dimensions.
@PM2Ring Thanks for the table. We are indeed now running 6.2.2 (having upgraded from 3.1.7 or something equally antiquated).
 
@aadibajpai Okay, so where did you end up saving that file to?
 
@holdenweb Sure you can, it'll just take a while
 
there's an xkcd about that too...
 
@Aran-Fey Ah, the old memory/time tradeoff :-)
 
3:16 PM
@MyWrathAcademia AppData in windows, ~/.local/share/swaglyrics in linux and "Library/Application Support" for macOS
 
@holdenweb Is that true? You can model a bullet's trajectory with a pencil and paper. I feel like we are now in the realm of things that can neither be proven nor disproven, which is where we sort of started.
 
This is a farfetched question which would require a LOT of code to copy over.... In Tkinter and matplotlib 2.1.2
I am plotting sets of data. I have radio buttons to switch between different variables. I am adding secondary axes with ax1.twiny() and ax1.twinx(). For the first canvas.draw() it looks GREAT, whatever variable you choose plots as wanted. When you switch The first axes (x and y) clear and plot again correctly. The second sets x and y overlap and never cleared. I have followed my variables and those do clear at the same place my originals do. I use ax1.clear() and ax2.clear() ay2.
 
I'm happy there. But I suspect there is an information-theoretic corollary to Gödel's Theorem that would support my assertion, if only I were smart enough. You can only model that bullet approximately with pencil and paper.
 
We don't have an exact description of reality but I don't know if that's a technical issue or a fundamental one
 
First, prove it exists - then we're down to solipsism.
 
3:25 PM
@Pandasncode I imagine you could reproduce the problem without a GUI, just calling functions that should do the clearing. Could you try doing that for an MCVE?
 
@AndrasDeak Either that or while trying to formulate the MCVE you will find you are unable to, and discover your error. That sometimes happens too ...
 
Oh that's so much code. lol.
 
@Pandasncode my point is to get an MCVE that isn't so much code.
creating twin axes with some dummy data should be a dozen lines or so
question is whether the problem prevails when you remove tkinter from the picture
@Pandasncode also hold on: what do you mean you're creating a secondary axes "with "ax1.twiny() and ax1.twinx()"? How many axes are we talking about?
either twinx() or twiny() would give you a secondary axes; calling both will give you 3 axes altogether
 
I have to create a parallel x and y axis with different scales than the original axes. Which works with whatever first variable is chosen. It's the clearing and redrawing that is having issues.
So there is a different scale on every side of the plot
 
that doesn't answer my question at all
 
3:33 PM
Okay
 
specifically, "How many axes are we talking about?"
 
Total 4. Having issues with 2
 
All in the same figure?
 
And it's just the redrawing of the 2 that I am having an issue with.
Yes
 
So ax1 is your main axes which works fine. Presumably ax2 and ay2 are the two twin axes which misbehave, and there's a fourth one which works?
 
3:36 PM
@holdenweb The weird thing about solipsism (from my 2 minute study) would be when one encounters beings of greater intelligence. This would indicate that my mind is technically capable of being much smarter but only allows that to manifest when it is generating the perception that these other, more intelligent minds actually exist.
 
Yes.
 
OK, and then as you said ax2 = ax1.twinx() and ay2 = ax1.twiny() I guess. How are you creating the fourth working axes?
Or is that an independent subplot?
 
That axis is created when the "main" Plot is. That really might be the issue. I am creating a plot that includes information for what is plotted and the labels for x and y. But I never specify in that what the "scales" are for x1 and y1.
plotObj.plot(variable, z , label) happens
then:
plotObj.set_sitle(title) and all the labels and xlim ect ect.
I understand where I messed up
 
@Dodge I'll let you know if I ever do ... 😉
 
@Pandasncode OK, I don't think I do, but it's more important that you do ;)
 
3:43 PM
Ducks help the world go round
This was code I inherited and have had to add features too... So I learn a new thing that the dude did before me every time.
 
btw interesting thing, the code from appdirs I need has remained unchanged for 10 years. Makes me wonder if my own stuff will last that long unchanged 🤔
 
He never plotted x1 or a y1
 
also I don't think supporting windows 7 is important lol
 
He just plotted it as an entire object. and it's a stacked object with another subplot that tikinter just draws.
That's why it never clears. I'm drawing them outside of that obj.
sprouts
 
I see... sounds like asking for trouble
 
3:47 PM
I just had to implement an emergency email sender, and I used Postman to verify the correct Mailgun parameters. Both great tools, both with a highly-usable free layer.
 
This entire project being done in tkinter has been asking for trouble
tkinter with matplotlib 2.1.2.
 
Sounds like it might be a bit late to survey alternative technologies, though ...
 
yup
 
Hi guys,

I know I've asked on this forum before and this isn't most of you guys area of experteise but is there any chance that anyone could help me with my run fuction for the automatic running of different .py files with different (possibly conflicting) depenencies?
This is the function that works but then when you then try to use the run fuction in the sam script straight after it's not picking up the dependencies for the second project
def Run(ImportName):
    import sys
    sys.path.append(ImportName + "Source")
    sys.path.append(ImportName + "Source/env/Lib/site-packages")
    import os.path
    if os.path.exists(ImportName + "Source/" + ImportName + ".exe"):
        import subprocess
        subprocess.call([ImportName + "Source/" + ImportName + ".exe"])
    else:
        __import__(ImportName)
 
The run function being somehow different from the Run function?
 
3:53 PM
You want to run or import these scripts? If it's about running, why not just install them in 2 separate virtualenvs?
 
The usual answer to such problems is virtual environments. You could go further and distribute your Python functionality as snaps.
However, you may simply not know about the runpy module. It's hard to tell from the question.
I'll be surprised if this doesn't help: docs.python.org/3/library/runpy.html
But the question of different programs/module using different versions just cries out for proper namespace separation, and runpy does everything in the same process, so multiple versions of the same package cannot co-exist.
 
@holdenweb I'm not sure what you mean between the difference between a run and Run function? Is there an inbuilt run function in Python?

@Aran-Fey I'm using the import function to "run" the .py file in question so as to que up several projects (.py files) to run one after anouter, I've got a try etc to capture any failures and sucesses. They are kind of in their own enveroments and this function is tapping into the dependencies of each virtual env.

This functions is working great to run on .py file and is picking up all of the correct dependencies and then if you shedule anouther .py file
 
Why not just run each different script as a subprocess?
 
@holdenweb but how would I tell each subprocess which virtal envrioment to use?
 
@JamesMcIntyre I was simply commenting on the discrepancy between your code and your description, which is rarely helpful.
@JamesMcIntyre By the path of the file you execute. If you build a Python module to install as a "console entry point" that creates an executable in the virtualenv's bin directory. Create each tool as an entry point in a suitable virtual environment. Assuming there were no name clashes, you could add all the virtualenv /bin directories to your path, but that would be a bit ugly.
 
4:07 PM
Appologies, I've just double checked on the VM and this is the most recent version, it should only change the level at which it's working on:
def Run(ImportName):
    import sys
    import os
    CL = os.getcwd()
    os.chdir(ImportName + "Source")
    sys.path.append("")
    sys.path.append("env/Lib/site-packages")
    import os.path
    if os.path.exists(ImportName + ".exe"):
        import subprocess
        subprocess.call([ImportName + ".exe"])
    else:
        __import__(ImportName)

    os.chdir(CL)
@holdenweb I'm afraid I learned Python on the job for the past year and a half and I don't undertsand what you're suggesting :/
 
@JamesMcIntyre my memory may be mistaken, but I'm decently sure that is exactly the issue we warned about last time.
 
I'm afraid @MisterMiyagi if you warned me about this last time, I did not understand your warning :/

Basically it works for each time sechule but as soon as there is more than one in the que it doesn't work.

I did try all of the methods you guys were suggesting but cound't get any of them to work
 
At a glance, the problem is that you append search paths but never remove them. Meaning any previously run script's dependencies take precedence.
 
@JamesMcIntyre Are you familiar with virtual environments?
 
Either way, there wouldn't just happen to be name conflicts, e.g. the name of the files to run being the same, or any of their direct or indirect dependencies being named the same?
Ah, here it is. Is this related to your idea of stitching together virtual environments?
 
4:20 PM
@MisterMiyagi so perhaps adding sys.path.remove("") and sys.path.remove("env/Lib/site-packages") would fix the issue?

@holdenweb I recently learned how to create them and install dependencies inside them and do the above but that's about the extent of my virtual env knolage

@MisterMiyagi I'm going to check out your link now, thanks
@MisterMiyagi it's kind of related as this is on the main challenges I experience in Python and that was me trying to solve it. I've not entirly given up on that project but it's on hold and I'm using the more traditonal virtual enviroments you guys suggest for the time being as you guys suggested. I'm hoping you can see this in my code?
 
In that case, I'm really not seeing why you don't just literally execute each script. subprocess or even just a shell/batch script would be more appropriate.
It seems like you are trying to do something that Python is already doing for you, which is not a good idea if you don't even know what Python is already doing for you.
 
@MisterMiyagi how would I tell each subprocess how to find it's specific virtual env's dependencies?
 
Either you activate the virtual env, or you use its executable.
E.g. /path/to/my/venv/bin/python /path/of/my/script.py
 
@MisterMiyagi previously I tried the executable method which didn't work for me. How would you activate the environment inside Python?
 
Well you've taken the first step along the way. If you create a new environment and activate it, then do (say) pip install grip you will see that something called grip appears in the /bin directory of your virtualenv. You will further see that it's shebang (#!) line specifies the exact path of the python executable.
 
4:27 PM
If you have properly installed scripts, and installed them to the appropriate virtual environment, you can execute the script directly. E.g. /path/to/my/venv/bin/script.py
 
That is the so-called "console entry point" installed as a part of the grip module/package.
 
@holdenweb I don't understand, would this not have to be done in the consile rather than in Python? or are you suggesting sending these commands to the command line from Python?

@MisterMiyagi I'm not sure how to "install" scripts to have their own speificed env? :/
 
Because it contains the path of the correct Python executable, you can take copies of that script and drop them in other directories on your path and they will still execute correctly (as long as the virtualenv continues to exist ...).
Hence my suggestion you write your tools as pi-installable entry points. Don't know whether this helps, but none of it would seem to be beyond your capabilities.
Running the Python interpreter from a virtualenv automatically puts that env's site-packages on the PYTHONPATH (sys.path) for the duration of execution. Hence the dependencies installed in that env will be available to the script.
 
@JamesMcIntyre Just a meta-reply (holdenweb seems better at explaining than me): Please use separate messages to reply to separate people. It breaks the flow of chat when one cannot reply to specific content, only an entire chunk of semi-related content.
 
Hence, as long as the kernel's execution mechanism locates (a copy of) a console entry point executable (which, btw, pip creates automatically for you when you install into the env) that (Python) executable will locate dependencies in the virtualenv's site-packages.
 
4:35 PM
I'm tempted to give MisterMiyagi's idea of sys.path.remove("") and sys.path.remove("env/Lib/site-packages"). I have to admit that I'm not really understaning the other suggestions. I'm just really fustrated as I've been trying to get this to fully work for months. I feel like the long term solution is to fully modulerise each dependency so they can be used by multiple projects without interfering with each other
 
The long term solution is not to fight the existing solutions.
 
I think that's about as much as I can usefully say right now, as it's a chunk of information to absorb. amir.rachum.com/blog/2017/07/28/python-entry-points takes a fairly light-hearted approach, and is quite readable.
 
This is not a simple issue that a single person can reinvent and improve on in a backwards compatible fashion in any realistic time frame.
 
Oh, and just, as Steve Jobs would have said, one more thing: tools that use non-conflicting dependencies can share the same virtualenv.
 
@holdenweb the problem is that I'm not sure what is going to conflic and what is not. Orignally I just used the one env and that got me into long term issues.
 
4:39 PM
@MisterMiyagi I'd underline that. The solutions available, while not perfect, are the result of a large amount of capable and detailed software engineering design.
 
Thank you guys so much btw, I'm dyslexic and so that really doesn't help all of this but you guys have been so generous and amazing!
 
If disk space is no problem (and it shouldn't be, at this level) just give each one it's own virtualenv!
 
@holdenweb aye, that's what I'm doing at the moment. it just affect effiency and transfer times
 
You can copy all the executables into a single directory, which you can then add to your path, and you have an Uncle Robert!
Got to rhubarb, people. Later ...
Once everything works you can analyse the virtualenvs for conflicts and optimise your distribution. Definitely going now ...
 
Thanks very much @holdenweb!
Thanks very much @MisterMiyagi!
 
5:37 PM
I spent entirely too long assuming that "what's the over/under on [thing]?" was the same as "what are the odds of [thing] happening?" when it actually means "given that [thing] can be assessed numerically, what value is the midpoint where 50% of outcomes are less than it, and 50% are greater?"
For example, the over/under on "spiders I will eat in my sleep tonight" is 4 spiders.
 
cbg
Dropping in to vent slightly at very useful bots that are great with 50% of their suggestions, but difficult/impossible to configure to silence the other 50%.
 
It be like that sometimes
 
Read: I love that Sourcery is suggesting places I could use enumerate, but not so much where it suggests inlining assigned expressions that are assigned to a variable so I can access it later in the test to verify the expression's value.
Or telling me to put a try/except around a next(iterable) that I want to kick an error if it runs out of items etc because it's part of a test.
/rant
 
6:04 PM
@Kevin when did you move to Australia?
 
Americans eat far more spiders in their sleep than Australians, which explains why Australia has so many more spiders. They're missing an important link in the food chain.
 
hello, question on classification machine learning models. when building KNN or decisiontrees, theres an optimal K value/max_depth that leads to highest accuracy scores. whenever i change the train_test_split(random_state=) this optimal K value can change
am i suppsoed to refit a model on a test dataset each time? I thought once i had an optimal model from the training set i use that one (with the specified K value)
 
@Kevin In Australia spiders are much larger, and are more of a main course than nighttime snack.
 
tldr: different train_test_splits on dataset can lead to varying optimal K values for KNN classifier or decision trees?
 
6:31 PM
@jamest It sounds like you need a larger dataset if changing the random state variable associated with generating a train/test split has a significant impact on your optimal K
 
Or perhaps the optimal K corresponds to overfitting? Can that happen? I don't know anything about ML
 
fair point @Dodge. The datasets I'm currently ~400 points
yeah Andras, it feels im trying to overfit my training model . false validation whenever my optimal K values equal with different random state variables
 
6:58 PM
cbg patch
 
@AndrasDeak We had a research proposal for adding little bumps on the touchscreen which easier when keyboard was active (think braile cause it was Braile - for visually impaired). The nonworking screen model was well liked by most people (visual impairment or not) because it was tactile typing again. I don't know what happened to it though
 
@LinkBerest that's cool, were these bumps actuated or just passively there
 
In the model they were passive but that was not the plan for the final product
 
btw guys, what would be the proper/pythonic way to organize the following:
I have a set 30 or so markup operations that take a pandas dataframe with a text column that basically flags certain words/phrases/frequency

that text column is used as input
I perform one or more of several types of regex based operations for each of the individual flagging procedures (search for n occurrences of word, search for m combinations of words, etc.)
a new column for each of these flagging proocedures contains a boolean entry for each row of the dataframe if the flag is triggered or not
 
7:25 PM
Hey anyone into Splash-Scrapy?
need help regarding it urgently
 
7:35 PM
Can anyone help with this issue
Its related sometimes to http request to endpoints that allow only https — AnGG yesterday
 
@MuhammadZeeshan sorry, we don't do "urgently". You can ask for help within the rules but rushing the free help you might be given will only make people want to help you less.
 
that I* instantiate with my flagging* inputs
 
7:52 PM
ok got it
 
I need a breather from Powerpoint for a bit; I forgot how lucky I've been not having to build one for three years! It doesn't help that I'm having to pack it full of screenshots from the live system that I built... that will be running in the tab right next to the powerpoint one, throughout the whole presentation.
 
@roganjosh 1. are you stuck with powerpoint, and 2. have you ever used latex?
 
1) Yeah, it has to be PowerPoint. I have to send it off tonight too in advance. 2) No, I actually haven't
 
Sorry, @roganjosh. I feel your pain. I've spent the past day-and-a-half making PowerPoint slides and meaningless diagrams...
 
Oh, my draw.io fun was yesterday :P
 
8:03 PM
I just heard today that powerpoint supports some kind of 3d rendering, loading simpler stl files or whatever into the slideshow
 
I realised I didn't have Visio on this laptop. I think I did an ok job putting together the diagram but it was a bit of a rush
 
I learned about draw.io about a year ago. It's a big improvement over what one can do in PowerPoint directly.
The problem is, you have to have some trivial amount of technical competence to be able to save/edit the diagrams, and... I can't assume that...
 
Ah, yeah. I just needed mine to get a PNG that I can embed in the slide as a one-off. I guess you're distributing yours
 
you ever seen that video of the person who created programming logic in powerpoint
 
I'm still weighing up the whole "btw, I could just demo this. Shall we just not do the slides?" but then that's like throwing a bone to Cerberus and waiting for everything to break down. I'll find my motivation again shortly :)
 
8:11 PM
@roganjosh Yup. So management can helpfully "update" the hardware/software architecture.
 
Oh, even better :(
The tech looks kinda cool, though. A guy I knew used to build "pigs" that you send down oil pipelines and they were looking for people trying to steal oil by boring into the pipes on the seabed and tapping them. That's not a pirating job I'd want to do myself
 
Haha
Yeah, pigs are a pretty neat technology.
Especially when they were first introduced many years back.
 
I'm pretty sure they've been used for millennia
 
Is that the kind of tech you're working with? Or where did that come from?
 
Nah, I just checked out Acellent and my background is Chemical Engineering so I ended up wandering around the different products out of curiosity
I saw one on pipe integrity and it reminded me of the ultrasonic pigs :P
 
8:27 PM
Oh, I see.
We are actually monitoring corrosion/thinning of the pipe walls themselves. And cracks that might form in the joints.
 
It's similar to what his pigs were doing. He was pretty cagey about how the tech worked but I did know that one part of it was to distinguish between corrosion and deliberate attempts at tapping. I've said "ultrasonic" but I guess it was a bit more sophisticated how they mapped the walls as the pig went on its merry way
 
There are actually a lot of different technologies for mapping that sort of thing.
90% of what we do is actually aerospace, but I have some limited experience with oil/gas.
There are some really cool systems, that my company has nothing to do with, that monitor fuel lines looking for metal particles. See, e.g., here.
The same company also has something called ChipCheck, which seems kinda neat, until you realize that it's just a small gas chromatograph. :-)
(I don't actually know if that's how it works. It probably isn't. But still, it's not doing anything that can't already be easily done other ways.)
The MetalScan is one of the few products that I've ever seen at a sensor industry trade show that actually impressed me.
 
@CodyGray I'd be surprised if they used any chromatography, it's probably just the end sensor. Still, it's pretty neat that you can get it in an on-line system - that's not a trivial engineering feat I guess
If they connected it to the lube oil for the pumps where I'm at, I suspect it would need an air-raid siren attachment to indicate the point where "we really should deal with this" :P
 
8:43 PM
The ChipCheck isn't online. You have to put the components to be analyzed into a card, and then put it into a benchtop analyzer.
The MetalCheck is the one that's online/inline, and that works by ferromagnetism.
It's pretty basic in terms of how it works, but it's a darn good idea, and well implemented.
(I am impressed by "well implemented" because... yeah. Experience with the opposite.)
 
Ooooh. The fact that they placed the image next to the plane taking off slightly misled me :P
Some poor sod in the fuselage taking samples as the plane takes off and preparing the slides :P
 
Haha. Marketing.
 
does anyone know offhand what I need to add to my .flake8 configuration file to increase the max characters per line setting?
 
@Dodge max-line-length = 88
 
@Dodge Perhaps this helps?
I searched for "flake8 max characters per line".
 
8:50 PM
yup thanks
 
01:00 - 21:0022:00 - 00:00

« first day (3595 days earlier)      last day (1354 days later) »