« first day (2133 days earlier)      last day (2815 days later) » 

user6568562
3:01 PM
@JGreenwell cbg [ :
 
Never mind, thought you were replying to my last message. Not sure why you expect a third party module to be in the official docs, and your original question was about the difference between os.system and subprocess. Obviously they're not the same, despite you saying they are. Have you tried debugging?
 
Ok, here's my current understanding: the operating system is capable of executing textual commands. For instance, calc.exe will cause the calculator executable to run. Users typically interface with software called a "shell" in order to issue these commands. The shell may understand special syntax that the OS can't natively parse. For instance, dir on the Windows Command Prompt shows a list of local files, even though there's no dir.exe anywhere in the path.
Shells usually make themselves visible to the user via a window called a "terminal", although this is not strictly mandatory. subprocess.call can either interface with the OS directly or interface with a terminal-less shell depending on the value of the shell flag. The former is preferable unless you need to use dir or piping etc etc.
 
And in the later case, you can almost certainly do that with built-in Python functions instead.
 
Here's a cool promo / interview video for Joe's album Permission To Evaporate
 
I'm not 100% clear on how to distinguish between "syntax interpretable by the OS" and "syntax interpretable by the shell" other than "try running call with shell=False and see if it crashes"
 
3:03 PM
@Kevin shell expansions and special characters are interpreted by the shell and need to be escaped.
As opposed to a process where you just pass argv without worrying about how the shell will interpret it.
 
hey @randomhopeful ... You know this is the first time I've pinged you and I've always thought your name was "randomhelpful" and thought that was cool (randomhopeful is not bad either :)
 
@davidism It looks like sh is using execv
 
Yes, and?
 
user6568562
@JGreenwell I sure hope to be helpful in the chat room one day : P
 
I'm lost
 
3:07 PM
Quick question. I just got chat privileges, where can I find rules / guidelines?
 
Try looking around this page. It's like a game of hide and seek. Except nothing's hidden!
 
@anshanno The rules for our room in particular are here. The rules for chat in general are on... Meta? Or somewhere like that.
Mostly it boils down to "be nice"
 
Or in the bottom right corner.
 
Most rooms will have a link in the top right.
 
Oh man, I feel dumb now. Thanks guys :)
 
3:09 PM
Hey, I give you props for bothering to find/read them!
That's miles more than most do. :P
 
@kevin anything that uses shell built-ins (like cd) has to be processed by shell=True because there is no executable to exec
 
@anshanno There's also the general SO Chat FAQ
 
@holdenweb that can be done with Python
And piping can be done with Popen.communicate
 
@anshanno don't worry. There are some people in this room who can make you feel dumb just by standing next to you.
Then there are some you might not want to find yourself standing next to
The two groups are not necessarily disjoint :-)
 
@holdenweb I figure if that doesn't happen at least once a day I'm doing it wrong ;)
 
3:12 PM
@holdenweb haha
 
There's also people who can make you feel short by standing next to you.
 
it's subproc.PIPE inside Popen, where I used it in the past...
 
Ok, I'm making a comprehensive list. Things the OS can execute without a shell:
- executables
- files that have a registered "default program", ex. `myfile.py`
 
if you are short this is not an uncommon occurrence anyway
 
Anything else?
 
3:12 PM
@davidism yes, but you can't put a Python function call into the middle of a shell pipeline very easily, can you?
 
@anshanno Yeah, what Morgan said. Thanks for asking about the rules. And welcome to the SO Python chat room, the best chat room on SO. :)
 
@kevin this talk of "registered default programs" reminds me you are a Windows user
 
@holdenweb which is why you do the pipeline in Python. I'm not saying you can't use the shell, just pointing out that it's not required. :-)
 
@davidism thank you
 
@Kevin registered defaults is with shell, I'm pretty sure.
 
3:14 PM
The talk of dir should have given away my filthy Windows user status ;-)
 
