« first day (1349 days earlier)      last day (3592 days later) » 

DSM
12:00 AM
For example, if it were actually set_daemon and not setDaemon, that would probably raise an AttributeError, but you wouldn't see it and it would take forever to notice..
 
12:52 AM
except Exception as error:
print 'Somthing unexpeted happend : /'
print error
sys.exit()
 
 
1 hour later…
2:20 AM
Hey, I was looking at SDL2, and noticed one of it's prerequisites is PyPy, which describes itself as an "alternative implementation of the Python language". But can it coexist with a regular Python installation? I've checked the FAQ, and it doesn't seem to mention anything concerning that. Might anyone know if I can?
 
3:04 AM
It's a completely separate installation. You would access it with the pypy command instead of the python command. If you use virtualenv, you can create an env for the pypy interpreter just like the standard cpython interpreter.
 
@Owatch: You just got an answer from davidism; you're probably not around to see it though.
@Owatch: Besides what he said, I don't believe SDL2 requires PyPy. I mean, SDL2 is a C++ library. There is at least one PyPy wrapper for it, though.
@Owatch: There are also Python wrappers, C# wrappers, etc. Lots of ways to use SDL2 from various languages.
 
heya @JohnY :)
 
Whoa! What are you doing up?!
I mean, cbg!
 
3:19 AM
oh - the same old, skype conferences at stupid hours
cbg right back at you, potato?
 
CBG!
I have the following in my views.py file
 
Eh, not bananas, but fine. Yourself?
 
from django.http import HttpResponse

def hello(request)
	return HttpResponse("Hello World!")
Does it have any errors?
 
@JohnY constantly tired, but otherwise mostly okay - nothing to grumble or moan about
 
@Ufoguy you have committed the cardinal sin of tabs instead of spaces
 
3:22 AM
@Ufoguy yeah... you're missing a : after the def ?
 
Thanks @JonClements
 
Yeah, it should be def: hello(request) etc. ;)
 
def hello(request): works
 
is works a global variable or something?
 
how amazing... I'm shocked by this news...
english sarcasm does come to the fore when I'm tired though :)
 
3:24 AM
LOL
;)
No matter how hard I try I always do some kind of typos or simple mistakes
I need to improve my memory
 
Nope - you need to learn to read exception messages :)
 
That too
 
I have no idea if you're using flask/django or similar
 
django
Just learning
 
okay, you'd have got a full trace back if you run it in debug mode
 
3:28 AM
I was getting a error in line 3
message
I didn't read the rest
I will from now on though
 
please do :)
Errors/Exceptions and anything similar in any language, isn't "done for a laugh"
@JohnY been up to much?
 
@JonClements: Well, trying to finish a major project at work.
I've been throwing a lot of weekend and evening time into it. I have a hard deadline coming up.
Been pretty much a hermit for several weeks now, and will continue to be for another week or so.
 
Okay, that's not the greatest position to be in :(
 
Yeah. But that's how I think it often is at my kind of company.
 
However, we must be on the same boat or something, been there done that, doing that, will do it again no doubt
 
3:42 AM
No doubt.
 
If these guys don't call me... I'm going to be seriously annoyed
 
Seriously! This is pretty ridiculous hours for you. Where are they supposed to be calling from?
 
