« first day (1020 days earlier)      last day (4154 days later) » 
00:00 - 16:0016:00 - 23:00

00:00
although it is working now... but I don't think that is a real solution..
anyway, thanks for the help @ZeroPiraeus
If you're looking to sanitize numeric input, maybe something like:
>>> import re
>>> illegal = re.compile("\D+")
>>> text = '\x7f10'
>>> re.sub(illegal, '', text)
'10'
Of course that's going to surprise anyone who enters e.g. '2.5' ...
Doesn't tkinter have specialised numeric entry field widgets that do that stuff for you?
Yup.-2.0 would be.fun ;-)
00:39
I just got the "Loser" gold badge! Woo! stackoverflow.com/help/badges/83/fanatic?userid=1014938
 
3 hours later…
 
2 hours later…
05:39
cabbage
06:27
st
 
2 hours later…
08:23
08:34
jinja2.exceptions.UndefinedError - UndefinedError: 'defined' is undefined
I lol'd
08:51
Hello
09:07
I have a list but for God's sake I just can't join it. WHY.
I tried literally every single unicode post I could find. smartstr, u''.join and whatnot.
But it just won't work.

It dies at the file output:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 23: ordinal not in range(128)
xkeyscore
fingers crossed
error. where do I execute this command exactly?
If I try to apply it before the join:
= "".join(parts)
UnicodeDecodeError: 'ascii' codec can't decode byte
Correction: It does not work BEFORE the join
even if I use the u"".join command, it throws the same error.
What else could I do with my array to make this work?
(It's a basic array with .appends
09:38
could you make a Pastebin with your code, please+
http://stackoverflow.com/questions/17990048/touchmove-a-div-character
930 edit reviews, only 70 to go!
nice
09:56
cabbage
0
Q: How to equalize the scales of x-axis and y-axis in Python matplotlib?

perfectionm1ngI wish to draw lines on a SQUARE graph. The scales of x-axis and y-axis should be the same. e.g. x ranges from 0 to 10 and it is 10cm on the screen. y has to also range from 0 to 10 and has to be also 10 cm. The SQUARE shape has to be maintained, even if I mess around with the window size. Cu...

@limelights - sorry I managed to get it working after a while
(now I'm back to where I was days ago... ehhh)
hehe :) good to hear?
there is a huge array, and I set up a loop.
If a new line comes, I append a line of from the other array, and add a new line.
But somehow it just won't work out. Thanks for the help btw!
10:41
Cabbage all.
My newest mascot is taking a seat in the USB slot.
lol cool
you should clean your laptop :(
@MartijnPieters funky...
I should indeed.
@MartijnPieters does it need cleaning? I can't tell from all the crap that's on my screen ;)
10:49
cbg
cbg - potato?
potato, potato. potato?
the same ;)
yesterday I created the basic SCSS layout of the site. We have syntax highlight for python inside -- with sopython flavour
10:50
I have a mascot ninja now.
@MartijnPieters so, with the usb stick, that ninjagogo thing... your employer will really start to have concerns about you ;)
They might object to turning up to the office dressed all in black with shurikens though...
Who needs shuriken when I have a nerf gun?
May have to paint it black though.
a nerf gun that shoots shurikens
now, that would be badass
Yes - they're not normally the most subtle of colours ;)
@MartijnPieters wtf... how come that default mutable argument isn't closed yet... that should have gone in like 2 minutes
Gotta get me a paintjob like this:
10:55
@PeterVaro sorry Peter - I was rambling on to Martijn.... there's syntax highlighting as well?
@JonClements I voted. You didn't post it here with though.
@JonClements yepp! iw will be great, really;)
@MartijnPieters omfg... have you seen the answer from Alfe?
have now..
11:01
haha - knew it wouldn't be able to resist a comment... otoh, it just made me somewhat speechless
@MartijnPieters oh - they're having a go at countering your argument ;)
anyway @JonClements look at this^, I have top-load widgets now!
@PeterVaro I have visions of that being awesome on a tablet device
could be
I'm going to change the GUI system from tkinter to custom opengl
and after that, it could run almost anything
Considering you basically learnt everything about this from scratch....
that's right.
literally my second GUI project
and you know, tkXT was the first one
and basically my 5th python project ever..
how to 2to3 -w *.py all files and all files in all subfolders and subsubfolders, etc. ?
11:17
Umm.... think there's an option that does that
Or, don't you just run it on the base directory and it recurses...
or am I confusing that with another tool.... errrr
haven't used it in ages
I can't find any option for this..
if I run it on a folder instead of a .py file, it will do what I want?
umm.. interesting, but there is no mention about that anywhere..
you were right @JonClements:
> 2to3’s basic arguments are a list of files or directories to transform. The directories are recursively traversed for Python sources.
Phew - not going too senile then ;)
no you are not;)
Not what?
> RefactoringTool: Line 147: cannot convert map(None, ...) with multiple arguments because map() now truncates to the shortest sequence
do I have to change those manually?
11:27
guess so... Never seen that one before...
me neither..
and I don't want to tinker in a huge code base like this...
@JonClements lol :)
sucks deleting posts :(
11:43
hi again @vaasu
@limelights Aw, I was just commenting on that post..
It was a valid attempt on the basis of the title alone. :-)
Yeah :)
hello@jon clements
I speed read the question and thought to myself "he said random, but his prefered output suggests something else, ah, to hell with it!" :)
@limelights what's that ?
11:45
@JonClements nothing, i was scrolled up and was referring to the Alfe post
@JonClements limelights answer to the "Python two list lists shuffle" question.
oh, I guess not.
Oh... wow - you both answered two different things to the same question
Martijn - you got the correct context ;)
What, now i'm lost
You are not the only one..
11:48
@limelights I might have been tempted to go for: print sorted(chain(a, b), key=lambda L: random.random())
I think "interleave" might be a better word for what the OP wants there. No randomness involved.
@JonClements Your answer was actually really nice, makes me really always think of itertools more
i am very bad at utilizing them
@limelights This was a fairly good example (imho): stackoverflow.com/questions/17971690/…
And this one wasn't too bad: stackoverflow.com/questions/17854381/…
HAHA:) after days of searching and tinkering, pyglet now running perfectly on Python 3.3.2 and Mac OS X Mountain Lion 10.8.4 -- it was a hell of a fight...
Victory to Varo! Victory to Varo! Victory to Varo!
11:51
what do you think guys, should I create a post on SO? because all the Q&A up there are not real answers... non of them are working..
@PeterVaro not quite sure what you mean?
TONS of people are complaining about pyglet that it is not working as it should on python3 and other ones are complaining about Mountain Lion support -- etc
they were asking on google threads and on SO as well
but most most of the answers are still not accepted -- because no one found a solution
perhaps this would be the place for you: pyglet.org/contribute.html
Boy I really dislike developing for android. The reason being, my fingers always type "andoird" on the first pass, and you have to type "android" a lot.
http://stackoverflow.com/questions/17993328/what-are-some-good-online-resources-on-angularjs-nodejs-integration
11:55
hi there!
@Kevin it's Anne Droid! :)
@StackUP howdy!
:D:D:D
Oh I loved that episode
can someone help me , in installing "postalmethods"
it was FANTASTIC
found it in this link
11:58
@StackUP looks like you should ask the company that provides that service...
@JonClements : but if it is a python script , this must be a package what we are importing. and should be available in library. I googled a lot but found nothing other than it's website
@StackUP by library - do you mean pypi?
can I delete all the .bak files after 2to3?
if you want to I guess...
although I'd probably make sure I've still got a copy somewhere... (or in a repo. or something)
heya @jozefg
Hi!
12:05
@JonClements: i dont know what is pypi probably is a python library.
in rough language what ever package i want to use in python using import command it should be installed in my system , if they are using this postalmethod package , so someone must have written it and should be available for installation
PyPI is the Python Package Index.
@StackUP that makes sense... but if it's by a company that offers a service - it might only be available as part of the membership in a personal members area... It's up to you to look at the site and read their boards/FAQs about it... It's not a general Python question
hi @ jozefg
popping out for lunch - bbiab
i had a issue in python, could you please help me out.
@jozefg
12:09
@JonClements: it means they got it done from some developer at their end and it is not opensource. I guess
@JonClements: sorry , thought it was a python question thats why i asked here
@JonClements: found module on their site :)
thanks mate
12:52
@stackup no problem fella... have fun
In this string
`<open file u'C:/Users/Animesh/Desktop/matrix.dat', mode 'rb' at 0x01E234F0>`
I need to extract the path ...
`re.match(r"['](.*)['][,]", string)` given `None` always
*gives 'None' always ... what change should I make in the re?
File objects have a filename attribute - use that
Why the character classes with just one character?
Just match the literal character instead..
@martijn why the fileobj repr to begin with... :-D
And you have a file object; don't confuse the string representation with the object itself.
13:06
Actaully I was trying to get the file path from tkinter
file = tkFileDialog.askopenfile(parent=root,mode='rb',title='Choose a file')
That returns a file object.
yes but how do I then get the file path
I linked you to the documentation
Now go read it. :-)
And look at os.path for some possibly useful... ask again if the docs aren't sufficient we've referenced
13:09
I tried os.path.abspath() but again I need to pass a string and what I have is a file object!
its file.name !
Firmly OT, not a practical programming problem.
what does this message mean:
2013-08-01 15:20:23.849 Python[11068:f0b] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/16/_3s9czk55q57fv8_rq3kbt980000gn/T/org.python.python.savedState
?
13:24
Is your question "why has it happened"?
yepp
right now, I'm having this after running any py file
No idea... pls feel free to accept my answer if it helped ;-)
all I did was 2to3 the pyglet library, run it once -- to see if it is working
and now it is working, and I put it on a different branch in my repo
switched back to my original repo
running the same file I always do (main.py)
and I'm having this..
it is working though
just curious what this message means and why is this happening..
;)
@JonClements +1 for honesty
It's such a lonely word ;-)
I finished debugging the too clever code I mentioned yesterday. Boy was it awful.
If I ever meet my past self, I'm going to bludgeon him heavily for catching and silently ignoring an exception.
13:29
@Kevin:
> "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." -- Brian Kernighan
;)
no offense, just came to my mind.
Sounds like your too clever code was in fact not that clever... qed you should have been able to debug it that easily...
Luckily for me, the code that was actually the problem was only at 49% of my maximum cleverness quotient :-)
So it was within the parameters for debugging
hello guys.. in my code i want to display the data which is in the queue on to the tkwindow.
new = self.queue.get()
self.label.config(text=new)
@vaasu tkinter?
yes
13:32
OK, so what is the problem then?
If the data in queue is of about 3 lines, i want to display this data on to the window, but it is displaying only the last few characters of the third line
I hope u all understand
not 100%, but did you tried wrapping the text?
It is not displaying all the elements in the queue, it is only displaying the last few character on the window
yes i done everyrthing but failing all the time.
the queue is one string?
13:34
check it
that's because you are in a loop:
    while self.queue.qsize():
        try:
            new = self.queue.get()
            self.label.config(text=new)
        except Queue.Empty:
            pass
