Re: sqlite for mac?

2007-05-01 Thread Daniel Nogradi
> >> I'm using python 2.4.4 because the download said there were more mac > >> modules available for 2.4.4. than 2.5, and I can't seem to locate a > >> place to download sqlite for mac. > > > > I it comes on OS X Tiger, and possibly earlier versions as well (it's > > used as an index for Mail.app).

Re: sqlite for mac?

2007-05-01 Thread Daniel Nogradi
> > > Does sqlite come in a mac version? > > > > The interface (pysqlite) is part of the python 2.5 standard library > > but you need to install sqlite itself separately (as far as I > > remember) fromwww.sqlite.org > > > > Daniel > > I'm using python 2.4.4 because the download said there were more

Re: What do people use for code analysis.

2007-05-02 Thread Daniel Nogradi
> Lots of code, calls to, calls by, inheritance, multiple tasks, etc. > > What do people use to figure out what's happening? This is a pretty cool project just for that: http://codeinvestigator.googlepages.com/codeinvestigator HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite for mac?

2007-05-03 Thread Daniel Nogradi
> > >> Does sqlite come in a mac version? > > > > > The interface (pysqlite) is part of the python 2.5 standard library > > > but you need to install sqlite itself separately (as far as I > > > remember) fromwww.sqlite.org > > > > http://developer.apple.com/documentation/MacOSX/Conceptual/OSX_Techn

Re: Mod Python Question

2007-05-08 Thread Daniel Nogradi
> I am very new to Python and Mod_Python and I am running into what > looks like a caching problem. > > I have the following code: > --- > from mod_python import apache > from folder import Messenger > > def handler(req): > > msg = Messenger(req): > > # using req

Re: __getattr__ and __getattribute__

2007-05-08 Thread Daniel Nogradi
> i find it difficult to understand the difference between the magic methods > __getattr__ and __getattribute__ > and so donot know when to use former or later. >From the docs: __getattr__(self, name) Called when an attribute lookup has not found the attribute in the usual places (i.e. it is not

Re: File modes

2007-05-10 Thread Daniel Nogradi
> After reading a file is it possible to write to it without first > closing it? I tried opening with 'rw' access and re-winding. This does > not seem to work unless comments are removed. > > > Also, does close force a flush? > > Thanks, > > jh > > #~~ > > f = open('c:\\

Re: Dynamic subclassing ?

2007-05-12 Thread Daniel Nogradi
> I've got an instance of a class, ex : > > b=gtk.Button() > > I'd like to add methods and attributes to my instance "b". > I know it's possible by hacking "b" with setattr() methods. But i'd > like to do it with inheritance, a kind of "dynamic subclassing", > without subclassing the class, only th

Re: Dynamic subclassing ?

2007-05-12 Thread Daniel Nogradi
> > > I've got an instance of a class, ex : > > > > > b=gtk.Button() > > > > > I'd like to add methods and attributes to my instance "b". > > > I know it's possible by hacking "b" with setattr() methods. But i'd > > > like to do it with inheritance, a kind of "dynamic subclassing", > > > without su

Re: [Newbie] design question

2007-05-12 Thread Daniel Nogradi
> Suppose I have class ShoppingCart which has one method called buy(), > and class Buyer who has one reference to ShoppingCart... Can I also > have method buy() in class Buyer, which will then called > ShoppingCard.buy(), and also do some other stuff? Is this legal > design pattern, have methods

elementtree and entities

2007-05-13 Thread Daniel Nogradi
Hi list, How does one prevent elementtree converting & to & (and similarly for other entities)? >>> from xml.etree import ElementTree as et >>> x = et.Element( 'test' ) >>> x.text = '&' >>> et.tostring( x ) '&' Sometimes I would like to have the output '&' Daniel -- http://mail.python.org/mail

Re: elementtree and entities

2007-05-13 Thread Daniel Nogradi
> > How does one prevent elementtree converting & to & (and similarly > > for other entities)? > > > from xml.etree import ElementTree as et > x = et.Element( 'test' ) > x.text = '&' > et.tostring( x ) > > '&' > > > > Sometimes I would like to have the output '&' > > > > element

Re: Asyncore Help?

2007-05-14 Thread Daniel Nogradi
> I am working on the networking code for a small Multiplayer RPG I'm > working on. I currently have some basic code using threads, but it > seems like asyncore would be far better suited for my needs. However, > I have trouble finding a solid example for what I need. Python.org and > other sites p

Re: How do I count the number of spaces at the left end of a string?

2007-05-16 Thread Daniel Nogradi
> I don't know exactly what the first non-space character is. I know the > first non-space character will be * or an alphanumeric character. How about: >>> mystring = 'ksjfkfjkfjds ' >>> print len( mystring ) - len( mystring.lstrip( ) ) 4 HTH, Daniel -- http://mail.python.org/mailman/li

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Daniel Nogradi
> > I've found the following strange behavior of cPickle. Do you think > > it's a bug, or is it by design? > > > > Best regards, > > Victor. > > > > from pickle import dumps > > from cPickle import dumps as cdumps > > > > print dumps('1001799')==dumps(str(1001799)) > > print cdumps('1001799')==cdum

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Daniel Nogradi
> > > > I've found the following strange behavior of cPickle. Do you think > > > > it's a bug, or is it by design? > > > > > > > > Best regards, > > > > Victor. > > > > > > > > from pickle import dumps > > > > from cPickle import dumps as cdumps > > > > > > > > print dumps('1001799')==dumps(str(100

Re: Sending a JavaScript array to Python script?

2007-05-17 Thread Daniel Nogradi
> Just wondering if there is any way of sending a JavaScript array to a > Python cgi script? A quick Google search didn't turn up anything > useful. Simplejson is what you want: http://cheeseshop.python.org/pypi/simplejson HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

[ANN] markup.py 1.7

2007-05-17 Thread Daniel Nogradi
A new release is available for markup.py, a module for generating HTML/XML output painlessly and practically without any learning curve. The goal of markup.py is to be able to quickly put together documents in an ad hoc basis so if you need anything for production look for something else, e.g. Elem

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-18 Thread Daniel Nogradi
> For example, it HAS been published elsewhere that YouTube uses lighttpd, > not Apache: . How do you explain these, then: http://www.youtube.com/results.xxx http://www.youtube.com/results.php http://www.youtube.com/results.py Just wondering,

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-18 Thread Daniel Nogradi
> > >> For example, it HAS been published elsewhere that YouTube uses lighttpd, > > >> not Apache: . > > > > > > How do you explain these, then: > > > > > > http://www.youtube.com/results.xxx > > > http://www.youtube.com/results.php > > > http:/

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-18 Thread Daniel Nogradi
> > >> For example, it HAS been published elsewhere that YouTube uses lighttpd, > > >> not Apache: . > > > > > > How do you explain these, then: > > > > > > http://www.youtube.com/results.xxx > > > http://www.youtube.com/results.php > > > http:/

model browser

2007-05-20 Thread Daniel Nogradi
Hi list, I'm looking for an sqlobject based model browser with a web interface (is this the thing called CRUD these days?). Searching all over the place turned up of course django's automatic admin interface and turbogears' catwalk but I wouldn't want to buy into any of these two frameworks becaus

Re: model browser

2007-05-20 Thread Daniel Nogradi
And before you ask, yes, I did read http://mail.python.org/pipermail/python-list/2007-May/440337.html but there was nothing beyond django/tg :) -- http://mail.python.org/mailman/listinfo/python-list

Re: model browser

2007-05-23 Thread Daniel Nogradi
> > Are there other options I overlooked? > > > > Daniel > > There is a CRUD template for TG: > http://docs.turbogears.org/1.0/CRUDTemplate > > Might be what you're looking for. I was looking for something that is not based on a framework such as django or tg (and not on sqlalchemy either, but on

Re: Resize image NO PIL!!

2007-05-29 Thread Daniel Nogradi
> I have created an image hosting site and when a user uploads an image, > I want a service to run on the server to create a few thumbnails while > the user does other things. > > My stupid host (pair.com) doesn't have PIL installed and I'm too much > of a stupid newbie to figure out how to get it

Re: google maps api for py?

2007-05-30 Thread Daniel Nogradi
> I see that the weapon of choice for google maps is javascript... Is > there anything for python? I wrote the following for finding the latitude/longitude of a location. You need to set the variable 'key' to the actual key you got from google. (Indentation might get mixed up on the way.) H

Re: first, second, etc line of text file

2007-07-25 Thread Daniel Nogradi
Thanks all! I think I will stick to my original method because the files can be quite large and without reading the whole file into memory probably enumerate( open( textfile ) ) is the only way to access an arbitrary Nth line. -- http://mail.python.org/mailman/listinfo/python-list

first, second, etc line of text file

2007-07-25 Thread Daniel Nogradi
A very simple question: I currently use a cumbersome-looking way of getting the first, second, etc. line of a text file: for i, line in enumerate( open( textfile ) ): if i == 0: print 'First line is: ' + line elif i == 1: print 'Second line is: ' + line ...

Re: first, second, etc line of text file

2007-07-26 Thread Daniel Nogradi
> > A very simple question: I currently use a cumbersome-looking way of > > getting the first, second, etc. line of a text file: > > > > for i, line in enumerate( open( textfile ) ): > > if i == 0: > > print 'First line is: ' + line > > elif i == 1: > > print 'Second line is

Re: Tix.Tk() on Mac Intel

2007-07-26 Thread Daniel Nogradi
On 7/26/07, Alan <[EMAIL PROTECTED]> wrote: > Hi List! > > I have I Macbook Pro Intel running OSX 10.4.10. > > I downloaded Python 2.5 and tried > TclTkAquaBI-8.4.10.0.dmg, but I got: > > Traceback (most recent call last): > File "", line 1, in > File > "/Library/Frameworks/Python.framework/Vers

Re: Where I could find older python releases ?

2007-03-04 Thread Daniel Nogradi
> Sorry jumped the gun a little there. Is this what you are looking for? > http://codespeak.net/download/py/py-0.9.0.zip Probably not, the OP is looking for a python distribution, what you are posting is a third party package *for* python and is actually a part of the pypy project. -- http://mail

list-like behaviour of etree.Element

2007-03-04 Thread Daniel Nogradi
The etree.Element (or ElementTree.Element) supports a number of list-like methods: append, insert, remove. Any special reason why it doesn't support pop and extend (and maybe count)? -- http://mail.python.org/mailman/listinfo/python-list

Re: list-like behaviour of etree.Element

2007-03-05 Thread Daniel Nogradi
> >> The etree.Element (or ElementTree.Element) supports a number of > >> list-like methods: append, insert, remove. Any special reason why it > >> doesn't support pop and extend (and maybe count)? > > > > Those methods would not be hard to add. Perhaps, submit a feature > > request to Fredrik Lun

Re: list comprehension help

2007-03-18 Thread Daniel Nogradi
> I need to process a really huge text file (4GB) and this is what i > need to do. It takes for ever to complete this. I read some where that > "list comprehension" can fast up things. Can you point out how to do > it in this case? > thanks a lot! > > > f = open('file.txt','r') > for line in f: >

Re: list comprehension help

2007-03-18 Thread Daniel Nogradi
> > > I need to process a really huge text file (4GB) and this is what i > > > "list comprehension" can fast up things. Can you point out how to do > > > f = open('file.txt','r') > > > for line in f: > > > db[line.split(' ')[0]] = line.split(' ')[-1] > > > db.sync() > > > > What is

Re: Documentation for "str()" could use some adjustment.

2007-03-19 Thread Daniel Nogradi
> The Python documentation for "str" says > "str([object]) : > Return a string containing a nicely printable representation of an > object." > > However, there's no mention of the fact that "str" of a Unicode string > with non-ASCII characters will raise a conversion exception. The > document

from maple to python + numpy/scipy

2007-03-19 Thread Daniel Nogradi
I'm just getting started with numpy/scipy and first would like to get a view of what it can do and what it can't. The main idea is to move from maple to python and the first thing that poped up is the fact that maple is very convenient for both formal manipulations and exact integer calculations. F

Re: Join strings - very simple Q.

2007-03-23 Thread Daniel Nogradi
> > I was told in this NG that string is obsolet. I should use > > str methods. > > > > So, how do I join a list of strings delimited by a given > > char, let's say ','? > > > > Old way: > > > > l=['a','b','c'] > > jl=string.join(l,',') > > > > New way? > > Dunno if it's the "new way", but you can

On text processing

2007-03-23 Thread Daniel Nogradi
Hi list, I'm in a process of rewriting a bash/awk/sed script -- that grew to big -- in python. I can rewrite it in a simple line-by-line way but that results in ugly python code and I'm sure there is a simple pythonic way. The bash script processed text files of the form: ###

Re: On text processing

2007-03-23 Thread Daniel Nogradi
> This is my first try: > > ddata = {} > > inside_matrix = False > for row in file("data.txt"): > if row.strip(): > fields = row.split() > if len(fields) == 2: > inside_matrix = False > ddata[fields[0]] = [fields[1]] > lastkey = fields[0] >

Re: On text processing

2007-03-23 Thread Daniel Nogradi
> > I'm in a process of rewriting a bash/awk/sed script -- that grew to > > big -- in python. I can rewrite it in a simple line-by-line way but > > that results in ugly python code and I'm sure there is a simple > > pythonic way. > > > > The bash script processed text files of the form: > > > > ###

Re: Other classes in a module

2007-03-25 Thread Daniel Nogradi
> Can an instance of a class in a module, in any simple way find out which > other classes that exists in said module ? # module x ## class c1: pass class c2: pass ### Python 2.5 (r25:51908, Nov 1 2006, 11:42:37) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3

Re: YouTube showing repr() of a tuple

2007-03-29 Thread Daniel Nogradi
> Thought this might amuse some of you: > > > > I'd heard that YouTube uses Python, but it's fun to see proof of that, > even if it comes in the form of a minor bug. But their web frontend is (probably) in php: http://youtube.com/result

Re: ISO programming projects

2007-04-01 Thread Daniel Nogradi
> I'm looking for a collection of useful programming projects, at > the "hobbyist" level. > > My online search did turn up a few collections (isolated projects > are less useful to me at the moment), but these projects are either > more difficult than what I'm looking for (e.g. code a C compiler) >

Re: Parsing Problems

2007-04-03 Thread Daniel Nogradi
> I have just started learning python.I need to parse an XML file > and present the contents in a particular format.The format is called > as "ini" file.I have written some code.A section of the format needs > the data to be present in format as given below: > > [Services] > supported=0x10,0x1

Re: Lists and Tuples and Much More

2007-04-12 Thread Daniel Nogradi
> And the last example brings up another question. What's the deal with a > tupple that has a list in it such as: > > >>>my_tupple = (1, 2, 3, 4, 5, [6, 7, 8, 9]) > > Now I read somewhere that you could change the list inside that tupple. But > I can't find any documentation that describes HOW to

Re: Binary To File

2007-04-12 Thread Daniel Nogradi
> Is there an easy way to take binary data and build it into a file? Generally > this will be BLOB data drawn from a database, the data will be for jpg > images, I want to take the blob data and build it into a physical .jpg file. > > > > Is there a simple function for doing this in python? Like bi

string methods of a str subclass

2007-04-16 Thread Daniel Nogradi
I am probably misunderstanding some basic issue here but this behaviour is not what I would expect: Python 2.4 (#1, Mar 22 2005, 21:42:42) [GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class mystr( str ): ...

Re: string methods of a str subclass

2007-04-16 Thread Daniel Nogradi
> > Why is the strip( ) method returning something that is not a mystr > > instance? I would expect all methods operating on a string instance > > and returning another string instance to correctly operate on a mystr > > instance and return a mystr instance. > > Why would you expect that? > Would y

Re: Deleting or Empty a File

2007-04-17 Thread Daniel Nogradi
> I'm looking to clear those log files we were discussing earlier chaps, > > > What the best method to do this? Delete the file completely? Or just empty > its content? If you just want to delete the content of a file but keep it with 0 length you can do: f = open( 'myfile', 'w' )# or open(

Re: array{uint32}

2007-04-18 Thread Daniel Nogradi
> I have a function that returns a array{uint32}, is there any way to output > that to screen in a more user friendly format? At the moment when I print it > by itself it appears as [65541L], which isn't much used to anyone. I'm not sure I understand your question precisely but this might help: >

python autoconf macro for building ming extension

2007-10-03 Thread Daniel Nogradi
It might be slightly off topic here but couldn't find a more suitable place for this question: I'm trying to build the python binding for ming -- http://ming.sf.net -- but for some reason the python macro for autoconf -- python.m4 -- doesn't seem to detect my python installation correctly. The str

Re: Barcode recognition in Python

2007-01-13 Thread Daniel Nogradi
> I am searching for a python library for barcode recognition. We have > developed a rather complex application for document tracking and > document management in python/Zope, called PAFlow (www.paflow.it: > sorry, most of the information is in Italian...). > > As our project is completely free sof

sqlobject 0.8.0b1 and python 2.5

2007-01-13 Thread Daniel Nogradi
Hi list, I get loads of DeprecationWarnings while using sqlobject 0.8.0b1 with python 2.5. Does this mean that the sqlobject project is not very up to date? Or should I just ignore them and happily use it? In general, what's the status of sqlobject, will it be dropped altogether after sqlobject2 i

Re: sqlobject 0.8.0b1 and python 2.5

2007-01-13 Thread Daniel Nogradi
> > To my knowledge, the 0.8.x series is the current line of development, and > > has > > made major progress over the previous versions. What makes you think it will > > be stopped developing? And where does a sqlobject2 come from? > > http://www.sqlobject.org/2/ Yes, that's what I meant. The we

Re: installing/maintaining modules for multiple versions of python

2007-01-16 Thread Daniel Nogradi
> I have a suse box that has by default python 2.4 running and I have a > 2.5 version installed > in /reg/python2.5. How do I install new modules for only 2.5 without > disturbing the 2.4 default > installation. If you do 'python2.5 setup.py install' on a new module supporting distutils it will on

Re: Traversing the properties of a Class

2007-01-18 Thread Daniel Nogradi
> I'm using Python version 2.4 and I created a class with some properties > like: > > def GetCallAmount(self): > return somedata > > def GetCallCurrency(self): > return somemoredata > > moredefs..etc. > > CallAmount = property(GetCallAmount,None,None,None) > CallCurrency

Re: Noob Question: Force input to be int?

2007-01-23 Thread Daniel Nogradi
> I have a piece of code that looks like this: > > if len(BuildList) > 0: > print "The script found %d game directories:" % len(BuildList) > print > num = 0 > for i in BuildList: > print str(num) +" " + i > num = num + 1 > print > print "Select a build

file -> open in stdlib patch

2007-01-24 Thread Daniel Nogradi
Hi list, AFAIK using file( ) to open a file is deprecated in favor of open( ) and while grepping through the stdlib I noticed a couple of occurences of file( ) in the latest revision. I made a patch for getting rid of them; it passes all the tests. Although the change is almost trivial, since this

[ANN] markup.py 1.6

2007-01-25 Thread Daniel Nogradi
The new 1.6 release of markup.py is available for download: http://sourceforge.net/project/showfiles.php?group_id=161108 What is it? Markup.py is an intuitive, lightweight, easy-to-use, customizable and pythonic HTML/XML generator. Where is the documentation? http://markup.sourceforge.net/ Wh

Re: [ANN] markup.py 1.6 (bugfix: 1.6.1)

2007-01-26 Thread Daniel Nogradi
> The new 1.6 release of markup.py is available for download: > > http://sourceforge.net/project/showfiles.php?group_id=161108 > > What is it? > > Markup.py is an intuitive, lightweight, easy-to-use, customizable and > pythonic HTML/XML generator. > > Where is the documentation? > > http://markup.s

Re: "Correct" db adapter

2007-01-31 Thread Daniel Nogradi
> Maybe you should take a look at sqlalchemy > > > Hi to all, > > > > i have started a month ago to seriously studying Python. I am now > > looking at the databases stuff > > and i want the opinion of more experienced Python programmers (than > > me) at the following : > > > > I see that there are

subway

2007-01-31 Thread Daniel Nogradi
Does anyone know what has happened to the codebase of the subway project? It seems the whole project has been shut down leaving no trace of the code on net but I would be very happy to see it, apparently it had some cool features that would be fun to look at. Does anyone have access to the code and

Re: subway

2007-01-31 Thread Daniel Nogradi
> Daniel> Does anyone know what has happened to the codebase of the subway > Daniel> project? It seems the whole project has been shut down leaving > Daniel> no trace of the code on net but I would be very happy to see it, > Daniel> apparently it had some cool features that would be

Re: subway

2007-01-31 Thread Daniel Nogradi
> > the egg file can not be downloaded completely, the connection is > > closed at byte 138903 all the time and the file is bigger than that. > > If anyone managed to grab the file please let me know so far I tried > > wget and firefox. > > I've checked on my hd and found a recent (Jun 2006) checko

pil, histogram, mask

2007-01-31 Thread Daniel Nogradi
How does one do a histogram on only a part of an image? This is what I found in the PIL documentation about histogram( ): """ im.histogram(mask) => list Returns a histogram for those parts of the image where the mask image is non-zero. The mask image must have the same size as the image, and be e

Re: pil, histogram, mask

2007-02-01 Thread Daniel Nogradi
> > I don't need the histogram really, only the mean color > > value, but as far as I can see the 'mean' attribute only applies to an > > image and a mask can not be specified. > > You can slice parts of the image, and then use the > ImageStat.Stat(im).mean > On it. > > Bye, > bearophile Okay, I'l

subway code

2007-02-07 Thread Daniel Nogradi
Does anyone know what happened to the subway project? The sites gosubway.org and subway.python-hosting.com have been down for a long time now. Actually, I would like to have the code just to look at it and maybe learn something, but it seems it completely disappeared from the net. Does anyone has

subway code

2007-02-07 Thread Daniel Nogradi
(Somehow this message didn't go through for the first time.) Does anyone know what happened to the subway project? The sites gosubway.org and subway.python-hosting.com have been down for a long time now. Actually, I would like to have the code just to look at it and maybe learn something, but it

Re: Segmentation faults using threads

2007-02-13 Thread Daniel Nogradi
> I use the thread module (not threading) for a client/server app where I > distribute large amounts of pickled data over ssh tunnels. > Now I get regular Segmentation Faults during high load episodes. I use a > semaphore to have pickle/unpickle run nonthreaded, but I still get > frequent nondeterm

Re: KeyboardInterrupt not caught

2007-02-16 Thread Daniel Nogradi
> why is KeyboardInterrupt not caught (xp)? > import sys > try: > inp = sys.stdin.read() > except (KeyboardInterrupt, SystemExit): > print "kbd-interr,SystemExit" > except EOFError: > print "eof encountered" > except: > print "caught all" > self.showtraceback() > print "normal e

Re: Approaches of interprocess communication

2007-02-16 Thread Daniel Nogradi
> Supposing you have two separate processes running on the same box, > what approach would you suggest to communicate between those two > processes. > > Let me list the ones I know of: > > * Sockets >Advantage: Supported per se in nearly every programming language > without even the need to ins

Re: Approaches of interprocess communication

2007-02-16 Thread Daniel Nogradi
> About "Linda": Am I right that it looks very similar to "JavaSpaces"? > If yes, are there any funcdamental differences between those two? Yes, they are both linda implementations, but I have no idea what so ever how they compare. A local java expert maybe? -- http://mail.python.org/mailman/list

Re: Reg Google Web Toolkit and Python

2007-02-17 Thread Daniel Nogradi
> > Hi , > > We have a project where I need to read files store > > them in database in the backend.We have done this in > > python.Now we decided to use Ajax technique for user > > interface.For that we found that GWT is one of the > > best toolkits.Now I got a doubt can I interface GWT > > with p

Re: conver string to dictionary

2007-02-18 Thread Daniel Nogradi
> I want to convert string to dictionary .what is the best solution for this? > for example string is like this: > > > '{"SalutationID":["primarykey",8388607,0,None],"CompanyID":[0,8388607,0,"index"], > "SalutationName":["",255,0,None],"isDefault":["tinyint",1,1,None]}' > > and I want to con

Re: JIT (just-in-tme accelerator) for Python - exists or no?

2007-02-22 Thread Daniel Nogradi
> Or is any progress going on now? > > The JIT in MATLAB or Java seems to be very effective. This document describes the JIT situation in pypy: http://codespeak.net/pypy/dist/pypy/doc/jit.txt -- http://mail.python.org/mailman/listinfo/python-list

Re: Help on Dict

2007-02-25 Thread Daniel Nogradi
> Can any body tell how Dict is implemented in python... plz tell what > datastructure that uses Please see http://svn.python.org/view/python/trunk/Objects/dictnotes.txt?rev=53782&view=markup for general notes and http://svn.python.org/view/python/trunk/Objects/dictobject.c?rev=

[OT] python notation in new NVIDIA architecture

2007-02-26 Thread Daniel Nogradi
Something funny: The new programming model of NVIDIA GPU's is called CUDA and I've noticed that they use the same __special__ notation for certain things as does python. For instance their modified C language has identifiers such as __device__, __global__, __shared__, etc. Is it a coincidence? Pro

Re: [OT] python notation in new NVIDIA architecture

2007-02-26 Thread Daniel Nogradi
> > Something funny: > > > > The new programming model of NVIDIA GPU's is called CUDA and I've > > noticed that they use the same __special__ notation for certain things > > as does python. For instance their modified C language has identifiers > > such as __device__, __global__, __shared__, etc. I

Re: I don't quite understand this error...

2007-02-26 Thread Daniel Nogradi
> Thus far, everything works fine unless I'm trying the Deposit or Withdrawal > functions. (I know they're different, but both give roughly the same error.) > Whenever I attempt one of these functions I get the following error message: > > > Exception in Tkinter callback > Traceback (most recent ca

Re: gmpy moving to code.google.com

2007-02-26 Thread Daniel Nogradi
> If you're interested in gmpy (the Python wrapper of GMP, for > unlimited-precision arithmetic, rationals, random number generation, > number-theoretical functions, etc), please DO check out > http://code.google.com/p/gmpy/ -- gmpy 1.02 is there (as far as I can > tell) in a workable state. Sourc

Re: gmpy moving to code.google.com

2007-02-27 Thread Daniel Nogradi
Hi Alex, I did another test, this time with python 2.4 on suse and things are worse than in the previous case (which was python 2.5 on fedora 3), ouput of 'python gmp_test.py' follows: Unit tests for gmpy 1.02 release candidate on Python 2.4 (#1, Mar 22 2005, 21:42:42) [GCC 3.3.5 20050117 (p

Re: gmpy moving to code.google.com

2007-02-27 Thread Daniel Nogradi
> > Hi Alex, > > > > I did another test, this time with python 2.4 on suse and things are > > worse than in the previous case (which was python 2.5 on fedora 3), > > ouput of 'python gmp_test.py' follows: > > Interesting! gmpy interacts with decimal.Decimal by "monkey- > patching" that class on th

Re: Curious UnboundLocalError Behavior

2007-02-28 Thread Daniel Nogradi
> I'm probably fundamentally misunderstanding the way the interpreter > works with regard to scope, but is this the intended behavior... > [] > SOMEGLOBAL: > Traceback (most recent call last): > File "unboundlocal.py", line 15, in ? > foo() > File "unboundlocal.py", line 11, in foo >

Re: gmpy moving to code.google.com

2007-02-28 Thread Daniel Nogradi
> Could you please tell me, on that 64-bit build, what happens with: > > >>> import gmpy, sys, operator > >>> sys.maxint > ??? > >>> gmpy.mpz(sys.maxint) > ??? > >>> operator.index(gmpy.mpz(sys.maxint)) > ??? > >>> sys.maxint+1 > ??? > >>> gmpy.mpz(sys.maxint+1) > ??? > >>> operator.index(gmpy.mpz(

Fwd: gmpy moving to code.google.com

2007-03-01 Thread Daniel Nogradi
> > Could you please tell me, on that 64-bit build, what happens with: > > > >>> importgmpy, sys, operator > > >>> sys.maxint > > ??? > > >>>gmpy.mpz(sys.maxint) > > ??? > > >>> operator.index(gmpy.mpz(sys.maxint)) > > ??? > > >>> sys.maxint+1 > > ??? > > >>>gmpy.mpz(sys.maxint+1) > > ??? > > >>> o

Re: Writing an interpreter for language similar to python!!

2007-03-02 Thread Daniel Nogradi
> I am new to python and working on a project that involves designing a > new language. The grammar of the language is very much inspired from > python as in is supports nearly all the statements and expressions > that are supported by python. Since my project is in initial stage, so > I think it w

Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)

2006-04-18 Thread Daniel Nogradi
> #include > > char code[] = "print 'hello moshe'"; > > void main(...) > { > Py_ExecString(code); > } I don't get this, with python 2.4 there is no function called Py_ExecString in any of the header files. I found something that might do the job PyRun_SimpleString( ) in pythonrun.h, but could

Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)

2006-04-18 Thread Daniel Nogradi
> #include > > char secret_code[] = "print 'moshe'"; > > int main() > { > return PyRun_SimpleString(secret_code); > } > > and you need to link with python24.lib or whatever the object file is > for your platform. Are you sure? On a linux platform I tried linking with libpython2.4.so (I assume

Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)

2006-04-18 Thread Daniel Nogradi
> >> char secret_code[] = "print 'moshe'"; > >> > >> int main() > >> { > >> return PyRun_SimpleString(secret_code); > >> } > >> > >> and you need to link with python24.lib or whatever the object file is > >> for your platform. > > > > Are you sure? On a linux platform I tried linking with libpy

Re: items in an array

2006-04-19 Thread Daniel Nogradi
> I am working on a project in which I generate an array of values > (list_array). I need to use the values in this array to create list > similar to the one below: > > list_array = [] > list = item1,item2,itemN... > > I am having difficulty in getting the values out of the original array. >

Re: how to transfer a python object to other computer?

2006-04-20 Thread Daniel Nogradi
> Hey, all.Now I wanna to transfer a object to other computer, Maybe I > could serialize the object to a file by pickle moudle, then send the file > and get it from the file.But I think the efficency is awful, because the > disk io is very slow. > Someone could do me a favor to give me som

Re: Python IDE for linux

2006-04-20 Thread Daniel Nogradi
On 4/20/06, Fulvio <[EMAIL PROTECTED]> wrote: > Alle 09:43, giovedì 20 aprile 2006, Neil Isaac ha scritto: > > At this point I'm thinking that I would like to start using a real IDE. > Idle, shipped with Python :-) > > F > -- > http://mail.python.org/mailman/listinfo/python-list > And there is als

Re: python application ideas.

2006-04-25 Thread Daniel Nogradi
> Hello, I know this isn't really a python centric question, but I'm seeking > help from my fellow python programmers. I've been learning python for the > past year and a half, and I still haven't written anything substantial nor > have I found an existing project which blows my hair back. Python i

Re: setting file permissions on a web server

2006-04-30 Thread Daniel Nogradi
> I always read about how you need to set certain file permissions (for > cgi files, for example), but it's never been clear to me *how* you do > this. I know you can run the line > > chmod 755 scriptname.py > > but *where* do you run this? Is this done on your personal system, or on > the server?

Re: Converting tuple to String

2006-04-30 Thread Daniel Nogradi
> Is their a command to convert a tuple to string? e.g. > > xyz = "Hello", "There" > print xyz > > Is their any way of getting print to see xyz as being one string i.e. > "Hello There" rather than "Hello" and "There", despite "Hello" and > "There" being, in reality, seperate? Try one_big_string =

Re: setting file permissions on a web server

2006-04-30 Thread Daniel Nogradi
> > In short, chmod refers to local files so wherever you run it it will > > refer to files on that machine. You run it simply by typing it in a > > shell as a user who has privilage to perform the operatation, which > > can mean you have to be an owner of the file but if you are root you > > can d

[ANN] markup.py 1.3 - an HTML and XML writer

2006-05-01 Thread Daniel Nogradi
The new 1.3 release of markup.py is available from http://markup.sourceforge.net/ The markup module attempts to make it easier to output HTML or XML from a python program without cluttering your code with tags in a simple and flexible way. Changes * improved documentation * function added t

Re: [ANN] markup.py 1.3 - an HTML and XML writer

2006-05-01 Thread Daniel Nogradi
> The new 1.3 release of markup.py is available from > > http://markup.sourceforge.net/ > > The markup module attempts to make it easier to output HTML or XML > from a python program without cluttering your code with tags in a > simple and flexible way. > > Changes > > * improved documentation >

Re: how to do with the multi-frame GIF

2006-05-01 Thread Daniel Nogradi
> how to do with the multi-frame GIF, I used the PIL ,but it seems not > support? The source distribution of the 1.1.4 version comes with a Scripts directory where you can find player.py, gifmaker.py and explode.py which all deal with animated gif. I don't know if they work with version 1.1.5 thou

<    1   2   3   >