« first day (1627 days earlier)      last day (3319 days later) » 

2:00 PM
( been going through old stuff... good track that's worth listening to )
 
@Katherina, are you using a tutorial while you're working on this Tkinter project? The style of coding you're using seems to be fairly common, and I'm trying to figure out if there's a single source that it's coming from.
 
user4433485
@kevin I did use a tutorial to get it somewhat working, now I am not using any tutorial ;)
 
Which tutorial was it?
 
user4433485
some random youtube video tutorial
 
user4433485
but as I have no sound here it wasn't really worth it:p
 
user4433485
2:06 PM
Atleast I don't get downvote spams:p
 
People have a lot of difficulty starting out in Tkinter because x = Button(...).pack() causes x to point to None, when they expect it to point to the newly created button.
I want to find the person that is teaching everyone that x = Button(...).pack() is acceptable, and have some words with them.
 
Or have words with the Tkinter project :)
 
Yeah, there is an argument there that pack should return the widget instance, simply because it prevents one extremely common class of problems.
 
user4433485
@kevin why ? does .pack() suck?
 
@Kevin, your losing...
 
2:10 PM
@Katherina It works fine, as long as you use it correctly
 
I have mixed feelings about Tkinter. On the one hang I guess it's a good introduction to OO GUI programming because it's fairly small, OTOH, maybe it's too small, so when you try to do fancy stuff, it can get complicated. A rough analogy: it's a bit like trying to do mechanical work in a very cramped workshop.
 
user4433485
Well Tkinter is not as easy as simple html/css for sure >.<
 
My Tkinter Grievances file currently contains 18 complaints.
 
CSS isn't simple :)
 
@PM2Ring I only use it for portability.
@RobertGrant More like CSS is simple, but the browsers make it complicated...
 
2:12 PM
@Katherina How long had you been learning Python before you started learning Tkinter?
 
user4433485
@PM2Ring oh, this is the first time I use python/Tkinter ^^
 
In Django, do you know if we can have the default value on a postgresql table, and not only on a django model field ?
as in, on the table definition
 
E.g. a 3D game engine, only using CSS transforms, is tricky: michaelbromley.co.uk/experiments/css-space-shooter
Third time's the charm
@paco er should be able to, but someone else can verify. My guess would be that Django will keep the default field definition, and not add it as part of the table definition, but I could be wrong
 
In that case, maybe you should put your Tkinter project to one side for a little while and concentrate on developing your core Python skills. If you try to attack too much at once it can get overwhelming. And once you're more familiar with Python, especially what objects are all about, stuff like Tkinter won't be so daunting.
 
user4433485
but if I can't use Tkinter I can't make something with a GUI @PM2Ring ?
 
2:17 PM
@RobertGrant yeah, that's the behaviour, but i was just wondering if there was a way to apply that to the postgres table
Thanks!
 
Certain Tkinter features do require a certain amount of Python proficiency. Ex. Button commands may require knowledge of first-class functions, lambda expressions, and binding/name resolution.
There are many questions on SO like "I have 10x10 buttons in a grid, how do I make commands for each one that prints the current button's coordinates?"
Which requires some substantial magic
 
@Katherina Well, Tkinter's not the only GUI library that you can use. There are better ones. But my point is that it's a Good Idea™ to learn the boring command-line stuff properly first before you try to conquer the exciting world of GUIs. You've got to learn to walk before you can run.
 
Button(root, command=lambda: button_clicked(i,j)) isn't going to cut it
 
Blimey, that sounds harder than I expected
 
user4433485
@PM2Ring you suggest me to learn by using the shell with boring commands and texts like hello world and some maths?
 
2:21 PM
But I guess programmatic GUI won't be easy
 
@Kevin At least Tkinter isn't multithreaded...
 
@Kevin Indeed. A major proportion of the SO Tkinter questions appear to come from people who just don't know enough core Python yet.
 
@Katherina No, you shouldn't be writing boring programs. Projects that are actually interesting to you are much better learning experiences. But if you can find an interesting project that doesn't require Tkinter, that would be a better first step
Being able to identify projects that are both interesting and mostly within one's capabilities, is itself an invaluable skill that needs to be trained.
 
user4433485
But what can you do without GUI like Tkinter? I prefer to struggle and get stuck for hours and make something cool then doing boring programs running shell
 