Oz
(obviously I don't mean "The Wizard of")
 
Yeah. They don't have Skype in the Emerald City.
 
Or phones I guess
Maybe, just maybe, they're hot ballooning the conversation
 
3:46 AM
I was just thinking perhaps flying monkey.
 
ahh yes... good point
 
how to merge the list inside the dictonary ex {0: [2, 3, 4], 1: [6, 7, 8]}, need [2,3,4,6,7,8]
 
Do you have to preserve any kind of order?
 
@john my concept is 2-4,6-8 means i need a list in [2,3,4,6,7,8], how to do this..
 
But what I mean is, are you OK if sometimes you get [6, 7, 8, 2, 3, 4] instead?
 
3:52 AM
its ok
 
The most concise way is probably list(itertools.chain.from_iterable(mydict.values())).
 
[x for v in mydict.values() for x in v]
 
sum(d.values(),[]) (provided that you know the values are all lists)
 
@john NameError: global name 'itertools' is not defined
 
You need to import it.
 
3:57 AM
(not that you should do it my way)
 
@zer
@ZeroPiraeus, It is working fine... Great idea...
 
@user3736293 what are you going to do with the list?
Because @JohnY's solution is better in some circumstances (and can be more concise, too).
 
@ZeroPiraeus, actually we have lot of bag nos, user will enter like this 2-5,10-15, then its value will update in the stock, that's why i searching this solution.
Thank you Friends...
 
So ...
 
@Volatility: Points for knowing the quirks of sum well enough to exploit them, I guess. I really figured they would have at least cleaned that up for Python 3, but I just tried it and they didn't. :P
 
4:06 AM
... each of [2,3,4,6,7,8] is a bag no, and you'll iterate over them to update in the stock? Is that it?
Because if you're iterating oover the list, you're better off with the chain solution really.
 
@Zero are you available later regarding dystroy.org/miaou/100?python-meeting ?
 
@Jon at 14:00 as per the schedule, or later tonight?
 
as per schedule
 
Yep, will be there.
 
thank you
 
4:09 AM
@ZeroPiraeus, i will write the value in text field 2,3,4,6,7,8 like this format.
 
Ah, ok. using ','.join(...) then? That's still iteration ...
 
@ZeroPiraeus, for example, Grade A is a product this product stocks will calculate in number of bags, 2,3,4,6,7,8 = 6. if i dispatching means it will get the value from this number of bags.
 
Nope, I can't parse that sentence at all I'm afraid.
 
@ZeroPiraeus Grade A is a product, production is number of bags are 4-8,10-14. This value is calculate as 4,5,6,7,8,10,11,12,13,14. this all values are updating in the grade A. Ok?
 
Er ... I'm going to take a guess that what you mean is for each of 4, 5, 6, ... you want to do something. In which case:
from itertools import chain
for bag in chain.from_iterable(mydict.values()):
    # do something with bag
... is probably your best bet.
And, bedtime for me. @Jon, any other RO's about: see you tomorrow :-) rbrb and all that ...
 
4:21 AM
@ZeroPiraeus: Rhubarb!
 
@ZeroPiraeus, yes it is also working...
@JohnY You are correct now it is working...
 
Glad you got it working. I'm also out. Rhubarb to anyone still around!
 
OK Ok Take care...
 
All of those are creepy, but my own country (USA) is one of the creepiest.
 
5:17 AM
How to compare 2 strings
 
@user3736293 You ask yourself, "Self, which of these two strings appeals to me more on an aesthetic level?" Pick the one that you determine is more pleasant to look at.
@user3736293 Alternatively, show both strings to your cat and take the one he does not tear to shreds instantly.
 
i having 2 strings like dd=3,4,5,6,7,8,9 and ss= 4,5,6,9 i want to compare this how to do this.
 
@user3736293 Print them both out to paper and compare how much ink was used to output each one.
 
i want to take matching values ss values from dd how?
@davidism help me...
 
@user3736293 Unfortunately we mere mortals cannot reach into the computer and take what we want, unlike Neo from the Matrix.
 
5:30 AM
can't understand...
 
@user3736293 the subtext is: "don't ask for code"
we're more than happy to point out flaws, or to suggest improvements, but we expect people to try to do things themselves instead of asking for straight-up code
 
@user3736293 this will print what values are in dd but not in ss:
import re

dd = '3,4,5,6,7,8,9'
ss = '4,5,6,9'

ddd = (int(x) for x in set(dd).difference(','))
sss = map(int, re.split(r',', ss))

zyzyx = tuple(set(ddd).difference(iter(sss)))
print(zyzyx)
 
@davidism no need to misguide the poor guy :-|
 
5:59 AM
Hello. I think I may have found an issue with the Recaptcha Plugin for WTForms. I posted on it here: stackoverflow.com/questions/24274764/… it's a week old question but I found out that it might be a bug, and decided to reword and repost.
 
6:34 AM
Cbg my children. Are we all content in the world to of cabbage?
 
6:47 AM
cbg
 
7:05 AM
cbg
 
cpx
cbg
 
CBG
 
I hate where the world is going in graphic design.. have you guys seen the new Material Design by Google?
 
7:28 AM
@PeterVaro This is awesome
 
I'm glad you like it, I think it is terrible.
 
It sucks
 
7:48 AM
Django is a lot hard to learn when compared to Flask
Dang it!
I'm staring at the tutorial like a complete idiot
The book however is very easy to follow
The Django book
 
Cbg
@Ufoguy the docs are actually pretty good :)
 
