Chart libs for python
Hi guys, Please suggest me chart generation library for python comparable to google chart in features and ease of development. Google Chart has a limitation on amount on data you can send in a URL. Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: Question: Evaluate an string variable's value to a variable
On Dec 21, 11:56 am, "Chris Rebert" wrote: > On Sat, Dec 20, 2008 at 10:49 PM, Mir Nazim wrote: > > Just a quick question. > > > For example I have > > >>>> class X > >>>> pass > > > Then I do > >>>> x = X() > >>>> x.name = 'Nazim > > > Now my question is whether something like below is possible and how > >>>> y = 'name' > >>>> print x.y # How can x.y can be evaluated to x.name > > print getattr(x, y) #==> Nazim > > There are also analogous setattr() and delattr() functions. > Damn Right. These functions simply eluded my mind for well 15 minutes Thanks a lot Chris. > Cheers, > Chris > > -- > Follow the path of the Iguana...http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list
Question: Evaluate an string variable's value to a variable
Just a quick question. For example I have >>> class X >>> pass Then I do >>> x = X() >>> x.name = 'Nazim Now my question is whether something like below is possible and how >>> y = 'name' >>> print x.y # How can x.y can be evaluated to x.name PS: In PHP this can be done by a $x->$y. I sure there is some way in Python also Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: Generating all possible combination of elements in a list
> Again, I don't understand. You have 924 things, eliminate some of them, > and end up with 1060 things? Eliminating elements should decrease > the number, not increase it. yes, u are right I had to types of lists: one one them has 924 permutations and other has 792 making them 1722. out of which only 1060 are permissible permutations > > > Now I ahave a lits with 1060 lists in it. Now comes the hard part. > > How many possible distinct ways are there to arrange 1060 elements > > taken 96 at a time > > > > 1060! / (1060 - 96)! > > Well, this gives you > > 317904921427021349485603608239524627276760370311702922721976055970970143122666905356954926552940841376332310832740817342891028120773779767941521978678527871167070887214646849981846725146620998653633794832176123350796907123110479415043912870243292225353946234880 > > lists. Assuming you have a 4GHz machine, and assuming you can > process one element per processor cycle (which you can't in > any programming language), you would still need > > 25201747322664680800165176959627459671229735089398062747493028281611261495934191613595232075457833435132676404036916070660062238617142105686897050370835541348547430483314423570284610022871849798632147655019915145574508473705630949386534784951089574551507435520 > > years to process them all. Even if you had 100 > computers (i.e. one per human being on the planet), you > still need ... you get the idea. > I under stand all these calculations. > > Now out of these i need to test only those lists whose sum of > > elements(18 or 19) follows a particular pattern. > > To succeed, you must take this condition into account. > What is the particular pattern? > here is the pattern: If A = 18 B = 19 ONLY POSSIBLE Sequence of A, B type rows is as follows A B A A B A B A A B A A B A A B A B A A B A A B A B A A B A (REPEATING after this) I need only thos permutations that follow this pattern. After that I need to look of a few groupings of elements. like: (2, 2) = 61 occurs times (1, 1) = 54 occurs times (2, 2, 2) = 29 occurs times (1, 1, 1) = 13 occurs times and so on. I am looking for the 96 row matrix that satisfies these groupings. -- http://mail.python.org/mailman/listinfo/python-list
Re: Generating all possible combination of elements in a list
> Again, I don't understand. You have 924 things, eliminate some of them, > and end up with 1060 things? Eliminating elements should decrease > the number, not increase it. yes, u are right I had to types of lists: one one them has 924 permutations and other has 792 making them 1722. out of which only 1060 are permissible permutations > > > Now I ahave a lits with 1060 lists in it. Now comes the hard part. > > How many possible distinct ways are there to arrange 1060 elements > > taken 96 at a time > > > > 1060! / (1060 - 96)! > > Well, this gives you > > 317904921427021349485603608239524627276760370311702922721976055970970143122666905356954926552940841376332310832740817342891028120773779767941521978678527871167070887214646849981846725146620998653633794832176123350796907123110479415043912870243292225353946234880 > > lists. Assuming you have a 4GHz machine, and assuming you can > process one element per processor cycle (which you can't in > any programming language), you would still need > > 25201747322664680800165176959627459671229735089398062747493028281611261495934191613595232075457833435132676404036916070660062238617142105686897050370835541348547430483314423570284610022871849798632147655019915145574508473705630949386534784951089574551507435520 > > years to process them all. Even if you had 100 > computers (i.e. one per human being on the planet), you > still need ... you get the idea. > I under stand all these calculations. > > Now out of these i need to test only those lists whose sum of > > elements(18 or 19) follows a particular pattern. > > To succeed, you must take this condition into account. > What is the particular pattern? > here is the pattern: If A = 18 B = 19 ONLY POSSIBLE Sequence of A, B type rows is as follows A B A A B A B A A B A A B A A B A B A A B A A B A B A A B A (REPEATING after this) I need only thos permutations that follow this pattern. After that I need to look of a few groupings of elements. like: (2, 2) = 61 occurs times (1, 1) = 54 occurs times (2, 2, 2) = 29 occurs times (1, 1, 1) = 13 occurs times and so on. I am looking for the 96 row matrix that satisfies these groupings. -- http://mail.python.org/mailman/listinfo/python-list
Re: Generating all possible combination of elements in a list
Paul Rubin wrote: > > 1060! / (1060 - 96)! > > More than you want to think about: > > import math > > def logf(n): > """return base-10 logarithm of (n factorial)""" > f = 0.0 > for x in xrange(1,n+1): > f += math.log(x, 10) > return f > > print logf(1060) - logf(1060 - 96) > > Of course there are other ways you can calculate it, e.g. My problem is not to calculate this number, but generate this much number of permutations in a fastest possible ways. by the way, logf(1060) - logf(1060 - 96) = 288.502297251. Do you mean there are only 289 possible permutation if 1060 elements taken 96 at a time. Wow it is cool. Please correct me if I got something wrong -- http://mail.python.org/mailman/listinfo/python-list
Re: Generating all possible combination of elements in a list
Martin v. Löwis wrote: > Mir Nazim wrote: > > Example Problem: > > > > Generate all possible permutations for > > [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2] > > > > [1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2] (notice an extra 2 ) > > > > eliminate some combinations based on some conditions and combine the > > rest of combinations. And now generate all possible combinations for > > resulting data set. > > Hope you get the idea. > > Unfortunately, I don't. Why do you have two lists for which to generate > permutations? Why is it important that the second list has an extra 2 > (actually, not extra, but it replaces a 1)? > What are "some conditions" by which to eliminate permutations? > How to "combine" the remaining permutations? > What is the "resulting data set", and what is a "possible combination" > of it? condition are there cannot be more than 3 consecutive 2's or 1's > If the task is to produce all distinct permutations of 6 occurrences > of 1 and 6 occurrences of 2, I suggest the program below. It needs > produces much fewer than 12! results (namely, 924). > Yes that number I had already worked out and it is 792 for second list. Now I have generated all distinct permutations and after eliminating the permutations based on above condition I am left with 1060 permutations. Now I ahave a lits with 1060 lists in it. Now comes the hard part. How many possible distinct ways are there to arrange 1060 elements taken 96 at a time 1060! / (1060 - 96)! Hope you got the idea, why i need some faster ways to do it. Now out of these i need to test only those lists whose sum of elements(18 or 19) follows a particular pattern. Can Anybody can alternate ways to do it on a Celeron 1.4 Ghz, 256 MB RAM laptop. Thnaks > Regards, > Martin > > numbers = [1,2] > remaining = [None, 6, 6] > result = [None]*12 > > def permutations(index=0): > if index == 12: > yield result > else: > for n in numbers: > if not remaining[n]: > continue > result[index] = n > remaining[n] -= 1 > for k in permutations(index+1): > yield k > remaining[n] += 1 > > for p in permutations(): > print p -- http://mail.python.org/mailman/listinfo/python-list
Generating all possible combination of elements in a list
Hello, I need to write scripts in which I need to generate all posible unique combinations of an integer list. Lists are a minimum 12 elements in size with very large number of possible combination(12!) I hacked a few lines of code and tried a few things from Python CookBook (http://aspn.activestate.com/ASPN/Cookbook/), but they are hell slow. Does any body know of an algorithm/library/module for python that can help me in generation of these combinations faster """ONLY REQUIREMENT IS SPEED""" Example Problem: Generate all possible permutations for [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2] [1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2] (notice an extra 2 ) eliminate some combinations based on some conditions and combine the rest of combinations. And now generate all possible combinations for resulting data set. Hope you get the idea. Thanks PS: Tried matlab/scilab. They are slower than python. -- http://mail.python.org/mailman/listinfo/python-list
Re: Nevow LivePage tutorial
Tim Parkin wrote: > Mir Nazim wrote: > > I really appriciate the help a lot, the but the problems is that i have > > already real those. What i was looking for was some kind of detailed > > tutorial, that explains the basic ideas about live page and > > formhandling etc. > > (my be it the time some nevow know guy got onto it) > What are you trying to implement.. it may be that you don't need > livepage at all.. Is it just some javascript to enhance a form field? > Tim Parkin you are right, if it was just a some java script to enhance some for functionality. But my needs are much more. I have implemented a School management system for a few school in my area. Currently it id implemented in PHP. Now they have asked my to redesign it using AJAX. According to thier specs a lot of AJAX will be put in to it. Not only this the scope has broadnd a lot. I have to develop integrated accounting and groupware/collaboration functionality to it. Now as we know python is much better language than php. I want to do it in python in order to keep it maintainable over the period of time. So thoght Nevow will be good for it. I have understod the basics from the docs that come with nevow and coded a few basic pages as well. But these docs do not talk about LivePage and form handling. I did no get any thing from google either. I even looked at the examples. but could no understand beyond very very basic things. Things like how to establish as connection between client side JS and server-side python, how to notify and how does it take place etc. Most important how much what sort of JS is I need to put on clien sde and how much server side. These are few things i would like to know. So can any one help me, please. It will be OK if some could give me some code examples with explaination like how to establish a connection, how to ask for data from serverside etc. Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: Nevow LivePage tutorial
I really appriciate the help a lot, the but the problems is that i have already real those. What i was looking for was some kind of detailed tutorial, that explains the basic ideas about live page and formhandling etc. (my be it the time some nevow know guy got onto it) -- http://mail.python.org/mailman/listinfo/python-list
Nevow LivePage tutorial
Hello, Can any one direct me to some tutorials for: 1. Nevow LivePage 2. Form handling in Nevow Any Help is greately appriciated. I have already googled for it but did not get any thing helpfull. Thankyou -- http://mail.python.org/mailman/listinfo/python-list
Re: Point and click GUI builder for Python
neuruss neuruss wrote: > Madhusudan Singh wrote: > > Is there such a thing for python ? Like Qt Designer for instance ? > > The easiest way to create Python GUI apps: PythonCard. > It is based on wxPython by it has a higher level of abstraction. > You just drag and drop widgets on a form and code the events like you > woud in Visual Basic or Delphi. > IMHO, it's easier, simpler, more intuitive and stable than Boa > Constructor. Add to it wxGlade.sourceforge.net. But remember it is only a UI designer(does it pretty well) not an IDE. I fee wxGlade+SPE(http://www.stani.be/python/spe/blog/) are a better combo than PythonCard. Mir Nazim. www.PlanetNazim.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Point and click GUI builder for Python
neuruss neuruss wrote: > Madhusudan Singh wrote: > > Is there such a thing for python ? Like Qt Designer for instance ? > > The easiest way to create Python GUI apps: PythonCard. > It is based on wxPython by it has a higher level of abstraction. > You just drag and drop widgets on a form and code the events like you > woud in Visual Basic or Delphi. > IMHO, it's easier, simpler, more intuitive and stable than Boa > Constructor. Add to it wxGlade.sourceforge.net. But remember it is only a UI designer(does it pretty well) not an IDE. I fee wxGlade+SPE(http://www.stani.be/python/spe/blog/) are a better combo than PythonCard -- http://mail.python.org/mailman/listinfo/python-list
Re: what is your opinion of zope?
http://www.zope.org/Wikis/ZODB/FrontPage/guide/index.html This should solve this problem. --- Mir Nazim www.planetnazim.com -- http://mail.python.org/mailman/listinfo/python-list
Report generator for object databases.
Hi, I m planning to use ZODB for an applicaton. Is any one aware of report generators like Data Vision, Crystal Reports, fo python object databases. Some of you may have faced/solved similar problem some where. Help appreciated. Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: (PHP or Python) Developing something like www.tribe.net
Ok I get your point. Well actually my application is small in the begining, but then may be will a large one when we want to add more features. -- http://mail.python.org/mailman/listinfo/python-list
Re: (PHP or Python) Developing something like www.tribe.net
Can you please brief me a bit about your decision to CherryPy -- http://mail.python.org/mailman/listinfo/python-list
Re: (PHP or Python) Developing something like www.tribe.net
Thanks fro ur advice. I was also thinking to look into quixote. but wanted a second opinion. thanks again. -- http://mail.python.org/mailman/listinfo/python-list
Re: (PHP or Python) Developing something like www.tribe.net
I agree Zope2/Plone are really mature. But I think you missed my point. It is not neccessary that I may be using all the functionality of Plone etc. More over zope3 seems to have got a few great features like better support for building filesystem based products, easier learning curve etc. Please take it in the light of what I want to do. Then may be someone among c.l.py people may be able to suggest a way out. PS: I have pointed out the problem to my employer but I want to present a solution to it as well. -- http://mail.python.org/mailman/listinfo/python-list
Zope3 and Plone
Hi, I wanted to know what will happen to plone once Zope3 will be official version. Is plone being ported to Zope3. I googled it but did not come accross anything stating the plone's migration to zope3. I am thinking to take up a project. plone is a candidate for it. should i want to take benifit of zope3 features too. what should be done. Please comment thanks -- http://mail.python.org/mailman/listinfo/python-list
(PHP or Python) Developing something like www.tribe.net
Hi there. I am about to undertake a project. My employer wants it to be developed in PHP. While I was thinking that Python will be better for this job. The project will implement the functionality similar to Yahoo360 (http://www.360.yahoo.com), http://www.Tribe.net, Orkut etc. 1) There will be a groups like functionality like google groups. 2) Groups/personal blogs/albums/events/buddy lists etc. need to be implemented. 3) Most importantly it needs to be implemented like platform. that is it has to expose API or web services so that application implemented on it can talk to each other and other applications can talk to it. My employer wants to go with PHP because almost all the functionality is available with a Drupal CMS for PHP. But it is important to note that for an application, rather a platform, which is intended to be used for a long time, time to implement should not be the major criteria above good design and maintainability(in which python scores highest). IMHO Zope3/Quixote seem to be the obvious choice here. Though functionality is not available on them but i think time spent now will be gained by gains in better design and maintainable code base. Now I want this wonderful c.l.py community to pour in their suggestions on what would be better alternatives. Also may we try various combinations of frameworks like Zope3 for components, Twisted2.0 for network functionality etc. PS: I am leaving out Zope2.x and Twisted1.x as a lot has changed in newer versions and I don't want to be hanged when Zope3 becomes official. Thanks --- Mir Nazim -- http://mail.python.org/mailman/listinfo/python-list
Employablity of python programmers
Hi, Here I am once again to give a bit trouble. I am at the verge of completing my graduation in computer sciences. I will be graduating within 6-8 months. Now I am faced with the problems of my career. I am in a fix what skill set I must choose to be safe as far as job openings are concerned. I understand that skill set should be that one like most but job is also important. I will try to achieve a balance in both with the help of you advice. I am currently developing in PHP as a freelance web developer. But I want to move to python(for all it all cool reasons discussed a zillion times on c.l.py) and wanted to know the job oportunites available to a python programmer(I know these have been also discussed a zillion time here but still..). I am living in India and would like to know about employability of python programmers in India (I know that a few Indians frequent c.l.py. Hello Sridhar, where are you). I would also like to know that if the knowledge of any other language will boost employability of a python programmer. As far as I see it, the following combination are desirable. 1) C/C++ and Python. 2) Java and Python. 3) Pure Python. Out of the three Java along with python seems to be straight forward choice as far as employability is concerned. But I would like to know the benifits which one is a better career choice to take out of these three choices(other suggestions are welcome). For me choice three would be better, not because I have only one language to learn. If I choose choice three I could spend more time in learning different approaches to develop the application and better master the library and frameworks avaialble for python. So what are the recomendations from your side. Please help. Thanks --- Mir Nazim. -- http://mail.python.org/mailman/listinfo/python-list
Quixote+Nevow+LivePage
Hi I am a PHP developer and in trying to get a better tool for developing web apps, I have been strugling with zope for past few months and still could not get anything useful work up and going. I really felt that "Z" shaped learning curve. Yesterday I was looking at quixote. I was surprized how simple it is. I think quiote gives the power without getting into the way. And in just a few hours I had quite a good understanding of framework and actually got something up and working (http://www.quixote.ca/learn/1). I feel quixote is the simplest way to develop powerful web apps. I needed a simple and powerfull web framework to develop web apps that are NOT content oriented and where mostly GUI clients have ruled. And I think quixote is just the tool for me. I also came across nevow. Its is also good, rather very good. Especially Live Page is really cool idea. It really help separate logic and presentation and is simpler than MVC thing that I could never get a nack of. Now I have three questions: Q1) Is it possibe to use "Nevow + LivePage + Quixote" together in a web app. Live Page is really important for me as I am not into content oriented web apps. Q2) Is is nessary that LivePage only with Twisted or can work with any web server like Apache. Q3) I cannot understand how to get quixote up and working under Apache using mod_python, FastCGI, SCGI (I have used only mod_php). A link to a tutorial will be good. I saw a paper A. M. Kuchling (http://www.amk.ca/talks/quixote/) that said that nevow can be used with quixote but it did not mention anything of LivePage. Please provide comments, Pros and Cons of the aproach. Links to relevent articles and tutorials are really appreciated Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list