ls works in Powershell now
just not well
 
And I have a dir command on this Linux box.
 
dir is a valid command in many Unix distros now, I believe
 
@davidism Ah, you're right. I must have mistyped when I was experimenting earlier.
 
clear vs cls is a better indicator I've found
 
3:15 PM
Not knowing that dir is a valid command in many Unix distros now should have given away my filthy Windows user status ;-)
 
wim
when pip install -r requirements.txt builds a dependency graph (assuming it does this at all?) is it using information from each packages respective requirements.txt , or from setup.py, or both?
 
Definitely not requirements.txt, as that isn't part of the package ;)
 
granted now clear works on Windows but I've never heard a Windows user refer to it over cls
 
(and if it were, it doesn't actually mean anything, AFAIK. That's just a convention, like self. It could be called fhqwghads.txt for all pip cares)
 
wim
are you sure about that?
because I see sometimes in the output
Collecting pytz (from influxdb->-r requirements.txt (line 2))
  Downloading https://.../root/pypi/+f/735/126cd1c1ddc82/pytz-2016.6.1-py2.py3-none-any.whl (481kB)
    100% |████████████████████████████████| 481kB 52.0MB/s
Collecting python-dateutil>=2.0.0 (from influxdb->-r requirements.txt (line 2))
 
3:18 PM
fhqwghads should be the new foo bar baz
 
wim
stuff like that
 
Interesting
 
$NEW_HIRE used clear yesterday while we were pair-programming, and it took him a bit to grok why it didn't clear the screen. I didn't understand at the time why he didn't use cls. Now it makes sense; he must have residual Linux muscle memory from his last job.
 
I could be wrong... I wonder if flit has anything to do with that. I think it's flit anyway
 
yeah, clear only works in newer Powershells (unless you force an alias in cmd)
 
3:19 PM
And/or non-cmd muscle memory
 
When you pip install a package I believe the external dependencies come from setup.py's install_requires
 
@Kevin Yeah, I spent a while working in cmd explicitly so I could build up both muscle memories. Sometimes it takes a minute to get back to the horror that is cmd
 
I just use Ctrl-l to clear the screen.
 
That's what I've always understood, but that influxdb line is interesting to me
 
3:20 PM
I ignore cmd as much as humanly possible - which is 99% of the time
G-d help me that 1%
 
I mostly use it to open the Python interactive prompt :-P
Much like how IE is the designated "firefox installer"
 
DSM
I-just-typed-cp-when-I-meant-copy morning cabbage for all!
 
wim
he copies the information from requirements.txt into setup.py
 
3:21 PM
^ that
 
honestly really, really rare - powershell + .net tie-ins is massively powerful or I end up using Python or C#
 
That's certainly one way to do it. You might call that the "new-fangled" way, since it didn't exist before pip, whereas setuptools did
 
wim
I think I'll make some dummy packages on pypi to experiment
 
IE is titled: "WHY DO YOU STILL HAVE IE?!" :)
 
wim
pip is a pain in the butt honestly
 
3:23 PM
Well, it definitely doesn't look like anything in the wheel file
 
@JGreenwell My dad was so stubborn about using IE, that I changed Chrome's icon and name to IE
7
 
wim
there should be one place to maintain this information and that is setup.py
requirements.txt is a travesty
 
@idjaw that is the awesomest thing I heard all day
 
Requirements are nice for keeping track of dev stuff and specific versions, but it should definitely not be shoved into setup install_requires.
 
@idjaw I've known many people who have skinned linux to Windows to trick their {relation} into thinking it was
 
3:25 PM
^^ha. wonderful
 
I am blissfully ignorant of the process for distributing programs. Anyone using my stuff has to climb uphill both ways to my github page and figure out dependencies from the ImportErrors.
 
@JGreenwell powershell is ridiculously powerful
 
@wim It's definitely in their MANIFEST.in file (i.e. requirements.txt, as well as a couple of others) so it shows up in the sdist)
 