you always restore the actual partial text to the label
you should first store the text and then pass it to the label
i will try this. thank you @peter varo
I tried, but same result
put this line print new after new = self.queue.get()
then copy-paste the result here, please
if i put print new, it prints the received data on the python console, but it is printing only last few elements of the data on the window
I will post the images, so you can get an idea.
13:46
what self.queue.qsize() is returning? and when is it changing?
goddamn it. Why's it so difficult to get this Flask thing running?
when your while loop will stop?
this guy has a funny interpretation of "full code".
I do love it when OPs "helpfully" omit their import statements
@crowz just you probably ;-)
@martijn is it okay to email you some login stuff... for cabbage bot and sopython.com site
sure, go ahead.
13:50
what even is cherrypy?
Will when I get back indoors and create the account
after displaying the data which is coming through the serial port.
sorry guys i am at office and i got a call my my ream lead
team tead
when ever i receives data through serial port, this data will display on the window
Oh good, OP posted his import statements... As a comment D-:
@Jon: so the tuple subclass is really one huge XY problem.
@martijn cabbage is a twisted service with a custom autobahn and the site is moving to a bare git repo
@martijnpieters I am strangely not surprised
13:56
To handle multiple queue items we might for example add a
variable to process_serial() as in:

def process_serial(self):
firstitem = True
while self.queue.qsize():
try:
new = self.queue.get()
if firstitem:
self.text.delete(1.0, 'end')
firstitem = False
self.text.insert('end', new)
except Queue.Empty:
pass
Some interesting changes to PEP 8: hg.python.org/peps/rev/fb24c80e9afb
2
This is the one i wrote the code in text widget, but i want the same output to be obtained using label widget.
@ZeroPiraeus: Thanks again for the awesome little Ninja. :-)
@MartijnPieters np; he looks pretty cool :-)
@JonClements I finally found the answer for that strange message:
> This message is "normal". The patch that I added was to prevent Mac OS X from automatically using or saving the application state (the org.python.python.savedState file referred to below). The side-effect is that you see this message on the console when you load pyglet. I couldn't find any way to suppress it. But you should be able to create and see multiple windows on Mountain Lion now.
> Note that pyglet won't delete the org.python.python.savedState file if it already exists (which may be the case if you ran some other windowed python program), but it does completely ignore the saved state file now.
so I have to live with that
14:02
@ZeroPiraeus I managed to push it into a undefined state when putting a encrypted file system on it; Mac USB has some trouble writing to the last block, apparently.
Will fix it tonight when at home with the Linux box.
I don't get exactly what's going on here github.com/radekstepan/Flask-Skeleton-App
@vaasu so it is working with Text?
what is that guy doing to start the flask server? I don't have a database soo
> Error: -69760: Unable to write to the last block of the device
@MartijnPieters heh ... never though of that, but of course it has to have an encrypted FS. Anything less would be wrong.
14:05
@vaasu you did here just I mentioned: you collect the data first, but in here, you write it at the end of the exisiting text
yes its working with text, but i want the received data to be at center of the window. so label had default CENTER, so i changed my code from text to label
Apparently the recovery mode Disk Utility can handle this case..
Who doesn't use encrypted fs's?
@vaasu text also has justify option: justify = Tkinter.CENTER
Especially for sticks and laptops
14:07
ok, i dont know that. thank you very much. i will have a look of that @peter varo
My phone has a remote "self destruct" even
@vaasu here you can find all the options: effbot.org/tkinterbook/text.html
Unfortunately not with a mushroom cloud but still
I dont want to edit the received data on the window.
@JonClements For USB sticks? I generally don't, but then I generally don't have anything important on them (and I want hassle-free use with any random WinXP box I have to stick them in).
14:09
ok i will have a look, if i face any problem, i will come back for help.
thank you. @peter varo
@vaasu then unbind all the actions you want to prevent, <Button-1>, <Button-2>, etc.
and then you have a "fix" text box
np @vaasu
@zeropiraeus when dealing with personal data - medical / credit for instance - it's a MUST
@ZeroPiraeus: I don't want anyone to add to the stick.
Even if you don't have anything sensitive on the stick, 2 seconds with your stick and you can add an auto-installing keylogger trojan on it, for the next time you use the stick in your laptop.
My travelling laptop has about 3mil pound of data on it... and unlikely that I'd leave it on a train, and hopefully not get mugged, etc. ..
@JonClements of course ... but I wouldn't put that kind of data on a stick unless it spent 99.9% of it's life in a safety deposit box.
@MartijnPieters pretty sure nothing can auto-install from removable media to my machine (if you know of a way to do so to a GNU/Linux box with non-insane autoplay options, please let me know).
14:15
Think one of the DB servers has hardware level enc... to not stress the cpu over the array
And that's in an underground bunker with armed guards or something
Sigh, twenty minutes installing modules so I can test this guy's code, and it turns out to be a mixed tabs/spaces problem
The only time I'm ever annoyed by significant whitespace is when it leads me on a wild goose chase on SO :-)
@kevin your commitment is awesome ;-)
On the plus side, I finally got requests installed.
to be fair, 15 of those minutes was me trying to remember how to install modules
If only SO's code blocks would distinguish between spaces and tabs. I don't think anyone other than Python users would care, though.
@Kevin you can bash people with this admonition now: python.org/dev/peps/pep-0008/#tabs-or-spaces ... it's more opinionated than before.
Wow.
I just opening my program for fun
14:29
Have we introduced curly brackets yet? ;-)
And decided to connect to www.google.com on port 80
It worked
That's not the weird part though.
97
A: Is it true that I can't use curly braces in Python?

