hi
I have a program which I call findmatch that expects these arguments
1.a person name
2.a group name
3.an integer
4.a float value
I thought I would allow user to call this program either using options
or using positional arguments in a predefined order
ie,
findmatch -f schoolmates -i jon -t 3.
thanks Peter
that was good advice
jim
On Oct 16, 1:44 pm, Peter Otten <__pete...@web.de> wrote:
> Keep it simple ;)
--
http://mail.python.org/mailman/listinfo/python-list
I am trying to code a function that takes a directory name and a name
string and try to return a list of fully qualified names of all files
in the directory having an exact match of name.
example,
I have these files in the directory,
'googlegroup_python__111.txt',
'googlegroup_python__112.txt',
'g
hi
I was testing a function using unittest.
def get_filenames(dirname,innerstring):
return filenames_containing_innerstring
class FileNamesTest(unittest.TestCase):
def setUp(self):
self.dirname='/home/me/data'
def test_get_filenames(self):
innerstr='tom'
hi
I have some demo python code hosted on a public host that uses
subversion..and I want to modify one of the files using a patch file
handed to me by another person..How do I do this?Generally I checkout
the code and make the change and then commit again..I have never done
through patch..Can some
hi Steven,
can you explain that?I didn't quite get it.
I have a module say 'managerutils' where I have a class
MyManager..
ie,
managerutils.py
--
class MyManager(object):
def __init__(self):
self.myaddresses={}
...
from another main program ,if I call ,
import managerutils
hi
while trying out urllib.urlopen ,I wrote this code to read a url and
return the data length
import datetime,time,urllib
def get_page_size(pageurlstr):
h=urllib.urlopen(pageurlstr)
data=h.read()
return len(data)
while True:
print 'reading url www.google.com
at',datetime
hi,
recently I switched to ubuntu jaunty and installed python 2.6.I
installed lib-tk so that I can work on my gui apps using Tix and
Tkinter.But ,it seems that the python version in jaunty ships a buggy
tix version which gives a 'TclError:unknown color' error message (this
happens when I try to use
hi
I have two lists of names.I need to find the difference between these
two lists.I tried to do it using sets.But I am wondering if there is a
better way to do it.Please tell me if there is a more elegant way.
thanks,
jim
my code snippet follows..
oldlst=['jon','arya','ned','bran']
newlst=['jaim
On Aug 28, 9:35 pm, Bruno Desthuilliers wrote:
Such a ping-pong between two classes is more often
> than not a design smell.
thanks Bruno,i understand my mistake..should have figured it out
myself
thanks again
jim
--
http://mail.python.org/mailman/listinfo/python-list
hi,
i am a python newbie..while trying out some message passing between
two object instances i came across a problem
moduleA.py
import moduleB
class MyClassA:
def __init__(self):
self.age=0
self.address=''
def createClassB(self):
self.objB=module
On Aug 27, 5:37 pm, Laszlo Nagy <[EMAIL PROTECTED]> wrote:
> These constructors will be calling each other forever. This will be an
> infinite recursion.
sorry,that was a quite stupid mistake on my part..thanks for pointing
out..
jim
--
http://mail.python.org/mailman/listinfo/python-list
I am new to python,and am learning from the tutorials
i created 2 .py files like below and put the main in one of them
empmodule.py
--
from workmodule import Worker
class Employer:
def __init__(self,n):
self.name=n
self.worker=Worker()
def getemployerName(self):
hi
I am using Python 2.5.1. In my code i want to use
self.myimage=PhotoImage (file=self.myfile)
so i can create the image in a canvas
self.mycanv.create_image(70,100,image=self.myimg)
it works when i add,
from ImageTk import PhotoImage
but this import caused an error message when i tried to run
i am looking for python code to convert a textfile(.txt) to an
image(preferrably Tiff).I believe it involves some scanning and
conversion using some font table and probably compression using
huffman encoding..is there an open source code doing this?can someone
give a pointer?
jim
--
http://mail.py
> * Run cmd.exe and see if you can run "dir f:\\code\\python\pgmgallery/*.*"
>
that causes a message 'Invalid switch - "*.*".'
> * Try using other directories under F: drive in your program and see> when
> you start hitting the problem.
i tried that..on some directories in the same drive this
hi
i have a directory containing .pgm files of P5 type.i wanted to read
the pixel values of these files ,so as a firststep i wrote code to
make a list of filenames using listdir
pgmdir="f:\code\python\pgmgallery" # where i have pgm files
g2=listdir(pgmdir)
i get the following error
WindowsError
hi
i am using PIL to get and set image data.Using image.getdata() i can
get a tuple of ints for each pixel. also i can use im.putdata(data)
to set pixels .
suppose i am given a double value as a pixel value (say 7245654.32456
which i may get from some image processing calc..) and thus i have an
>>Are you sure the lists you give belong to the same image?
the greyvalues list was printed out by python script on a 3X4
sampleimage i made to check this
im=Image.open("mypicgrey.jpg")
pixels=im.getdata()
for pix in pixels:
print pix
whereas the integers in the second list were from java cod
hi
i am getting value of a pixel of a greyscale image using PIL's
image.getdata and need to pack it as an int as below
ie greyvalues
127 , 56 , 135 , 99 , 102 , 101 , 146 , 112 , 155 , 154 , 112 , 169
should become
-4473925, -8289919, -4144960, -5789785, -5592406, -5658199 ,-3684409,
-5131855, -3
>
> I'd try to avoid duplicating the calculation code.
>
> Also, if you split the data in two, you can just read the filename list
> alone:
thanx G
those were good suggestions
gordon
--
http://mail.python.org/mailman/listinfo/python-list
hi
i have written a program that takes in user input thru a gui and then
does some calculations and then displays a result value.I have split
the code into 3 parts
1.the gui code--mygui.py containing a class to handle all ui stuff
2.calculations.py (also has one class to do all processing)
3. doc
thanx guys for the replies
need a little clarification
srcarray=array([1.2,2.3,3.4,4.5,5.6])
destarray=array(srcarray,copy=False)
then
srcarray[2]=99.9
will cause the change to be reflected in both src and dest.
doesn't that mean data is shared between both arrays?
but if i do
destarray=array(sr
hi,
(i posted this to numpy discussion grp couple of days back ..but it
fails to appear..)since it is needed for my work i would appreciate if
anyone can help me with this question
i have two ndarrays of 1000 elements each and want to copy all
elements from srcarray to destarray
srcarray=numpy.a
forget about syntax err.. sorry ..but still would like to know if
raising exception inside an except clause the right way?
--
http://mail.python.org/mailman/listinfo/python-list
some more doubts in this area,,forgive the ignorance of a beginner
i have
class MyError(Exception):
def __init__(self,msg)
self.msg=msg
now my method that can raise this is
class SomeClass:
...
def mymethod(self):
if (somecondition):
raise MyError("somec
hi bukzor & everyone who replied
thanks for the detailed replies
will try to write that way
thanx a lot
jim
bukzor wrote:
> On Jan 4, 8:51 am, bukzor <[EMAIL PROTECTED]> wrote:
>
> #exercise of the class and error handling
> m = myclass()
> try:
> m.mymethod()
> print "Completed success
hi, i have some code where i set a bool type variable and if the value
is false i would like to return from the method with an error msg..
being a beginner I wd like some help here
class myclass:
.
def mymethod(self):
success=True
msg="all validation OK"
> (May I ask why an accessor like getpixellist() instead of simply
> rgbimage1.pixellist?)
sorry,
bad style of coding on my part..was doing java stuff..
>
> I don't get the name - why "rgb to double"? This does not return a
> "double", but a long integer,
actually it was to be of 'long' type not
hi
am a beginner in python and PIL .I need to read an RGB 8 bit image
(am using jpeg )and pack the rgb color values into a double value so i
can store the image as a list of pixelvalues.From my application i
should be able to call rgbimage1.getpixellist() to retrieve the double
values of an image.
30 matches
Mail list logo