Re: pyZui - anyone know about this?

2009-12-11 Thread Daniel Fetchinson
> Hi, > I happened upon this youtube link: > http://www.youtube.com/watch?v=57nWm984wdY > It fairly blew my socks off. In it a fellow by the name of David Roberts > demos > a zui written in Python. Aside from the zooming (which is impressive enough) > it show embedding of images, pdf files, web pag

Re: Open source projects

2009-12-12 Thread Daniel Fetchinson
>> I'm a pretty okay python programmer and I really want to start >> developing for an open source project. I'm looking for one that >> preferably deals with networking and isn't as huge as twisted (that's >> just a preference, not extremely important). Could anyone suggest any >> projects? I also

Re: pyZui - anyone know about this?

2009-12-16 Thread Daniel Fetchinson
> PyZUI 0.1 has been released: > > http://da.vidr.cc/projects/pyzui/ Cool, thanks very much! I'm using python 2.6 these days and noticed that you use the sha module which makes py2.6 spit out a deprecation warning: /home/fetchinson/pyzui/pyzui/tilestore.py:22: DeprecationWarning:

Re: pyZui - anyone know about this?

2009-12-17 Thread Daniel Fetchinson
>> /home/fetchinson/pyzui/pyzui/tilestore.py:22: DeprecationWarning: the >> sha module is deprecated; use the hashlib module instead >> import sha > Yeah, I'd noticed that. It's fixed in the repository now. Great, thanks, pulled it and all looks good. Cheers, D

Re: Class variables static by default?

2009-12-21 Thread Daniel Fetchinson
>>> In python, 'class variable' is a variable that belongs to a class; not >>> to the instance and is shared by all instance that belong to the class. >> >> Surely, since string variables are strings, and float variables are >> floats, and bool variables are bools, and module variables are modules,

Re: Class variables static by default?

2009-12-22 Thread Daniel Fetchinson
>> I don't think Steven cares much, he loves this type of nitpicking and >> uber pedantic formulations, but only if he can apply it to other >> people's post :) > > Heh heh :) > > I actually do care, because (not having a Java/C++ background) I actually > do get a mental "double-take" every time I

Re: Question-Answer based web App

2009-12-28 Thread Daniel Fetchinson
> I am trying to make a web based application which has a set of questions and > answers associated with it such that a report is generated based on the > answers a user chooses for each question.It's like facebook apps where we > have questions , answers and reports . Should i generate the report

Re: Python OOP Problem

2009-12-28 Thread Daniel Fetchinson
> Hi, all. My problem is: > 1) I have a database(postgresql) > 2)I'm getting some string from database(string is a classname - > written by me). > 3)I need to construct new object from this string. > In java it's done by Class.forName().newInstance(); > > For instance: > 1)I receive the string: "My

Re: I think I found a bug in Python 2.6.4 (in the inspect module)

