Re: OT: spacing of code in Google Groups

2004-12-31 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > When I copy code from a source file into a Google Groups message, the > > indentation is messed up, making my Python code illegal and all my > code > > ugly. Are there tricks to avoid this? > > Try putting

Re: OT: spacing of code in Google Groups

2004-12-31 Thread [EMAIL PROTECTED]
Grant Edwards wrote: > On 2004-12-31, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > >> When I copy code from a source file into a Google Groups > >> message, the indentation is messed up, making my Python code > >> illegal

Re: removing comments form a file

2005-01-03 Thread [EMAIL PROTECTED]
wfile = sys.argv[2] > comment = sys.argv[3] > rmcomment(oldfile, newfile, comment) > > > > > This script works fine with standard text files. An example is this one: > > example.txt: > > Hello Fuckin' World /

website hosting

2005-01-03 Thread [EMAIL PROTECTED]
here is the place that I host my websites with . If your still looking for a good host check out http://frontpage-web-hosting.org -- http://mail.python.org/mailman/listinfo/python-list

Working with recordsets

2005-01-07 Thread [EMAIL PROTECTED]
Hi. I have one recorset that I would like to pass to 2 functions, one is for create an CSV file and the other one is to create a HTML file. The problem is that the recordset is totally read in the first function, and then when I pass it to the second funtion the recordset is in the last record. I

Re: Old Paranoia Game in Python

2005-01-09 Thread [EMAIL PROTECTED]
Aahz wrote: > Trust the computer, the computer is your friend. However, the computer isn't a fuckin' mind reader. If you're going to post source code on the usenet, don't have lines longer than 72 characters. Otherwise you'll find your code has wrapped lines. This not only causes syntax errors i

Re: Old Paranoia Game in Python

2005-01-09 Thread [EMAIL PROTECTED]
Paul McGuire wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > Aahz wrote: > > > Trust the computer, the computer is your friend. > > > > However, the computer isn't a fuckin' mind reader. > > > > If y

Re: Datetime module

2005-01-10 Thread [EMAIL PROTECTED]
take a look at the logging module as well, in the documentation (paragraph 6.29.2 for release 2.4) you find a basic example -- http://mail.python.org/mailman/listinfo/python-list

Re: Old Paranoia Game in Python

2005-01-10 Thread [EMAIL PROTECTED]
Lucas Raab wrote: > [EMAIL PROTECTED] wrote: > > Aahz wrote: > > > >>Trust the computer, the computer is your friend. > > > > > > However, the computer isn't a fuckin' mind reader. > > > > If you're going to post source code on

Re: Time script help sought!

2005-01-11 Thread [EMAIL PROTECTED]
post your script here so we can go over it with you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Time script help sought!

2005-01-11 Thread [EMAIL PROTECTED]
using my code above... start = x[3].split(":") #split the minutes from the seconds this splits something like 1:22:40 into three parts 1(hours), 22(mintes), 40(seconds) so, you must add a special case handler... if len(start) == 3: { start[1] = int(start[0]) * 60 + int(start[1]) start = start[1], s

Re: Time script help sought!

2005-01-11 Thread [EMAIL PROTECTED]
man, now that is beautifully done. Paul, I wish I knew about pyparsing a while ago. I could have used it in a few projects. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Excel module for Python

2005-01-12 Thread [EMAIL PROTECTED]
that's easy. Just make an html file of your data, using tables and save it as a "*.xls" and excel will think it's an excel file. -- http://mail.python.org/mailman/listinfo/python-list

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread [EMAIL PROTECTED]
I can not break the original code in 2.4, if I try this: import os, sys class NoMimeError(Exception): pass def detectMimeType( filename ): extension = filename[-3:] basename = os.path.basename(filename) if extension == "php": return "application/x-php" elif extension == "cpp" or extension.endswit

Class initialization from a dictionary, how best?

2005-01-13 Thread [EMAIL PROTECTED]
# # My problem is that I want to create a # class, but the variables aren't known # all at once. So, I use a dictionary to # store the values in temporarily. # Then when I have a complete set, I want to # init a class from that dictionary. # However, I don't want to specify the # dictionary gets by

Re: Class initialization from a dictionary, how best?