Make a text adventure
 
2:26 PM
@Katherina Something like that. OTOH, it's possible to do simple graphical stuff without a GUI library. Here's an example I wrote a few years ago that I updated today: LissPBM_RK.py. It plots Lissajous figures as bitmaps in PBM format, which most Linux image viewers (and some Windows ones) can understand.
 
user4433485
How do I open it?
 
@PM2Ring easygui.sourceforge.net might be useful, too.
 
user4433485
:(
 
user4433485
Tkinter seemed to be nice tho.
 
@matsjoyce Interesting concept. For serious GUI work you do need to learn event-driven programming eventually, but I guess there's no need to be thrown into the deep end.
 
2:30 PM
Let's see, what non-GUI stuff do I have in my Old Projects folder...
- Ascii art generator
- BrainF*ck interpreter
- multi-computer chat client
- Project Euler solutions
- Text adventure
- "Kevin Teaches Typing" game
- Dozens of programs that use PIL and ImageMagick to generate odd images and animations
 
Does python have a library that makes it easy to generate pixel graphics? Something like how you have built-in graphics in BASIC or Javascript?
 
So there's plenty of non-boring stuff to do without Tkinter @Katherina :-)
 
At least when I was learning, that was the fun stuff.
 
@Kevin Yeah, like curses!
 
@Kevin Seconding Project Euler.
 
2:31 PM
@QuestionC There's turtle, but that has more in common with LOGO than with javascript.
 
user4433485
what about web application ?
 
You can create images with pixel-perfect control using the third-party PIL library
(or rather, its better-maintained fork project "Pillow")
 
@Katherina you can try Django, but I did a whole project in it and didn't really learn any Python
 
user4433485
Damn
 
@Katherina Tkinter is ok. It's not fantastic, and eventually you'll probably want to migrate to something with more scope, like GTK or Qt. I'm certainly not telling you to never learn Tkinter, merely that you should get a bit more comfortable with core Python first and you'll save yourself a lot of grief.
 
user4433485
2:32 PM
I don't really need to learn web application since I can simply use PHP
 
I'd just complete a Python tutorial first
 
@Katherina, I would recommend Flask
 
I mean easily create graphics to the screen though. Like QBASIC PSET
 
Very easy to use
 
user4433485
@paco I heard about Flask, but not sure what it is
 
2:33 PM
I recommend not using Youtube for tutorials, since 90% of them are made by 12 year olds with a week of experience
3
 
it's like a lightweight django
maybe a bit more pythonic
 
user4433485
I need a effective way to learn Python
 
Dive Into Python
it's a free book (I think) and it's very good
 
udacity.com/course/cs101 -> free trial ( I wish udacity hadn't gone commercial, its less fun)
 
@Kevin Pillow is fun. But it's still a good idea (IMHO) to have some core Python proficiency before you tackle it.
 
2:35 PM
The later chapters of Dive Into Python have some issues, going by the number of questions that get asked on SO about them
@PM2Ring I partially agree. If you strictly stick to only Image.new and Image.putpixel and Image.save, you can have a fun time doing visual stuff without getting confused by the rest of PIL's interface.
 
@Kevin Good point.
 
Theoretically, you only need to know function/method calls and import in order to use that little slice of the library.
 
I can recommend a book to not read: Learn Python the hard way
 
user4433485
ugh
 
user4433485
2:38 PM
I'm so bad in reading books =D
 
@Katherina at some point it'll be hard to learn the next thing, and you'll have to push through it :)
 
Hmm, am I confusing Learn Python the Hard Way and Dive Into Python? Which one has the chapter on text adventures which is heavily recursive and thus inevitably causes a "maximum recursion depth exceeded" error?
Well, whichever one has that. I don't like them.
 
user4433485
@RobertGrant You've been learning last couple months right? could you show me some of your work?
 
@Katherina haven't done anything the last couple of months; the only thing I've really made is in a private Github repo because a friend and I might use it for a little business thing. It's just a Django site with some moderately nifty features
 
user4433485
Ah Okay ;)
 
user4433485
2:41 PM
Github, no idea how to use it
 
cbg
 
DSM
Morning cabbage for all.
 
