Beat_Slayer 17

Your import concept mate is totally wrong. You should read a good python tutorial.

Back to the code, something like
[CODE]self.image_list = []

def addImage(self, imageName):
try:
newImageData = {}
im = Image.open(imageName)
data = im.getdata()
width, height = im.size
self.image_list.append(imageName)
except IOError:
showerror( "File Error", "The selected file could either opened or converted." )
return

    newImageData['im'] = im
    newImageData['data'] = data
    newImageData['width'] = width
    newImageData['height'] = height
    newImageData['id'] = -1
    newImageData['contours'] = []
    newImageData['dots'] = []
    newImageData['landmarks'] = []
    newImageData['linewidth'] = 1
    newImageData['linelength'] = 20
    newImageData['stack'] = self.getCurrentStack()
    self.imageInfo.append(newImageData)[/CODE]

You can then use the image_list something like...
[CODE]
for image in self.image_list:
...[/CODE]
Cheers and Happy coding

Beat_Slayer 17

First wrap your code with Code-tags. You can do it easilly by selecting your code and clicking the code button.

And that code is useless mate. I mean you to show the code you use to open them.

And imports are done at the beginning of the script and never inside a function.

Cheers and Happy coding

Beat_Slayer 17

You don't need to display them, if you maintain a list of the image objects open, you can easilly save them all in a nice loop.

Show a example of what you mean, I'll help you.

Cheers and Happy coding

Beat_Slayer 17

Only the print implementation.

You can do
[CODE]from future import print_function[/CODE]
and keep the 3.x print style.

Cheers and Happy coding

Beat_Slayer 17

What you mean? Like clipboard access? Or a internal function?

Copy to variable and write the variable to the widget maybe?

Cheers and Happy coding

Beat_Slayer 17

doffing81, theres no need to hardcode the 5 deals.

[CODE]def deal():
"""this function deals the cards individually to each hand"""
for i in range(5):
self.append(deck.pop(0)) #pop(0) grabs the first card/item in list
p2.append(deck.pop(0)) #pop() would grab last...I believe
p3.append(deck.pop(0))
p4.append(deck.pop(0))[/CODE]

Cheers and Happy coding

doffing81 commented: Perfect +1

Beat_Slayer 17

Here it is. Now it works.

[CODE]class Rectangle:

def __init__(self, length = 1, width = 1):
    self.set_length(length)
    self.set_width(width)

##Setters to float
def set_length(self, length):
    length = float(length)
    try:
        if 0.0 < length < 20.0:
            print "Value is in range.  You may continute."
            self._length = length
        else:
            raise ValueError
    except ValueError:
        print "Value must be between 0.0 and 20.0"

def set_width(self, width):
    width = float(width)
    try:
        if 0.0 < width < 20.0:
            print "Value is in range.  You may continute."
            self._width = width
        else:
            raise ValueError
    except ValueError:
        print "Value must be between 0.0 and 20.0"
Getters
def get_length(self):
    return self._length

def get_width(self):
    return self._width
Get perimeter and area
def perimeter(self):
    return 2 * self._length + 2 * self._width

def area(self):
    return self._length * self._width[/CODE]

Cheers and Happy coding

Beat_Slayer 17

Or [CODE]Hands.hasFlush()[/CODE] for outside the class Hands, or [CODE]self.hasFlush()[/CODE] if it's inside the class that defines hasFlush().

Cheers and Happy coding

Beat_Slayer 17

Like this I believe...

[CODE]#!/usr/bin/python
import socket
import subprocess

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
host = socket.gethostname()
port = 1234
sock.bind((host,port))

while True:
command, addr = sock.recvfrom(1024)
if len(command) > 0:
print("Received ", command, " command from ", addr)
exec_command = subprocess.Popen(command, stdout=subprocess.PIPE)
print(exec_command.stdout.read())

sock.close()[/CODE]

Cheers and Happy coding

Beat_Slayer 17

ask grade exam a
ask grade exam b
ask homework
90 = (needed0.35) - (a0.25) - (b0.25) - (homework0.15)

Cheers and Happy coding

Beat_Slayer 17

Yeah, you need do read a litle bit before jumping into it, trying is good, but research also.

[URL="http://effbot.org/zone/tkinter-menubar.htm"]Some help[/URL]

Cheers and Happy coding

Beat_Slayer 17

Already had similar problems, we try to keep the names neat, but as it adds the script path to the syspath, it replaces the modules if we have files with the same name.

It can be cool depending of the situations. :D

Cheers and Happy coding

Beat_Slayer 17

Mate change your script filename, it's replacing the module.

Your script named unittest.py, it's replacing the module file.

Cheers and Happy coding

Beat_Slayer 17

???

Does yours outputs like this mate?

[CODE]>>> import unittest

dir (unittest)
['FunctionTestCase', 'TestCase', 'TestLoader', 'TestProgram', 'TestResult', 'TestSuite', 'TextTestRunner', '_CmpToKey', '_TextTestResult', '_WritelnDecorator', 'all', 'author', 'builtins', 'doc', 'email', 'file', 'metaclass', 'name', 'package', 'unittest', 'version__', '_makeLoader', '_strclass', 'defaultTestLoader', 'findTestCases', 'getTestCaseNames', 'main', 'makeSuite', 'os', 'sys', 'time', 'traceback', 'types']
print unittest.TestCase
<class 'unittest.TestCase'>[/CODE]

