Search Results

Showing results 1 to 40 of 1000
Search took 0.05 seconds.
Search: Posts Made By: jlm699
Forum: Python 1 Day Ago
Replies: 6
Views: 115
Posted By jlm699
I think that this may simply be the same thing using different logic:
user_input = [ 1, 2, 3 ] #all are integers
int_data = [ 1, 2, 3, 4, 5 ] #all are integers
for num in user_input:
if num...
Forum: Python 1 Day Ago
Replies: 6
Views: 115
Posted By jlm699
Here's some examples of converting between strings, lists, lists of strings, and ints using list, str and int:
>>> usr_inp = '123456'
>>> usr_inp2 = '1,2,3,4,5,6'
>>> list(usr_inp)
['1', '2',...
Forum: Python 2 Days Ago
Replies: 9
Views: 166
Posted By jlm699
If you declared the encoding (http://www.python.org/dev/peps/pep-0263/) at the beginning of your program the same way that IDLE does, it would have worked I believe?
Forum: Python 2 Days Ago
Replies: 9
Views: 166
Posted By jlm699
Try this trick (I'm assuming you're using Windows)

1) Open up a terminal (command prompt window) Ctrl+R -> cmd -> [Enter]
2) Type/find path to Python executable dir C:\Py* -> [Enter]
# You...
Forum: Python 2 Days Ago
Replies: 5
Views: 157
Posted By jlm699
And if that's not an option make sure you're both installing and running all these things by right-clicking the executable and selecting "Run as Administrator"
Forum: Python 2 Days Ago
Replies: 7
Views: 147
Posted By jlm699
We can't really do your homework for you, but the basics of a while loop are like this.


some_flag = initial_state
while some_flag (does not meet) my_condition:
perform action
update...
Forum: Python 2 Days Ago
Replies: 4
Views: 111
Posted By jlm699
Just please note that in Python, we use the built-in function dict() to convert certain objects to a dictionary. If you used the above code, you would lose this ability as you're overwriting that...
Forum: Python 2 Days Ago
Replies: 9
Views: 166
Posted By jlm699
He also is using parenthesis in his print statements. I'd surmise that he's using Python 3.0, in which case the use of input is the only option. (input has been replaced by raw_input)

EDIT:...
Forum: Python 2 Days Ago
Replies: 2
Views: 112
Posted By jlm699
def main():
print "This program illustrates a chaotic function."
print "Please enter two numbers between 0 and 1."
x = input ("Enter first number: ")
y = input ("Enter second...
Forum: Python 2 Days Ago
Replies: 1
Views: 88
Posted By jlm699
So each record is 4 lines total (with only 3 lines we care about).

Can you give an small snippet of a file with at least two records for example? I envision either simply taking every 4 lines and...
Forum: Python 2 Days Ago
Replies: 8
Views: 144
Posted By jlm699
Why not use one that does then?

I use Notepad++, but I know that even python-specific IDEs like PyScripter have parenthesis highlighting, etc. In fact, PyScripter will have a red underline on any...
Forum: Python 3 Days Ago
Replies: 14
Solved: palindrome
Views: 270
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 4 Days Ago
Replies: 5
Views: 198
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 10 Days Ago
Replies: 5
Solved: DNA Questions
Views: 346
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 11 Days Ago
Replies: 8
Views: 319
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 11 Days Ago
Replies: 17
Views: 381
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 12 Days Ago
Replies: 17
Views: 381
Posted By jlm699
See my above post
Forum: Python 12 Days Ago
Replies: 7
Views: 284
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 12 Days Ago
Replies: 1
Views: 126
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 12 Days Ago
Replies: 17
Views: 381
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 12 Days Ago
Replies: 2
Views: 199
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 12 Days Ago
Replies: 2
Views: 239
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 14 Days Ago
Replies: 2
Views: 138
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 14 Days Ago
Replies: 12
Views: 307
Posted By jlm699
Or IBM...
Forum: Python 14 Days Ago
Replies: 4
Solved: Debug me please
Views: 167
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 14 Days Ago
Replies: 6
Views: 263
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 14 Days Ago
Replies: 12
Views: 307
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 14 Days Ago
Replies: 1
Views: 263
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++ 14 Days Ago
Replies: 6
Views: 212
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 14 Days Ago
Replies: 9
Views: 288
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 14 Days Ago
Replies: 6
Views: 250
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 15 Days Ago
Replies: 10
Views: 335
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 15 Days Ago
Replies: 1
Views: 121
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 15 Days Ago
Replies: 10
Views: 335
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 15 Days Ago
Replies: 7
Views: 263
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 16 Days Ago
Replies: 4
Views: 232
Posted By jlm699
What "dint work"?
Forum: Python 16 Days Ago
Replies: 4
Views: 303
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 16 Days Ago
Replies: 4
Views: 232
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 16 Days Ago
Replies: 10
Views: 335
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 16 Days Ago
Replies: 2
Views: 196
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...
Showing results 1 to 40 of 1000

 


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

©2003 - 2009 DaniWeb® LLC