« first day (1674 days earlier)      last day (3265 days later) » 

3:21 AM
BIt of a newbie to Python. I can get all the directories using listdir, but I need to get all the sub-directories and files as well. Then I need to read them. Any links that would help me out?
 
I have a few questions about Python Package naming...
...Say you're creating a new python package, and you thought of a sweet name for it...that's currently taken...by a dead project.
Would it really be so bad if you just...used the name too?
Secondly, is there some sort of guideline/unwritten rule when it comes to naming python packages?
You got your somethingpys, and your pysomethings...
 
cbg
 
What's the protocol there (if any)?
@Ajay cbg
 
@NoobSaibot Check this section from the Python Style Guide PEP-008
 
3:32 AM
http://stackoverflow.com/questions/30282600/python-ranking-dictionary-return-rank/30282702#30282702

somebody plz tell what's wrong with my solution
 
hmm... whenever I use os.walk and use print(os.path.join(subdirs,name)) the program crashes, but if I switch it back to print(os.path.join(maindir,name)) it works fine. Any ideas what I am doing wrong?
 
@thefourtheye Informative, but doesn't answer my questions.
 
 
1 hour later…
4:47 AM
@NoobSaibot cannot upload to pypi with that name
 
5:04 AM
Now looking for the best or quickest solution to filter by extension.
When using os.walk()
 
os.path.splitext(). Really, try reading through the docs, searching Google, and searching SO. The answers are out there, you just need to try and find them.
 
@MattDMo, trust me, I've been searching and everything always comes up short. I don't mean just for an hour. I've spent countless hours over a long span of time, more then I'd like to say looking for the right info. Thanks for your time.
This language is a lot more thought out than PHP.
 
5:25 AM
Do you guys think this answer makes sense?
 
6:00 AM
writing such recursive code looks complicated and not intuitive. repeat(square, 2)(5)
def repeat(f, n):
    def identity(x):
        return x
    def apply_n_times(x):
        return repeat(f,n-1)(f(x))
    if n < 0:
        raise ValueError("Cannot apply a function %d times" % (n))
    elif n == 0:
        return identity
    else:
        return apply_n_times
this recursive code looks more intuitive.
def repeat2(f, n, x):
    if n < 0:
        raise ValueError("Cannot apply a function %d times" % (n))
    elif n == 0:
        return x
    else:
        return repeat2(f, n-1, f(x))
g = repeat2(square, 2, 5)
What are the advantages of this style of programming? repeat(square, 2)(5)
 
6:45 AM
cbg
Am I dumb? Why does sopython.com resolve but www.sopython.com not?
 
7:27 AM
good morning
 
7:48 AM
@AdamSmith don't think you're dumb, I have same, as I reported the other night (persists here for me)
Morning, by the way
 
I'll speak to davidism. Might be when we moved servers we didn't set up www
 
I guess so, probs either a www prefix or a wildcard missing somewhere. He might be aware, we had a timezone constrained brief exchange about 30 hours ago, IIRC
 
 
2 hours later…
9:42 AM
Cbg
 
10:30 AM
cbg
btw: tonnikala rocks
if you're in need of a good templating language, consider using tonnikala
 
10:41 AM
antti i looked up alot of stuff, you send me
found out that you can install pymongo on windows directly with an .exe file
 
@AnttiHaapala you need a blog post comparing to jinja2, say
Like this, but for templating :)
 
@RobertGrant ironic that you post armin's post..
there is no feature parity with jinja 2 yet though :d
tonnikala exceeds jinja2 in some, lags in others
if I did the jinja2 syntax, well, then...
You can use a dot (.) to access attributes of a variable in addition to the standard Python __getitem__ “subscript” syntax ([]).

The following lines do the same thing:

{{ foo.bar }}
{{ foo['bar'] }}
and this too... I do not like it :D
 
Indeed :)
I actually really liked that post of his; helped me understand a bit more coming from Django
 
@RobertGrant currently tonnikala allows embedding Python expressions, and that's it
if you have a property foo, then you use bar.foo
if it is a dictionary key, then use bar['foo']
 
