Re: Modifying a textfile

2009-09-03 Thread konstantin
On Sep 3, 2:21 pm, Olli Virta wrote: > Hi! > > So I got this big textfile. It's full of data from a database. About > 150 or > more rows or lines in a textfile. > There's three first rows that belong to the same subject. And then > next > three rows belong to another subject and so on, to the end

Re: urllib2 - safe way to download something

2008-11-14 Thread konstantin
On 14 нояб, 18:12, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 14 Nov 2008 06:35:27 -0800, konstantin wrote: > > Hi, > > > I wonder if there is a safe way to download page with urllib2. I've > > constructed following method to cat

Re: urllib2 - safe way to download something

2008-11-14 Thread konstantin
I mean I don't want to catch all unexpected errors with empty "except:" :). -- http://mail.python.org/mailman/listinfo/python-list

urllib2 - safe way to download something

2008-11-14 Thread konstantin
Hi, I wonder if there is a safe way to download page with urllib2. I've constructed following method to catch all possible exceptions. def retrieve(url): user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' headers = {'User-Agent':user_agent} request = urllib2.Request(url, he

Re: Problem with lower() for unicode strings in russian

2008-10-06 Thread konstantin
itations with Unicode .lower also, but I don't > > think they apply to Russian (specifically, SpecialCasing.txt is > > not considered). > > > HTH, > > Martin Alexey, if your strings stored in some text file you can use "codecs" package > import codecs > handler = codecs.open('somefile', 'r', 'utf-8') > # ... do the job > handler.close() I prefer this way to deal with russian in utf-8. Konstantin. -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.6 final

2008-10-02 Thread konstantin
on-dev team) > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.9 (Darwin) > > iQCVAwUBSOREJ3EjvBPtnXfVAQLAigP/aEnrdvAqk7wbNQLFbmBonIr2YQbd1vEu > TyTr5imYXFWGNfv1/JMeMBjMfwpHi1bgPEDTLEZdhDRNj/G1h4NqqnpfJS0lfIaU > 4JBKwnsO80se/RGyupcs5f09UdKxOljhbFKEw46CHDkd9lE+cqy2yhetEwyx3c3+ > AVC11sjcO54= > =Oxo3 > -END PGP SIGNATURE- Congratulations! Konstantin -- http://mail.python.org/mailman/listinfo/python-list

Re: cache-like structure

2008-08-07 Thread konstantin
> And if you change the deque for a Queue.Queue, you don't even need a > Lock... > > Cheers, > > Maxime Maxime, thanks, sched module could be a nice solution. I've never used it before but it seems to be the right way. You guessed right. I want to used it in Queue. But this implementation does no

cache-like structure

2008-08-07 Thread konstantin
Hi, I've write a class that actually is data structure with items that automatically removed from collection when timeout expires. Interface is pretty simple. First public method is to make a record. And second (__contains__) is to define if record is actually in table. I prefer async way to clean

Re: string[i:j:k]

2008-07-22 Thread konstantin
Now it's clear. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: string[i:j:k]

2008-07-21 Thread konstantin
On Jul 22, 9:18 am, alex23 <[EMAIL PROTECTED]> wrote: > On Jul 22, 3:10 pm, konstantin <[EMAIL PROTECTED]> wrote: > > > some_string[i:j:k] > > What does it mean? > > i = start position, j = end position, k = step size > > >>> s = "ABABABABA

string[i:j:k]

2008-07-21 Thread konstantin
Hello, I'm not a newbie in python, but recently faced a problem in simple expression: some_string[i:j:k] What does it mean? I believe this grammar (http://docs.python.org/ref/ slicings.html) describes the syntax. But I can't grasp it. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: makepy.py not working

2008-04-08 Thread Konstantin Veretennicov
On Tue, Apr 8, 2008 at 4:18 PM, <[EMAIL PROTECTED]> wrote: > Hallo, > > I've a problem getting makepy running. When I start the tool on my > machine with doubleclick everything is fine. > But when I try this in my Code: > > makepy.py -i "Microsoft Excel 11.0 Object Library(1.5)" This syntax i

Re: Python Data Utils

2008-04-06 Thread Konstantin Veretennicov
On Sun, Apr 6, 2008 at 7:43 AM, Jesse Aldridge <[EMAIL PROTECTED]> wrote: > In an effort to experiment with open source, I put a couple of my > utility files up http://github.com/jessald/python_data_utils/ > tree/master">here. What do you think? Would you search for, install, learn and use thes