(For some things)
 
@RobertGrant Powershell is the .NET version of IPython
 
user6568562
3:26 PM
That's what I'm using right now, until I'll tidy my stuff up to switch to Ubuntu
 
:)
Not sure you could do stuff like chase referrals across active directories with IPython and then bung the resulting info in a Word document quite as easily, but I'll take your word for it
 
This is not a jest - the output of ls or dir in Powershell is some kind of filename object things
 
more like .NET version of IPHP
 
@RobertGrant Well, if you weren't using Windows-specific things. I'm not sure what you mean by referrals, but you could easily dump info into a .txt or markdown, or whatever document
heck, with the right library you could do it into a Word doc
It's just very Microsoft-centric, which is why I try to avoid PS like the plague
 
Yeah it's just amazing for stitching together high-level MS stuff, and terrible at everything else
 
3:30 PM
my favorite thing about powershell, though, is that it has the whole "oh noes, don't execute powershell scripts that are untrusted because dangerous!"
except you can get around that by creating a .bat file that creates a ps file and executes it with the -ExecutionPolicy bypass or whatever the invocation is
it's security through hoping everyone is stupid
 
yes it is, sometimes in not a good way - seen a lot of people brick their systems due to not knowing Powershell well and trying something foolish
or you can just set the Environment Variable directly Wayne
then you never see that again
 
Yeah, but then you have to do it
I'm talking about {malicious_attacker}
I could give you a .bat file that you could run, and MUAHAHAHAH I have all the powershell features
 
ah, yes. Then again a lot of people run their personal computers as Administrators or try and use the same/extremely similar password for Admin privileges so it is easy to do a lot of junk on Win - without even needing .bat
 
That's partly because so many programs are too old to behave with UAC turned on
 
lack of the idea of a true "root" is one problem I have with Windows philosophy in general
 
3:36 PM
Awesome. In between accepting a passing PR and merging in to master, lxml update today to 3.6.2 broke our build
 
This is where Macs have a big advantage: you just can't run old programs because they switched architecture and OS
 
yay! at least you know what broke the build ;)
 
Yeah. ncclient uses lxml and its requirements are using '>='
so I had to cap it for now in my own requirements
just annoying to have the master branch on GH broken
waiting for travis to go green so I can get this thing in
 
okay, back to work. rbrb
 
3:43 PM
@JonClements I have used my psychic powers to guess an answer in comments
 
^^ Yeah I was just drafting something similar but you beat me to it. I think that is what is going on.
 
Bets on it being related to LPTHW?
 
Interesting call. OK. I'll bite. I'm in.
 
@JRichardSnape Meddling in the Dark Arts again I see Snape :)
 
For LPTHW
 
3:46 PM
@JonClements Can't resist it!
 
I knew he was a baddie!
 
Maybe the best way to counter LPTHW is to make LPTEW
 
user6568562
@JRichardSnape Spot on for figuring out that that OP is following a Python 2 tutorial using Python 3. I, also, bet it's the case as I've been through that phase
 
How to decode this [b'/usr/bin/git', b'--git-dir', b'/tmp/app/.git', b'--no-pager', b'branch', b'-a'] ?
For subprocess call?
 
What have you tried?
 
3:57 PM
don't use b?
 
huh?
 
(Given this isn't a codewriting service, and you wouldn't just dump coding problems here, obviously)
 
I can change only that array
 
You wouldn't download a code writing service
 
@KevinMGranger :D
 
3:59 PM
You wouldn't write the code for a code writing service.
 
well...probably out of pure annoyance of that question, I copy pasted and added a valid git path and that call works
so I have no idea what you are asking
but good luck
 
Not to open a potential can of worms, but can you just use dulwich?
 
:D ehm
 
or any other python git module for that matter
that are widely available on the system of tubes
 