2009-12-29 Thread Daniel Fetchinson
On 12/29/09, inhahe wrote: > Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] > on > win32 > Type "help", "copyright", "credits" or "license" for more information. import inspect def a(b=1): pass > ... inspect.getargvalues(a) > Traceback (most recent call

Re: twenty years ago Guido created Python

2010-01-04 Thread Daniel Fetchinson
> Sorry I failed to salvage the thread. Go, quick, these threads are all around us! They are popping up everywhere! Go, go, quick! There is another troll thread right there! They are encircling us! They keep coming! At least one troll thread started on usenet just since I started typing! Quick, qu

Re: twenty years ago Guido created Python

2010-01-04 Thread Daniel Fetchinson
>>> Go, quick, these threads are all around us! They are popping up >>> everywhere! Go, go, quick! There is another troll thread right there! >> >> I wouldn't characterise this thread as a “troll thread”. If you think it >> is, that's fine I suppose. >> >> I'll continue to try improving the signal

Re: twenty years ago Guido created Python

2010-01-05 Thread Daniel Fetchinson
>>> Python is a truly awesome programming language. Not only is Guido a >>> genius language designer, but he is also a great project leader. What >>> an accomplishment. Congratulations to everybody who has contributed >>> to Python in the last two decades! >> >> The more languages you learn befo

lightweight encryption of text file

2010-01-08 Thread Daniel Fetchinson
I have a plain text file which I would like to protect in a very simple minded, yet for my purposes sufficient, way. I'd like to encrypt/convert it into a binary file in such a way that possession of a password allows anyone to convert it back into the original text file while not possessing the pa

Re: lightweight encryption of text file

2010-01-08 Thread Daniel Fetchinson
>> I have a plain text file which I would like to protect in a very >> simple minded, yet for my purposes sufficient, way. I'd like to >> encrypt/convert it into a binary file in such a way that possession of >> a password allows anyone to convert it back into the original text >> file while not po

Re: lightweight encryption of text file

2010-01-08 Thread Daniel Fetchinson
>>> I have a plain text file which I would like to protect in a very >>> simple minded, yet for my purposes sufficient, way. I'd like to >>> encrypt/convert it into a binary file in such a way that possession of >>> a password allows anyone to convert it back into the original text >>> file while n

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
> I have a plain text file which I would like to protect in a very > simple minded, yet for my purposes sufficient, way. I'd like to > encrypt/convert it into a binary file in such a way that possession of > a password allows anyone to convert it back into the original text > fi

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
On 1/9/10, Steven D'Aprano wrote: > On Fri, 08 Jan 2010 20:14:51 +0100, Daniel Fetchinson wrote: > >> I have a plain text file which I would like to protect in a very simple >> minded, yet for my purposes sufficient, way. I'd like to encrypt/convert >> it int

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
> > I have a plain text file which I would like to protect in a very > > simple minded, yet for my purposes sufficient, way. I'd like to > > encrypt/convert it into a binary file in such a way that possession of > > a password allows anyone to convert it back into the original text > > file wh

Re: lightweight encryption of text file

2010-01-09 Thread Daniel Fetchinson
>> I have a plain text file which I would like to protect in a very >> simple minded, yet for my purposes sufficient, way. I'd like to >> encrypt/convert it into a binary file in such a way that possession of >> a password allows anyone to convert it back into the original text >> file while not po

Re: lightweight encryption of text file

2010-01-10 Thread Daniel Fetchinson
>> I have a plain text file which I would like to protect in a very >> simple minded, yet for my purposes sufficient, way. I'd like to >> encrypt/convert it into a binary file in such a way that possession of >> a password allows anyone to convert it back into the original text >> file while not po

Re: lightweight encryption of text file

2010-01-10 Thread Daniel Fetchinson
>> Thanks, this looks very simple too, but where is the decryption code? >> Wikipedia seems to suggest that encryption and decryption are both the >> same but running crypt on the output of crypt doesn't give back the >> original string. So probably I'm misunderstanding something. > > Yes, the natu

easy_install fails on python-magic

2010-01-11 Thread Daniel Fetchinson
I'm not sure whose fault this is, the author of python-magic or easy_install (I'm guessing easy_install) but in any case easy_install python-magic (as root) fails with Searching for python-magic Reading http://pypi.python.org/simple/python-magic/ Reading http://hupp.org/adam/hg/python-magic No l

Re: Bugs in CPython 3.1.1 [wave.py]

2010-01-12 Thread Daniel Fetchinson
PS: It would be nice if someone(TM) could describe here in detail how to properly report errors like this. Of course I'm not going to do it if it involves establishing Yet Another Account somewhere. But hopefully it doesn't? >>> That's not very public-spirited, is it? Pytho

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Daniel Fetchinson
>> As of this writing two main variants of the Python language are in use, >> namely Python 2.x and Python 3.x (versions 3.0 and greater). Mostly >> they’re the same but the effect of e.g. the / division operator changed in >> 3.0, so in practice it’s very hard to create programs that work the sam

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Daniel Fetchinson
>> Also, I would replace >> >> "in practice it’s very hard to create programs" >> >> with >> >> "in practice it’s very hard to create complex programs" >> >> because for small programs it's very possible to write code that will >> work with both python 2 and 3. The question is of course what progra

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Daniel Fetchinson
>> One code base of cheetah works under python 2 and 3? I doubt it, but I >> could be wrong. What I can easily imagine is that somebody ported >> cheetah to python 3. In this case there are two code bases, one for >> python 2 and another for python 3. So it's not the same program that >> runs under