Re: urllib and bypass proxy

2008-04-05 Thread Konstantin Veretennicov
On Thu, Apr 3, 2008 at 9:21 PM, kc <[EMAIL PROTECTED]> wrote: > If this has value, do I submit a bug report or does > someone else? You do :) (http://bugs.python.org) -- kv -- http://mail.python.org/mailman/listinfo/python-list

Re: UML reverse engineering

2008-04-05 Thread Konstantin Veretennicov
On Fri, Apr 4, 2008 at 6:51 PM, <[EMAIL PROTECTED]> wrote: > Hello, > > Do you know a free software witch can compute a UML class diagram from a > python code. I tested many free UML softwares like BoUML, ArgoUML, Dia, > PNSource (not found) ... Did you mean /PyNSource/ ? (http://www.atug.com/and

Re: default method parameter behavior

2008-04-02 Thread Konstantin Veretennicov
On Wed, Apr 2, 2008 at 10:59 PM, <[EMAIL PROTECTED]> wrote: > I ran into a similar situation like the following (ipython session). > Can anyone please explain why the behavior? Of course. >From http://docs.python.org/ref/function.html: Default parameter values are evaluated when the function def

Re: Python queue madness

2008-04-02 Thread Konstantin Veretennicov
On Wed, Apr 2, 2008 at 4:52 PM, nnp <[EMAIL PROTECTED]> wrote: > > Is there any other way for data to get onto a queue Yes, by manipulating Queue.Queue's internal "queue" attribute directly. > or are there any known bugs with Python's Queue module that could lead to > this kind of behaviour? >

Re: non-terminating regex match

2008-04-02 Thread Konstantin Veretennicov
On Wed, Apr 2, 2008 at 9:32 PM, Maurizio Vitale <[EMAIL PROTECTED]> wrote: > Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > > > On Wed, 02 Apr 2008 16:01:59 +, Maurizio Vitale wrote: > > > >> And yes, I'm a total beginner when it comes to Python, but it seems > >> very strange to me th

Re: xlrd and cPickle.dump

2008-04-02 Thread Konstantin Veretennicov
On Wed, Apr 2, 2008 at 5:23 PM, <[EMAIL PROTECTED]> wrote: > Still no luck: > > Traceback (most recent call last): > File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework > \scriptutils.py", line 310, in RunScript >exec codeObject in __main__.__dict__ > File "C:\text analysis\pickle_

Re: import multiple modules with same name

2008-04-01 Thread Konstantin Veretennicov
On Mon, Mar 31, 2008 at 11:52 PM, Christian Bird <[EMAIL PROTECTED]> wrote: > Is it possible to import multiple modules with the same name from > different locations? This might work: import imp util1 = imp.load_source('util1', 'mod1/util.py') util2 = imp.load_source('util2', 'mod2/util.py') B

Re: XML Parsing

2008-04-01 Thread Konstantin Veretennicov
On Tue, Apr 1, 2008 at 10:42 PM, Alok Kothari <[EMAIL PROTECTED]> wrote: > Hello, > I am new to XML parsing.Could you kindly tell me whats the > problem with the following code: > > import xml.dom.minidom > import xml.parsers.expat > document = """Lettermanis token>betterthan token>JayLen

Re: Is this a good time to start learning python?

2008-04-01 Thread Konstantin Veretennicov
> > > > > Backward compatibility is important. C++ could break all ties with > C > > > to "clean up" as well, but it would be a braindead move that would > > > break existing code bases upon upgrade. > > > > C++ is not C. No one "upgrades" from C to C++. > > You misunderstand. C++ has a lot o

Re: Why prefer != over <> for Python 3.0?

2008-04-01 Thread Konstantin Veretennicov
On Tue, Apr 1, 2008 at 12:04 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 01 Apr 2008 04:15:57 -0300, Jorge Vargas <[EMAIL PROTECTED]> > escribió: > > > as for the original question, the point of going unicode is not to > > make code unicode, but to make code's output unicode. thin o

Re: Create executable from executable with py2exe

2008-03-30 Thread Konstantin Veretennicov
On Sat, Mar 29, 2008 at 3:23 PM, <[EMAIL PROTECTED]> wrote: > Hello, > > Is there any example how can I create executable ... with py2exe > Check out PyBuilder's source code (http://pybuilder.sourceforge.net/). -- kv -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and xml

2008-03-29 Thread Konstantin Veretennicov
On Sat, Mar 29, 2008 at 3:57 PM, Doran, Harold <[EMAIL PROTECTED]> wrote: > I am a python neophyte who has used python to parse through text files > using basic functions and no OOP experience. I have a need to process some > xml files and from what I am now reading python is the exact tool I nee

Re: stdin, stdout, redmon

2008-01-22 Thread Konstantin Shaposhnikov
Sorry, I meant: Alternatively you can use following command cat file | python script.py instead of cat file | script.py On Jan 22, 1:54 pm, Konstantin Shaposhnikov <[EMAIL PROTECTED]> wrote: > Hi, > > This is Windows bug that is described > here:http://sup

Re: stdin, stdout, redmon

2008-01-22 Thread Konstantin Shaposhnikov
) Do not forget to launch new console (cmd.exe) after editing registry. Alternatively you can use following command cat file | python script.py instead of cat file | python script.py Regards, Konstantin On Jan 22, 1:02 pm, Rolf van de Krol <[EMAIL PROTECTED]> wrote: > Well, that&#

Re: MFC app to Python IDLE communication

2008-01-11 Thread konstantin . smolin
>         IDLE is a Tkinter/TK IDE for Python... Why would you invoke a whole > IDE to manipulate application data? It was just an idea. I have never dealt with python before... I need some hints to understand where the answer to my problem is. > >          If you already have MFC in the mix, woul

MFC app to Python IDLE communication

2008-01-11 Thread konstantin . smolin
Hi all In my MFC application I need to call Python IDLE, pass some terms (or scripts or values - they are simple strings or memo fields) there so that user may modify/evaluate/interpret it and then return the modified terms back to the application. How can I do it the best way (MFC->IDLE)? As for

Decimal(1) > 0.0 == False

2006-03-01 Thread Konstantin Veretennicov
Hello, I'm having hard time trying to justify this decimal quirk to my coworker (he calls it a bug): ActivePython 2.4.1 Build 247 (ActiveState Corp.) based on Python 2.4.1 (#65, Jun 20 2005, 17:01:55) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more i

Re: noob question

2005-06-26 Thread Konstantin Veretennicov
On 6/26/05, Matt Hollingsworth <[EMAIL PROTECTED]> wrote: > Seems like an _extremely_ elegent language that is very easy to read, so > I suppose it's not really as much of an issue as it is with other > languages. Still, I would like to see what other people do and what are > some good ideas for t

Re: Favorite non-python language trick?

2005-06-26 Thread Konstantin Veretennicov
On 25 Jun 2005 12:17:20 -0700, George Sakkis <[EMAIL PROTECTED]> wrote: > If they go to itertools, they can simply be: > > def map(f, *iterables): > return list(imap(f,*iterables)) > > def filter(f, seq): > return list(ifilter(f,seq)) >>> from itertools import ifilter >>> def filter(f, s

Re: Favorite non-python language trick?

2005-06-25 Thread Konstantin Veretennicov
On 6/25/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 25 Jun 2005 17:41:58 +0200, Konstantin Veretennicov wrote: > > > On 6/25/05, Mandus <[EMAIL PROTECTED]> wrote: > >> It is really a consensus on this; that > >> removing map, filter, red

Re: Favorite non-python language trick?

2005-06-25 Thread Konstantin Veretennicov
On 6/25/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 24 Jun 2005 14:29:37 -0700, James wrote: > > 2.) Contracts > > Explain please. James probably meant Eiffel's Design by Contract. My favourite Python implementation is Terence Way's http://www.wayforward.net/pycontract/ ;-) - kv --

Re: Favorite non-python language trick?

2005-06-25 Thread Konstantin Veretennicov
On 6/25/05, Mandus <[EMAIL PROTECTED]> wrote: > It is really a consensus on this; that > removing map, filter, reduce is a good thing? It will render a whole lot > of my software unusable :( I think you'll be able to use "from __past__ import map, filter, reduce" or something like that :) They don

Re: super problem

2005-06-25 Thread Konstantin Veretennicov
On 6/25/05, Uwe Mayer <[EMAIL PROTECTED]> wrote: > AFAIK super only works with new-style classes, so I checked: > > >>> from qtcanvas import * > >>> isinstance(QCanvasItem, object) > True AFAIK, this is not the right way to check for new-styledness: >>> class X: "i'm an old-styler" >>> isinstanc

Re: Office COM automatisation - calling python from VBA

2005-06-25 Thread Konstantin Veretennicov
On 6/25/05, Josef Meile <[EMAIL PROTECTED]> wrote: > You could try to do an addin/addon for Word, Excel, and Outlook. You > don't need to code with VBA. Here you just need a language from where > you can access the microsoft interop assemblies (ie: C++ or C#; > IronPython maybe?) Hmm... Why jump t

Re: Office COM automatisation - calling python from VBA

2005-06-25 Thread Konstantin Veretennicov
On 6/25/05, Stephen Prinster <[EMAIL PROTECTED]> wrote: > guy lateur wrote: > > If you are new to Python and want to use it with COM, definitely get > yourself a copy of _Python Programming on Win32_ by Mark Hammond and > Andy Robinson. ...or at least read the chapter available online: http://www

Re: windows service problem

2005-06-25 Thread Konstantin Veretennicov
On 6/24/05, Austin <[EMAIL PROTECTED]> wrote: > def __init__(self,args): > win32serviceutil.ServiceFramework.__init__(self,args) > self.hWaitStop = win32event.CreateEvent(None, 0, 0, None) > self.check = 1 Change last two lines to self.check = 1 self.hWaitStop

Re: printing indented html code

2005-06-24 Thread Konstantin Veretennicov
On 6/24/05, Lowell Kirsh <[EMAIL PROTECTED]> wrote: > Is there a module or library anyone knows of that will print html code > indented? Depends on whether you have to deal with xhtml, valid html or just any, possibly invalid, "pseudo-html" that abounds on the net. Here's an example of (too) simp

Re: suggestions invited

2005-06-23 Thread Konstantin Veretennicov
On 23 Jun 2005 12:30:27 -0700, Aditi <[EMAIL PROTECTED]> wrote: > Thanks for ur effort... And I apologise for being sloppy in writing. > Well I agree the whole project sounds fictitious because it has been > assigned to me in that spirit. The project was explained to me in > just 5 minutes and so t

Re: string capitalize sentence

2005-06-23 Thread Konstantin Veretennicov
On 6/24/05, dimitri pater <[EMAIL PROTECTED]> wrote: > a = 'harry is a strange guy. so is his sister, but at least she is not a > guy. i am.' > b = a.replace('. ', '.') > splitlist = b.split('.') > newlist = [] > for i in range(len(splitlist)): > i = ''.join(splitlist[i].capitalize() + '

Re: PEP ? os.listdir enhancement

2005-06-23 Thread Konstantin Veretennicov
On 6/22/05, Riccardo Galli <[EMAIL PROTECTED]> wrote: > I propose to add an 'abs' keyword which would make os.listdir return the > absolute path of files instead of a relative path. What about os.listdir(dir='relative/path', abs=True)? Should listdir call abspath on results? Should we add another

Re: Avoiding deadlocks in concurrent programming

2005-06-23 Thread Konstantin Veretennicov
On 22 Jun 2005 17:50:49 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > Even on a multiprocessor > system, CPython (because of the GIL) doesn't allow true parallel > threads, ... . Please excuse my ignorance, do you mean that python threads are always scheduled to run on the same sing

Re: Detect windows shutdown

2005-06-22 Thread Konstantin Veretennicov
On 6/22/05, Austin <[EMAIL PROTECTED]> wrote: > My program is running on windows and it is wrritten by Python and wxPython, ... > Is there any way to dectect windows shutdown or reboot? Will wx.EVT_END_SESSION or wx.EVT_QUERY_END_SESSION help? - kv -- http://mail.python.org/mailman/listinfo/pyth

Re: Avoiding deadlocks in concurrent programming

2005-06-22 Thread Konstantin Veretennicov
On 6/23/05, Steve Horsley <[EMAIL PROTECTED]> wrote: > It is my understanding that Pythons multithreading is done at the > interpteter level and that the interpreter itself is single > threaded. In this case, you cannot have multiple threads running > truly concurrently even on a multi-CPU machine

Re: Python API to manipulate CAB files.

2005-06-22 Thread Konstantin Veretennicov
On 6/22/05, Peter Maas <[EMAIL PROTECTED]> wrote: > Isaac Rodriguez schrieb: > > Does anyone know of a Python API to manipulate CAB files? I guess you'll have to interface with setupapi.dll (SetupIterateCabinet) via ctypes, or with Microsoft Cabinet utilities via subprocess module. Neither is what

Re:

2005-06-22 Thread Konstantin Veretennicov
On 6/22/05, Doug Ly <[EMAIL PROTECTED]> wrote: > Is there a good IDE for Python? See http://tinyurl.com/8jqjc - kv -- http://mail.python.org/mailman/listinfo/python-list

Re: suggestions invited

2005-06-22 Thread Konstantin Veretennicov
On 22 Jun 2005 02:47:06 -0700, Aditi <[EMAIL PROTECTED]> wrote: > i have to make a system used by the IT department of a company which > contains 31 applications and their details which are being used in a > company ...the details are... > Application sub application catagorypla

Re: utf8 silly question

2005-06-21 Thread Konstantin Veretennicov
On 6/21/05, Jeff Epler <[EMAIL PROTECTED]> wrote: > If you want to work with unicode, then write > us = u"\N{COPYRIGHT SIGN} some text" ...and you can get unicode character names like that from unicodedata module: >>> import unicodedata >>> unicodedata.name(unichr(169)) 'COPYRIGHT SIGN' See a

Re: Loop until condition is true

2005-06-21 Thread Konstantin Veretennicov
On 6/21/05, Magnus Lycka <[EMAIL PROTECTED]> wrote: > I don't know anything about the Python compiler internals, > but it doesn't seem very hard to identify simple literals following > while and if, and to skip the runtime test. (Perhaps it's done > already?) True doesn't seem to be a literal, it

Re: Python choice of database

2005-06-21 Thread Konstantin Veretennicov
On 6/21/05, Charles Krug <[EMAIL PROTECTED]> wrote: > > Related question: > > What if I need to create/modify MS-Access or SQL Server dbs? You could use ADO + adodbapi for both. http://adodbapi.sourceforge.net/ - kv -- http://mail.python.org/mailman/listinfo/python-list

Re: Using code objects?

2005-06-21 Thread Konstantin Veretennicov
On 6/21/05, Chinook <[EMAIL PROTECTED]> wrote: > > When I create the code objects though, it seems a couple different ways work > and I'm wondering which is better and why (or is there a more correct > technique in this situation)? > > The two different ways are illustrated below: ... > >>> obj1

Re: Howto access a enumeration in a COM TypeLib

2005-06-21 Thread Konstantin Veretennicov
On 6/21/05, Alexander Eisenhuth <[EMAIL PROTECTED]> wrote: > Hello alltogether, > > I hope somebody can help me in that case. I bet I have overseen s.th.. > > I have a VC++ IDispatch Com-Server (ATL) and include for error handling > issues a enumeration in the IDL-File. > > [...] > enum PROG_ERR

Re: .dll files

2005-06-21 Thread Konstantin Veretennicov
On 20 Jun 2005 23:56:50 -0700, Sabin.A.K <[EMAIL PROTECTED]> wrote: > > Will the COM Object be a total solution for my problems? I just try to > make a dll to encapsulate some 'icon and text' files for my > application. Are you trying to create a windows resource dll? I believe Python isn't the t

Re: after transfer of data from MS-outlook(mail ids) to application, mail ids are consisting of strange characters

2005-06-21 Thread Konstantin Veretennicov
On 20 Jun 2005 22:24:09 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello all, ... > I hope somebody will help > me in this regard to unfold this mystery.Bye. I hope you will explain how this is related to Python. - kv -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple Unpacking in raise

2005-06-20 Thread Konstantin Veretennicov
On 6/21/05, Steven Bethard <[EMAIL PROTECTED]> wrote: > James Stroud wrote: > P.S. If you insist on using the two argument version of raise, you can > do it like this: > > py> class E(Exception): > ... def __init__(self, atup): > ... Exception.__init__(self, "Error with %s-%s" % atup)

Re: Tuple Unpacking in raise

2005-06-20 Thread Konstantin Veretennicov
On 6/21/05, James Stroud <[EMAIL PROTECTED]> wrote: > Hello All, > > Is this a bug? No, it works as documented. You should've consulted language reference: http://docs.python.org/ref/raise.html - kv -- http://mail.python.org/mailman/listinfo/python-list

Re: reading a list from a file

2005-06-20 Thread Konstantin Veretennicov
On 6/20/05, David Bear <[EMAIL PROTECTED]> wrote: > I have a file that contains lists -- python lists. sadly, these > are not pickled. These are lists that were made using > a simple print list statement. Sad, indeed. But what kind of objects they held? Only ints? Ints and strings? Arbitrary objec

Re: Question about HTMLgen

2005-06-20 Thread Konstantin Veretennicov
On 6/20/05, Sebastian Bassi <[EMAIL PROTECTED]> wrote: > Hello, > > I am using HTMLgen. It is very nice. But I can't make it to > generate an arbitrary command. > For example I want to output this: > > type="image/svg+xml" name="wmap" wmode="transparent"> Works for me... >>> d = HTMLgen.BasicD

Re: Python and encodings drives me crazy

2005-06-20 Thread Konstantin Veretennicov
On 6/20/05, Oliver Andrich <[EMAIL PROTECTED]> wrote: > Does the following code write headline and caption in > MacRoman encoding to the disk? > > f = codecs.open(outfilename, "w", "macroman") > f.write(headline) It does, as long as headline and caption *can* actually be encoded as macrom

Re: JEP and JPype in a single process

2005-06-20 Thread Konstantin Veretennicov
On 6/20/05, skn <[EMAIL PROTECTED]> wrote: > Hello, > > I have written a very simple java class file, which invokes a Python script > using JEP. . . . > Now inside this Python script I want to make Java calls using JPype. I am not familiar with either Jepp or JPype, but I spotted this snippet on

Re: What makes an object uncopyable?

2005-06-18 Thread Konstantin Veretennicov
On 17 Jun 2005 15:41:07 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am trying to make a copy of a certain Python object using the > copy.copy() function. When I try to perform this operation I get an > error like the following: > > copy.Error: un(shallow)copyable object of type ... >

Re: thread.start_new_thread question

2005-06-17 Thread Konstantin Veretennicov
On 6/17/05, Brian <[EMAIL PROTECTED]> wrote: > Hi KV, > > Here's a site that provides an easy, beginners example of how to do > threading. You might find this useful too... :-) > > http://www.codesampler.com/python.htm > (Look for the "Spawning Threads" section.) Thank you, but that doesn't a

thread.start_new_thread question

2005-06-16 Thread Konstantin Veretennicov
Hi, Just curious: >>> import thread >>> help(thread.start_new_thread) . . . start_new_thread(function, args[, kwargs]) . . . Second argument is mandatory. Is it incidental or for a reason? - kv -- http://mail.python.org/mailman/listinfo/python-list

Re: which ports to use for SOAP?

2005-06-16 Thread Konstantin Veretennicov
On 6/17/05, Maurice LING <[EMAIL PROTECTED]> wrote: > Hi, > > I'm writing something that specifies the use of SOAP. One requirement > that fumbles me is the port number(s) to use. (I assume you're talking about TCP ports, not SOAP ports.) > Is there any way to find > out which ports are not used

Re: Set of Dictionary

2005-06-16 Thread Konstantin Veretennicov
On 6/16/05, Vibha Tripathi <[EMAIL PROTECTED]> wrote: > I need sets as sets in mathematics: That's tough. First of all, mathematical sets can be infinite. It's just too much memory :) Software implementations can't fully match mathematical abstractions. >sets of any unique type of objects inc

Re: Set of Dictionary

2005-06-16 Thread Konstantin Veretennicov
On 6/16/05, Vibha Tripathi <[EMAIL PROTECTED]> wrote: > Hi Folks, > > I know sets have been implemented using dictionary but > I absolutely need to have a set of dictionaries... While you can't have a set of mutable objects (even dictionaries :)), you can have a set of immutable snapshots of thos

Re: pyunit: remove a test case on the fly

2005-06-15 Thread Konstantin Veretennicov
On 15 Jun 2005 14:13:09 -0700, chris <[EMAIL PROTECTED]> wrote: > We have a number of TestCase classes that have multiple test methods. > We are interested in removing any of the individual test methods on the > fly (dynamically, at runtime, whatever). Here's a simple approach imitating NUnit's Ca

Re: Single test for a class and all its subclasses?

2005-06-15 Thread Konstantin Veretennicov
On 6/15/05, Anthra Norell <[EMAIL PROTECTED]> wrote: > > class C: ... > class C2 (C): ... > > # What I want to do: > > if x.__class__ in (C, C2): >do_something_with (x) If you have an instance, you can use isinstance() built-in. - kv -- http://mail.python.org/mailman/listinfo/pyth