Re: Dealing with name clashes in pypi

2011-05-23 Thread Patrick Sabin
On 2011-05-22 23:23, Terry Reedy wrote: On 5/22/2011 2:34 PM, Patrick Sabin wrote: I wanted to register my project (epdb) in pypi. Unfortunately there already exists a project with the same name. It is not possible for me to change the name of the project, because I used it in multiple writings

Dealing with name clashes in pypi

2011-05-22 Thread Patrick Sabin
I wanted to register my project (epdb) in pypi. Unfortunately there already exists a project with the same name. It is not possible for me to change the name of the project, because I used it in multiple writings. Any ideas how I can deal with the situation? Is it possible to register a project

Re: Dictionary or Database—Please advise

2010-02-26 Thread Patrick Sabin
Shelve looks like an interesting option, but what might pose an issue is that I'm reading the data from a disk instead of memory. I didn't mention this in my original post, but I was hoping that by using a database it would be more memory efficient in storing data in RAM so I wouldn't have to r

Re: Call C program

2009-12-03 Thread Patrick Sabin
Have a look at the ctypes module http://python.net/crew/theller/ctypes/tutorial.html e.g.: from ctypes import * cdll.LoadLibrary("libc.so.6") libc = CDLL("libc.so.6") print libc.rand() print libc.atoi("34") - Patrick Patxi Bocos wrote: Hi!, I am developing a Python application and I need t

Re: Simple greatest common factor script

2009-11-29 Thread Patrick Sabin
I don't see how this script is able to divide by zero. If a and b switch places everything works ok. Have a look at your if-statements. It is possible, that both your if's are executed in one loop iteration (you can check this using pdb). You may want to try elif instead. - Patrick -- http:/

Re: Is there something similar to list comprehension in dict?

2009-11-20 Thread Patrick Sabin
Peng Yu wrote: I'm wondering if there is something similar to list comprehension for dict (please see the example code below). Do you mean something like this: >>> {i:i+1 for i in [1,2,3,4]} {1: 2, 2: 3, 3: 4, 4: 5} This works in python3, but not in python2 - Patrick -- http://mail.python.or

Re: Python & Go

2009-11-12 Thread Patrick Sabin
kj wrote: I'm just learning about Google's latest: the GO (Go?) language. (e.g. http://golang.org or http://www.youtube.com/watch?v=rKnDgT73v8s). There are some distinctly Pythonoid features to the syntax, such as "import this_or_that", the absence of parentheses at the top of flow control const

Re: Python & Go

2009-11-12 Thread Patrick Sabin
Carl Banks wrote: Well, it's hard to argue with not being like C++, but the lack of inheritance is a doozie. Well it has the concept of embedding, which seems to be similar to inheritance. - Patrick -- http://mail.python.org/mailman/listinfo/python-list

setuptools, accessing ressource files

2009-10-02 Thread Patrick Sabin
I use setuptools to create a package. In this package I included some images and I checked that they are in the egg-file. The problem is how can I access the images in the package? I tried pkgutil.get_data, but only got an IOError, because the EGG-INFO directory doesn't exist. I tried pkg_re

Re: SVG PIL decoder

2009-09-30 Thread Patrick Sabin
Donn wrote: Have a look at Cairo (python-cairo) in conjunction with librsvg (python-rsvg) -- that'll fix you up. You can go from an SVG to a PNG/array and thence into PIL if you need to. Thanks for the tip. Got it work, although it was a bit tricky, as resizing doesn't seem to be supported by

SVG PIL decoder

2009-09-30 Thread Patrick Sabin
I would like to open svg files with PIL, but svg doesn't seem to be supported. Does anyone know about a svg decoder for the PIL? - Patrick -- http://mail.python.org/mailman/listinfo/python-list

Re: Python book

2009-09-30 Thread Patrick Sabin
My favorite book is "Python Essential Reference" from David M. Beazley. It is not a beginner book. It is about the python language and not about a framework or third-party library. It is much more complete than for instance "Dive into python", but maybe somewhat more difficult. - Patrick lal

Re: Python strict mode?

2009-09-13 Thread Patrick Sabin
> You could write a class with a custom __setattr__() method that checks for valid attribute names for that class (a list of strings given to it's __init__() method). That way you could form several restricted "namespaces" for variables simply as different instances of that class. This can be

Re: Creating a local variable scope.

2009-09-11 Thread Patrick Sabin
Johan Grönqvist schrieb: Hi All, I find several places in my code where I would like to have a variable scope that is smaller than the enclosing function/class/module definition. One representative example would look like: -- spam = { ... } eggs = { ... } ham = (a[eggs], b[spam])

Re: How can I format unicode strings?

2009-09-09 Thread Patrick Sabin
gentlestone schrieb: return u"{}".format(self.name) u"{0}".format(u"blah") works for me with python-2.6.2 Maybe your format string is wrong. - Patrick -- http://mail.python.org/mailman/listinfo/python-list

Re: Reversible Debugging

2009-07-04 Thread Patrick Sabin
Now, if the snapshot is a feature of the Python VM, that's another matter entirely. I thought of taking a snapshot using fork, which creates a copy of the process. It may not be the most performant, but it should be quite portable. Of course there are some issues with multithreading/multiproc

Re: Reversible Debugging

2009-07-04 Thread Patrick Sabin
Horace Blegg schrieb: You might consider using a VM with 'save-points'. You run the program (in a debugger/ida/what have you) to a certain point (logical point would be if/ifelse/else statements, etc) and save the VM state. Once you've saved, you continue. If you find the path you've taken isn'

Re: Reversible Debugging

2009-07-04 Thread Patrick Sabin
Gabriel Genellina schrieb: Do you want reverse execution, like an undo function? Undo all changes made by executing some piece of code? I am not completly sure, if I really want to make exact undo, i.e. undoing commands by reversing all their effects, or just restoring the program state to an ar

Reversible Debugging

2009-07-03 Thread Patrick Sabin
Hello, I am interested if there are any python modules, that supports reversible debugging aka stepping backwards. Any links or ideas would be helpful, because I am thinking of implementing something like that. Thanks in advance, Patrick -- http://mail.python.org/mailman/listinfo/python-list