2005-01-14 Thread [EMAIL PROTECTED]
Yes, my examle here is a tiny part of a larger more complex issue. My application is an DOM XML parser that is reading attributes one at a time. My class that I am creating is used elsewhere and must have certain arguments for those uses to continue working. So, I seem to be left with creating an i

Re: Com port interrupts again

2005-01-14 Thread [EMAIL PROTECTED]
A search on google gave me this library, I haven't tested it though: http://groups-beta.google.com/group/comp.lang.python.announce/browse_frm/thread/6d3263250ed65816/291074d7bd94be63?q=com+port+python&_done=%2Fgroups%3Fhl%3Den%26lr%3D%26safe%3Doff%26q%3Dcom+port+python%26qt_s%3DSearch+Groups%26&_do

Re: win32net help

2005-01-14 Thread [EMAIL PROTECTED]
Have you tried using UDP instead of TCP? Also, it is common practice to choose a random port over 1024 for opening a connection to a remote server. -- http://mail.python.org/mailman/listinfo/python-list

Re: getting a class attribute using a keyword argument

2005-01-17 Thread [EMAIL PROTECTED]
Guy Robinson wrote: > Hello, > > I have a list of class instances. I wish to get the appropriate class attribute > in each class instance depending on a SINGLE keyword in the calling class. > > How do I get the calling method to correctly recognise the keyword as a keyword > and not a class attrib

Re: List problems in C code ported to Python

2005-01-17 Thread [EMAIL PROTECTED]
Lucas Raab wrote: > I'm done porting the C code, but now when running the script I > continually run into problems with lists. I tried appending and > extending the lists, but with no avail. Any help is much appreciated > Please see both the Python and C code at > http://home.earthlink.net/~lvraab.

Central New Jersey PIG Meeting -- Python Interest Group In Princeton PIG/IP

2005-01-17 Thread [EMAIL PROTECTED]
nuary 19, 2005 at 7:00 PM Where: Mercer County Library Lawrenceville Branch 2751 Brunswick Pike Lawrenceville, NJ 08648 882-9246 Map and directions at http://www.lugip.org/meeting/location/ For more information about this group http://python.meetup.com/156/ or email Jon Fox at [EMAIL PROT

Re: pychecker - sets.Set need to be overridden

2005-01-17 Thread [EMAIL PROTECTED]
mport sets class Foo: def __init__(self): self.x = sets.Set() x = Foo() print x, getattr(x, 'x') gives for me: <__main__.Foo instance at 0x00C578A0> Set([]) on 2.4. on WinXP. What environment do you run in? -- http://mail.python.org/mailman/listinfo/python-list

Re: List problems in C code ported to Python

2005-01-17 Thread [EMAIL PROTECTED]
l = [] for i in range(2): for j in range(2): l[i],[j] = 0 print l gives Traceback (most recent call last): File "C:\TEMP\test.py", line 75, in -toplevel- l[i],[j] = 0 TypeError: unpack non-sequence That's why your current code needs a matrix class. -- http://mail.python.org/mailman/listinfo/pyt

Re: pychecker - sets.Set need to be overridden

2005-01-17 Thread [EMAIL PROTECTED]
I don't know pychecker, maybe there's something wrong with it as your code seems valid to me. -- http://mail.python.org/mailman/listinfo/python-list

Re: List problems in C code ported to Python

2005-01-17 Thread [EMAIL PROTECTED]
>>> l = [] >>> for i in range(2): for j in range(2): l[i][j] = 'x' Traceback (most recent call last): File "", line 3, in -toplevel- l[i][j] = 'x' IndexError: list index out of range So you still have to dimension the list before you can use it , eg like >l = [] >for i in range(2): >l.appen

Re: How to prevent the script from stopping before it should

2005-01-17 Thread [EMAIL PROTECTED]
#import urllib, sys #pages = ['http://www.python.org', 'http://xxx'] #for i in pages: # try: #u = urllib.urlopen(i) #print u.geturl() #except Exception, e: #print >> sys.stderr, '%s: %s' % (e.__class__.__name__, e) will print an error if a page fails opening, rest open

Re: Assigning to self

2005-01-17 Thread [EMAIL PROTECTED]
An implementation of what you want can be found here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 -- http://mail.python.org/mailman/listinfo/python-list

