bug in modulus?

2006-04-23 Thread [EMAIL PROTECTED]
I think there might be something wrong with the implementation of modulus. Negative float values close to 0.0 break the identity "0 <= abs(a % b) < abs(b)". print 0.0 % 2.0 # => 0.0 print -1e-010 % 2.0 # =>1.99 which is correct, but: print -1e-050 % 2.0 # => 2.0 print -1

Re: bug in modulus?

2006-04-23 Thread [EMAIL PROTECTED]
Hmmm. I understand. I'd suggest that someone just drop a link from the Library reference manual as the divmod entry over there seems to contradict it. """ divmod(a, b) Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using lo

error

2006-04-24 Thread [EMAIL PROTECTED]
Anyone know what this error means? C:/Python24/pythonw.exe -u "C:/Python24/MyProjects/HeadsUp/cls_Bot.py" File "C:/Python24/MyProjects/HeadsUp/cls_Bot.py", line 10246 elif handname == 'straightflush': SystemError: com_backpatch: offset too large thanks -- http://mail.python.org/mailman/l

Re: error

2006-04-24 Thread [EMAIL PROTECTED]
thanks for the heads up. I read other posts on this error, but it's unclear to me whether the following will be a problem as well. Suppose I break up my very long module into smaller modules and import them into another module 'main'. Will I get the same error running main if the total number of

Re: error

2006-04-24 Thread [EMAIL PROTECTED]
thanks for the help. cheers. -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommended IDE for creating GUI?

2006-04-24 Thread [EMAIL PROTECTED]
Always nice to recommend myself: http://farpy.holev.com Free WYSIWYG GUI editor for wxPython (and wxRuby!). Have fun... -- http://mail.python.org/mailman/listinfo/python-list

C API - tp_getattro and tp_methods

2006-04-24 Thread [EMAIL PROTECTED]
Hi, I'm using a tp_getattro function to call into a C library and get values the the lib keeps track of. This works: >>> o = obj.Obj() >>> o.var 'value' Thats great but I also want to expose some instance methods and I'm having trouble. But when I set tp_methods nothing shows up? If I unset t

Re: C API - tp_getattro and tp_methods

2006-04-24 Thread [EMAIL PROTECTED]
André Malo wrote: > tp_getattro is like defining __getattribute__, i.e. it gets called on every > attribute read access. You can use PyObject_GenericGetAttr inside the > function to find predefined attributes before applying your own rules. Thanks for the reply. I see and was afraid of that, I

Re: C API - tp_getattro and tp_methods

2006-04-24 Thread [EMAIL PROTECTED]
Ahhh... The the light clicks on in my head. I see what is happening and both of these are great approaches. Many thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: I have problems with creating the classic game Wumpus. the file: http://esnips.com/webfolder/b71bfe95-d363-4dd3-bfad-39999a9e36d0

2006-04-25 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Im trying to create a version of the game Wumpus. Mine is called > Belzebub. But im STUCK! And its due tuesday 2 maj. Im panicing! Can > some one help me?? > here is the file: > http://esnips.com/webfolder/b71bfe95-d363-4dd3-bfad-3a9e36d0 > > Wh

Re: I have problems with creating the classic game Wumpus. the file: http://esnips.c

2006-04-25 Thread [EMAIL PROTECTED]
connyledin wrote: > Im trying to create a version of the game Wumpus. Mine is called > Belzebub. But im STUCK! And its due tuesday 2 maj. Im panicing! Can > some one help me?? > here is the file: > http://esnips.com/webfolder/b71bfe95-d363-4dd3-bfad-3a9e36d0 > > What i have the biggest problem

Re: Zope 3

2006-04-25 Thread [EMAIL PROTECTED]
I have been using ZOPE (mostly with CMF/Plone) for a couple years now. MY recolleciton of the initial leraning curve, was hours reading through source code, newsgroups, web site, outdated garbage, days long marathons of coffee, beer and very little sleep. After about 2 weeks of this horrible mindn