Thanks
 
8:40 AM
macdown.uranusjr.com might be of interest to some people (in particular @Peter)
 
@Ffisegydd I used mouapp.com before SublimeText
(so, so, so similar)
but since ST has build-systems and such, I prefer that one :)
 
Does ST support rendering of markdown?
 
however this is FOSS -- which is awsome
@Ffisegydd nope, I created a small python plugin, that refreshes the browser each time the file changed
 
Ah ok
 
I don't mind having two windows side-by-side, besides: it is a full-blown browser :)
(I mean I can tinker the CSS in google-chrome or Safari, you know what I mean)
@Ffisegydd haha -- the link you shared also mentions Mou :)
(I payed for Mou, to support the development to reach 1.0 -- it was 1.5 years ago)
@Ffisegydd very nice, it uses Prism!!!!
(although it is not hard to integrate it yourself, but it is a nice feature to have it)
 
8:47 AM
What's Prism?
 
What does Django have that flask doesn't have?
 
that's the one, yes
 
@Ufoguy there's probably articles out there that are better written than what we could patch together here
 
Other than databse syncing using models
 
150
Q: Django vs Flask for a long-term project

Goober McGrooI am looking for a comparison of django and flask for a project that will live for a long time, and will need to be maintained, built upon and grow as the months progress. I am considering Flask + SQLAlchemy or Django. I do not need batteries, as I usually end up having to modify them, so it is...

 
8:50 AM
cabbage
 
@Ufoguy basically Django comes ready with all the tools you need to work with, but they're the Django tools and if you need to replace them then it can be a pain.
Flask comes with (almost) no tools, but allows you to add whatever you need.
 
@Ffisegydd although I think this one is the best and most powerful syntax highlighter (+ code editor!!!!) available right now: ace.c9.io/#nav=about
 
@Ufoguy use pyramid for long term projects
flask and django are written by noobs :P
 
and the only one that uses the same tmLanguage as ST or the predecessor TextMate
which means, you can use my Python3 syntax file, to highlight your code online
 
That's amazing. I might even embed that into my website and have it so I can use it from wherever I need to (probably put it behind a login so random plebs can't use it)
 
8:55 AM
:):)
 
We should put that into sopython @Peter for editing the wiki...
 
@Ffisegydd nice list of users :) ace.c9.io/#nav=production
@Ffisegydd it would be lovely!
 
Because with that I reckon we could put together a Ctrl+K functionality to indent code...
 
I wish we could customise this room's appearance, so when one posts a code it would be highlighted..
 
9:12 AM
Hi how to remove duplicate string values in python
 
@user3736293 like "aaba" -> "ab" ?
 
@user3736293 you were in here 4 hours ago and it was politely pointed out to you that this room is not a code writing service.
We can help you solve problems but we expect you to put the work in as well, and to at least try to solve your own problems first.
 
I having two string a= 40, 41, 42, 43, 44, 89, 90, 91, 92, 93, 94, 95, 96 b= 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, here i want to remove 40, 41, 42, 43, 44, how to do that..
 
Have you tried to solve this yourself?
 
@user3736293 as Ffisegydd pointed out: what have you tried so far?
 
9:15 AM
Yes i tried near by 4 hours
 
can you share what you have?
 
What code do you have so far then? Please share it.
If it's very long then put it in a dpaste
 
I converted to list format, and i tried to set() method but no output...
 
@user3736293 that sounds like a good blueprint
that's why we are asking to show what you have
umm.. indentation does matter..
which loop these lines are in?
rr = dd + ss
print set(rr)
 
Here indentation is correct when i paste there that is unproper indendatioen
 