Re: Those two controversial 2nd & 3rd paragraphs of my ch 1

2010-01-13 Thread Daniel Fetchinson
>> Again, django has been ported to python 3, that's fine, everybody >> acknowledges that, but it's not the case that one code base works with >> both python versions. > > Well, if the port is done via 2to3, you can install the same code base in > Python 2 and Python 3, and the distutils install me

Re: python 3's adoption

2010-01-27 Thread Daniel Fetchinson
>>> * Print is now a function. Great, much improvement. > > Actually not, IMHO. All it does is is to provide incompatibility. What incompatibility are you exactly talking about? Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2 Type "help", "co

myths about python 3

2010-01-27 Thread Daniel Fetchinson
Hi folks, I was going to write this post for a while because all sorts of myths periodically come up on this list about python 3. I don't think the posters mean to spread false information on purpose, they simply are not aware of the facts. My list is surely incomplete, please feel free to post y

Re: myths about python 3

2010-01-27 Thread Daniel Fetchinson
>> Hi folks, >> >> I was going to write this post for a while because all sorts of myths >> periodically come up on this list about python 3. I don't think the >> posters mean to spread false information on purpose, they simply are >> not aware of the facts. >> >> My list is surely incomplete, plea

Re: myths about python 3

2010-01-27 Thread Daniel Fetchinson
>> 1. Print statement/function creates incompatibility between 2.x and 3.x! >> >> Certainly false or misleading, if one uses 2.6 and 3.x the >> incompatibility is not there. Print as a function works in 2.6: >> >> Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) >> [GCC 4.4.1 20090818 (Red Hat 4.4.

Re: python 3's adoption

2010-01-27 Thread Daniel Fetchinson
> * Print is now a function. Great, much improvement. >>> Actually not, IMHO. All it does is is to provide incompatibility. >> >> >> What incompatibility are you exactly talking about? >> >> Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) >> [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2

Re: python 3's adoption

2010-01-27 Thread Daniel Fetchinson
>>> * Print is now a function. Great, much improvement. > Actually not, IMHO. All it does is is to provide incompatibility. What incompatibility are you exactly talking about? Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)

Re: myths about python 3

2010-01-27 Thread Daniel Fetchinson
>> Hi folks, >> >> I was going to write this post for a while because all sorts of myths >> periodically come up on this list about python 3. I don't think the >> posters mean to spread false information on purpose, they simply are >> not aware of the facts. >> >> My list is surely incomplete, plea

Re: Library support for Python 3.x

2010-01-28 Thread Daniel Fetchinson
>> I'm going to be starting some new Python projects in Python 2.6, but am >> concerned that at least three of the libraries I will be >> using--pycrypto, paramiko and feedparser--are not currently supported in >> Python 3.x. The authors of these programs have not given any indication >> that work

Re: SQLObject

2009-09-28 Thread Daniel Fetchinson
> I'm new to using SQLObject, and having some problems with getting it > to recognise my current MySQL database. > > I've set up my connection fine, but it won't recognise the names of > the columns (presumably because they're not written using the default > naming convention?). For example, one o

Re: AJAX Widget Framework

2009-10-02 Thread Daniel Fetchinson
> I'm looking for an open source, AJAX based widget/windowing framework. > Here is what I need: > > - end user opens up a browser, points it to a URL, logs in > - on the server site, sits my application, creating a new session for > each user that is logged in > - on the server site, I create windo

Re: have opensource crawler written by python?

2009-11-02 Thread Daniel Fetchinson
> Is there a crawler written by python? anybody can give me more information? http://www.google.com/search?q=python+web+crawlers HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyfora, a place for python

2009-11-02 Thread Daniel Fetchinson
>> If you have any suggestions, let me know -- this is a community >> effort! > > Suggestion: Please don't make efforts to fragment the community. When a community grows and consequently its needs also grow, how do you differentiate "natural growth" from "fragmenting the community"? Same question

