« first day (1556 days earlier)      last day (3616 days later) » 

00:12
You could get all the results then use a dict comprehension to parse them as you want.
 
4 hours later…
Dan
Dan
04:16
cbg
cbg @Dan
Dan
Dan
@MattDMo how r ya?
not too shabby - yourself?
Dan
Dan
04:45
@MattDMo sorry for dropping off the planet, I'm doing alright
05:21
http://stackoverflow.com/questions/28018140/python-delete-item-in-a-‌​list-within-a-list/28018186#28018140
06:11
from __future__ import braces
not a chance ;)
cvd
that adam smith question
just another exmaple of "I have code that works for this example, how to fix it".
@AdamSmith ah your edit is wrong :d
06:40
cbg
07:07
no one up?
07:17
Up to what? :p
i need an answer and it seems so simple.
i am in x folder and i have a python file here. i have a folder which is child of current folder and i have to import that file.
assume child folder name is child.
i tried import child.loggers and i tried sys.path.append("path/to/child") and import loggers
its not working
from child import loggers?
after appending to sys path?
07:22
Dunno. Yeah, why not
yeah, that should work
I'm more saying AFAIK import child.loggers isn't valid syntax
from talogging import loggers
ImportError: No module named talogging
Maybe stick an ____init____.py in your child folder
Did you put __init__.py there?
07:23
that would be underscore underscore init underscore underscore dot py
You'll also need __init__.py in your x folder
why is that?
It's implicit Python magic
Basically it's a magic file name that turns a folder into a Python module
You need it as well as the sys.path thing, unfortunately
just checked
i have a init.py file already there
With the underscores?
07:26
yes yes
Oh yeah, I see the bolded init :)
and this same code works on some other machine
weird..
different python version?
Nah that shouldn't matter
Are you sure you need the entry in sys.path to make it work?
well this exact same code works on some other machine
07:30
anyway, sorry, I'm not an expert at Python's import system
thanks for trying anyways
well it worked
just changed the version from 2.5 to 2.7
and instead of running file from different folder, ran code from same folder
Yeah the import system seems like deep magic
cbg folks!
what is cbg?
07:44
@Ffisegydd cbg
@AjGauravdeep sopython.com/salad
haha, nice.
one question guys
cel
cel
@AjGauravdeep just ask :)
looking for a place to copy past the crazy output
too bug for here
cel
cel
Best thing would be to narrow the output down to the important parts, so that it fits into the question.
2015-01-19 00:18:27.051 Python[28226:1718748] -[__NSCFString objCType]: unrecognized selector sent to instance 0x7f959641d110
2015-01-19 00:18:27.235 Python[28226:1718748] *** ObjC exception 'NSInvalidArgumentException' (reason: '-[__NSCFString objCType]: unrecognized selector sent to instance 0x7f959641d110') discarded
cel
cel
Yea, that may be fine. Just add it to your question. It's hard to help here, without knowing the context.
- (id)initWithEcid:(NSNumber *)\
thats the function definition
.initWithEcid("3118376226067")
i am calling it with somewhat like this
Cabbage!
@AjGauravdeep That looks like some ObjectiveC/Apple stuff to me. Don’t think it’s really relevant to Python.
@inspectorG4dget You around?
but that function is python function
umm..
08:42
- (id)initWithEcid:(NSNumber *)` vs. .initWithEcid("3118376226067")` – I’m no ObjectiveC expert (I really don’t want to :P) but it looks as if you’re passing a string instead of a number.
So you probably want to do .initWithEcid(3118376226067) instead.
poke... it works... awesome..
:)
09:07
Cbg
Cabbage
09:48
cbg
10:03
cbg
10:18
cbg
Damn, a cbg streak and I am about to break it.
I am thinking of adding stackoverflow.com/questions/28021409/… to the canon.
It is one of the rare cases where using a tab won't raise an error in Python 3 and is not caught by running python -tt either.
I've written a comprehensive answer there. Unless someone knows of a better dupe, I'll add it to sopython.com/canon/
@MartijnPieters Sounds good to me.
Maybe -t should have an option to detect mixed tab & space indentation usage through the whole script, not just on a per line basis... but I guess that would slow things down a bit.
10:40
@PM2Ring It doesn't work that way though. Python fills out tabs to the next multiple of 8, so if you use 3 spaces, then a tab, you indented to column 8. That is detectable just fine.
You can use 4 spaces for one level, a tab for the next, and a tab and 4 spaces for the next, etc. perfectly legally. People often did.
That kind of use is almost indistinguishable from the use here.
But I am surprised tabnanny cannot be configured to be dictatorial about only tabs or only spaces for indentation, or that no indentation level is ever expressed as both tabs and spaces on different lines. That should be perfectly detectable.
10:55
Tab being 8 spaces? Never knew that- seems crazy big
@MartijnPieters Understood. I guess the most problematic case is the that no indentation level is ever expressed as both tabs and spaces on different lines. And as you say, that shouldn't be too hard for a parser to detect.
@RobertGrant Tab stops being every 8 spaces is an ancient convention.
Old mechanical typewriters let you set tab stops on whatever column you wanted. And some early electro-mechanical / electronic systems let you do that too, but every 8 columns was the standard default if you didn't set up custom tab stops.
Hell, for all I know there are software terminal emulators that support custom tab stops, too. :)
cbg(all)
actually used to have (and have reason to consult) a paper VT220 manual
11:06
is there a better option to scan for folders in a folder than using os.walk?
(I don't need recursion, only one a level scan)
@Zero you working through the night?
@Peter isn't there something like os.listdir?
yeah.. :)
@Ffisegydd Well, technically it's 08:07 right now.
@ZeroPiraeus Ta! I knew I'd read that somewhere. :)
at the same moment I asked I found that one :)
11:09
@Zero nice :P
FWIW, in ancient times, I knew how to set tab stops on one of these babies, using the program drum.
@PeterVaro os.walk is nice, but it's generally overkill; I use os.listdir_far_ more frequently.
yepp.. although I have to manually filter for dirs
@RobertGrant I had a discussion with someone on SO about tabs vs. spaces (yay) once and he was surprised that all my things used four tabs by default since he only knows 8 and didn’t consider 4 normal…
@PeterVaro In the future, that will be somewhat more performant (doesn't help you now, I know, but still).
@PeterVaro yes, os.walk() does exactly that under the covers, filter the os.listdir() result.
11:18
all righty, thanks guys :)
@MartijnPieters While I think it’s a good canonical answer for this problem, I don’t think the question itself is a good way to identify the problem. But it’s difficult to have one, so I don’t know.
@poke It is very difficult to identify the problem.
And in most cases it isn't as subtle as it is here even.
Yeah, I remember that one question where there was some unicode character that resulted in a different variable name…
I don't know how to alter the question to make it easier to identify. But putting it in the canon at least gives us a keyword to look for.
Found it – that was super fun.
@ZeroPiraeus “similar to pathlib.Path.is_dir() , but the return value is cached on the DirEntry object; doesn't require a system call in most cases;” – so the value is pre-filled already and doesn’t need a syscall?
@Martijn that’s true; and I don’t have any suggestion on how to make it clearer either.. :/
11:23
@PeterVaro: if you are using Python 3.4 you can use pathlib; dirs = [d for d in Path('some/dir').iterdir() if d.is_dir()].
@poke Didn't reread the whole PEP just now, but IIRC from the python-dev discussion it's cached from the OS-level stat calls.
@MartijnPieters ofc I'm using 3.4 -- thanks for the headsup
@ZeroPiraeus That sounds good. Otherwise it would have been the same :P
@MartijnPieters suggested title: "Why does my return act like it's more indented than it is?" Not perfect but at least mentions indentation.
@Martijn I changed the title, this might make it better
11:26
@poke ah, yours is better :-)
@Zero I made it a bit more generic now :P
@MartijnPieters ahh.. this is wonderful, and I can do d.name to get the actual bare folder name
nice :)
@poke thanks, that is indeed an improvement.
@poke @PM2Ring thanks for the insight :) makes sense to me, except that it's still in the Python spec :)
@poke Oh the joys of Unicode. Next up: NFD vs. NFC forms.
11:33
That actually wasn’t the question I was referring to… but I can’t find the one I mean ^^
In question I was looking for, OP had two variables and one was written with another character that looked the same, so it was two different variables…
I wonder if it was deleted without me noticing :(
I hate when that happens.
@poke Python 3 then. I think I've seen something along those lines.
Like using a Cyrillic character that looks just like the ASCII character.
Oh! Found it!
The question title was just bad: stackoverflow.com/questions/14056875/…
Yeah, same thing :P
11:42
Mine was an A though
Or wait.
Wow.
Thank you for pointing out a mistake in two year-old answer xD
@poke you had two in there, the o and the a.
Or wait. Wasn’t that wrong. I just linked to the A from the val and ignored the o in total :P Good enough, no need to fix that.
>>> '''\
... total = 0
... for val in range(5):
...     vаl = val * val
...     tоtal = total + val
...
... print(tоtal)
... '''
'total = 0\nfor val in range(5):\n    vаl = val * val\n    tоtal = total + val\n\nprint(tоtal)\n'
>>> ascii(_)
"'total = 0\\nfor val in range(5):\\n    v\\u0430l = val * val\\n    t\\u043etal = total + val\\n\\nprint(t\\u043etal)\\n'"
11:44
@MartijnPieters TIL ascii… xD
U+0430 and U+043E
Both are closed -.-
Kids these days... writing a number to words converter is an excellent exercise for new programmers. IMHO.
Mind you, I've never done it in Python. But I'm sure it's somewhat easier than doing it in C.
Hey I'm getting heavily downvoted on this stackoverflow.com/a/28024380/4099593 ... Anybody knows why?
12:21
More non-answers to delete: stackoverflow.com/users/4469927/jack
@BhargavRao Didn't vote, but what's with the extra spaces in there?
'{} \n' instead of '{}\n'?
@Martijn poor Jack is going to think, you, jonrsharpe and I are bullying him :p
Aha .. Eagle eyes ...
edited
@BhargavRao ahhh - no they're ninja eyes - eagles are jealous of them :)
12:23
Yeah..
But why don't people comment before downvoting?
Some do - some don't
Better add a comment there also
0
Q: How To Deploy: Installing Mezzanine Theme

sddHow to install Mezzanine Theme exactly, step-by-step? E.g., Moderna free theme.

What is he up to?
Yeah that's an annoying question. Voted.
Looks like he's trying to do a reference post...
heya @Rob
@BhargavRao a self-answer, but the question is not up to standard.
12:37
@JonClements wotcher
Have you just been possessed by @Zero? :p
heya @aberna
@MartijnPieters I guess he forgot that the hat season is over
@JonClements I don't always use that greeting ... but when I do, I spell it right ;-)
12:42
@ZeroPiraeus Sorry :(
Let the hyperlink battle commence! :)
@RobertGrant -1, no meme reference :-P
@ZeroPiraeus ah, this is beyond me then
Okay then... in Mortal Kombat style... @Zero FINISH HIM!!!
12:48
C-C-C-C-C-COMBO BR-oh. Wrong again.
12:59
Thanks all of you people, im new to programming. my question may be dumb, but i learnt something,.. i also would really like to know whats the exact reason to get down voted, and at the same time getting pretty polite responses with various answers with explanation too. — arvindh 2 mins ago
Replied
Feelin sad for him
Umm... better than being rick-rolled - thanks my "friend" for sending me that link :(
@JonClements I think the real opposite of .rstrip() would be something like this:
def not_rstrip (str):
    import random
    while True:
        str += random.choice(' \t\n\r')
    return str
that's just evil :)
13:08
The question stackoverflow.com/questions/28024595/… should be spam .... The guy is propagating about what he has done I guess
Hey, I’m just going by the definition of rstrip which removes any number of whitespaces at the end of the string :P
@BhargavRao How is that spam? It’s a very good answer to a bad question.
Can you imagine Python and the opposite of lstrip? str = random.choice(' \t\n\r') + str
(I kid)
@poke He has answered it himself.... I guess he has done that project and wants all of us to visit it ..
Yeah I've done that before. Partly so I can find it again :)
@BhargavRao Visit what?
13:10
@poke You forgot the non-breaking space \x0a, and you need to add a random number of characters for it to be useful, rather than make it an infinite loop. :-P
Oh noes.
@poke Visit all of his links
@MartijnPieters Don’t take out all the fun by making it useful now.
@BhargavRao That is not spam.
It is a self-answer. The question is just.. bad.
13:12
Yeah.. It is not spam
All my questions are self-answered.
But advertisement
How is it an advertisement? What does it promote?
It’s not an advertisement?
Those links which he has added ... I clicked on each of them .... So felt that others would have done the same
13:14
PythonAnywhere is a well known hoster, linking to askubuntu SE very likely isn’t any advertisement, so all that’s left is the theme, but it#s only being used as an example. And it’s from an independent designer.
Is there something like djanog ?? Or is it a typo
Djanog is the web framework used by the Elder Gods and their High Priest, Cthulhu.
@BhargavRao It's a Python-based Web framework for dyslexic people.
13:19
@poke I bumped into the owner of PythonAnywhere when I was working on the Python Job Board... we had a small discussion about his services offering something similar to what that Sphere thing does
@Jon And? ^^
@poke we had a chat about a proposed API, then I forgot about it, and I presume he did as well :)
lol
Good job :P
What can I say... I'm a professional!? :p
Okay, this is funny. Earlier today, my side-buttons of my mousewheel stopped working in Firefox (I switch tabs with it). Then just now, the wheel stopped working completely. A reboot later, it works again.
13:25
Probably a bit late to "out of the blue" re-establish that discussion - at the time I thought, it'd solve our "running code" inside RABBIT
Wow, pythonanywhere is free for development?
Will have to look at that
@JonClements what's sphere?
@Robert a similar service for running Python code.
guys i want ask
about django in tango with django
@RobertGrant It’s what ideone.com uses
Nice, in-browser SSH terminal
13:29
@icemelt if you have a question, just ask.
this code is about user loggin
def some_view(request):
if not request.user.is_authenticated():
return HttpResponse("You are logged in.")
else:
return HttpResponse("You are not logged in.")

what i confuse is why he use "if not"
Ah okay, looks as though it was made by ideone
@icemelt you've got that backwards
Get rid of the not
Oh, that's what you're saying.
what do you mean with i've got the backwards??
is that code wrong?
13:31
yeah, it’s wrong
@icemelt get rid of the not
oh silly me i thought it's wrong too
so i should contact the author right?
Unless being authenticated suddenly means that you are not logged in…
I've no idea what that code's used for. Let's say yes :)
13:32
cbg @AnttiHaapala
@icewelt Well spotted though. Seeing issues with other’s code is the best proof that you understand what’s going on :)
@RobertGrant I was using in browser terminal 15 yrs ago, though it was a java applet.
Guys what is the attribute to maximize tkinter window? root.attributes('-fullscreen', True) makes it full screen. I want it to be maximized only
@RobertGrant probably last millennium :D
@BhargavRao zoomed?
5
Q: tkinter python maximize window