Re: python application ideas.

2006-04-25 Thread [EMAIL PROTECTED]
Thats the best way to go about it. Python I find is fun because you can just play with the interpreter throwing commands at it and really just working with syntax and usually POC ideas. The most useful ideas usually just come to you. I recieved a pretty barebones MP3 player from my sister for my

Re: Plotting package?

2006-04-25 Thread [EMAIL PROTECTED]
Try matplotlib, it's pretty nice and easy to use. -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-25 Thread [EMAIL PROTECTED]
sturlamolden wrote: > But as long as the cygwin dll is there, it creates an overhead for any > system call. The worst overhead is associated with the Unix fork() > system call, which Cygwin must emulate as there are no Win32 > equivalent. In particular, a fork() on Unix will be optimized with > cop

Re: proposed Python logo

2006-04-25 Thread [EMAIL PROTECTED]
The simplest and most widely known Monty Python image I can think of is a dead parrot. So maybe an upside-down parrot? Could be nice and colorful too, not to mention memorable. It is true that many won't make the connection between some kind of Monty Python image and the Python language, as they w

Re: I have problems with creating the classic game Wumpus. the file: http://esnips.c

2006-04-25 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > the file is on that side. But apparently you have to register to > download it.. =( But i can send it to anone who is willing to look > trough it. just send me an email [EMAIL PROTECTED] Ok, e-mail it to me. But I cannot guarantee anything. I'll p

Re: Introspection Class/Instance Name

2006-04-26 Thread [EMAIL PROTECTED]
What about: py> class A: py. def __init__(self): py. print self.__class__.__name__ py. print str(self) py. def __str__(self): py. return 'instance of %s' % self.__class__.__name__ py. py> a = A() A instance of A py> -- http://mail.python.org/mailman/l

Re: Type-Def-ing Python

2006-04-26 Thread [EMAIL PROTECTED]
If you are interested in static analysis for bug hunting purposes, then you might want to have a look at Pylint. Cheers, Aurélien. -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing Exceptions Across Threads

2006-04-26 Thread [EMAIL PROTECTED]
have you tried replacing : main = threading._MainThread() with main = threading.currentThread() ? (not sure if that will be sufficient) Well your way to pass exception between threads looks like I would have done myself. But I am no expert. Have you considered using stackless Python ? It pro

KeybordInterrupts and friends

2006-04-26 Thread [EMAIL PROTECTED]
ur seems bogus to me : [EMAIL PROTECTED]:~$ python test.py C-c C-c C-d C-d Traceback (most recent call last): File "test.py", line 5, in ? raw_input() KeyboardInterrupt The crash happens when I type C-c another time (always *after* atleast one C-d has been issued). What's wrong ? My

Re: KeybordInterrupts and friends

2006-04-26 Thread [EMAIL PROTECTED]
Thanks Robert. But I'm not trying something at all with this, only asking if it is a bug (and it looks like one). I suspect too, that it is related to signal handling. Cheers, Aurélien. -- http://mail.python.org/mailman/listinfo/python-list

scipy and py2exe

2006-04-26 Thread [EMAIL PROTECTED]
I am trying to package my application with py2exe. Unfortunately it uses both scipy/numpy and numarray so I'm having to jump through a lot of hoops to get it going. I'm getting problems packaging an app that uses only scipy. See below. Thanks! Janto ===setup.py=== from distutils.core import setup

Re: A defense for bracket-less code

2006-04-26 Thread [EMAIL PROTECTED]
wrong group -- http://mail.python.org/mailman/listinfo/python-list

Re: KeybordInterrupts and friends

2006-04-26 Thread [EMAIL PROTECTED]
I know it is racey, but the bug is not the race (iow : it is not a matter of pressing twice C-c very quickly). It happens all the time. I let enough time between the key strokes to let the program wait on raw_input. Or maybe you have something else in mind. Care to expand ? Thanks, Aurélien. --

Re: KeybordInterrupts and friends

2006-04-26 Thread [EMAIL PROTECTED]
Precision : it does not happen when running interactively. -- http://mail.python.org/mailman/listinfo/python-list

C API []-style access to instance objects

2006-04-26 Thread [EMAIL PROTECTED]
Hi, I am having trouble figuring out how to set up an object to be scriptable through the C API. An example of what I am attempting to do: >>> obj = foo.Foo() >>> obj["key"] Traceback (most recent call last): File "", line 1, in ? TypeError: unsubscriptable object >>> I've tried defining __ge

Re: I have problems with creating the classic game Wumpus. the file: http://esnips.c

2006-04-26 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > i just mailed it to you. Thanks for looking at it. Returning. Comments added by me start #m. I tried to keep all your original lines commented out and added my fixes with #m on either side, but there were so many errors I had to give up. I tried to preserve the c

Re: Twisted and Tkinter

2006-04-27 Thread [EMAIL PROTECTED]
Posting that error message would be helpful -- http://mail.python.org/mailman/listinfo/python-list

PyEval_EvalFrame

2006-04-27 Thread [EMAIL PROTECTED]
I see a C/python program that we're using spending a lot of time in this function, far more than we think it should. What is it? Thanks in advance! There seems to be nothing (but a bunch of stack traces) when I google this. Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: C API []-style access to instance objects

2006-04-27 Thread [EMAIL PROTECTED]
That worked! Thank You! I'd also like to say this group is great at fast accurate responses! Cheers! thanks ~jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted and Tkinter

2006-04-28 Thread [EMAIL PROTECTED]
Fredrik is right, ChatFactory doesn't have sendLine as a method b/c it doesn't inherit it from ClientFactory. The code: protocol = ChatClient does do anything within ChatFactory except set the variable. Try out these. from twisted.protocols.basic import LineReceiver, LineReceiver.sendLine or chan

Re: convert a int to a list

2006-04-28 Thread [EMAIL PROTECTED]
Tim Chase wrote: > > > > a = ['spam!', 1, ['Brie', 'Roquefort', 'Pol le Veq'], [1, 2, 3]] > > > > As an exercise, write a loop that traverses the previous list and > > prints the length of each element. What happens if you sen

Re: resume picking items from a previous list

2006-04-30 Thread [EMAIL PROTECTED]
kpp9c wrote: > I have a several list of songs that i pick from, lets, say that there > are 10 songs in each list and there are 2 lists. > > For a time i pick from my songs, but i only play a few of the songs in > that list... now my wife, Jessica Alba, comes home, and i start playing > from Jessic

ANN: nose 0.9.0a1

2006-04-30 Thread [EMAIL PROTECTED]
I'm pleased to announce the 0.9.0a1 release of nose, a test runner that brings py.test convenience to unittest, without resorting to (too much) magic. nose 0.9 includes a host of new features, as well as numerous backwards-incompatible changes to interfaces and implementation. For this reason, I'm

ANN: nose 0.9.0a1

2006-04-30 Thread [EMAIL PROTECTED]
I'm pleased to announce the 0.9.0a1 release of nose, a test runner that brings py.test convenience to unittest, without resorting to (too much) magic. nose 0.9 includes a host of new features, as well as numerous backwards-incompatible changes to interfaces and implementation. For this reason, I'm

Re: self modifying code

2006-05-01 Thread [EMAIL PROTECTED]
First of all, the test can be optimized by adding a boolean flag which indicates if the data has been initialized or not, and then just testing a boolean value instead of doing an "is" comparison, at the cost of an extra global variable. But this is still ugly (actually uglier IMO). I think this

Re: self modifying code

2006-05-01 Thread [EMAIL PROTECTED]
Yes, my implementation was less efficient because of the extra function call. > class Weird(object): > @staticmethod > def __call__(arg): > data = 42 > def func(arg): > return arg+data > Weird.__call__ = static

Re: self modifying code

2006-05-01 Thread [EMAIL PROTECTED]
Personally, I would almost always pay the x2 efficiency price in order to use a class. But then I don't know what you're writing. Of course, if you really need it to be efficient, you can write it as a C extension, or use Pyrex, etc. and get -much- better results. -- http://mail.python.org/mailm

set partitioning

2006-05-01 Thread [EMAIL PROTECTED]
Can someone tell me of a good algorithm to partition a set of n elements into m non-empty, disjoint subsets, where each subset has size k? -- http://mail.python.org/mailman/listinfo/python-list

Re: set partitioning

2006-05-01 Thread [EMAIL PROTECTED]
Also, if I do not care about the number of subsets, what is a good algorithm to partition a set of n elements into non-empty, disjoint subsets of size k? -- http://mail.python.org/mailman/listinfo/python-list

Re: set partitioning

2006-05-01 Thread [EMAIL PROTECTED]
Hello, Not quite what I'm looking for. I would like a list of all partitions with each partition having k or less elements, not just one instance. [EMAIL PROTECTED] wrote: > Something like this, or am I missing something? > > def partition(List, n, m, k): > if n!=m*k:

Polling from keyboard

2006-05-02 Thread [EMAIL PROTECTED]
I am trying to find a way to poll the keyboard. In my searching, I have found that Windows users are given the msvcrt module. Is there an equivilant for Unix systems? I am writing a p2p chat application, and would like to ideally approach user input in a manner similar to the way I am using poll

detect video length in seconds

2006-05-02 Thread [EMAIL PROTECTED]
Is there a way to get the length of a video clip (divix/xvid) in seconds? oh this is on linux. I first tryed to see if mplayer would tell me then I could wrap the call in a popen object and be done but it does not appear to output the length. Now I am looking at pymedia .It would be nice if there w

Re: An Atlas of Graphs with Python

2006-05-03 Thread [EMAIL PROTECTED]
You could have a look at the Mozart/Oz community. Oz is a language supporting logic and constraint programming out of the box and people are using these capabilities to play linguistic with graph matching. See http://www.lifl.fr/~duchier/papers/duchier-xdg-cslp2004.pdf for a possibly enlightening

Re: A python problem about int to long promotion just see the idle session

2006-05-03 Thread [EMAIL PROTECTED]
m the above you can see what int to long promotion is causing Nope, it's not the promotion causing the problem. > i dont need to say much please see for yourself. is this a bug or > a feature. Neither. Try changing the "+" and "-" to "+=" and "-=&

Any useful benefit to a tiny OS written in Python?

2006-05-03 Thread [EMAIL PROTECTED]
I was curious if there was any benefit to having an OS written in Python. The only benefit I can think of is that maybe Python is easier to audit for security bugs than C is. Any other benefits? Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser and multiple option names

2006-05-05 Thread [EMAIL PROTECTED]
that will break horribly in windows, remenber it install all it's crap in c:\Program Files -- http://mail.python.org/mailman/listinfo/python-list

Tkinter Canvas Pre-Buffer

2006-05-05 Thread [EMAIL PROTECTED]
Is there a way that using Tkinter I can pre-render the canvas then draw it on the screen? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove 50000 elements from a 100000 list?

2006-05-05 Thread [EMAIL PROTECTED]
Try to use set objects: >>> a=set(range(10)) >>> b=set(range(5)) >>> a = a - b -- http://mail.python.org/mailman/listinfo/python-list

Re: easy way to dump a class instance?

2006-05-05 Thread [EMAIL PROTECTED]
Some Googling yielded this recipe http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/137951/index_txt, a little test shows promising results of the described recipe. BTW: the Python Cookbook is always a good place to browse with questions other people probably had as well! -- http://mail.pyt

Re: Is this a good use of __metaclass__?

2006-05-06 Thread [EMAIL PROTECTED]
Hi! Thank you for a quick and informative response! > I'd go for 'manually decorating' anyway. Metaclasses can be really handy > for framework-like stuff, but for the use case you describe, I think the > explicit decorator option is much more, well, explicit - and also more > flexible - than meta

Python Eggs Just install in *ONE* place? Easy to uninstall?

2006-05-06 Thread [EMAIL PROTECTED]
It appears that apps distributed as Python Eggs are either a single compressed blob in site-packages directory or a directory under site-packages directory. Is this ALWAYS true? So by just erasing stuff under site-packages I can do a COMPLETE uninstallation of an Egg? Chris -- http://mail.pyth

Re: Is this a good use of __metaclass__?

2006-05-06 Thread [EMAIL PROTECTED]
I played around with my old code before I saw your post, and I believe I've found a solution that's a bit neater than what I had before. I thought I could just as well post it if you're interested and have the time. This one uses multiple inheritance, but it's legal and there's only one metaclass.

Splice two lists

2006-05-06 Thread [EMAIL PROTECTED]
Is there a good way to splice two lists together without resorting to a manual loop? Say I had 2 lists: l1 = [a,b,c] l2 = [1,2,3] And I want a list: [a,1,b,2,c,3] as the result. I've been searching around but I can't seem to find a good example. Thanks, Dan McLeran -- http://mail.python.org

Re: python 2.5a2, gcc 4.1 and memory problems

2006-05-06 Thread [EMAIL PROTECTED]
Michele Petrazzo wrote: > > I haven't tried to recompile py 2.4 myself with gcc 4.1 because it is > already compiled with it (4.0.3), so I think (only think) that is a py > 2.5 problem. > I'm right? or I have to compile it with something other switches? Sounds like a gcc problem to me. Try adding

Re: Splice two lists

2006-05-06 Thread [EMAIL PROTECTED]
Thanks, this worked great. Can you explain the syntax of the '*' on the return value of izip? I've only ever seen this syntax with respect to variable number of args. Thanks again. -- http://mail.python.org/mailman/listinfo/python-list

md5 from python different then md5 from command line

2006-05-07 Thread [EMAIL PROTECTED]
Hi I noticed that the md5 computed with md5 module from python is different then the md5 sum computed with md5sum utility (on slackware and gentoo). i.e. $echo marius|md5sum 0f0f60ac801a9eec2163083a22307deb - >>> test = md5.new("marius") >>> print test.hexdigest() 242aa1a97769109065e3b4df359bcfc

Re: Splice two lists

2006-05-07 Thread [EMAIL PROTECTED]
>When used in a function call (as opposed to a function definition), * >is the "unpacking" operator. Basically, it "flattens" an iterable into >arguments. The docs mention it... Cool, looks like I didn't read carefully enough. Thanks again. -- http://mail.python.org/mailman/listinfo/python-li

Re: Passing options around your program

2006-05-07 Thread [EMAIL PROTECTED]
When I have done this, I've used the last option -- creating a "config" module which can be imported wherever the configuration info is needed. (This module also handles any config files and/or Windows registry keys needed.) Using a Borg is a nice idea... but that ConfigBorg is probably going to

why _import__ only works from interactive interpreter?

2006-05-07 Thread [EMAIL PROTECTED]
I don't know what I'm doing wrong, but the result is that _import_ only works from a python shell, but not when I call a python script. $ cat test.py mod = __import__("/home/me/tests/test_imp") Called from a script it does not work: $ python /home/me/test.py Traceback (most recent call last): F

Re: why _import__ only works from interactive interpreter?

2006-05-07 Thread [EMAIL PROTECTED]
It's not that, it looks like __import__looks into sys.path, so if use an absolute path it cannot work. I found this thread and it seems they are right: http://groups.google.com/group/comp.lang.python/browse_thread/thread/6eed0025488bf130/637790b4ed62

Re: utility functions within a class?

2006-05-07 Thread [EMAIL PROTECTED]
You do *NOT* want to put double-underscores before and after a method name. That does not indicate a private method, it indicates a "magic method" -- something that has special meaning to Python. Thus, you have special methods like __init__(), __len__(), __getattr__(), __setattr__(), etc; all of

Re: Python Eggs Just install in *ONE* place? Easy to uninstall?

2006-05-07 Thread [EMAIL PROTECTED]
But not matter where eggs are installed they are never spread across multiple places on hard drive right? An egg is all under one node of tree right? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Eggs Just install in *ONE* place? Easy to uninstall?

2006-05-07 Thread [EMAIL PROTECTED]
But not matter where eggs are installed they are never spread across multiple places on hard drive right? An egg is all under one node of tree right? -- http://mail.python.org/mailman/listinfo/python-list

Re: why _import__ only works from interactive interpreter?

2006-05-07 Thread [EMAIL PROTECTED]
You are absolutely right, it's that empty entry that allows the absolute path to work. I'll probably add the path to sys.path, but as this is only a config file from which I need just a few vars, I'll try to use execfile, looking in past threads it looks like a better option for this use, I really

Why list.sort() don't return the list reference instead of None?

2006-05-07 Thread [EMAIL PROTECTED]
L = [4,3,2,1] L=L.sort() L will refer to None, why L.sort() don't return the L? I want to ask why the designer of Python do so? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why list.sort() don't return the list reference instead of None?

2006-05-08 Thread [EMAIL PROTECTED]
Thanks a lot! However, I wonder why L.sort() don't return the reference L, the performance of return L and None may be the same. If L.sort() return L, we shouldn't do the awful things such as: keys = dict.keys() keys.sort() for key in keys: ...do whatever with dict[key]... we can only write t

Re: why _import__ only works from interactive interpreter?

2006-05-08 Thread [EMAIL PROTECTED]
Sorry to follow up myself, I've finally used the execfile approach, passing an empty dict for capturing locals and then just processing it: new_settings = {} execfile(self.SETTINGS_MODULE, new_settings) # returns its locals in new_settings # assign UPPER_CASE vars for setting in new_settings.keys

advanced number recognition in strings?

2006-05-08 Thread [EMAIL PROTECTED]
Hi everybody, we want extract numbers from strings and wonder if there is already a module around for doing this. An example in our case would look like this: 0.032 +/- 0.5 x 10(-4) it would even be helpful to have a routine which does not recognise the +/- , but at least the 10(-4). Thank you

logging module: add client_addr to all log records

2006-05-08 Thread [EMAIL PROTECTED]
Hi! I'm writing a server and I want to use the logging module for logging stuff. I want to log all transactions in detail, and if everything goes haywire I want to know which client did it. Therefore I want to affix the client address to every single log item. I would like to do the following: Fo

Re: Why list.sort() don't return the list reference instead of None?

2006-05-08 Thread [EMAIL PROTECTED]
Thank you! I got it. -- http://mail.python.org/mailman/listinfo/python-list

Re: python 2.5a2, gcc 4.1 and memory problems

2006-05-08 Thread [EMAIL PROTECTED]
Michele Petrazzo wrote: > [EMAIL PROTECTED] wrote: > > Michele Petrazzo wrote: > >> I haven't tried to recompile py 2.4 myself with gcc 4.1 because it > >> is already compiled with it (4.0.3), so I think (only think) that > >> is a py 2.5 problem

Re: PythonWin's Check (any other Lint tool) ?

2006-05-09 Thread [EMAIL PROTECTED]
Hello, There're a pylint (http://www.logilab.org/projects/pylint) and pychecker (http://pychecker.sourceforge.net/) projects. Eugene -- http://mail.python.org/mailman/listinfo/python-list

Re: do "some action" once a minute

2006-05-09 Thread [EMAIL PROTECTED]
This is why your best bet is probably threads. Class Eureka(Threading.Thread): def __init__(self): Threading.Thread.__init__(self) self.start() def run(self,sleep_time): while 1: time.sleep(sleep_time) print "eureka" -- http://mail.python.o

Re: Shadow Detection?

2006-05-09 Thread [EMAIL PROTECTED]
7;__builtins__': , '__name__': > '__main__', '__doc__': None} > >>> blah = None > >>> globals() > {'__builtins__': , '__name__': > '__main__', '__doc__': None, 'blah': None} >

Re: Multi-line lambda proposal.

2006-05-10 Thread [EMAIL PROTECTED]
multi-line lambdas, had it been added to python a long time ago, would had reduced a lot of complexity in the language. for example - with multi-line lambdas - decorators are unneccesary. just give the multi-line lambda as an argument to a function - no need for special syntax.. the alternative dec

Re: advanced number recognition in strings?

2006-05-10 Thread [EMAIL PROTECTED]
Thank you all for your suggestions. After a few modifications the approach with the regexps works well! Sebastian -- http://mail.python.org/mailman/listinfo/python-list

python sqlite3 api question

2006-05-10 Thread [EMAIL PROTECTED]
Hi, is it possible to pass args through the api which are the same as the args you can use on the sqlite3 command line? What I'm talking about is the .mode or .output commands which you can enter via the sqlite3 cli so I can dynamically change were the output goes. Ta -- http://mail.python.org/ma

Re: python sqlite3 api question

2006-05-10 Thread [EMAIL PROTECTED]
Ah, je comprend. Thanks for pointing that out to me - I'll just have to spend more time at the code face to get the job done. Many thanks, Lol -- http://mail.python.org/mailman/listinfo/python-list

Re: Multi-line lambda proposal.

2006-05-11 Thread [EMAIL PROTECTED]
this is how I think it should be done with multi-line lambdas: def arg_range(inf, sup, f): return lambda(arg): if inf <= arg <= sup: return f(arg) else: raise ValueError and instead of @arg_range(5, 17) def f(arg): return arg*2 you do: f = arg_range(5, 17, lambda(arg)):

SSL support in SOAPpy to build a SOAP server

2006-05-11 Thread [EMAIL PROTECTED]
Can some one get me started with a working SOAP server that works over https. (SSL)? I have M2Crypto installed and found the following sample, but something is wrong in ssl_context = SSL.Context() Any help or tutorial appreciated? from SOAPpy import SOAPServer from M2Crypto import SSL

Amazing offers for Computers,Laptops

2006-05-13 Thread [EMAIL PROTECTED]
Hy every one. An amazing opportunity for all the people to buy and get all the information related to the Laptops, Computer Systems, registration for free trail and for rental basis. Effort less thing, just make look over www.eazyrentals.com -- http://mail.python.org/mailman/listinfo/python-lis

Re: Sending mail with attachment...

2006-05-13 Thread [EMAIL PROTECTED]
Replace: mesg['To'] = recievelist By: mesg['To'] = ', '.join(recievelist) -- http://mail.python.org/mailman/listinfo/python-list

Re: Slovenian Python User Group

2006-05-13 Thread [EMAIL PROTECTED]
Sebastjan Trepca wrote: > Hi! > > just wanted to send a notice about a new portal/group for Slovenian > Python fans here :) > > http://soup.zen.si (btw, it's in slovene lang) But why is SOUP (Slovenski Ortodoksni Uporabniki Pythona) used as an acronym? Or is SOUP a word in Slovene also? > > S