EDIT:

Mate change your script filename, it's replacing the module.

Cheers and Happy coding

Beat_Slayer 17

The print, one place is enough.

Cheers and Happy coding

Beat_Slayer 17

Maybe if you search [URL="http://www.awaretek.com/toolkits.html"]here[/URL] you find something more.

Cheers and Happy coding

Beat_Slayer 17

Beat_Slayer 17

You should have all working with the ips you give, i believe it's firewall problem.

If you notice this forum has lots of sub-foruns, and evey one has a different category.

Python is a computer programmming language.

Maybe [URL="http://www.daniweb.com/forums/forum107.html"]here[/URL], or [URL="http://www.daniweb.com/forums/forum13.html"]here[/URL] will be better to find your answer.

Cheers and Happy coding

Beat_Slayer 17

For that function you use pyhton 3.x, or you do:

[CODE]from future import print_function

def main():
f = open('lines.txt')
for line in f:
print(line, end = '')

if name == "main": main()[/CODE]

Cheers and Happy coding

Beat_Slayer 17

It relys on a bad configuration for sure.

If the printer is connected to the router on a valid network configuration, then it is on the same network as the computers, since that it should be a firewall problem.

It can also be a NAT problem.

Wich are the IPs? of the computer, router and printer?

Cheers and Happy printing :)

Beat_Slayer 17

It relys on a bad configuration for sure.

If the printer is connected to the router on a valid network configuration, then it is on the same network as the computers, since that it should be a firewall problem.

It can also be a NAT problem.

Wich are the IPs? of the computer, router and printer?

Cheers and Happy printing :)

Beat_Slayer 17

I believe with a GetCellValue(self, row, col) in a nice loop.

[CODE]ncols = 7
row = 3
row = [self.GetCellValue(row, col) for col in range(ncols)][/CODE]

Cheers and Happy coding

Beat_Slayer 17

Your router may be cofigured to only allow connections through ethernet cable and not wireless connections to the settings.

Apart that, this is the python forum, for python related questions.

Cheers and Happy coding.

Beat_Slayer 17

[QUOTE]format
This parameter can be used instead of the fmt24hr and displaySeconds parameters, respectively; it provides a shorthand way to specify the time format you want. Accepted values are 'HHMMSS', 'HHMM', '24HHMMSS', and '24HHMM'. If the format is specified, the other two arguments will be ignored.
fmt24hr
If True, control will display time in 24 hour time format; if False, it will use 12 hour AM/PM format. SetValue() will adjust values accordingly for the control, based on the format specified. (This value is ignored if the format parameter is specified.)[/QUOTE]

You can do

[CODE]self.EndingHour = masked.TimeCtrl(panel, -1, name='24 hour control', format = '24HHMM')[/CODE]
or
[CODE]self.EndingHour = masked.TimeCtrl(panel, -1, name='24 hour control', fmt24hr = True)[/CODE]

Cheers and Happy coding

Beat_Slayer 17

Some code???

Cheers and Happy coding

Beat_Slayer 17

OFF-TOPIC

[CODE]nod = lambda(x): len(str(x))

print nod(125125)[/CODE]

Cheers and Happy coding

Beat_Slayer 17

It does it now, but I'm not a regex expert, maybe they can make other way.

I can only see as searching with regex, catching the longest, then search for that group with the regex and ask the start.

[CODE]words = ['cataaaaac', 'pooooloo']

for word in words:
longest = 0
letterlist = set(word)
for char in letterlist:
seq = sorted(re.findall('%s+' % char, word))[-1:]
sequence = ''.join(seq)
lenght = len(sequence)
if lenght > longest:
longest = lenght
letters = sequence
m = re.search(letters, word)
print 'Word:', word
print 'Most:', letters[0], 'with', len(letters), 'starting at index', m.start()[/CODE]

Cheers and Happy coding

Beat_Slayer 17

[CODE]import re

words = ['cataaaaac', 'poolooo']

for word in words:
longest = 0
letterlist = set(word)
for char in letterlist:
for item in re.findall('%s+' % char, word):
lenght = len(item)
if lenght > longest:
longest = lenght
sequence = item
print 'Word:', word
print 'Most:', sequence[0], 'with', len(sequence), 'starting at index', word.index(sequence)
[/CODE]

Cheers and Happy coding

Beat_Slayer 17

It does the work, but it's not regex.

[CODE]words = ['cataaaaac', 'poolooo']

for word in words:
rep = ''
count = 0
i = 0
most = ''
great = 0
index = 0
start = 0
for char in word:
if char == rep:
count += 1
if count > great:
most = rep
great = count
index = start
else:
start = i
rep = char
count = 1
i += 1
print 'Word:', word
print 'Most:', most, 'with', great, 'starting at index', index[/CODE]

Cheers and Happy coding

Beat_Slayer 17

As NOT wizards, we don't guess code solutions.

Cheers and Happy coding