But just complete a tutorial; even the act of finishing something when it gets hard is generally a good idea, as well as it being a better way to learn Python
 
user4433485
like this?
 
2:44 PM
Yep :)
 
I think I'll take the alternate side here and say that it's fine to bang your head on a difficult project, as long as you don't get so frustrated that you quit entirely.
 
I'm actually going through that thing again myself, in case there were any bits I didn't understand and now can do
 
@Katherina There's a Download link at the top of the page, and just under that there's a little button to copy the code to your clipboard so you can paste it into your editor. By default, the program saves its output to a file named 'liss.pbm' in the current directory. Read the code for further details. :)
 
Go ahead and learn Tkinter simultaneously with Python, if it floats your boat. Some people only feel the heat of passion while in the crucible of adversity.
 
@Kevin Learn Python the Hard Way has that stupid text adventure we get heaps of questions about. I'm not sure if Dive Into Python has one, too.
 
2:47 PM
@PM2Ring That's probably what I was thinking of, then. I retract my complaint against Dive Into Python
 
DSM
I was about to propose LPTHW as an example of a tutorial it's worth avoiding.
 
... For now.
 
@Kevin but she's also learning programming at the same time, I think. It's not Python + Tkinter, it's programming + Python + Tkinter. That's why I was saying a tutorial might be best.
@Katherina unless I got confused?
 
DSM
Wow, I was just checking the birthday calendar and we've already hit the birthday paradox!
 
I better stick to this chatroom than read LPTHW, they make learn everything I want.
 
user4433485
2:48 PM
@RobertGrant sorry? what you mean? :d
 
Annoying Python thing: len(str) vs str.lower()
(That probably won't get a star)
 
There is a marvelous explanation for why we have len(str) instead of str.len(), but I lost it :-(
 
Is it "Guido says get over it"?
 
It's 30% that, max.
 
2:50 PM
@RobertGrant Not quite: Python's not Katherina's 1st language: she's coming to us from the wonderful world of PHP.
 
@Kevin It's actually Rob
 
... And don't call me Shirley ;-)
 
wonderful world?
I thought Python was the most wonderful language!
 
DSM
If __len__ is a special method (and it is), then to have .len work too, we'd need to have both, with one delegating to the other.. blek.
 
user4433485
@RobertGrant the problem with that tutorial is that they play with math
Math
Great! Now let's do some math. You can add, subtract, multiply, divide numbers like this

addition = 72 + 23
subtraction = 108 - 204
multiplication = 108 * 0.5
division = 108 / 9
 
2:51 PM
@BhargavRao I was being sarcastic.
 
user4433485
I am so bad in math =D
 
@Katherina yeah, but you don't need to do it, the computer will do it for you. And that's only one screen
 
user4433485
i can't get further as this question
 
user4433485
I don't know what to do
 
There are various crude jokes about what PHP stands for; they tend to feature words like "poo", "pus", and "puke". :)
 
2:52 PM
Math is easy. You just need to employ the Feynman algorithm:
Write down the problem.
Think real hard.
Write down the solution.
 
DSM
Don't forget to add the disclaimer..
 
*might only work if you're Feynman
 
user4433485
@RobertGrant Set the variable count_to equal to the sum of two big numbers. :p
 
@Katherina so?
count_to = 10000 + 999348
Done
 
user4433485
lol whut
 
2:53 PM
Define "big number"
What are we talking here, like a trillion digits?
 
user4433485
^
 
user4433485
count_to = 10000 + 999348

print count_to
 
@Kevin Does that work for stackoverflow.com/a/5236278/3946766?
 
user4433485
this did the job indeed
 
Do you understand it?
 
2:55 PM
@DSM Exactly. It's just like the situation with str() & __str__() and repr() & __repr__().
 
Incidentally, one of my favorite features of Python is arbitrarily large numbers. 9999999999999999999999999999999999999999999999999999999999999999999999 is too big to fit in an integer in most languages, but Python accepts it uncomplainingly.
 
@Kevin YOur RAM complains instead
 
That's because Python is fed up of the whingeing of lesser languages
 
@Kevin yeah that is really awesome
 
user4433485
@RobertGrant except the Exponentiation I do understand the tutorial
 
2:57 PM
@Katherina what don't you understand about that?
 
user4433485
Notice that we use ** instead of * or the multiplication operator.
 
user4433485
never seen something like that before
 
user4433485
10 ** 2 = 100 ?
 
DSM
Yep.
 
We can't use ^ because it's taken already
 
2:57 PM
But do you know what squaring a number is?
E.g. what's 10 squared?
 
DSM
Python: for numbers that don't fit in the starred message list.
 
Too awesome for SO chat
 
user4433485
10^2
 
user4433485
Lol
 
Sure
Except it's written 10**2 in Python
That's it.
 
user4433485
2:59 PM
I don't know how the ^ is working tho
 
^ is the XOR operator. You probably won't need to use it.
 
user4433485
never had mathematics @ school:)
 