Re: SystemError: ... cellobject.c:22: bad argument to internal ?

2006-05-13 Thread [EMAIL PROTECTED]
robert wrote: > From the trace of a 2.3.5 software i got: > > \'SystemError: > C:sfpythondist23srcObjectscellobject.c:22: bad > argument to internal > function\\n\'] ... > Will there be another bug-fix release of Python 2.3 ? No, is this still a problem in 2.4? 2.4.4 i

Re: please help me is sms with python

2006-05-15 Thread [EMAIL PROTECTED]
Yet another option: Use web-service provided by your mobile operator (by means of cookielib, urllib2, etc). -- http://mail.python.org/mailman/listinfo/python-list

Re: please help me is sms with python

2006-05-15 Thread [EMAIL PROTECTED]
Yet another option: Use Python high level API for Symbian (http://opensource.nokia.com/projects/pythonfors60/) to write simple server which listen to desktop client (both in Python). Server (phone side): accept requests, send SMS using mobile phone capability Client (desktop): send requests, speci

Re: Finding yesterday's date with datetime

2006-05-15 Thread [EMAIL PROTECTED]
Try something like this... HTH. A. from datetime import * d1 = datetime( year=2006, month=5, day=15) d2 = datetime.now() for d in [d1,d2]: yest = d - timedelta(days =1 ) print "%s -> %s" % (d, yest) -- http://mail.python.org/mailman/listinfo/python-list

C API: getting sys.argv

2006-05-15 Thread [EMAIL PROTECTED]
Hi, How would one go about getting sys.argv fom within the context of a C API extention module? I want to pass it along to C library that I'm calling from my module code. TIA~ I'm trying to load the sys module using: PyObject *_argv = PyImport_ImportModule("sys.argv"); but it is coming back N

Re: C API: getting sys.argv

2006-05-15 Thread [EMAIL PROTECTED]
John Machin wrote: > > PyObject *_argv = PyImport_ImportModule("sys.argv"); > > What does the name of the function tell you? You can't do that in one > hit. Start with > PyObject *_sys = PyImport_ImportModule("sys"); > then you need to get the module's argv attribute. I just figured this out, doh

Re: Large Dictionaries

2006-05-16 Thread [EMAIL PROTECTED]
BTW why are python dicts implemented as hash tables and not judy arrays? -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the difference between tuple and list?

2006-05-16 Thread [EMAIL PROTECTED]
Lists are mutable, i.e. one can do this: a = [1,2,3] a[0] = 100 You can't do that with a tuple. a = (1,2,3) a[0] = 100 # error -- http://mail.python.org/mailman/listinfo/python-list

Unable to extract Python source code using Windows

2006-05-16 Thread [EMAIL PROTECTED]
I'm currently trying to get access to the Python source code, however whenever I try to extract the files using the latest version of WinZip (version 10) I get the following error "error reading however after processing 0 entries -- http://mail.python.org/mailman/listinfo/python-list

Unable to extract Python source code using Windows

2006-05-16 Thread [EMAIL PROTECTED]
I'm currently trying to get access to the Python source code, however whenever I try to extract the files using the latest version of WinZip (version 10) I get the following error "error reading header after processing 0 entries" I was under the impression that I could (from reading the various pos

Re: Unable to extract Python source code using Windows

2006-05-16 Thread [EMAIL PROTECTED]
>You can get Python sources from python.org I'm unable to locate a source file brings that will work with WinZip. Can anybody please point me to the exact URL that will get me to the source code? but it it is tar ball format or a gzip format, than that will work for me as WinZip is not open. --

Re: Unable to extract Python source code using Windows

2006-05-16 Thread [EMAIL PROTECTED]
Scott , I tried downloading for different archives, (different versions of Python) I can't believe they are all garbled. But they all don't work with WinZip. -- http://mail.python.org/mailman/listinfo/python-list

A better way of making subsclassing of built-in types stick for attributes?

2006-05-16 Thread [EMAIL PROTECTED]
Is there a better way to make the subclassing of built-in types stick? The goal is to have the the fields of a class behave like strings with extra methods attached. That is, I want the fact that the fields are not strings to be invisible to the client programmers. But I always want the extras to

Re: build now requires Python exist before the build starts

2006-05-16 Thread [EMAIL PROTECTED]
Toon Knapen wrote: > I'm trying to build the svn-trunk version of python on a Solaris box. > However I do not have a python installed yet and apparantly the build of > python requires a python to be accessible (as also annotated in the > Makefile generated during the ./configure). How can I solve t

questions on python script compiling for embedding

2006-05-17 Thread [EMAIL PROTECTED]
Dear all, I am trying to embed python into another scripting language, to do this I need to solve a number of problems on importing or compiling python script. First let me state what exactly I want to do, that is, I want the following syntax to be supported in the host language which I am develop

<    34   35   36   37   38   39   40   41   42   43   >