Lars Wirzeniusif foo: #{ print "it's true" #} else: #{ print "it's false!" #} (Obviously, this is a joke.)

What's weird is I clicked "Create" which ideally would have the server send a reply code back to confirm it had done what I asked. (Join or create are two choices you get if you connect to the server or a server sucessfully)
Of course, it's google.com
It doesn't work like my server does
But 5 minutes later
The chat opens
So it must have recieved a correct reply somehow
Ah, and here's the original: python.org/doc/humor/…
@Xeon, Uh oh, they reverse-engineered your chat specifications. Prepare for assimilation.
14:34
It would probably take them 1 minute.
@ZeroPiraeus short of altering the hardware, I guess not. :-P
@ZeroPiraeus: Still, I am a paranoid git and play it safe.
Was good fun reverse engineering the SO chat ;-)
Need to get 7 upvotes for cabbage so it can be made room owner
Actually, a plain old FAT-formatted USB stick is quite a nice diagnostic tool - stick it in non-technical-friend's machine, wait 30 seconds, take it out, stick it in your machine, see what unpleasant things got written to it.
@ZeroPiraeus I'm heading off to python-ideas to suggest making tabs illegal in Python 4.
@martijn another artist you might like is Imelda May
@wooble long time no see - how ya doing?
14:41
@Wooble I wouldn't be surprised if that happens actually.
Kentish Town Waltz and Mayhem are fairly good
Not bad. realizing that my 3-programmer project needs to hire a DBA that we totally don't have the budget for because we're awful.
"who'd have thought that adding 16K rows to this table that had 400 before would completely break everything?" :)
Heya @rogcg
Just saying cabbge suffices ;-)
14:43
is it considered too?
bok choy or napa is so much better than that stuff ^^
@JonClements Interesting, listening now.
don't talk about cabbage that way
me and cabbage have something special
14:59
@JonClements Reminds me a little of Vaya Con Dios as well.
It's a little too polished almost though.
15:18
How does one make the progress bar step forward ?
Suppose there is a loop with 200 interations and I want to make bar move forward only after an iteration! How can I do it ?
    root = Tk()
    root.title("GUI Example")
    root.geometry('450x100+100+100')
    progressbar = ttk.Progressbar(orient=HORIZONTAL, length=500, mode='determinate')
    progressbar.pack(side="top")
    progressbar.start()
    root.mainloop()