Don't use ^
 
Unless you want to do little encryption projects
 
2:59 PM
Okay, so 10 ** 2 means 10 times 10
10 ** 3 means 10 times 10 times 10
 
So, so many chefs
 
Troll response: And 10 ** 0.5 means ten times...?
 
@Kevin your face
 
1, obv
 
user4433485
oh it works like x2
 
3:00 PM
@Katherina no, it's times itself
2 ** 2 is 2 times 2
3 ** 2 is 3 times 3
2 ** 3 is 2 times 2 times 2
 
DSM
@Robert: check your second one there.
.. and your third.
 
Thank you :)
 
And the third
haha
 
It is so hometime
 
user4433485
I see
 
user4433485
3:01 PM
hmm
 
user4433485
Won't ever use it anyway
 
Said a Friends character
 
user4433485
I hope
 
DSM
Could I be any more metallic?
 
It really won't be hard if you do use it
 
user4433485
3:01 PM
maybe I should have learned math in Bulgaria
 
rhubarb time here too
 
Anyway! Rbrb you beautiful lot.
 
DSM
Rhubarb for all the departing.
 
rhubarb([robert, pm])
 
user4433485
I get to go aswel
 
user4433485
3:02 PM
Cya later <3
 
rhurbarb_list.append(katherina)
 
DSM
Did you know there was an expatriates stack exchange?
 
I want a nice hinged wooden box to hold my Magic: The Gathering cards. I wonder how many hours of carpentry practice that would require.
I think my first step would be to Google "carpentry forums" and post "plz give teh blueprints".
Then they'll close my post and give a lmgtfy link to Learn Carpentry the Hard Way or Dive Into Carpentry.
 
It wouldn't be too difficult
What sort of wood would you want to use?
 
DSM
I made a hinged treasure chest in junior high. My folks still have it.
 
3:13 PM
I don't own any tools. Is there, like... An internet cafe, but with bandsaws instead of computers?
 
There's a hacklab in Edinburgh. I'm sure we can't be the only place in the world
 
DSM
For weekend warr builders? Huh. That's actually not the craziest idea I've ever heard of.
 
@IntrepidBrit priorities in descending order: finished product doesn't give me splinters; not heavy; light colored.
From Minecraft, I know that birch wood has a light color.
 
There are hackspaces / makerspaces everywhere these days
 
Internet cafes with bandsaws do exist. My friend started one in my town.

He overestimated local demand. We don't have one anymore.
 
3:16 PM
@Kevin Uhh, depends on where you lived. In the UK, I would definitely recommend pine. All of the above, relatively cheap and good for the environment to boot.
 
@JRichardSnape Nice. And in my local area too :-)
 
Bamboo is also good, but I've never had the chance to work it (been years and years since I made anything)
 
Apropos of nothing: I notice that our birthday boy is one vote off a gold badge for stackoverflow.com/questions/17130975/python-vs-cpython ...
 
@kevin I knew there was a reason to have location on SO profile. So that you can find a place to cut your fingers off with a bandsaw ;)
 
Do it right or don't do it at all. Make it from the wood of the true cross.
 
DSM
3:18 PM
@Zero: the honour was mine. I think this means he has to send me some of his SO loot.
 