Re: Central New Jersey PIG Meeting -- Python Interest Group In Princeton PIG/IP

2005-01-18 Thread [EMAIL PROTECTED]
Yes Jay. PIG/IP meetings are publicly open with no RSVP necessary. Most of the folks coming are LUG/IP members, as I am and the location is the same as LUG/IP meetings. We haven't formalized the group's affiliation yet. -- Jon -- http://mail.python.org/mailman/listinfo/python-list

Re: hex notation funtion

2005-01-18 Thread [EMAIL PROTECTED]
This will do it: >>> int('1000', 2) 128 >>> hex(int('1000', 2)) '0x80' >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: Fuzzy matching of postal addresses

2005-01-18 Thread [EMAIL PROTECTED]
I think you guys are missing the point. All you would need to add to get a 'probable match' is add another search that goes through the 10% that didnt get matched and do a "endswith" search on the data. From the example data you showed me, that would match a good 90% of the 10%, leaving you with a

Re: is there better 32 clock() timing?

2005-01-23 Thread [EMAIL PROTECTED]
alternatively you could use the now() method of the datetime module, it has a resolution of 1 microsecond -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to do a series of regexp checks with groups

2005-01-23 Thread [EMAIL PROTECTED]
what about something like this? >>> import re >>> m = re.match(r"""(?Padd|mult) (?P\d+) (?P\d+)""", 'add 3 5') >>> from operator import add, mul >>> op = {'add': add, 'mult: mul} >>> op[m.groupdict()['operator']](int(m.groupdict()['int_1']), int(m.groupdict()['int_2'])) 8 -- http://mail.python.or

Re: Help with Threading

2005-01-24 Thread [EMAIL PROTECTED]
I use threading.Thread as outlined in this recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65448 -- http://mail.python.org/mailman/listinfo/python-list

Re: short programming projects for kids

2005-01-24 Thread [EMAIL PROTECTED]
I was just about to suggest Livewires. I'm a programming newb (35 yrs old ) haha- and I'm finding the lIvewires course pretty helpful, even though it's geared for teens. I suppose my brain works on that functional level. :) And a book that's great for beginner's (know you probably don't want to bu

smtplib bug with Windows XP

2005-01-24 Thread [EMAIL PROTECTED]
I'm having problem with a script that used to work under Win2k but is now broken after an install of WinXP Pro. I can no longer connect to a local mail server. Has anyone else seen this? If so, were you able to work around it? Here's the traceback (below). Interestingly, if I change ports to t

Re: smtplib bug with Windows XP

2005-01-25 Thread [EMAIL PROTECTED]
thank Peter, elbert, for the suggestions. I hadn't thought of using telnet to try to connect to the SMTP server. and when I do try, telnet can't connect either, at least on port 25. On port 110, it has no problem. So, perhaps the IT people have made some configuration changes; I'll have a chat

Re: __deepcopy__ without recursive copies?

2005-01-25 Thread [EMAIL PROTECTED]
Here I found something on __deepcopy__ http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/c34431c5fd3c223b/427866340239edd7?q=__deepcopy__+example&_done=%2Fgroups%3Fq%3D__deepcopy__+example+%26hl%3Den%26lr%3D%26safe%3Doff%26sa%3DN%26tab%3Dwg%26&_doneTitle=Back+to+Search&&d#42786

Re: Question Regarding SocketServer

2005-01-25 Thread [EMAIL PROTECTED]
you are missing quotes in "socketserver.py". Make sure the comments at the top are quoted out. In "IDLE" they should be green. -- http://mail.python.org/mailman/listinfo/python-list

Re: __deepcopy__ without recursive copies?

2005-01-25 Thread [EMAIL PROTECTED]
In this thread a solution is given on how to work with __deepcopy__: http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/c34431c5fd3c223b/427866340239edd7?q=__deepcopy__+example&_done=%2Fgroups%3Fq%3D__deepcopy__+example+%26hl%3Den%26lr%3D%26safe%3Doff%26sa%3DN%26tab%3Dwg%26&_don

Re: Question Regarding SocketServer

2005-01-25 Thread [EMAIL PROTECTED]
I tried to reply earlier... basically your "SocketServer.py" file is messed up. That line "AF_INET{,6}: IP (Internet Protocol) sockets (default)" should be commented out. It should be part of a block of lines that are all commented out. -- http://mail.python.org/mailman/listinfo/python-list

access private field in python 2.4

2005-01-26 Thread [EMAIL PROTECTED]
Hello, I'm new to python, How can I access private field in python. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: access private field in python 2.4

2005-01-26 Thread [EMAIL PROTECTED]
Hello, if we want to access the private member of object we use the classname, it doesn't make sense. For example: I have class A: class A: def __init__(self, i): self.__i = i; pass __i = 0 a = A(22); b = A(33); How can I get field i in object a and how can I get field i in object b? Beside I

can not use __methods__

2005-01-26 Thread [EMAIL PROTECTED]
Hello, I try to use __methods__ in python 2.4 and 2.2 it always fail. Can some one tell me if I want to itterate the methods in a class and print it in a string format ( it is possible using __methods__ ). Is there any replacement? Sincerely Yours, Pujo -- http://mail.python.org/mailman/listinf

Re: smtplib bug with Windows XP

2005-01-26 Thread [EMAIL PROTECTED]
it works! you da man! At the same time as my desktop was upgraded to Windows XP, the IT people switched virus checker products to McAfee Enterprise. And indeed, as soon as I disabled that 'mass worm sending' option, my Python scripts is once again able to send mail. thanks so much for this tip!

Re: subprocess.Popen() redirecting to TKinter or WXPython textwidget???

2005-01-26 Thread [EMAIL PROTECTED]
Ivo, my initial thought would be, you need to know how much text you will get back from popen. My Python reference has the following example: import os dir = os.popen('ls -al', 'r') while (1): line = dir.readline() if line: print line, else: break that example shows how to capture the process ou

Re: access private field in python 2.4

2005-01-26 Thread [EMAIL PROTECTED]
thanks Steve pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: Question Regarding SocketServer

2005-01-26 Thread [EMAIL PROTECTED]
I am glad you were able to figure it out. It's strange that the pyc file didn't get updated... it should have automatically fixed itself. *shrug* that's one of those problems that aggrivate you to death... -- http://mail.python.org/mailman/listinfo/python-list

Re: exclude binary files from os.walk

2005-01-26 Thread [EMAIL PROTECTED]
you might want to look up the 'isascii' function... i.e. - can be represented using just 7-bits. -- http://mail.python.org/mailman/listinfo/python-list

Re: Daylight savings and getmtime

2005-01-28 Thread [EMAIL PROTECTED]
on my windows xp box os.path.getmtime gives back local time (I just saved the file): >>> os.path.getmtime('c:\\temp\\testset.py') 1106955016 >>> print time.mktime(time.localtime()) 1106955034.0 You can try to figure out if DST is on by comparing time.localtime() versus time.gmtime(). In the Wester

Re: Nested scopes and class variables

2005-01-31 Thread [EMAIL PROTECTED]
To me it seems you should do it something like this: -def f(x): -class C(object): -def __init__(self, x): -self.x = x # here you set the attribute for class C -c = C(x) # instantiate a C object -print c.x -f(5) -- http://mail.python.org/mailman/listinfo/python-lis

stop program in komodo

2005-01-31 Thread [EMAIL PROTECTED]
Hello, How can we stop this peace of code in KOMODO: while 1: print "helo" I can't stop it, even using Ctrl+C pujo -- http://mail.python.org/mailman/listinfo/python-list

Relocatable binary installs....

2005-01-31 Thread [EMAIL PROTECTED]
Hello all, I'm currently working on a software package that is going to be distributed in binary form (with accompanying source) for lot of different unixes (Linux, AIX, HP-UX and others). Parts of the package are written in Python... so we are going to want to distribute our own version of pytho

Re: stop program in komodo

2005-01-31 Thread [EMAIL PROTECTED]
Hello Will, I have received information from [EMAIL PROTECTED] That he has already added this problem as bug. "I've added a bug for this: http://bugs.activestate.com/show_bug.cgi?id=36443 Regards, Shane" So stay tune. Pujo -- http://mail.python.org/mailman/listinfo/python-list

How can I use PyDoc to generate html file (modul in directory d)

2005-01-31 Thread [EMAIL PROTECTED]
Hello How can I use PyDoc to generate html file when my file.py is in other directory. Sincerely Yours, Pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I use PyDoc to generate html file (modul in directory d)

2005-01-31 Thread [EMAIL PROTECTED]
Hello all, I finaly find the solution, but please share yours if you have different way to do it. Theories: PyDoc menu can only search the module in directory when it was first called and in python directory for example c:\python24. So I have to call PyDoc in my module directory. It would be nec

type of simple object

2005-02-01 Thread [EMAIL PROTECTED]
Hi, How do I know type of simple object is tuple or list or integer, for example my function should understand what is the object type passed in its argument Pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: type of simple object

2005-02-01 Thread [EMAIL PROTECTED]
The result How can I check it since it is not a string right? Pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: type of simple object

2005-02-01 Thread [EMAIL PROTECTED]
Thank you guys. My function should multiply every element of a list, for example "something" and "something" can be an integer or another list. If it deals with integer than it is ok, but If it deals with list than it become false for example list*2 = listlist, and what I really want is to mutlit

Re: type of simple object

2005-02-01 Thread [EMAIL PROTECTED]
Hello Jacek, Thanks for the answer, Can you tell me how can I check if an object is a sequence (you are right, this is actually what I want)? -- http://mail.python.org/mailman/listinfo/python-list

How run valgrind on Python C extensions?

2005-02-01 Thread [EMAIL PROTECTED]
I have Python C extensions that are giving me seg faults that I'd like to run valgrind on. Can I use valgrind on these through python?? HOW??? Is it easy or must I do some work like recompiling python source with the -g extension? Thanks! Chris -- http://mail.python.org/mailman/listinfo/pyth

Re: Two classes problem

2005-02-02 Thread [EMAIL PROTECTED]
If you create a.py like -test = 'Spam' - -class a: -def __init__(self, arg): -global test -test = arg -self.result = arg + ' added' -def __call__(self): -return self.result and b.py like -import a -a.test = 'donkey' -x = a.a('dinosaur') -print a.test It will

Integrated Testing - Peppable?

2005-02-02 Thread [EMAIL PROTECTED]
Hi, Please excuse the intrusion from an admirer, but not a user, of Python. I've got an idea that I think could improve the language and might be relatively simple to implement. I've developed a prototype with a toy language here: , with screenshot here:

Re: Finding user's home dir

2005-02-02 Thread [EMAIL PROTECTED]
on win xp home, python 2.4 its also correct for me -- http://mail.python.org/mailman/listinfo/python-list

test msg

2005-02-03 Thread [EMAIL PROTECTED]
tes tmsg -- http://mail.python.org/mailman/listinfo/python-list

Re: Integrated Testing - Peppable?

2005-02-03 Thread [EMAIL PROTECTED]
Thanks, Jeremy, > No prose can compare to a live, functional demonstration. I agree; that's what my prototype amounts to: (sorry, it's Windows-only) But I take your larger message, and John's, to heart - this isn't worthy of making it i