Re: Pyfora, a place for python

2009-11-02 Thread Daniel Fetchinson
If you have any suggestions, let me know -- this is a community effort! >>> >>> Suggestion: Please don't make efforts to fragment the community. >> >> When a community grows and consequently its needs also grow, how do >> you differentiate "natural growth" from "fragmenting the community"

Re: Pyfora, a place for python

2009-11-03 Thread Daniel Fetchinson
On 11/3/09, Diez B. Roggisch wrote: > Daniel Fetchinson schrieb: >>>>>> If you have any suggestions, let me know -- this is a community >>>>>> effort! >>>>> Suggestion: Please don't make efforts to fragment the community. >>>&

Re: Pyfora, a place for python

2009-11-03 Thread Daniel Fetchinson
>> I was referring to this comment by Ben: >> >> "Suggestion: Please don't make efforts to fragment the community." >> >> This IMHO is hostile, because it presupposes that the mere goal of the >> OP is fragmenting the community > > It presupposes nothing of any goal. It describes a predictable resu

Re: Pyfora, a place for python

2009-11-04 Thread Daniel Fetchinson
I was referring to this comment by Ben: "Suggestion: Please don't make efforts to fragment the community." This IMHO is hostile, because it presupposes that the mere goal of the OP is fragmenting the community >>> >>>It presupposes nothing of any goal. It describes a predi

Re: Pyfora, a place for python

2009-11-04 Thread Daniel Fetchinson
>>> Hi everyone, >>> >>> I am proud to announce the release of Pyfora (http://pyfora.org), an >>> online community of Python enthusiasts to supplement comp.lang.python >>> and #python. While the site is small right now, please feel free to >>> register and post any questions or tips you may have. >

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
>> I want to implement such specific feature: >> I have a server written in Python. I have a client written in C++. I >> want to use Python as network protocol between them. I mean: client >> send to server such string: "a = MyObject()", so object of this type >> will appear in server. Any ideas ho

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
>>> This is a *really* bad idea. >> >> How do you know for sure? Maybe the OP wants to use this thing with 3 >> known researchers working on a cluster that is not even visible to the >> outside world. In such a setup the model the OP suggested is a >> perfectly reasonable one. I say this because I

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
>>> This is a *really* bad idea. >> >> How do you know for sure? Maybe the OP wants to use this thing with 3 >> known researchers working on a cluster that is not even visible to the >> outside world. In such a setup the model the OP suggested is a perfectly >> reasonable one. I say this because I

Re: Python as network protocol

2009-11-10 Thread Daniel Fetchinson
>> My point is that hacking can still be a fun and easy-going activity >> when one writes code for himself (almost) without regards to security >> and nasty things like that creeping in from the outside. I'm the king >> in my castle, although I'm fully aware of the fact that my castle >> might be u

Re: ask a question about the module

2009-11-12 Thread Daniel Fetchinson
> Could not import module "Gnuplot" - it is not installed on your > system. You need to install the Gnuplot.py package. > \easyviz\gnuplot_.py(41) : > Traceback (most recent call last): > File "E:\study\python\commodity modle 10.23.py", line 3, in > import multipleloop as mp > File "E:\stu

Re: Vote on PyPI comments

2009-11-13 Thread Daniel Fetchinson
>> PyPI grew a commenting and rating system a while back, apparently in >> response to requests from users. However, since it's been rolled out, >> there's been a backlash from package maintainers who already have >> mailing lists, bug trackers, etc for their packages and don't want to >> have to t

Re: Vote on PyPI comments

2009-11-15 Thread Daniel Fetchinson
>> > I am skeptical about the utility of both rating and comments. If >> > somebody wants to know >> > if a package is good, she should ask here. >> >> Because unlike people writing comments, people here are never >> incompetent, misinformed, dishonest, confused, trolling or just wrong. >> >> But s

Re: ANN: Urwid 0.9.9 - Console UI Library

2009-11-17 Thread Daniel Fetchinson
On 11/16/09, Ian Ward wrote: > Announcing Urwid 0.9.9 > -- > > Urwid home page: >http://excess.org/urwid/ > > Updated screen shots: >http://excess.org/urwid/examples.html How did you make the html 'screenshots'? I guess you have some kind of urwid2html tool or some suc

Re: ANN: Urwid 0.9.9 - Console UI Library

2009-11-18 Thread Daniel Fetchinson
>> How did you make the html 'screenshots'? I guess you have some kind of >> urwid2html tool or some such or is it plain ncurses? > > It's all handled in the demo code. This is from tour.py: > > if urwid.web_display.is_web_request(): > screen = urwid.web_display.Screen() > else: >

Re: Python/HTML integration: phileas v0.3 released

2009-11-20 Thread Daniel Fetchinson
>> The prime goal of 'phileas' is to enable html code to be seamlessly >> included in python code in a natural looking syntax, without resorting >> to templatng language. >> >> see: >> >> http://larry.myerscough.nl/phileas_project/ >> >> I intend to submit phileas to the python.announce forum with

Re: How do I create a vanilla object in C?

2009-11-21 Thread Daniel Fetchinson
> I need to create a vanilla object in C, something I can do > PyObject_SetAttr on. Obviously, I do something somewhat like this every > time I create a minimal python class. I need to know how to do this in C > though. Please see http://docs.python.org/extending/index.html http://docs.python.o

Re: xmlrpc idea for getting around the GIL

2009-11-22 Thread Daniel Fetchinson
> Has anyone every tried wrapping the CPython lib into a daemon with an > RPC mechanism in order to move the GIL out of the process? I have > multiple audio threads, each of which use the python interpreter but > don't have to interact with each other and can might as well use a > separate interpre

Re: xmlrpc idea for getting around the GIL

2009-11-24 Thread Daniel Fetchinson
>> icating) the multiprocessing module would be ideal. >>> > The problem is that the OP has a embedded application running threads. >>> > multiprocssing doesn't help there. >>> >>> that's right. I cannot make CPython calls from my original C-based >>> threads. >> >> >> It's quite possible to do tha