using start() will make the bar progress at intervals of 50ms as per documentation
Should I put progressbar.step(1) in a loop ?
if you do something like for i in range(100): progressbar.step(1), then it will step 100 times without actually refreshing the GUI.
So from the point of view of the user, it will be at 0, freeze for a bit, then immediately be at 100.
Ok so that is what is happening
Perhaps you could use the after method to periodically update the bar.
so should I use stop() method to stop it after every iteration
Typo error; OP was looking for wrong filename (different extension).
15:27
If you want to manually control when the progressbar changes, you shouldn't use start or stop at all.
anyone here used Django?
(this is not a plea for help)
@Btuman @limelights are you here? (I have used Django, but a while ago, and not for anything big).
I just was wondering how it compared to rails
if it followed MVC
or was a different structure all together
@Kevin May be I could use an indeterminate progress bar !
15:37
Blasni Blasni
@AnimeshPandey, does your project use threading? Because IIRC if your 200 iteration loop is performed in the same thread as the display logic, then no change to the GUI can occur until after the loop is finished.
It may be constructive to have a display thread for GUI business, and a worker thread for your 200 iteration loop. If progressBar.step is thread safe, you can call it once per loop iteration and it ought to update properly.
But you also pointed out that, to the user it would appear to start and end at the same point if step() is used in loop!
Wow - fingers crossed - might have just won a contract
@JonClements cool now mail me donuts :|
without showing off your true self via the drunk elephant they would have never awarded you it ;D
Yes, if the application is single-threaded, then the bar won't update until the loop ends and tkinter has time to perform GUI changes. But if it's multithreaded, then Tkinter can perform changes before the loop completes, as desired
15:51
Being the drunken elephant of course a custom and massive keyboard has been built so I can bounce around on it...
. haha
hmm what's Monty's and Guido's versions of python ...
It's going to be highly productive
i only know of the latter
You rang...?
.......... Monty as in Monty python the movie thingy? / tv show?
15:53
I have even mastered falling over the keyboard while it implements swype motions
Should probably learn Python at some point though ;-)
The show is language's namesake
mhmm
it's in the docs
lots of monty references
i was wondering if someone decided to make a parody python though
... i should do that :|
dammit, I just wanted a link
00:00 - 16:0016:00 - 23:00

« first day (1020 days earlier)      last day (4154 days later) »