Search Results

Showing results 1 to 40 of 159
Search took 0.02 seconds.
Search: Posts Made By: shadwickman
Forum: Python Sep 17th, 2009
Replies: 9
Views: 425
Posted By shadwickman
Python doesn't need to explicity declare variables in the same way languages like C/C++, Java, etc. do. By writing for comment in inComment: you are creating a new variable called 'comment' that is...
Forum: Python Sep 17th, 2009
Replies: 9
Views: 425
Posted By shadwickman
Sneekula's correct. You're storing each item in the inComments like so: (lineNumber, lineText). So you just need to access the correct index of the tuple, the same way you would access an item in a...
Forum: Python Sep 15th, 2009
Replies: 14
Views: 495
Posted By shadwickman
Python is a good choice for easy-going desktop application development. Of course, you're going to want to get adjusted to and familiarized with classes, methods/functions, etc. before starting on...
Forum: Python Aug 9th, 2009
Replies: 2
Views: 200
Posted By shadwickman
If you don't mind as much about memory usage, you could use

if number in range(10, 24): # careful!
# This gives a range of 10 - 23.
# The end index (24) isn't included in it.

if number in...
Forum: Python Jul 31st, 2009
Replies: 10
Views: 807
Posted By shadwickman
No offense, but gross code you have there. You have an unbelievable amount that's just copy-pasted. I mean, all the questions are running pretty much the exact same code except for the Q it prints...
Forum: Python Jul 30th, 2009
Replies: 10
Views: 807
Posted By shadwickman
I'm quite sleepy, so excuse me if I'm way off here, but is armRight declared within the global scope of the script? If so, then you need to state global armRight within your function so that when you...
Forum: Python Jul 29th, 2009
Replies: 14
Views: 423
Posted By shadwickman
Instead of using a global variable for p, you could just pass that to the function as an optional parameter for the recursion you're doing. And you may want to rename the function. I think that loop...
Forum: Python Jul 29th, 2009
Replies: 14
Views: 423
Posted By shadwickman
Bumsfeld is putting you on the right track. I'll say not to convert the raw_input to an integer like you're doing now, so that you can cycle through each character in it as a string. Then just make...
Forum: Python Jul 29th, 2009
Replies: 4
Views: 326
Posted By shadwickman
Flash can take command-line arguments. So you can do os.system("flash.exe myFileToOpen.fla"). That'll open Flash and have it open the document "myFileToOpen.fla".

If the FLA is in a different...
Forum: Python Jul 25th, 2009
Replies: 10
Views: 403
Posted By shadwickman
Oh sorry! I didn't see your previous post metioning that :D Does anyone know if this has to do with Python 3.x? Changing the value of sys.sydout always worked for me...
Forum: Python Jul 25th, 2009
Replies: 10
Views: 403
Posted By shadwickman
Well I can see that the line you have redirecting the standard output (stdout) is commented out. So it won't be changing the output to that window you wanted. Or is there something I'm missing...? :P
Forum: Geeks' Lounge Jul 24th, 2009
Replies: 31
Views: 2,251
Posted By shadwickman
The rent here in BC can be bad depending on the city too. Where I live, a one bedroom apartment with a tiny kitchen and living room/den can easily be $800/month without utilities and such. And the...
Forum: Python Jul 24th, 2009
Replies: 10
Views: 403
Posted By shadwickman
I don't use Tkinter as I personally hate it :P But I'm going to assume that the Text control has a write function of some kind, just like the wxPython TextCtrls. If that's the case, then you redirect...
Forum: Geeks' Lounge Jul 24th, 2009
Replies: 22
Solved: indian invasion
Views: 1,101
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: Python Jul 24th, 2009
Replies: 7
Views: 449
Posted By shadwickman
Oh damn, good point. I forgot about the new line thing being different on UNIX from Windows... UNIX is just \n and Windows is \r\n
I think?....
Forum: Python Jul 24th, 2009
Replies: 7
Views: 449
Posted By shadwickman
Yeah, the "\x##" is the format for encoding non-ansi (is that correct?...) characters. As far as I can tell, these are useless characters anyway, because if you pick through the segment:...
Forum: Geeks' Lounge Jul 24th, 2009
Replies: 22
Solved: indian invasion
Views: 1,101
Posted By shadwickman
Very true, which is sad because their population expansion was so rapid that their infrastructure and social services are very lacking for such a large amount of people.
Forum: Geeks' Lounge Jul 24th, 2009
Replies: 22
Solved: indian invasion
Views: 1,101
Posted By shadwickman
Since when did anyone mention beauty or looks in this thread?...
Forum: Geeks' Lounge Jul 24th, 2009
Replies: 31
Views: 2,251
Posted By shadwickman
Possibly some deeply-rooted Celtic hatred of the Saxons :P

And moving out isn't just that easy. I work two jobs but still live at home...
Forum: Geeks' Lounge Jul 22nd, 2009
Replies: 22
Solved: indian invasion
Views: 1,101
Posted By shadwickman
Fair enough. I haven't had those experiences that you've had. Although, I imagine some communication and coordination would also be difficult if their developers' English skills are anything like...
Forum: Python Jul 22nd, 2009
Replies: 5
Views: 310
Posted By shadwickman
You were on the right track. Find the 'del' part, then include backwards until you encounter an underscore; this allows for if the number was single, double, triple, quadruple, etc digits long.
...
Forum: Geeks' Lounge Jul 22nd, 2009
Replies: 22
Solved: indian invasion
Views: 1,101
Posted By shadwickman
Well now... I think I'll just drop this and slowly back away, avoiding all eye-contact in the process...
Forum: Geeks' Lounge Jul 22nd, 2009
Replies: 22
Solved: indian invasion
Views: 1,101
Posted By shadwickman
Let's please not let this thread steer in the creepy direction too. That whole post was completely unnecessary and I really didn't need to read more of that drivel.

That being said, I'm not...
Forum: Python Jul 18th, 2009
Replies: 6
Views: 365
Posted By shadwickman
From the py2exe site:
"py2exe does not currently (as of 0.6.5) work out of the box if some of your program's dependencies are in .egg form. "

So, here's...
Forum: Python Jul 18th, 2009
Replies: 6
Views: 365
Posted By shadwickman
Open the .egg in Notepad and see what sort of data in contains... I've personally never used mechanize, but then again I've never encountered a module that ran with only an egg file. It could be a...
Forum: Python Jul 18th, 2009
Replies: 6
Views: 365
Posted By shadwickman
Is there a file in the C:\Python25\Lib\site-packages folder named mechanize.pth or a folder named mechanize in that directory? There should be, and the data in mechanize.pth should simply say...
Forum: Python Jul 16th, 2009
Replies: 3
Views: 244
Posted By shadwickman
I'd go with using floats because I'm sure you want to allow for using decimal numbers in your program. And as I said before, math in Python = math in wxPython. All that wxPython is, is a wrapper for...
Forum: Python Jul 16th, 2009
Replies: 3
Views: 244
Posted By shadwickman
First, you should change the line where you bind the button to:
button.Bind(wx.EVT_BUTTON, self.onClick) or else give the button an id (it's the arg passed second in the button's constructor) and...
Forum: Python Jul 10th, 2009
Replies: 5
Views: 451
Posted By shadwickman
I'd put the window updating segment in a function and call that via a thread as well. Try how that works out.

P.S. As long as your style works for you. I personally can't stand it as whitespace is...
Forum: Python Jul 10th, 2009
Replies: 5
Views: 451
Posted By shadwickman
You'll need to use threading to handle this. One thread calls the function which does the subprocess, and the other calls a function which updates the GUI. Something along the lines of:

#...
Forum: Geeks' Lounge Jul 9th, 2009
Replies: 43
Views: 2,720
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 9th, 2009
Replies: 3
Views: 778
Posted By shadwickman
Just read the file as-is and then write the output with the lines that aren't blank. Here's an example:

# Read lines as a list
fh = open("myfile", "r")
lines = fh.readlines()
fh.close()

#...
Forum: Python Jul 9th, 2009
Replies: 2
Views: 243
Posted By shadwickman
You need to use the 'self' keyword. So inside the function variable, you'd say self.f = 5. Then when you call printf, you'd say print(self.f).

By not making the variable a property of the class by...
Forum: Python Jul 9th, 2009
Replies: 6
Views: 251
Posted By shadwickman
I'm not entirely sure... Just have a look through the Python documentation! :P
Forum: Python Jul 9th, 2009
Replies: 6
Views: 251
Posted By shadwickman
Well if you're using Python 2.x there's the exec expression. I don't know if it still exists in Python 3.0, and I wouldn't normally use it, but it's all I can think of in this case. All you have to...
Forum: Python Jul 8th, 2009
Replies: 7
Views: 476
Posted By shadwickman
I personally think (as a side note), that he should:

a) Use a relative path so that he can keep the project in one folder and use a hierarchy of folders within that. This allows him to move the...
Forum: Python Jul 8th, 2009
Replies: 4
Views: 287
Posted By shadwickman
I forgot to mention that in solution #2, you assign temp_list2 to the same address of memory as list2, but then that's undone as you create a new list (and new address in memory for it) consisting of...
Forum: Python Jul 8th, 2009
Replies: 5
Views: 662
Posted By shadwickman
Here's an example of how to get the current date and time (as a string) using the datetime module.

import datetime
timestamp = str(datetime.datetime.now())
"""result ->
'2009-07-08...
Forum: Python Jul 8th, 2009
Replies: 4
Views: 287
Posted By shadwickman
Because your temporary list is the same thing as your other list. You said temp_list1 = list1. This means that the value for temp_list1 will be the same address in memory as the value for list1, i.e....
Forum: Python Jul 6th, 2009
Replies: 7
Views: 433
Posted By shadwickman
Ah, good point, I hadn't thought of that. This illustrates what woooee means:

>>> a = b = []
>>> a.append('hi')
>>> a.append('world!')
>>> a
['hi', 'world!']
>>> b.remove('hi')
>>> b...
Showing results 1 to 40 of 159

 


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

©2003 - 2009 DaniWeb® LLC