@Ffisegydd actually that sounds like the only thing I should write - then I can sit back and let the service do my work for me!
 
4:03 PM
17 hours ago, by Andras Deak
this dulwich is open source
 
gittle is not ported to python3
 
Good job the only one people mentioned is Dulwich, then
 
s/job/thing
I mentioned the can of worms because wasn't someone having trouble with it earlier?
 
this works on py3
 
@KevinMGranger yes (I think Andras recommended it for the same issue, some hours ago...)
 
4:04 PM
no
 
yes
 
I just assumed to role of advanced Google sprite
 
But prettier.
 
but not as pretty as you Fizzy
 
4:05 PM
<3
 
VeeeneX had an issue of using gittle which uses dulwich, and dulwich was the one throwing errors due to not actually being py3-compatible
 
Ah - I retract my 'recommended' and replace with 'drew attention to'
 
17 hours ago, by VeeeneX
Because I'm using gittle and it has dependency for dulwich which is not ported to py3
the prequel to my message ^
 
Ah, interesting, as it claims to be compatible
> Dulwich supports (and is tested on) CPython 2.7, 3.4, 3.5
 
ah there is history involved in this whole debacle
 
4:07 PM
This is a bit like Memento. @VeeeneX - check your body for tattoos.
 
from the github - maybe it is a bug we see before us.
 
@JRichardSnape hence my message
16 hours ago, by Andras Deak
what I don't get is why an allegedly py3-compatible library contain a bug like this
 
@JRichardSnape Yes, see their dependency in setup.py
 
16 hours ago, by Andras Deak
well, they're not saying how they tested it
 
Who had the bug? dulwich or gittle?
 
4:07 PM
Pretty sure we've all got dulwich tattoo'd on ourselves now.
 
dulwich first, I believe
 
I've been using dulwich (admittedly for super simple stuff) in 3 just fine
 
gittle
 
dulwich in gittle...
 
What bug did it have?
 
4:08 PM
@JRichardSnape mine has 2 Ls, a space and a T, but otherwise yeah
 
just a sec
17 hours ago, by VeeeneX
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    repo = Gittle.clone(repo_url, repo_path)
  File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 457, in clone
    local_repo = cls.init(local_path)
  File "/usr/local/lib/python3.5/dist-packages/gittle/gittle.py", line 312, in init
    repo = constructor(path)
  File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 885, in init
    cls._init_maybe_bare(controldir, False)
  File "/usr/local/lib/python3.5/dist-packages/dulwich/repo.py", line 869, in _init_maybe_bare
 
Oh right, gittle depended on an older version of dulwich, that didn't support 3 right?
 
File "/usr/local/lib/python3.5/dist-packages/dulwich/refs.py", line 545, in set_symbolic_ref
    f.write(SYMREF + other + '\n')
TypeError: a bytes-like object is required, not 'str'
@KevinMGranger that is possible
 
@RobertGrant I just thought it would look better when you came round that way.
:P
 
I remember seeing a .9 in a setup.py somewhere in this room's history
latest is .14 something
 
4:09 PM
although the dulwich on github seemed to contain the same bogus file opening in wb mode?
 
Deja vu, we had the same thing here: me complaining about dulwich not being py3-compat, VeeeneX insisting on a grittle issue:P
 
:D
 
4:10 PM
@JRichardSnape I guess it means I'm Magrat
 
I'm glad I have to drive some nails screws into concrete walls instead
 
hmmm...I don't see any tests attached to gittle
 
And the last commit to touch that file was Mork work on swift module python3 compatibility., great
 
@AndrasDeak it's all the same with a Birmingham Screwdriver
 
@AndrasDeak Is it not two lines under that where the issue lies. The new version has b'\n', old version simply '\n'
 
4:12 PM
I would have been tempted to fork and update the tests to validate py3 functionality, but I don't see anything in that project for any kind of unittest
 
@JRichardSnape oooooooooooh I see!
thanks
 