9:22 AM
you should use the "fixed font.." button on the right when you paste a multi-line text
 
Paste it again but before you press enter, select all the code and press Ctrl+K
 
also, try to post as much code as possible to make it "stan dalone"
 
I'll delete your old message to avoid cluttering the room once you've pasted it.
 
for example, what are dd and ss are?
 
dd.append(rem)
                    ss.append(bag_detail)
                    for ss_val in ss:
                        for dd_val in dd:
                            if ss_val in dd_val:
                                print "Success"
                            else:
                                print "Failure"
                            rr = dd_val + ss_val
                            print set(rr),"WWWWWWWWWWWWWW"
 
9:23 AM
2 messages moved to Trash can
 
there is syntax error in the code ;) no () for print :P
 
Shush Antti :P
 
don't confuse the OP @AnttiHaapala
 
@user3736293 it is hardly self contained, we need the values
 
^ +1
 
9:25 AM
ss = [] and dd= []
 
most probably the problem is that the values are of wrong type...
@user3736293 does the order matter? if you just want a set union, it is this easy:
rr = list(set(ss + dd))
 
You append rem and bag_detail, are these lists? Because if they are then you'll just have a list with a single list inside of them.
 
indeed
>>> set([1, [1]])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
that too :P
anw the full solution:
 
@AnttiHaapala, i tried urs code i got this output only [u'40, 41, 42, 43, 44, 89, 90, 91, 92, 93, 94, 95, 96', u'40, 41, 42, 43, 44, 45, 46, 47, 48, 49']
 
a_list = [ i.strip() for i in a.split(',') ]
b_list = [ i.strip() for i in b.split(',') ]
you need to split the string into separate items
then:
result = list(set(a_list + b_list))
so the result from split is a list of strings that are separated by the given separator...
but you have ' 41' and 41, we will need to remove the extra spaces, that's what strip() for.
then make new lists of those
 
9:31 AM
AttributeError: 'list' object has no attribute 'split'
 
yes, you said you have a string a = u'40, 41...'
now you stuffed it in a list
as I said we shouldn't need to second guess what you have in your code, you just ought to copy paste exactly the minimal actual code that demonstrates the problem.
 
Hi guys
 
anyone interfaced wifi with python
?
 
9:35 AM
              dd.append(rem)
                    ss.append(bag_detail)
                    for ss_val in ss:
                        for dd_val in dd:
                            if ss_val in dd_val:
                                print "Success"
                            else:
                                print "Failure"
                    a_list = [ i.strip() for i in a.split(',') ]
                    b_list = [ i.strip() for i in b.split(',') ]
                    result = list(set(a_list + b_list))
 
I mean used python for wi fi controlling?
 
@AnttiHaapala, Now i changed as list..
 
nope but I do not at all know what you're asking
 
i'm new to python as well as wi fi
 
@user3736293 you shouldn't need your original code there anymore
 
9:36 AM
@user3736293 may I suggest you ask a full question on the site? That way you can give the full detail necessary in a concise manner?
 
@user3736293 +1 for @Ffisegydd's
 
Ok ok, carry on, i am a beginer of python.
 
Whether you're a beginner or the BDFL himself is besides the point, you have come to us for help and we have asked you for more detail so that we can help you but you have not given that more detail. There is nothing else we can do in this case.
 
*or
 
If you ask a question on the main site then please give a MCVE or you are likely to get your question closed.
@Peter what typo? There was no typo. Your brain must be malfunctioning from bloodloss due to your enormous beard.
 
9:40 AM
:):):)
 
9:53 AM
hey guys
 
heyho
 
is it possible to write a pyton script as an alternative for the laptop wifi toggle switch?
 
cbg
 
toggle what? the wifi feature on/off?
 
@raforanz Windows? Linux? Mac?
 
9:55 AM
windows
@ColinO'Coal yes
@Ffisegydd windows
 
Your best bet is probably to write windows cmd line operations and then use subprocess to run them
 
sorry, I was an electronics guys ,also from C background only. Could you please eloborate ?
@Ffisegydd could you?
 
You can probably do what you want to do using just Windows (ignoring Python for a second) correct?
On the command line I mean.
 