Well that's okay, I'd probably write that anyway for clarity
But I guess a designer might struggle because they need to know which is which
 
10:48 AM
yeah, tonnikala is not the templating solution for the "designers"
this is for the engineers
 
Yeah, makes sense
You should market it as such :)
The Full Stack Developer's Templating Language
 
most of the engineers are better web designers than 90 % of the "web" designers anyway
I don't understand why they need to make yet another dsl on top of python
 
:)
Now to learn a bit about dateutil
 
so: in Jinja2 you can do
number|abs
what's the point, is it somehow more intuitive for the designer than
abs(number)
 
Yeah, although the thing is you can read it left to right, which might make more sense with multiple filters to people who aren't used to code, where you read right to left in a sense
Have an arrow operator a la Clojure :)
 
10:58 AM
{% if foo.expression is equalto 42 %}
or this abomination
 
Oh yeah that is weird :)
I haven't seen that before
 
{% extends layout_template if layout_template is defined else 'master.html' %}
also: this kind of computed approach will not probably be supported ever.
or who knows
 
 
1 hour later…
12:06 PM
@AnttiHaapala What do you mean by that?
 
1:05 PM
cbg
 
 
1 hour later…
2:08 PM
rbrb
 
2:26 PM
Hi
 
 
1 hour later…
3:46 PM
I'm using Python with Selenium and I'm having some issues storing cookies. I know asking for help here might be a long shot but I can't find anything else.
 
Have you tried asking a detailed question on stackoverflow.com, including what you've tried, what you expect to happen and what happened?
 
No, I was thinking I'd start here to see if anyone had experience working with Selenium, but asking on SO is my last resort.
 
Why?
(To the last resort bit)
 
Why what? I don't understand. Why SO is my last resort?
 
Yeah :)
 
3:54 PM
When I post a question on SO I want it to be structured and well written, in chatrooms I don't have to be as formal so I think it's easier to ask here before putting down a lot of time which might not result in anything :)
 
Is that because people will spend some of their time drawing the info out of you instead of you having to think of what to say?
 
No, I really have a simple question but I can't seem to find any information about it at all. But I might've just made a breakthrough, I'll keep you posted!
 
Okay :)
If it's simple, it shouldn't take too long to post
If it's a useful thing to add to SO then do it; it'll help someone else in the future
 
Good point. I'll keep that in mind if I don't solve this now :)
 
4:16 PM
@StephanMuller that 90 % of the "web" designers are graphics designers that shouldn't be let anywhere near HTML.
 
Oh, yeah I can agree with that
that makes engineers better "web developers" than designers though
 
and if they can do HTML, then let them do HTML and have a templating language that is reasonably close to HTML...
if they'd understand baz|bar|foo but not foo(bar(baz)) then I'd not let them anywhere near the templates in my projects
 
yeah, as a front-end dev I rather not let designers touch my code either
 
there is the argument that "templates are not code"
"just presentation"
 
4:40 PM
Isn't that like saying "Javascript is not code"? :P
 
5:12 PM
Stay classy, Lounge!
 
 
2 hours later…
6:48 PM
cbg
personal nitpick: if I ask you for the date, and you tell me "Saturday," you're just the worst kind of person.
 
Maybe they thought you said "a date" and wondered why you got annoyed
 
@AdamSmith the ladies love you, man.
 
"I need a report reprinted." "Sure. What's the date for it?" "Saturday."
grumble
 
7:04 PM
Wow - these spicy potato wedges weren't lying about the spicy
 
 
1 hour later…
8:45 PM
cbg
and closed
 
user559633
 
10:52 PM
@Kevin's list.append(Ex Machina) | 8.9/10 => the rules are the same as always, do not read anything about it, just let it surprise you!
anyway, @Torxed, @JRichardSnape, @XavierCombelle, @QuestionC thank you all for your answers about the non-blocking stdin reading, and sorry for not accepting/answering in the last few days, but I was not near my computer => I will test the answers tomorrow :)
 

« first day (1674 days earlier)      last day (3265 days later) »