Re: Integrated Testing - Peppable?

2005-02-03 Thread [EMAIL PROTECTED]
Thanks, John, I think there's a true, powerful, difference between inline tests and external (albeit adjacent) ones. I think the developer experience should be superior with inline tests for several reasons: - during initial development, without any navigation beyond the Enter key, you flow direc

Re: remove duplicates from list *preserving order*

2005-02-03 Thread [EMAIL PROTECTED]
You could do it with a class, like this, I guess it is a bit faster than option 1, although I'm no connaisseur of python internals. -class uniquelist(list): -def __init__(self, l): -for item in l: -self.append(item) -def append(self, item): -if item not in s

Re: remove duplicates from list *preserving order*

2005-02-03 Thread [EMAIL PROTECTED]
You could create a class based on a list which takes a list as argument, like this: -class uniquelist(list): -def __init__(self, l): -for item in l: -self.append(item) - -def append(self, item): -if item not in self: -list.append(self, item) - -l = [1

Re: how to generate SQL SELECT pivot table string

2005-02-03 Thread [EMAIL PROTECTED]
McBooCzech wrote: > Hallo all, > > I am trying to generate SQL SELECT command which will return pivot > table. The number of column in the pivot table depends on the data > stored in the database. It means I do not know in advance how many > columns the pivot table will have. > > For example I will

regular expression match collection

2005-02-04 Thread [EMAIL PROTECTED]
Hello, For example I have a string : "Halo by by by" Then I want to take and know the possition of every "by" how can I do it in python? I tried to use: p = re.compile(r"by") m = p.search("Helo by by by") print m.group() # result "by" print m.span() # result (5,7) How can I get the inf

Re: regular expression match collection

2005-02-04 Thread [EMAIL PROTECTED]
Thanks you... -- http://mail.python.org/mailman/listinfo/python-list

Thread in python

2005-02-04 Thread [EMAIL PROTECTED]
Hello, is any one knows websites which give a python thread tutorial ? Sincerely Yours, Pujo Aji -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic func. call

2005-02-04 Thread [EMAIL PROTECTED]
Try this: def myfunc(): print "helo" s = "myfunc()" a = eval(s) -- http://mail.python.org/mailman/listinfo/python-list

komodo thread problem

2005-02-04 Thread [EMAIL PROTECTED]
Komodo problem with threading: Hello, I can't run this program: def printtime(Max): i = 0 while True: time.sleep(1) print time.ctime(time.time()) i+=1 if i==Max : break pass if __name__ == "__main__": thread.start_new_thread(printtime,(2,)) But it runs inside IDLE. pujo --

Re: sos!

2005-02-05 Thread [EMAIL PROTECTED]
Dan Perl wrote: > "jordan2856977" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > hellow everybody! I'm from china. I'm a beginner of python. in china, > > python is not a fashionable language, so it's difficult to find some &g

tab 2 into tab 4 ?

2005-06-19 Thread [EMAIL PROTECTED]
Hello, I have python code which use tab=2. Recently I would like to change it into tab=4. Anyone has suggestion to convert easily and safely ? pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: tab 2 into tab 4 ?

2005-06-19 Thread [EMAIL PROTECTED]
Thanks it works! pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: calling subclass constructor question

2005-06-19 Thread [EMAIL PROTECTED]
No. You will go into an infinite loop - at least I get there when I try someting like this: class Base: def __init__(self): Derived.__init__(self) print 'Base' class Derived(Base): def __init__(self): Base.__init__(self)

Re: login website that using PHP

2005-06-20 Thread [EMAIL PROTECTED]
pbpscript is a little python toolkit for simulating a webbrowser, specifically for doing testing. It handles all the cookies and stuff for you. You might want to have a look at it. Stephen. -- http://mail.python.org/mailman/listinfo/python-list

Python can do it for me?

2005-06-21 Thread [EMAIL PROTECTED]
Hello people! I think it is my first message here. Well, I would go to start a Delphi database program, but now my client want a program that runs in Linux. So I want to know your opinion: what best language/IDE I can use for my purposes? I need mainly: MySQL or Potsgree SQL ***remote connection*

Re: Python can do it for me?

2005-06-21 Thread [EMAIL PROTECTED]
Really? I see Python is very good general-purpose language. I studing TCL, C++ and Java too. And remote conection? Do you know something? Thank you very much! Bye! -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading registry export files

2005-06-22 Thread [EMAIL PROTECTED]
It works fine for me on NT. I think it has nothing to do with Python but with the way the file is created - what windows version are you on? Also note the possibility the '/' - I prefer a noatation like below to avoid ambiguity. Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]

