Search Results

Showing results 1 to 40 of 724
Search took 0.06 seconds.
Search: Posts Made By: sneekula ; Forum: Python and child forums
Forum: Python 7 Hours Ago
Replies: 1
Views: 52
Posted By sneekula
Code Snippets are for finished code, post questions in a regular Python forum thread!
Forum: Python 7 Hours Ago
Replies: 4
Views: 134
Posted By sneekula
The module numpy is your friend here:
# create matrix with arange().reshape()
# perform add and multiply matrix operations
# module numpy (numeric python extensions, high speed)
# free from:...
Forum: Python 9 Hours Ago
Replies: 5
Views: 151
Posted By sneekula
It looks like badboy00z is correct. The last result is really a permutation with a sample size of 2.
Forum: Python 9 Hours Ago
Replies: 5
Views: 151
Posted By sneekula
I think badboy00z is correct. You can use module itertools to show it:
# combinations and permutations using Python3 itertools

import itertools

iterable = [1, 2, 3]
# sample_size <...
Forum: Python 8 Days Ago
Replies: 1
Views: 177
Posted By sneekula
See:
http://www.daniweb.com/forums/post1079895.html#post1079895
Forum: Python 8 Days Ago
Replies: 130
Views: 51,005
Posted By sneekula
I modified the code in the previous post to join two images into one:
# use a drawing bitmap and wx.MemoryDC to create a canvas you can
# draw on and optionally save the drawing to an image file
#...
Forum: Python 8 Days Ago
Replies: 130
Views: 51,005
Posted By sneekula
I modified the code in the previous post to join two images into one:
# use a drawing bitmap and wx.MemoryDC to create a canvas you can
# draw on and optionally save the drawing to an image file
#...
Forum: Python 8 Days Ago
Replies: 2
Views: 174
Posted By sneekula
Call for update() as shown below:
from tkinter import *

