« first day (1414 days earlier)      last day (3535 days later) » 
02:00 - 17:0017:00 - 23:00

5:00 PM
@davidism OR keep it until the first SoPythonCon
 
@IntrepidBrit I think we're calling it sopycon
 
@davidism I have a online REPL and I am trying to give the error back to the user.
 
(sticking with lower case and being as short as pos!)
 
@davidism I see I was not aware of that. I could then technically look at the code for that.
 
Yeah, it sends back full, interactive tracebacks.
But on the other hand it has no security, since it assume you are the developer in debug mode
 
5:04 PM
The thing I am trying to do is not with python but a different REPL.. I am just trying to get the return of an error from the repl I am running. Of course you guys don't have that REPL. I am trying to do this with subprocess.get_checkoutput
But that does not seem to return the error. If there is no error I get the output.
 
@JonClements More snappy. I can get on board with that
 
I put "unclear what you're asking", but I guess I meant "too broad" :P
 
@Johnston so hang on... when running the code provided with the python example... you do get an error don't ?
 
@JonClements When running the gist that you wrote I cannot get the python error to be returned.
 
5:09 PM
@Johnston would you give me a sample code snippet that would be run and would generate an error?
 
@davidism not my project
It's @Johnston that's having issues... works fine for me
 
Ok one sec
 
Yeah, autocomplete problems.
 
5:23 PM
Ok I have it
one sec
I made a whole other project
So the issue with it is that the error that subprocess.check_output does not get sent back to the browser.
 
OK, I'll try it out.
 
Thank you!
 
Well, the immediate problem is that there is no stdout output for that code, even when it fails. You probably want to capture stderr.
 
5:38 PM
how do I capture that
 
You can see that this is the case because the terminal running the flask server will output the error.
I'm looking up how to capture it.
 
exactly. You are right
 
return subprocess.check_output(['python', '-c', 'print 1 + r'], stderr=subprocess.STDOUT)
 
did it work for you?
lemme check
 
try:
    output = subprocess.check_output(['python', '-c', 'print 1 + r'], stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
    output = e.output
return output
That works
I thought we'd already added the stderr bit
 
5:42 PM
I think the best course is to send stdout and stderr to your own streams and return the contents of both.
 
There we go @JonClements. But @davidism how do you do that?
I understand the concept but I wouldn't know where to start in making that happen.
 
Probably by opening files (or stringio) and passing them to stdout= and stderr=
I've never done it.
 
This is awesome that this is at least working.
Do you know how to capture stdin?
I don't think it is capturing that.
In the same way we would capture stderr. I tried adding stdin=subprocess.STDOUT
 
I think your javascript would need to handle that
What would stdin mean in a web app?
 
See heres the thing about my original question way back when. When I run my command (which is not python...) it prints out some initial info.
 
5:46 PM
You can ask for the script and the input, send both to the server, and pass the user input to stdin
 
like Darwin something something something.
Swift version 0.67b something like that.
Where would that be captured?
stdin is prob the wrong name for it
 
No idea, play around with pipes and find out.
It's either stdout or stderr.
 
["echo","'println(\"1+2\")'","|", "xcrun", "swift", "-i", "-v", "-"] is what I am trying to run
Does that look right to you at least?
 
Looks reasonable - try it
 
OK thank you guys. I really appreciate your help
 
5:52 PM
@Johnston might be worth checking: pymotw.com/2/subprocess
 
oooo, thank you
i will check that out
 
I should start giving my SO questions buzzfeed clickbait titles. "I tried to run my flask app. You won't believe what happens next"
10
 
haha
 
6:31 PM
To understand what recursion is, you must first understand recursion
 
7:21 PM
buenos cabbages!
 
@MattDMo that's a new one :)
 
I try
so what is the process if I'd like to suggest some changes to the "Useful Comments" section on sopython.com? There are a couple phrasings that make me twitch...
 
What would you like to change?
 
Well, a couple things - the "Welcome to Stack Overflow!" one mentions compiler errors, which is of course not valid for Python questions.
I'd also like to change the SSCCE link to the internal MCVE link (stackoverflow.com/help/mcve) - which I'd also like them to make a commenting shortcut, like [ask] and [edit]
 
I think it's meant to be as generic as possible; after all, Python does compile to some sense :)
 
7:30 PM
Yeah that one is meant to be particularly generic
Still @MattDMo I've added you to the approved list so you can edit wiki posts. They don't have version control though so be careful to not accidentally delete something :P
You can also make new wiki posts and add/edit the canon questions.
 
No, I know it's meant to be generic, but shouldn't it at least make some sense in the context of Python? Maybe my understanding is wrong, but Python code isn't compiled in the strict sense of the word, is it?
that's cool, thanks @Ffisegydd
No VCS in the one Flask app to rule them all?
 
Well we have git
But the wiki is kept in a postgresql db which doesn't have VC
 
We're aiming to put VC in a future release
 
sounds good
 
It's on my todo list!
 
7:37 PM
:P
 
So does everyone more-or-less agree on taking out the "compiler errors" bit? If not, I won't.
 
What would it be without it then? Can you copy it in?
Oh I see it
 
I was busy so missed dr-who... excuse me...
 
I have no real opinion on it.
 
I'd just say ...and the output you actually get (console output, stack traces, etc). The more detail...
actually, maybe tracebacks would be more accurate
and with that resounding confirmation, here we go!
 
AQT
8:17 PM
hey
 
sup
 
8:35 PM
Umm... okies - wasn't overly convinced on the 2nd episode
And the preview for the next one, doesn't look like something I'd enjoy either...
so I'm really hoping Moffat's not going to f* up Capaldi's doctor - as I really do like him
 
9:29 PM
I feel like experimenting with making a video game. Is python adequate for a meh tier game?
 
Yes
 
meh tier game? wassat?
 
as in, I have zero clue what I am doing
 
lol... was just looking it up - general feeling about life - always surprised when it works out.
 
9:50 PM
@Ffisegydd Gene Hunt as a teacher in: bbc.co.uk/iplayer/episode/b04g4x2j/…
 
"BBC iPlayer TV programmes are available to play in the UK only. Find out why." Let me guess - money (i.e. licensing)?
 
@Isedev yup licencing issues
 
can't you just alter your request going in? Like how you can change your user-agent string
 
yup... plenty of ways to make it think you're in the UK
 
geo-ip filtering is my guess
@jon loads of proxies available to fake source ip
 
9:56 PM
That's all it is
 
even TOR can help although trial and error :)
well, random more like
 
TOR always makes my computer look suspicious
 
only if running a node, not a client. anyway, TOR is an odd one - better anonymity vs less security :)
ran a TOR node for a while
unreal how much info you can capture
just need a little python network proxying script and ...
btw, speaking about TOR, ever read this: theguardian.com/world/2013/oct/04/…
seriously tickles my sense of irony
 
10:31 PM
YAML and regexes make for a most pleasant evening
 
o
 
02:00 - 17:0017:00 - 23:00

« first day (1414 days earlier)      last day (3535 days later) »