Re: Reading registry export files

2005-06-22 Thread [EMAIL PROTECTED]
It works fine for me on NT. I think it has nothing to do with Python but with the way the file is created - what windows version are you on? Also note the possibility the '/' - I prefer a noatation like below to avoid ambiguity. Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]

Re: timedelta comparision with gmtime()

2005-06-22 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED]:~ $ python Use now() from datetime class of datetime module instead of time module. Python 2.4.1 (#2, Mar 30 2005, 21:51:10) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for mor

Re: how to use more than 1 __init__ constructor in a class ?

2005-06-22 Thread [EMAIL PROTECTED]
You also could use a list to represent your data, then you get more dimensions supported, e.g: import math class Point: def __init__(self, *args): self.points = list(args) def dist(x, y): if len(x.points) != len(y.points): raise RuntimeError('dimensi

what list comprehension can't

2005-06-24 Thread [EMAIL PROTECTED]
Hello, Can we impose if then else into list comprehension ? Like we do in lambda-map form: This code change None into 0 L = [None, 12] R = map(lambda x: (x==None and [0] or x)[0], L) # [0,12] pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: what list comprehension can't

2005-06-24 Thread [EMAIL PROTECTED]
Thank you pujo -- http://mail.python.org/mailman/listinfo/python-list

ANN: Python Mock 0.1.0 released

2005-06-24 Thread [EMAIL PROTECTED]
I am pleased to announce the first release of Python Mock (version 0.1.0) on SourceForge: http://sourceforge.net/projects/python-mock/ About Python Mock - The Python Mock library enables the easy creation and use of Mock objects for Python unit testing, inspired by the various Jav

How does one write a function that increments a number?

2005-06-24 Thread [EMAIL PROTECTED]
Apologies if this question seems stupid: How does one write a function that increments a value in Python? When I tried, the variable never changed. The session went like this: >>> def incr(counter): counter = int(counter) counter += 1 >>> counter = 1 >>> incr(counter) >>> print c

Re: How does one write a function that increments a number?

2005-06-24 Thread [EMAIL PROTECTED]
Wait... so this means it is impossible to write a function that increments an integer without turning the integer into a list? -- http://mail.python.org/mailman/listinfo/python-list

Re: How does one write a function that increments a number?

2005-06-24 Thread [EMAIL PROTECTED]
Thank you all for your helpful replies. Regards, Vaibhav -- http://mail.python.org/mailman/listinfo/python-list

accessing object attribute as parameter

2005-06-26 Thread [EMAIL PROTECTED]
Hello, I would like to access object parameter / variable from a function. For example : class A: def __init__(self, x,y): self.x = x self.y = y in the main program, I have a list of obj A: L = [A(1,2), A(2,3)] Now I need to access the value of x or y from a function: def GetSomethi

Re: accessing object attribute as parameter

2005-06-26 Thread [EMAIL PROTECTED]
thanks Diez pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: Documentation How-to's for cx_Oracle

2005-06-26 Thread [EMAIL PROTECTED]
You can find that here: http://starship.python.net/crew/atuining/cx_Oracle/html/contents.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Boss wants me to program

2005-06-27 Thread [EMAIL PROTECTED]
I guess you need a database plus GUI layer for your apps, you might look in to MS Access (or Open Office 2.0 Base, but this is still beta, so I don't think your boss will like that) for that -- http://mail.python.org/mailman/listinfo/python-list

Re: Programmers Contest: Fit pictures on a page

2005-06-29 Thread [EMAIL PROTECTED]
Chung Leong wrote: > Isn't that an NP-complete problem or am I crazy? That makes it a more realistic challange, doesn't it? Suppose it was something simple, like calculating a minimal spanning tree. Every program would produce the same output. What kind of contest would that be? -- http://mai

Re: Programmers Contest: Fit pictures on a page

2005-06-29 Thread [EMAIL PROTECTED]
Don wrote: > Chung Leong wrote: > > > Isn't that an NP-complete problem or am I crazy? > > It is NP complete. Its known as the "cutting stock problem" (aka "Knapsack > problem"). Here's a Wikipedia page that describes it: > > http://en.wikipedia.org/wiki/Cutting_stock_problem > > There are commer

Help please: How to assign an object name at runtime

2005-06-29 Thread [EMAIL PROTECTED]
Good day: Probably the answer to my question is staring me in the face, but the solution escapes me. The following is the input line of the file: SoftDict-.csv: ca1017,GRPHScriptSet,ADD/REM,Adobe Acrobat 4.0=2005/06/14 I expected an instance of Machine() to be created with a name ca1017. Inste

Re: sys.ps2

2005-06-30 Thread [EMAIL PROTECTED]
You should be in interactive mode to see those, otherwise you get the error -- http://mail.python.org/mailman/listinfo/python-list

Re: Add methods to string objects.

2005-06-30 Thread [EMAIL PROTECTED]
You can even get closer, but it is NOT recommended class foostr(str): def plural (self): if self.value[-1] in "sz": return self.value + "es" else: return self.value + "s" #ugly hack setattr(__builtins__, "str", foostr) print str("apple").plural() #

<    1   2   3   4   5   6   7   8   9   10   >