class fb( Frame ):
def fastbuttons( self ):
b = Button(self)
b.grid()
self.update()
print(...
Forum: Python 8 Days Ago
Replies: 2
Views: 181
Posted By sneekula
The module threading is the higher level module and actually uses module thread, since that one has the lower level tasks. So one can assume that threading is somewhat slower in speed, but nicer in...
Forum: Python 9 Days Ago
Replies: 28
Views: 819
Posted By sneekula
If there is no space in the rank or name you can do it this simple way:
mydata = """\
<Ranking: AA (John)>
<Ranking: CA (Peter)>
<Ranking: TA-A (Samantha)>
"""

rank_list = []
for line in...
Forum: Python 9 Days Ago
Replies: 2
Views: 207
Posted By sneekula
Here would be one way to accomplish this:
mylist = [
['A', 60],
['B', 40],
['C', 90],
['B', 150],
['C', 230],
['A', 220]
]
Forum: Python 15 Days Ago
Replies: 2
Views: 251
Posted By sneekula
When you use
os.system('cls')
you limit yourself to the Windows OS.

In 99.9% percent of console apps you really don't need to clear the console screen.
Forum: Python 15 Days Ago
Replies: 8
Views: 279
Posted By sneekula
Well, in Python just about anything is an object not just the typical OOP stuff. I assume that your instructor forgot about that and actualy means creating a class Student where each instance is a...
Forum: Python 15 Days Ago
Replies: 8
Views: 346
Posted By sneekula
Let's be somewhat pleasant about this. If you search on Google for goolge this comes up:
Did you mean: google

Yes, Google uses Python and can figure that out.
Forum: Python 24 Days Ago
Replies: 3
Views: 446
Posted By sneekula
If you search DaniWeb, you will find a whole lot of similar requests about queues, stacks and html tag names. Looks like this homework has been given in the last few weeks to a bunch of folks. The...
Forum: Python 24 Days Ago
Replies: 7
Solved: temperature?
Views: 479
Posted By sneekula
You may also take a look at:
http://www.daniweb.com/forums/thread240778.html
Forum: Python 24 Days Ago
Replies: 7
Solved: Temperture
Views: 385
Posted By sneekula
There is a very similar thread at:
http://www.daniweb.com/forums/thread241913.html
Forum: Python 25 Days Ago
Replies: 11
Views: 590
Posted By sneekula
This little module has been updated to work with Python2 and Python3 recently, look at the new beta version at:
http://mcsp.wartburg.edu/zelle/python/
Forum: Python 25 Days Ago
Replies: 3
Views: 286
Posted By sneekula
This should give you an idea how to split the window into three parts. One could add to the left side score, the other to the right side score, and the third is for a click to exit.
#

from...
Forum: Python 25 Days Ago
Replies: 3
Views: 286
Posted By sneekula
The title is somewhat misleading. You want to add 2.
Forum: Python Nov 7th, 2009
Replies: 8
Views: 343
Posted By sneekula
Okay, this might even be mildly better:
import string
a = list(string.ascii_lowercase + "!@#$%^&*()-+={}|\/?><,.'") + range(1, 10)

print a
For Python3 change to list(range(1, 10)). Oh, the...
Forum: Python Nov 7th, 2009
Replies: 7
Views: 297
Posted By sneekula
What do you mean with "WxGlade does not show value"?
Is it WxGlade or your program you wrote using WxGlade?

Just a note on the smart side of things. If you have a problem for others to look at...
Forum: Python Nov 7th, 2009
Replies: 130
Views: 51,005
Posted By sneekula
Just testing wxPython's wx.TextCtrl widget used as an edit field for input and output of text based data:
# testing wxPython's
# wx.TextCtrl(parent, id, value, pos, size, style)
# a widget used...
Forum: Python Nov 7th, 2009
Replies: 8
Views: 343
Posted By sneekula
Also the OP didn't want a zero in the digits part. :)
Forum: Python Nov 7th, 2009
Replies: 3
Views: 485
Posted By sneekula
It's always good to use a few test prints:
import operator

OPERATORS = {
'+': operator.add,
'-': operator.sub,
'*': operator.mul,
'/': operator.div,
}
Forum: Python Nov 7th, 2009
Replies: 7
Views: 7,090
Posted By sneekula
Ah, the pros and cons on posting on an old thread.
If you are interested in a regex solution, I would start a new thread and put regex in the title.
Forum: Python Oct 31st, 2009
Replies: 5
Views: 532
Posted By sneekula
Well, you could do something like this:
# File_lister2.py
# create a list of all the files and sizes in a given direcory
# and optionally any of its subdirectories (Python2 & Python3)
# snee
...
Forum: Python Oct 31st, 2009
Replies: 209
Views: 102,430
Posted By sneekula
Here is a simple number project:

Prime numbers are positive integer numbers that are only divisible by itself or one. For example 2, 3, 5, 7, 11, 13, 17, are prime numbers, by convention 1 is not...
Forum: Python Oct 31st, 2009
Replies: 8
Solved: simple question
Views: 337
Posted By sneekula
You could do:
for c in "Hello World":
print c ,
In Python2 the comma puts in a space and keeps it on the same line.
Forum: Python Oct 30th, 2009
Replies: 6
Solved: Using Functions
Views: 288
Posted By sneekula
You are somewhat confused about functions.
Forum: Python Sep 21st, 2009
Replies: 9
Views: 418
Posted By sneekula
I made an attempt on user friendly data entry with just such a simple temperature converter program, see:
http://www.daniweb.com/forums/post992595.html#post992595
Forum: Python Sep 21st, 2009
Replies: 197
Read Me: Starting Python
Views: 89,768
Posted By sneekula
The ultimate user friendly Temperature Converter program. If you put an 'F' or 'f' on the end of the temperature you enter it will give you Celsius. Otherwise it simply assumes you entered a...
Forum: Python Sep 21st, 2009
Replies: 4
Views: 397
Posted By sneekula
As a beginner use for loops first, later on 'list comprehensions' become more natural.
Forum: Python Sep 21st, 2009
Replies: 10
Views: 401
Posted By sneekula
Looks like one of the 638 web pages is not available. You should use a try/except trap for this case.
Forum: Python Sep 21st, 2009
Replies: 4
Views: 324
Posted By sneekula
At first, I would adopt consistent indentations! Very important in Python. Most people use 4 spaces.
Forum: Python Sep 21st, 2009
Replies: 4
Views: 763
Posted By sneekula
And don't forget to use self to turn those functions into methods for the instance, like
def moveup(self):
Forum: Python Sep 21st, 2009
Replies: 6
Views: 323
Posted By sneekula
Something like that might do. I avoided the use of float() until the end to keep time-stamp and port info from turning into floats:
raw_data = """\
501 0 0.932 0.933 0.931 0.931 0.929 0.933...
Forum: Python Sep 20th, 2009
Replies: 7
Views: 421
Posted By sneekula
With wxPython code you can give py2exe an XML based manifest to force it to adopt the Windows XP theme.
Forum: Python Sep 20th, 2009
Replies: 10
Views: 414
Posted By sneekula
To make more sense you should have written your class this way:
class Animal:
def __init__(self, legs):
self.legs = legs

cow = Animal(4)
chicken = Animal(2)
octopus =...
Forum: Python Sep 20th, 2009
Replies: 7
Views: 503
Posted By sneekula
Now I am curious, did that work for Python26?
Showing results 1 to 40 of 724

 


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

©2003 - 2009 DaniWeb® LLC