Re: vpython installation problem

2009-11-26 Thread Daniel Fetchinson
> I am trying to install Vpython. > > configure worked well [snip] > but make fails: [snip] > what I can do? I'd suggest asking for help on vpython's mailing list: https://lists.sourceforge.net/lists/listinfo/visualpython-users HTH, Daniel -- Psss, psss, put it down! - http://www.cafepress

Re: PEP 3147 - new .pyc format

2010-02-01 Thread Daniel Fetchinson
> PEP 3147 has just been posted, proposing that, beginning in release > 3.2 (and possibly 2.7) compiled .pyc and .pyo files be placed in a > directory with a .pyr extension. The reason is so that compiled > versions of a program can coexist, which isn't possible now. > > Frankly, I think this is a

Re: PEP 3147 - new .pyc format

2010-02-01 Thread Daniel Fetchinson
>> I also think the PEP is a great idea and proposes a solution to a real >> problem. But I also hear the 'directory clutter' argument and I'm really >> concerned too, having all these extra directories around (and quite a >> large number of them indeed!). > > Keep in mind that if you don't explici

Re: PEP 3147 - new .pyc format

2010-02-02 Thread Daniel Fetchinson
>>> Personally, I think it is a terribly idea to keep the source file and >>> byte code file in such radically different places. They should be kept >>> together. What you call "clutter" I call having the files that belong >>> together kept together. >> >> I see why you think so, it's reasonable, h

Re: PEP 3147 - new .pyc format

2010-02-03 Thread Daniel Fetchinson
>>> I like seeing them in the same place as the source file, because when I >>> start developing a module, I often end up renaming it multiple times >>> before it settles on a final name. When I rename or move it, I delete >>> the .pyc file, and that ensures that if I miss changing an import, and >

Re: PEP 3147 - new .pyc format

2010-02-03 Thread Daniel Fetchinson
>>> Python does most of that for you: it automatically recompiles the >>> source whenever the source code's last modified date stamp is newer >>> than that of the byte code. So to a first approximation you can forget >>> all about the .pyc files and just care about the source. >> >> True, but the .