Rasmus Damgaard NielsenI want to initialize a window as maximized, but I can't find out how to do it. I'm using python 3.3 and Tkinter 8.6 on windows 7. I guess the answer is just here: http://www.tcl.tk/man/tcl/TkCmd/wm.htm#m8 but I have no idea how to input it into my python script Besides, I need to get the width a...

@AnttiHaapala Yeah .. It's workin cool Thanks
13:37
@poke @RobertGrant thanks for the reponse guys
Downstairs is noisy today
Oh, you have your friends over?
yes... be nice if they weren't quite so "talkative" :)
@icemelt sure
@AnttiHaapala no, sure, but it's much nicer than using Heroku, especially on a corporate network
Okay... soundbar with music with a good bass seems to drown them out...
13:46
Bloody puppy muscling in on my territory!
This is how wars begin. I'm going to have to go start brushing up on itertools now.
Oh beep - itertools is easier than numpy as well - cowers in the corner
I was half way through writing it as well. I'll live though, as long as Martijn doesn't start answering too many.
I think fjarri's point was "You can use a list, it just won't do what you think it will do." because in your answer you say "You can't use a list"
Ahh... I'll elaborate
@JonClements The white dog at the back left looks possessed; see those eyes? :-P
13:55
I forgot to turn the flash off
@JonClements Where is your evil twin?
@BhargavRao ahh... so I'm the good twin then? :p
face falls off revealing circuitry
@JonClements Not yet sure ...
You took the coin away
Only because the evil one would have done and then used it for his own evil purposes...
It was much safer for the entire planet that it be in my stomach
13:57
pushes face back into place
@JonClements that's the best no diet excuse yet

« first day (1556 days earlier)      last day (3616 days later) »