So - just need to make gittle use the new version. Or patch your dulwich install on the fly if you're into that kind of thing.
 
for some reason I thought that "other" was the culprit, didn't even think of the \n
 
I.e.
user image
4
 
(I am, I have many matplotlibs lying around in indeterminate state)
 
4:13 PM
I mean, I thought the fixed version would not have wb
@RobertGrant ah I see:D
I though it was a Who reference
 
@RobertGrant Are you taking a hammer to my craftsmanship, sirrah?
 
how did Bobby get a picture of my weekend project attempt.
 
That hammer + *screw picture makes me so uncomfortable for some reason
 
DSM
I admire the spirit.
 
Because it's not a nail
 
4:15 PM
It is wrong. Entirely wrong.
 
*errr, you know what I mean
 
Although given that mistake, it could be that DIY just makes you uncomfortable
 
When all you have is a hammer...
 
I have heard of the hammer being referred to as a "Manchester screwdriver", in homage to the wordworking skills of my compatriots from oop north.
 
If I were a bartender then I'd give myself "The Hammer" as a nickname, as everyone around me would get smashed.
 
4:16 PM
Yeah, I'm breaking dulwich now. Interesting
 
 
Another subtle thought from Metallica
 
@RobertGrant You're on fire today, Bobby.
I'm going home. Later all.
 
It's not because I'd see all the female customers as potential nails
 
I am using Flask, and I'm trying to change an HTML element using JavaScript, but the JS code is running before the HTML is rendered (I think). So I don't have access to the HTML when running the JS. Does anyone know how to access the HTML from JS?
 
4:17 PM
@RobertGrant wags finger
 
I'd nickname myself "The Countersink" just to make people wonder
 
@simeg I love how because you're using Flask you think that's a Python problem ;) However, I do actually know what your problem /likely/ is
 
@simeg this is nothing to do with Flask, right? Your script block just needs to be after your HTML
 
You need to either do as @RobertGrant says, or just wait until the DOM is ready
 
@RobertGrant yeah I tried that, but then it doesn't run at all.
 
4:19 PM
Ah, a jQuery recommendation
:D
 
I haven't tried using jQuery, I thought I was gonna avoid it :P
 
@simeg then you've done something wrong in your HTML.
 
DSM
My JS is terrible, but don't you just protect the code with a window onload?
 
If you prefer VannilaJS, there's always this approach
 
What's the best way to endlessly duplicate a sequence for zip?
 
4:21 PM
@RobertGrant nice link, thanks
 
Yeah it has an equivalent of jQuery's document.ready that is cool
 
you guys gave me an idea, I'll try it and report back. Thanks
 
DSM
@MorganThrapp: cycle or repeat, maybe, depending on the details. Example?
 
Pretty sure you can just have a script block after the html and it'll work, now that it's cool to put script blocks at the bottom of the page
Might be wrong, though
 
4:22 PM
I have data that cycles through a list of types, and I want to get that type.
 
So, for example zip(data, ['first_type', 'second_type'])
 
then stackoverflow.com/q/39022105 as migrate to Server Fault
 
Yeah I got it working! Thanks everyone
 
4:23 PM
Thanks.
 
DSM
@RobertGrant: I can't remember if that's actually guaranteed or not, though, regardless of whether or not it works.
 
@DSM yeah same
 
@davidism I think there's probably some other dupe of that somewhere. I know I've configured IIS as a reverse proxy before. It's a PITA
 
window.onload waits until assets such as images have arrived, which you probably don't need
Actually the thing they do in that do you need jquery site is right according to something else I just read
 
Although you might want to check for duplicates there first: encrypted.google.com/…davidism 16 secs ago
 
4:25 PM
Wayne's link has the equivalent. "The DOMContentLoaded event is fired when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading"
 
DSM
Sweet, sweet information!
 