@Ffisegydd Yes , we can . like Device Manager ,right?
 
No I mean on the command line.
So you type a command and it'll do it for you rather than pointing and clicking
 
10:00 AM
First you need a way to toggle the mode:
 
whats the command?
 
- external programm
- win32 function
etc.
 
@raforanz I don't know, use Google.
In any case.
You can use the subprocess library to run these commands within Python.
 
@Ffisegydd okay. after I get the commands?
 
So if you find the windows command then you can run it using the subprocess
 
10:01 AM
where is that 'subprocess library" located?
 
So what you're effectively doing is using the Windows command process but you're just controlling it with Python
Type python subprocess into Google and you'll find the docs. It's a standard library built in to Python.
 
@Ffisegydd Yes, I got the whole idea now. Just confused about the technical details
 
Read around the subject a bit, see if you can work it out, and if not then come back with what you've got so far.
 
@Ffisegydd Thanks for your help :-)
 
@raforanz: you can use the DevCon Tool from MS to enable/disable devices on windows (support.microsoft.com/kb/311272)
here a tutorial for do this with your wireless connection: wlanbook.com/enable-disable-wireless-card-command-line
finally you can wrap the devcon command line call with pythons subprocess.Popen() function (docs.python.org/2/library/subprocess.html#popen-objects)
 
10:49 AM
Urgh I think I'm gonna have to ask a question Stack Overflow. Not only that but it's gonna be a javascript question...meaning if I get any type of rep from it I'm going to lose my 100% Python rep :'(
</first world problems>
 
nooooo...
 
It's for that ACE editor and I can't find the answer in the docs
Trying to debug js code is a bitch
 
(full of memes today..)
 
Trying to get "indent selected text" to work
I've got all the components but I can't get the startRow and the endRow from the selected range to pass to indentRows
No wait think I've got a better way
 
11:06 AM
I like to imagine python in the browser will be like electric cars in 20 years. Reddit: "TIL people had python in the browser (electric cars) way back in 2000." --> "Why didn't they just go with that from the beginning instead of javascript (internal combusion engine)?" --> "The javascript lobby!"
... or "Edison"
 
Is there anything wrong with this code
from datetime import datetime
from flask import Flask
from flask import render_template
from flask.ext.wtf import Form
from wtforms import StringField, SubmitField
from wtfroms.validators import Required

app = Flask(__name__)
app.config['SECRET KEY'] = 'fshbert576y54rdfuyhyh45y6'

Class NumberFrom(Form):
	number = stringField('What is the phone number?',validators=[Required()])
	submit = submitField('Submit')

@app.route('/')
def index():
    return render_template("home.html")

@app.route('/the-time')
I'm getting a 500 error
on the server
 
@Ufoguy The main problem I can see is that it's long enough to need a scrollbar and you didn't use a pastebin.
 
11:23 AM
Never mind I had Class NumberFrom
instead of class NumberForm
 
Your secret key is contained within the code itself
I think this is a poor design choice
 
11:47 AM
@Ffisegydd that's generally the way flask works
cbg all
 
You can put the configuration in a separate file, just fine.
but for a quick test setup it is easier to include the configuration in the Python file.
 
@Jon I was under the impression that putting the key in a separate file was better as it can help prevent security lapses when for example sharing code.
 
My current flask projects don't put the secret anywhere in VCS-tracked files.
 
Normally you'd put configs in another file - but if your server is so insecure that you can't put it in the main then you're buggered regardless
 
Sigh, questions where the OP hasn't even run his own code yet :-I
 
11:56 AM
@JonClements what the hell were you doing online at like 4am this morning?!
 
From his comments I'm pretty sure he doesn't even know how to run his code.
 
I couldn't sleep so I started playing with my phone, wasn't expecting an active conversation to be going on here at that time
 
@Ian was waiting for a Skype call
 
@Jon did they turn up today?
 
did they insert expletive here
 
11:59 AM
I love every part of iced coffee apart from the brain-freeze :'(
When you take your new job won't you be firing them anyway?
 

« first day (1349 days earlier)      last day (3592 days later) »