Search Results

Showing results 1 to 23 of 23
Search took 0.01 seconds.
Search: Posts Made By: shadwickman
Forum: Python Jul 27th, 2009
Replies: 52
Views: 1,442
Posted By shadwickman
I can only assume that you put the indentation level of the if statements so that they were inside the loop. They should be outside of that while loop, like I had in my above code.
Forum: Geeks' Lounge Jul 24th, 2009
Replies: 22
Solved: indian invasion
Views: 1,122
Posted By shadwickman
Nav33n is correct. Say hello to Serkan Sendur... if you search around for his posts you'll probably find most non-programming related threads seem to have been polluted with some (at times)...
Forum: DaniWeb Community Feedback Jul 22nd, 2009
Replies: 28
Views: 2,225
Posted By shadwickman
You have my vote. I believe the forums would be filled with a lot less of the "i has homework give me code plz" posts.
Forum: Python Jul 21st, 2009
Replies: 41
Views: 1,078
Posted By shadwickman
Remember that the script executes downwards; it doesn't all happen at once. Things like raw_input also stall until input is given, then the script continues. So this is fairly easy to do; here's an...
Forum: Geeks' Lounge Jul 9th, 2009
Replies: 43
Views: 2,777
Posted By shadwickman
I'm not trying to start slinging shit here, but is this a mutual agreement or are you just putting words into your friends' mouths? Hmm... by the way this isn't a union thing or nothing. Please feel...
Forum: Python Jul 2nd, 2009
Replies: 196
Read Me: Starting Python
Views: 88,446
Posted By shadwickman
For Python 2.x:
People seem to overlook the usefulness of built-in functions for handling common issues with lists. A lot of times, filter, map, and reduce can easily and efficiently serve typical...
Forum: Python Jun 29th, 2009
Replies: 8
Views: 427
Posted By shadwickman
You can try the built-in filter function. Here's what I tried in the interpreter:

>>> a = [
'filter',
'lol',
'filter',
'lol',
'lol',
'filter',
'lol'
Forum: Python Jun 29th, 2009
Replies: 3
Views: 244
Posted By shadwickman
Yield is for generator functions. Return ends the function and sends back the specified value.
Generators are functions that return iterators, i.e. they 'yield' a value after each iteration of them,...
Forum: Python Jun 25th, 2009
Replies: 3
Solved: urgent help
Views: 263
Posted By shadwickman
PLEASE! Use tags! If you look at your post, you realize your Python code has no indentation anymore, and indentation is a crucial part of Python. I'm not going to bother looking through your code...
Forum: Python Jun 25th, 2009
Replies: 4
Views: 832
Posted By shadwickman
In case you didn't notice, your linedata dictionary has no key "id". Hence you receiving the "KeyError" problem. You need the ID of the column you're inserting this into if I'm correct (I barely...
Forum: Geeks' Lounge Jun 24th, 2009
Replies: 75
Views: 4,964
Posted By shadwickman
Ahahah! Wow, this is just getting a little odd guys (not to mention off topic, what happened to movies? :P)
Forum: Game Development Jun 24th, 2009
Replies: 0
Views: 423
Posted By shadwickman
If anyone is still interested in those old, nostalgic text-based games to run in the console, there's Python Universe Builder by Joe Strout. Yes, it's a dead project as the last release dates back to...
Forum: Python Jun 24th, 2009
Replies: 2
Views: 231
Posted By shadwickman
Got it :D


data = [['4/18/94', '29.125', '442.46'],
['4/19/94', '29.336', '442.54'],
['1/20/04', '75.175', '1138.77'],
['1/21/04', '75.711', '1147.62'],
['1/22/04', '75.595',...
Forum: Python Jun 24th, 2009
Replies: 7
Views: 349
Posted By shadwickman
Which Linux distro are you using? Regardless, if you want a visual editor for wxPython, I'd suggest wxGlade (http://wxglade.sourceforge.net/). It generates nice code but it may take a little getting...
Forum: Geeks' Lounge Jun 23rd, 2009
Replies: 75
Views: 4,964
Posted By shadwickman
Trainspotting
One Flew Over the Cuckoo's Nest
A Clockwork Orange
A Scanner Darkly
Fear and Loathing in Las Vegas
Forum: Python Jun 22nd, 2009
Replies: 2
Solved: my text game
Views: 314
Posted By shadwickman
Your "items" dictionary doesn't have a key named "o" which apparently you are trying to locate. The line if p.weapon == items[sitem[1]] is basically equating to if p.weapon == items["o"]. That seems...
Forum: Python Jun 21st, 2009
Replies: 7
Views: 325
Posted By shadwickman
I haven't done this in forever, and I'm not on a linux machine at the moment, but I'll try to say what I remembered doing :P

If you originally installed it using "sudo apt-get install ...." then...
Forum: Python Jun 8th, 2009
Replies: 9
Solved: simple question
Views: 369
Posted By shadwickman
All it does is split the input into a list and save it as b like we did before. As of then, we have a list of numbers, but they are actually strings (e.g. ['3', '4', '10']).

From there, we use a...
Forum: Python Apr 28th, 2009
Replies: 2
Solved: Class help
Views: 258
Posted By shadwickman
I'm highly confused... so what are you asking to call? Assuming you have the attributes __employee_name and __employee_number on the class this function is a part of, this should run fine...
So I'm...
Forum: Python Mar 27th, 2009
Replies: 2
Views: 1,173
Posted By shadwickman
I would say you could take the input string, and split it at each whitespace into a list. Index 0 would be the function name, and each index after would be the arguments. Like:

cmdlist =...
Forum: Python Mar 26th, 2009
Replies: 15
Views: 1,605
Posted By shadwickman
The variable timesflipped used for the while loop is undefined before the comparison while timesflipped < 100:. This script should just return a NameError and not run.
Here's a fixed version:
...
Forum: Python Mar 25th, 2009
Replies: 2
Views: 293
Posted By shadwickman
Why not keep a list of lists for responses corresponding to each user answer? Such as:

responses = [
["Q1, A", "Q1, B", "Q1, C" ],
["Q2, A", "Q2, B", "Q2, C" ],
["Q3, A", "Q3, B",...
Forum: Python Nov 3rd, 2008
Replies: 2
Views: 379
Posted By shadwickman
All I was able to find was this article, but from what it says, it sounds risky as each platform/distro is quite different and difficult....
Showing results 1 to 23 of 23

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC