Search Results

Showing results 1 to 40 of 990
Search took 0.06 seconds.
Search: Posts Made By: jlm699
Forum: Python 3 Hours Ago
Replies: 14
Views: 184
Posted By jlm699
Use replace to swap out the punctuation for an empty string (''). Then use upper on both the original and the reversed string when you compare them so that the cases are the same.
Forum: Python 1 Day Ago
Replies: 5
Views: 167
Posted By jlm699
Your real problem is that you're using IDLE.

Your best bet is to switch to a better-featured (not to mention better-designed) IDE and run your scripts directly using python.exe or pythonw.exe

I...
Forum: Python 7 Days Ago
Replies: 5
Solved: DNA Questions
Views: 334
Posted By jlm699
We're not here to do your homework for you. But good job on copy-pasting your assignment.

Dear MasterofPuppets,
You shouldn't be spoon feeding people looking for us to do their homework for...
Forum: Python 8 Days Ago
Replies: 8
Views: 293
Posted By jlm699
How about instead of just generating an arbitrary StaticText object, assign it to a persistent member of your class (let's call it self.login_status_text). Then instead of generating it each time,...
Forum: Python 8 Days Ago
Replies: 17
Views: 354
Posted By jlm699
Okay, you've solved your own problem you just don't even realize it yet. The circle function is looking for the values you suggested above. Everything you've provided is correct except the...
Forum: Python 9 Days Ago
Replies: 17
Views: 354
Posted By jlm699
See my above post
Forum: Python 9 Days Ago
Replies: 7
Views: 245
Posted By jlm699
The same way you create any .exe, using py2exe (http://www.py2exe.org/)! Search this forum for examples of setting up a setup file.
Forum: Python 9 Days Ago
Replies: 1
Views: 115
Posted By jlm699
If you're looking for native-looking windows apps you'll want to go with wxPython. This is a Python class wrapper for the wx.widgets toolkit, which is cross-platform and extremely powerful.
...
Forum: Python 9 Days Ago
Replies: 17
Views: 354
Posted By jlm699
So if getpos() is a function for a class object, then you forgot the most important detail. The parameter self!

Your function should be defined as such:
def getpos(self):
r1 = x,y =...
Forum: Python 9 Days Ago
Replies: 2
Views: 171
Posted By jlm699
It will be way simpler to use string formatting like so:

>>> print '%04X' % 16
0010
>>> print '%04X' % 245
00F5
>>> print '%04X' % 1024
0400
>>> print '%04X' % 4096
1000
Forum: Python 9 Days Ago
Replies: 2
Views: 202
Posted By jlm699
You've simply forgotten to put the value of results into the string. Instead you mistakenly typed the name results. Here's how you should use string formatting to add the value:
...
Forum: Python 11 Days Ago
Replies: 2
Views: 129
Posted By jlm699
In the if statement you are using w[i+5].

This means that you need to make sure the maximum i plus 5 does not go out of bounds for the string. Let me demonstrate:

>>> w = 'aabbccdd'
>>> print...
Forum: Python 11 Days Ago
Replies: 12
Views: 295
Posted By jlm699
Or IBM...
Forum: Python 11 Days Ago
Replies: 4
Solved: Debug me please
Views: 151
Posted By jlm699
Basically you have to iterate over your "split" coefficients and then perform float conversion on each one independently. When you split them they return a list, which you'll be doing your iteration...
Forum: Python 11 Days Ago
Replies: 6
Views: 245
Posted By jlm699
Why yes, that is poorly coded. Good thing this is Python!

>>> x != 1 and x != 2 and x != 3
True
>>> x not in [1,2,3]
True
Data validation is extremely important for code that is...
Forum: Python 11 Days Ago
Replies: 12
Views: 295
Posted By jlm699
The best beginner's language is Assembly code. It will teach you how amazingly convenient a high level language like Python is.

That is sarcasm, but just read my response to this post in the...
Forum: Python 11 Days Ago
Replies: 1
Views: 237
Posted By jlm699
This (http://docs.python.org/library/cgi.html#installing-your-cgi-script-on-a-unix-system) should help. Don't ever underestimate the power of documentation.
Forum: C++ 11 Days Ago
Replies: 6
Views: 192
Posted By jlm699
I don't see any reason why you should skip your high school's C++ classes; however realize that your high school career doesn't really impact your job opportunities as much as your college career.
...
Forum: Python 11 Days Ago
Replies: 9
Views: 268
Posted By jlm699
This code has a lot of room for improvement. It would benefit you to read up on classes (http://docs.python.org/tutorial/classes.html)and functions...
Forum: Python 11 Days Ago
Replies: 6
Views: 238
Posted By jlm699
Can you explain what the bug is? Each call worked and printed "This is Test2's method."

What was the expected output?

EDIT: I think I understand now. You're saying the real program that you...
Forum: Python 11 Days Ago
Replies: 10
Views: 316
Posted By jlm699
Unless you run your script on a compatible platform, you will not be able to experience the joy of curses, no. If you're on windows you can either download and burn a linux live CD to boot from...
Forum: Python 12 Days Ago
Replies: 1
Views: 111
Posted By jlm699
You'll find it all here (http://www.pygame.org/news.html). Download pygame, tutorials, code examples, everything.

there's also a number of threads about pygame in this very forum. Just search...
Forum: Python 12 Days Ago
Replies: 10
Views: 316
Posted By jlm699
The platform can be simplified to mean your operating system. If you load up a python interpreter try the following exercise:

>>> import sys
>>> sys.platform
'win32'
>>> import curses...
Forum: Python 12 Days Ago
Replies: 7
Views: 250
Posted By jlm699
You're not an idiot, you're learning! It's good that you've solved your own problem. I actually just read an article about how a programming instructor put a teddy bear on his desk.

When...
Forum: Python 12 Days Ago
Replies: 4
Views: 215
Posted By jlm699
What "dint work"?
Forum: Python 13 Days Ago
Replies: 4
Views: 268
Posted By jlm699
Gribouillis

I'm not sure if this has been fixed or not (perhaps you're using a newer version of Python where this bug has been eliminated) but when I use your path.join this is what I get:

>>>...
Forum: Python 13 Days Ago
Replies: 4
Views: 215
Posted By jlm699
You're likely getting an exception. When an exception is raised, the program quits.

The best way to catch the traceback is to open your own command prompt and run the program that way.

Go to...
Forum: Python 13 Days Ago
Replies: 10
Views: 316
Posted By jlm699
That's because curses isn't available for Windows. The documentation should probably specifically say that, but they actually just tip-toe around that fact:[Source = PyDocs...
Forum: Python 13 Days Ago
Replies: 2
Views: 178
Posted By jlm699
It would be easier for us to help if you gave us just the barebones code that produces this abnormality. Most users won't have every single one of those modules and it would be cumbersome to...
Forum: Python 13 Days Ago
Replies: 8
Views: 247
Posted By jlm699
Actually, it is printing the current value of name. The employee.name is always a space (' '), because you never change it. In your get_details function, you have created a new variable called name...
Forum: Python 14 Days Ago
Replies: 6
Views: 245
Posted By jlm699
In that case you'll want this:

c.execute("INSERT INTO a (Category, Value) VALUES (%s, %s)", tuple(row[0].split()))

Basically this takes the element [0], which represents that string 'test...
Forum: Python 14 Days Ago
Replies: 1
Views: 186
Posted By jlm699
According to your explanation:
def step(x,y):
pass

If you need something else you'll need to explain what you're trying to do and give some context. If you really want some code written for...
Forum: Python 15 Days Ago
Replies: 6
Views: 245
Posted By jlm699
You should uncomment your commit statement. You need to commit your transactions before they go through.
Forum: Python 15 Days Ago
Replies: 3
Views: 186
Posted By jlm699
Here, try this (http://tinyurl.com/yk7stjg)
Forum: Python 15 Days Ago
Replies: 4
Solved: Ipart - Fpart
Views: 193
Posted By jlm699
Alternately you could use modulus division like this:

>>> f = 123.456
>>> ipart = int(f)
>>> fpart = f % 1
>>> ipart
123
>>> fpart
0.45600000000000307
>>>
Forum: Python 15 Days Ago
Replies: 5
Views: 249
Posted By jlm699
To do it the way you're trying to do it, use this:

>>> num = 0
>>> mylist = []
>>>
>>> while num < 10:
... num += 1
... mylist += [num]
...
>>> for item in mylist:
Forum: Python 16 Days Ago
Replies: 3
Solved: numtolet
Views: 162
Posted By jlm699
Or what about using chr() and then just adding 65?:

>>> def numtolet(num):
... return chr(num + 65)
...
>>> numtolet(1)
'B'
>>> numtolet(12)
'M'
>>> numtolet(14)
Forum: Python 20 Days Ago
Replies: 3
Views: 164
Posted By jlm699
You need to pass a second parameter to the open function which will declare the mode that you're opening the file in. Default (no parameter as in your case) is read mode or 'r'. You want either...
Forum: Python 21 Days Ago
Replies: 7
Views: 428
Posted By jlm699
Eval is what you're looking for:
>>> sports = [1,23,4]
>>> eval( 'sports' )
[1, 23, 4]
>>>
Forum: Python 21 Days Ago
Replies: 13
Views: 442
Posted By jlm699
Like this: my_boolean = False. Now the variable named my_boolean will act as your "flag" to tell you whether a number is "lucky" or not.

Here's what I posted above, maybe you didn't read it last...
Showing results 1 to 40 of 990

 


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

©2003 - 2009 DaniWeb® LLC