Re: Your beloved python features

2010-02-05 Thread Daniel Fetchinson
>> I've asked this question at stackoverflow a few weeks ago, and to make >> it clear: this should NOT be a copy of the stackoverflow-thread >> "hidden features of Python". >> >> I want to design a poster for an open source conference, the local >> usergroup will have a table there, and in the past

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
>>> This is a short complaint on admin abuse on #python irc channel on >>> freenode.net. >> >> Let's see, you are complaining about getting banned from #python by >> CROSS-POSTING between c.l.py and comp.lang.lisp. From my POV, that's >> grounds for extending the IRC ban permanently. > > It certai

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
> LOL assert funny > 1 > pow(funny, sys.maxint) >> >>> This is a short complaint on admin abuse on #python irc channel on >> >>> freenode.net. >> >> >> >> Let's see, you are complaining about getting banned from #python by >> >> CROSS-POSTING between c.l.py and comp.lang.lisp. From my POV, tha

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
>> LOL >> pow(funny, sys.maxint) >> > Yes, funny, but it overlooks the point that Xah is a nuisance to > multiple communities, not just to ours, and quite often concurrently. I don't think we need to worry about other communities or every internet related problem. The only thing we need to make su

Re: python admin abuse complaint

2010-02-07 Thread Daniel Fetchinson
>>> LOL >>> pow(funny, sys.maxint) >>> >> Yes, funny, but it overlooks the point that Xah is a nuisance to >> multiple communities, not just to ours, and quite often concurrently. > > I don't think we need to worry about other communities or every > internet related problem. The only thing we need

Re: ANN: obfuscate

2010-02-09 Thread Daniel Fetchinson
> I am pleased to announce the first public release of obfuscate 0.2.2a. > > http://pypi.python.org/pypi/obfuscate/0.2.2a > > obfuscate is a pure-Python module providing classical encryption > algorithms suitable for obfuscating and unobfuscating text. > > obfuscate includes the following ciphers:

Re: ANN: obfuscate

2010-02-10 Thread Daniel Fetchinson
>> All algorithms in obfuscate are obsolete, insecure and only >> interesting for people *that* want to get well educated in the history >> of encryption. > > Not true. Another use case is suggested by the chosen name for the > library: to obfuscate text against casual human reading, while not > ma

Re: Bizarre arithmetic results

2010-02-11 Thread Daniel Fetchinson
On 2/11/10, Terrence Cole wrote: > Can someone explain to me what python is doing here? > > Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47) > [GCC 4.3.4] on linux2 > Type "help", "copyright", "credits" or "license" for more information. -0.1 ** 0.1 > -0.7943282347242815 a = -0.1; b = 0.

Re: working with laptop battery

2010-02-13 Thread Daniel Fetchinson
>> It's probably gonna depend on which OS you're running. Which would be...? > > Sorry, forgot to mention this. I'm running debian linux. I don't know about python modules but have a look at /proc/acpi/battery/BAT0/info /proc/acpi/battery/BAT0/state You can parse the numbers you want from there.

Re: Plugin architecture

2010-02-15 Thread Daniel Fetchinson
> I'm thinking about writing plugin-style architecture for (a new) > web-based app (with SQLAlchemy as backend). > > Say, there's core web app and someone decides to write plugin Accounting > for this web app that would work with SQA objects of the core app or > other plugins. > > I found this: > >

Re: Python library for working with simple equations

2010-02-18 Thread Daniel Fetchinson
> Given a string expression as: x + 5 + x * (y + 2), any library that > can develop the equation for example. > Or if we say factor with "x" then it renders the expression with x * > ( rest of expression ). > There could be a functionality where when x,y are given then the > expression can be evalu

Re: Python library for working with simple equations

2010-02-18 Thread Daniel Fetchinson
>> Given a string expression as: x + 5 + x * (y + 2), any library that >> can develop the equation for example. >> Or if we say factor with "x" then it renders the expression with x * >> ( rest of expression ). >> There could be a functionality where when x,y are given then the >> expression can be