Hey, speaking of powershell and linux commands... azure.microsoft.com/en-us/blog/…
"PowerShell is open sourced and is available on Linux"
 
o.O wat
 
woah
 
I mean... I understand that Mono is a thing...
 
4:30 PM
I'm pretty sure they open sourced .Net, which is different than Mono?
 
but Windows has an entirely different approach to all the things, so I'm confused as to everything
 
Mono and .Net core are merging, if I understand
 
I was never very clear about the distinction.
 
like... there's a vast difference in the filesystem architecture
and permissions
and... and.. and
Though of course now I'm wondering if there's a package for Arch...
 
Mono was a FOSS alternative implementation of .Net for the sake of xamarin. MS bought them, and as part of their plans to open source .Net, they want to make them mostly equivalent now.
It was announced an hour ago, so if it's not the AUR by now something's wrong
 
4:32 PM
hehe
 
Well, hurry up Wayne! You've written a pkgbuild before, right?
 
Hasn't everyone who uses Arch?

Well, except for me, I guess.
> We fit in well with the architecture, idioms and existing tools.
Secure shell has been around for nearly as long as I've been using computers. I don't have a cow, I don't need your bull.
 
"We will be extending the PowerShell Remoting Protocol (MS-PSRP) to use OpenSSH as a native transport. Users will have the option to use SSH or WINRM as a transport."
 
why doesn't mac os x have a way to re-install fresh easily?
 
4:38 PM
Because "normal" users don't ever need to do that, and if they do, they just have the genius bar do it :/
 
^^
 
> Installing the toolchain is as easy as running Start-PSBootstrap in PowerShell. Of course, this requires a self-hosted copy of PowerShell on Linux. - github.com/PowerShell/PowerShell/blob/master/docs/building/…
So, in order to install powershell, you need to have powershell installed
 
Psh, just want nothing installed on my computer ever except iterm, vim, and some other CLI tools
 
neovim tho
 
Sounds like RPM hell to me. I guess you really do fit in with the idioms ;)
 
4:40 PM
 
user6568562
: D
 
user6568562
I believe Bios still prompts you to press F1 or F2 if it didn't detect a keyboard
 
user6568562
But to its defense, I think it intends for you to press F1 when keyboard is finally plugged in
 
That makes sense. The F2 to abort, not so much
 
user6568562
4:44 PM
Not at all, lol, I agree
 
Do I need to do anything special to get pandas.DataFrame.fillna() to fill NaT?
 
wow....I only looked at the avatar and thought DSM was asking that ^^
haha
 
but our avatars are different :(
 
yes I realize this now. It was upon a quick glance it just looked really similar to me
 
:D
 
DSM
4:49 PM
I was going to object that not all squares look alike, but to be honest, you're right, they do look awfully similar. :-)
 
I fixed that damn thing!!!
 
Hold on now, your square is blue and your corners are not as crisp as mine
 
--git-dir doesn't work well for switching branches
 
now now...you're both beautiful unique squares in your own way
 
DSM
Aww, thanks. Warm fuzzies all around.
 
4:51 PM
<3
 
--git-dir probably works fine for switching branches, did you need to specify a working dir too?
 
@KevinMGranger Can I specify working dir for git?
 
Anyone ever get past level 13 in this python challenge thing
I can't tell if the page is broken or if it's just part of the challenge
 
--work-tree or GIT_WORK_TREE
 
@MarcusS what Python challenge thing?
 
Design For Manufacturing == my bane today
they just totally broke my mental model of how my product is supposed to flow through SMT/Manufacturing ... and now i get to rewrite all my test software for them ....
 
@MarcusS holy 90s internet batman
 
@KevinMGranger Thaaaank youuu sooo muuuch!!!!
 
DSM
"There are currently levels."
 
> -- Found PythonInterp: /usr/bin/python (found version "3.5.2")
^ from manually building powershell. Interesting.
 

« first day (2133 days earlier)      last day (2815 days later) »