|
On the threading module page, why is it code:
code:
|
# ¿ Feb 10, 2008 18:12 |
|
|
# ¿ May 4, 2024 11:09 |
|
Ok so maybe I'm going blind but I don't see any global variables. I see two class definitions, a counter object and a for loop.
|
# ¿ Feb 10, 2008 20:40 |
|
Ok, let me ask this, if code:
code:
code:
code:
|
# ¿ Feb 10, 2008 21:23 |
|
Any nose users: I'm trying to import a module at runtime with __import__, I can make calls to the imported module (see m.hello()), but nose complains saying "OSError: No such file" when nose.runmodule() is executed.code:
epswing fucked around with this message at 21:41 on Mar 28, 2009 |
# ¿ Mar 28, 2009 21:31 |
|
Habnabit posted:Hi. Thanks for taking a look, I appreciate it. Edit: Ahaha I just got the "" The nose guys might say something, if anyone's interested http://code.google.com/p/python-nose/issues/detail?id=247 Of course there's something in argv, I want to load an argv-specified module at runtime, that's the point So...what can I do here. Maybe clean out argv (if it's modifiable?) before it hits nose.runmodule()? Thanks again. epswing fucked around with this message at 16:18 on Mar 29, 2009 |
# ¿ Mar 29, 2009 16:12 |
|
When I catch SomeException and I want to print the exception message, is itcode:
code:
What's the difference? When should I use which? Also, should it be format(str(e)) rather than just format(e)?
|
# ¿ Sep 27, 2011 19:06 |
|
What if I want to use the catch-allcode:
|
# ¿ Sep 27, 2011 23:32 |
|
I'm sending mail and catching an SMTPException, I was asking about a bare except clause out of curiosity. I would think it's useful when using some 3rd party library that could throw who knows what?
|
# ¿ Sep 28, 2011 00:33 |
|
TasteMyHouse posted:IMO you should avoid situations where you have to use spaces for alignment anyway. "Avoid situations"? I'm hoping you wouldn't prefer this code:
code:
|
# ¿ Sep 30, 2011 00:36 |
|
Janin posted:The second is a maintenance nightmare, because every time someone adds a URL/view name/etc that's longer than the previous alignment, you have to shift everything over (and thus gently caress up the diff history). By "maintenance nightmare" you mean "oops, I need to add/subtract a space from all these other lines"? Whew, what a nightmare I look at code far more often than diffs of code. Edit The more I think about this, the more it is. Do you know what a maintenance nightmare is? Have you ever worked on code that was/is actually in production? MY DIFF HISTORY epswing fucked around with this message at 05:52 on Sep 30, 2011 |
# ¿ Sep 30, 2011 05:20 |
|
Is creating a zipfile with shutil.make_archive as useless as I think? I wrote a simple backup script, zip a directory, and getting code:
(I'm just going to use tar instead. I'm still mad though.)
|
# ¿ Apr 27, 2012 15:49 |
|
I have a couple Django sites running on Linode, and they have excellent step by step tutorials for Django and practically everything else too. I'm no server admin but I managed to set up apache, postgres, and django without much trouble, just following their tutorials.
|
# ¿ May 8, 2012 16:34 |
|
the posted:And they wonder why no one uses Linux. Jesus Christ, I am going to throw this laptop out of the window. I hope you do a few years of python development in linux, so you can look back at this statement and laugh at yourself. It's perfectly sane, you're just unfamiliar with it and throwing a fit because it doesn't behave the way you think it should.
|
# ¿ Jun 7, 2012 21:28 |
|
generator.py:code:
code:
pre:C:\Users\Documents>python generator.py one Tue Mar 31 10:39:51 2015 two Tue Mar 31 10:39:52 2015 thr Tue Mar 31 10:39:53 2015 C:\Users\Documents>python generator.py | python filter.py ONE TUE MAR 31 10:40:02 2015 Tue Mar 31 10:40:05 2015 TWO TUE MAR 31 10:40:03 2015 Tue Mar 31 10:40:05 2015 THR TUE MAR 31 10:40:04 2015 Tue Mar 31 10:40:05 2015 What I want: pre:C:\Users\Documents>python generator.py one Tue Mar 31 10:39:51 2015 two Tue Mar 31 10:39:52 2015 thr Tue Mar 31 10:39:53 2015 C:\Users\Documents>python generator.py | python filter.py ONE TUE MAR 31 10:40:02 2015 Tue Mar 31 10:40:02 2015 TWO TUE MAR 31 10:40:03 2015 Tue Mar 31 10:40:03 2015 THR TUE MAR 31 10:40:04 2015 Tue Mar 31 10:40:04 2015
|
# ¿ Mar 31, 2015 15:42 |
|
Hammerite posted:Haven't tried it, don't know much about this sort of stuff, but is there some way of "flushing" the output of generator.py using the sys.stdout file-like object? It does have a flush() method. I don't actually have control over generator.py, it's another program spitting out log files. For the sake of argument, I added sys.stdout.flush() after every print call, and there was no change in behavior.
|
# ¿ Mar 31, 2015 15:57 |
|
|
# ¿ May 4, 2024 11:09 |
|
I seem to be getting "Forbidden 403, CSRF cookie not set" on IE, FIreFox, and Chrome, when running the local dev server. I'm getting the error when submitting the standard django admin site login form. I don't think it's likely that all of a sudden none of the browsers on my machine are accepting cookies. What else could cause this? I can see the csrfmiddlewaretoken hidden input in the html source. Edit: Django 1.7.7 Edit: vvv Whoops! Thank you. epswing fucked around with this message at 17:33 on May 28, 2015 |
# ¿ May 28, 2015 17:14 |