What happened to pyjamas?

2010-02-18 Thread Daniel Fetchinson
Does anyone know what happened to pyjs.org ? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: What happened to pyjamas?

2010-02-18 Thread Daniel Fetchinson
>> Does anyone know what happened to pyjs.org ? > > it's working for me. That's odd, it's unpingable for me from both Europe and the US, ping says unknown host. Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to continue after an exception ?

2010-02-20 Thread Daniel Fetchinson
> I would like my program to continue on the next line after an uncaught > exception, > is that possible ? try: # here is your error except: pass # this will get executed no matter what See http://docs.python.org/tutorial/errors.html HTH, Daniel -- Psss, psss, put it down! - http://

Re: Avoid converting functions to methods in a class

2010-02-23 Thread Daniel Fetchinson
> I have a convention when writing unit tests to put the target of the test > into a class attribute, as follows: > > class MyTest(unittest.TestCase): > target = mymodule.someclass > > def test_spam(self): > """Test that someclass has a spam attribute.""" > self.failUnless(h

Re: Signature-based Function Overloading in Python

2010-02-23 Thread Daniel Fetchinson
> In Java, Method Overloading is my best friend, but this won't work in > Python: > > >>> def a(): > pass > >>> def a(x): > pass > >>> a() > Traceback (most recent call last): >File "", line 1, in > a() > TypeError: a() takes exactly 1 argument (0 given) > > So - What would

Re: [Python-Dev] Question for you

2010-02-23 Thread Daniel Fetchinson
>> Hello, Dave; >> >>My name is Craig Connor and I am a senior s/w developer at Northrop >> Grumman. >> >> I have a question for you. I have installed* Boost* (via the >> Installer), and stored it into my >> >> C Drive inside a dir called: >> >> * C:\boost_1_42* >> >> I also installed the* Boos

Re: Spam from gmail (Was: fascism)

2010-02-23 Thread Daniel Fetchinson
>> >> Is it just me or has the spew from gmail on this list radically >> >> increased in the last week? Anyone else considering blocking all gmail >> >> posts to this list? >> > >> > I did that a long time ago for all of the Usenet groups I read >> > and all but one of the mailing lists I read. >>

Re: Challenge: escape from the pysandbox

2010-02-26 Thread Daniel Fetchinson
>> pysandbox is a new Python sandbox project Out of curiosity, the python sandbox behind google app engine is open source? If so, how is it different from your project, if not, anyone knows if it will be in the future? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putit

Re: Challenge: escape from the pysandbox

2010-02-27 Thread Daniel Fetchinson
On 2/26/10, Victor Stinner wrote: > Le vendredi 26 février 2010 15:37:43, Daniel Fetchinson a écrit : >> >> pysandbox is a new Python sandbox project >> >> Out of curiosity, the python sandbox behind google app engine is open >> source? If so, how is it di

Re: cpan for python?

2010-02-28 Thread Daniel Fetchinson
> Is there something like cpan for python? I like python's syntax, but I use > perl because of cpan and the tremendous modules that it has. It's called PyPI or Cheese Shop: http://pypi.python.org/pypi Is it only me or others also mentally read C-SPAN when somebody writes CPAN? Cheers, Daniel

Re: Challenge: escape from the pysandbox

2010-02-28 Thread Daniel Fetchinson
>>I guess they also have some kind of a sandbox if they let people run >>python on their machines, I'm not sure if it's open source though. > > Thing is, I'm sure that Google uses a critical backstop to any > Python-based sandbox: something like a chroot jail. The Python sandbox > is mostly there

Re: Draft PEP on RSON configuration file format

2010-03-01 Thread Daniel Fetchinson
>> it is my goal (which I may or may not be smart enough to reach) to >> write a module that anybody would want to use; > > But you are working on a solution in search of a problem. The really > smart thing to do would be pick something more useful to work on. We > don't need another configuratio

Re: Draft PEP on RSON configuration file format

2010-03-02 Thread Daniel Fetchinson
>> > But you are working on a solution in search of a problem. The really >> > smart thing to do would be pick something more useful to work on. We >> > don't need another configuration language. I can't even say "yet >> > another" because there's already a "yet another" called yaml. >> >> And i

Re: Re Interest check in some delicious syntactic sugar for "except:pass"

2010-03-03 Thread Daniel Fetchinson
> By way of motivation, I wrote that email after copying/pasting the > following a few times around a project until I wrote it into def > SilentlyDelete() and its cousin SilentlyRmdir() > > """ code involving somefile """ > try: > os.remove(somefile) > except: > ...pass # The bloody

Re: Curiosity stirkes me on 'import this'.

2010-03-08 Thread Daniel Fetchinson
> I took a look at the 'this' module to see where the file is stored. This is > probably old news to some people, but was new to me. > > print this.s > Gur Mra bs Clguba, ol Gvz Crgref > > Ornhgvshy vf orggre guna htyl. > Rkcyvpvg vf orggre guna vzcyvpvg. > Fvzcyr vf orggre guna pbzcyrk. > Pbzcyrk

Re: how to start a python script only once

2010-03-14 Thread Daniel Fetchinson
> I'd like to make sure, that a certain python program will only be run > once per host. (linux/windows) > > > so if the program is started a second time it should just terminate and > let the other one run. > > This does not have to be the fastest solution, but it should be reliable. > > > I have

Re: (a==b) ? 'Yes' : 'No'

2010-03-30 Thread Daniel Fetchinson
>> Hi, how can I write the popular C/JAVA syntax in Python? >> >> Java example: >> return (a==b) ? 'Yes' : 'No' >> >> My first idea is: >> return ('No','Yes')[bool(a==b)] >> >> Is there a more elegant/common python expression for this? > > return ('Yes' if a == b else 'No') And for less cl

what's the precision of fractions.Fraction?

2010-11-18 Thread Daniel Fetchinson
I do a recursive evaluation of an expression involving fractions and unsurprisingly the numerator and denominator grows pretty quickly. After 10-20 iterations the number of digits in the numerator and denominator (as integers) reaches 80-100. And I'm wondering until what point I can trust the resul

Re: what's the precision of fractions.Fraction?

2010-11-18 Thread Daniel Fetchinson
>> I do a recursive evaluation of an expression involving fractions and >> unsurprisingly the numerator and denominator grows pretty quickly. >> After 10-20 iterations the number of digits in the numerator and >> denominator (as integers) reaches 80-100. And I'm wondering until what >> point I can

inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
I guess this is a question to folks with some numpy background (but not necessarily). I'm using fractions.Fraction as entries in a matrix because I need to have very high precision and fractions.Fraction provides infinite precision (as I've learned from advice from this list). Now I need to calcul

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
>> I guess this is a question to folks with some numpy background (but >> not necessarily). >> >> I'm using fractions.Fraction as entries in a matrix because I need to >> have very high precision and fractions.Fraction provides infinite >> precision (as I've learned from advice from this list). > >

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
I guess this is a question to folks with some numpy background (but not necessarily). I'm using fractions.Fraction as entries in a matrix because I need to have very high precision and fractions.Fraction provides infinite precision (as I've learned from advice from thi

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
>> I'm using fractions.Fraction as entries in a matrix because I need to >> have very high precision and fractions.Fraction provides infinite >> precision . . . >> >> Probably it doesn't matter but the matrix has all components non-zero >> and is about a thousand by thousand in size. > > I wonder h

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
>> It's a mathematical problem so no uncertainty is present in the >> initial values. And even if there was, if there are many orders of >> magnitude differences between the entries in the matrix floating point >> does not suffice for various things like eigenvalue calculation and >> stuff like tha

Re: inverse of a matrix with Fraction entries

2010-11-24 Thread Daniel Fetchinson
>> So after all I might just code the inversion via Gauss elimination >> myself in a way that can deal with fractions, shouldn't be that hard. > > I wouldn't do it that way. Let M be your matrix. Work out the LCM l of > the denominators, and multiply the matrix by that to make it an integer > mat

<    1   2   3   4   5   >