But then my evil-aligned magic decks would burst into flames :-(
I need morally neutral wood.
 
Jesus was a MtG fiend dude. That was basically the first 30 years of his life.
 
I imagine a pacifist like him would play with Divine Intervention so as to force a draw every game.
 
@Kevin Then, surely you'll need Nottinghamforest Oak. Although, it might be prone to giving your best cards to your opponents#
 
It's also a flavor win because of the "three turns to end the game"/"three days to resurrect" parallel
@IntrepidBrit I actually do have a deck whose stated purpose is to give my cards to my opponents. I must have this special wood.
 
3:26 PM
"Robin! Take this fellow's money order..."
 
Needs reproducing code
Hmm, my local maker space has a rather onerous one-day access fee... I think it would be cheaper to break into my old high school at night and use their wood shop
 
DSM
Does that include the cost of the probable consequences of such a move?
 
You're thinking too small. That one-day access fee gives you access to tools, that can be used as weapons to overthrow their evil regime
 
@DSM As a white male with no prior criminal history, I would expect a nominal punishment. Unless they spin "breaking into a school" as some kind of "child endangerment" thing.
 
re-cbg!
 
3:38 PM
I’m out for now, rhubarb
 
My defense would be, unless students are running around campus at midnight, I'm only endangering my own fingers
I guess the real cost would be that I could no longer claim "no prior criminal history" if I want to commit a second crime later.
 
Are you serious about sopycon?
Did you mean: soupcon?
 
haha
 
lol
 
Oh, we should definitely call it soupçon :-)
 
3:45 PM
soupçon is a great name!
 
DSM
See, this is why you shouldn't start caring about internet points. There's a guy who has some stray tabs, and he says he doesn't but I can see them. I could answer it, but it's unlikely to get enough votes to keep my vote-per-answer ratio where it is. :-/
 
You need a rep Kickstarter where people will pre-commit to upvoting before you make the post.
 
DSM
Do we have a room policy on indentation error questions? Are they candidates for typo-closing? Or do we have a "So you think you have an IndentationError" target?
 
For me, indentation problems fall under the "typo" category
 
DSM
.. but I can reproduce it if I copy his raw text.
 
3:49 PM
So my procedure is the same as for usual typos: indicate the problem to the OP in a comment (or answer if you're feeling saucy), and only vote to close if the OP replies "that was it, thanks"
 
@DSM Yeah, I was wrong...
 
DSM
This is the one I'm talking of, BTW.
Plus any question which contains "Can any1 PLZ help?" should probably be downvoted into oblivion anyhow..
 
> FHU! Formatting Helps Us! Put on ALL your posts!
What is this? Some kind of chain letter?
 
I can see the argument for typo, but it's such a common problem that a canonical indentation Q/A covering all the bases (mixed tabs spaces, inconsistent unindent etc.) might do a better job of averting post-close-whining.
 
+1
 
DSM
3:50 PM
Explain how you can use -t and -tt, show how you can use repr, etc.
 
@DSM I'd care more about the points if I could redeem them for a toaster or something.
 
Writing the actual question without getting downvotes from people who care more about process than efficacy might be tricky, though.
 
DSM
@Wayne: speak for yourself. Every morning as the honey sinks into the bread I'm grateful I have 80k. ;-)
 
this is probably a very dumb question, but what is the difference between a module and a class in general programming terms?
 
DSM
3:55 PM
Aaargh. Noisy construction outside.
 
In the olden days, a module was a way to group related functions and classes together.
 
Modular programming is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality. A module interface expresses the elements that are provided and required by the module. The elements defined in the interface are detectable by other modules. The implementation contains the working code that corresponds to the elements declared in the interface. Modular programming is closely related to structured programming and object-oriented...
 
Q: In Ruby, I can call the int method on a String and get an integer. If the string doesn't represent a valid integer, int just returns 0. Does Python have an equivalent lenient int conversion that won't raise an exception?
 
DSM
No, and to the Pythonic mind that'd be a dangerous thing to have.
 
int(s) if s.isdigit() else 0?
 
DSM
3:57 PM
@vaultah: -3. ;-)
 
Pfft
 
Hey, I didn't know Python had postfix ifs. Cool.
 
DSM
That's our ternary op.
 
I decided to answer that tabbing question.
 
Thanks!
 
3:58 PM
I feel like providing a screenshot as proof is a substantial enough contribution to make it acceptable to not be just a comment
That sentence is a mess.
 
DSM
If you get five votes for that I'm afraid I'll have to end you. Nothing personal, simply policy.
 

« first day (1627 days earlier)      last day (3319 days later) »