Re: [BangPypers] [commercial] python/django training
On Sun, May 15, 2011 at 1:13 PM, kaushik kalyanaraman dialkforkaus...@gmail.com wrote: On Sun, May 15, 2011 at 11:31 AM, Santosh Rajan santra...@gmail.com wrote: I have been reading this thread with interest, and I think this whole thread is degenerating into a level of immaturity. snip This is not about PAID or FREE. If you can train someone, for FREE for 3 months, FULL TIME, to become a productive software engineer, that would be FANTASTIC. I have never posted to this list before although I have been around almost since its inception. I have had to make an exception to agree with the above. Some of the posts in this thread suggest either trolling or, pardon me, ignorant noobs. IMHO, and with the caveat that I am not a software engineer, I _believe_ that anything that is _gratis_ is not quite likely to work well and will generally be of questionable quality; however, if it is not, it shall almost certainly be an exception. I have no idea who Kenneth is other than through his posts that I have read in close to a dozen communities for nearly half a decade (some of which I am no longer part of). Also, unfortunately, I have no knowledge of Django and/or how it is used in software industry. However, given my impression, if he is offering such a course, and if I had a choice, I would rather shell out the 25 K. Again I am not well informed but if as Kenneth claims (and not in jest) that a month's (gross/net ?) pay is likely to be higher than the cost of his offering, then it becomes even more prudent to go with him rather than someone offering a freebie but is otherwise rather unversed. This is the best response in this whole thread. Indians often wonder why Indians can't build product companies. That is not going to happen till people are ready to pay for a product (which this training is) if it brings value to them. I would rather pay 25K to work with a person who has been an active programmer and has managed teams of programmers than to a training institute where the trainers are senior students who hardly have any real life experience. Information is getting cheaper everyday, relevant knowledge dearer, as it should. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Django + NoSQL
All popular NoSQL solutions (Couch, MongoDB, Riak ..) have Python bindings. Core django modules still assume a relational backend. Why the insistence on django ? Putting on the Django glasses everytime is not a healthy development. +PG On Wed, Apr 20, 2011 at 7:50 AM, Anush Shetty anushshe...@gmail.com wrote: Hi All, What is the most preferred NoSQL engine with Django here. Would like to hear out some experiences. - anush ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Django + NoSQL
This SqlAlchmeny must be a new library then. Is it anything like the SQLAlchemy library that talks only to relational databases? On Wed, Apr 20, 2011 at 12:58 PM, vijay vnbang2...@yahoo.com wrote: I have used Django with SqlAlchmeny. --- On Wed, 20/4/11, Anush Shetty anushshe...@gmail.com wrote: From: Anush Shetty anushshe...@gmail.com Subject: [BangPypers] Django + NoSQL To: bangpypers@python.org Date: Wednesday, 20 April, 2011, 5:20 PM Hi All, What is the most preferred NoSQL engine with Django here. Would like to hear out some experiences. - anush ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] How to handle files efficiently in python
On Tue, Mar 22, 2011 at 12:49 PM, Noufal Ibrahim nou...@gmail.com wrote: On Tue, Mar 22 2011, briji...@gmail.com wrote: Hi All, How can I print last five lines of a file using python. The file may contain thousands of lines each line may differ in length. [...] You'd have to use some kind of heuristic (a.k.a. dirty hack). Stat the file to find it's size and use an average length of line to go a few lines back. Then count the number of newlines from there to the end. If it's 4, then you have your 5 lines. Otherwise, seek back a little more and repeat. Negative file.seek does not work on Text files [1] [1] http://mail.python.org/pipermail/python-bugs-list/2008-August/057225.html ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] How to handle files efficiently in python
If you are on Linux/Unix, use the tail command $ tail -n 5 somefile.txt On Tue, Mar 22, 2011 at 11:09 AM, briji...@gmail.com briji...@gmail.com wrote: Hi All, How can I print last five lines of a file using python. The file may contain thousands of lines each line may differ in length. * Regrads, Brijith P * * * ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Suggestion for GUI
On Sun, Jan 9, 2011 at 6:22 PM, Narendra Sisodiya naren...@narendrasisodiya.com wrote: On Mon, Jan 10, 2011 at 3:54 AM, Vivek Khurana hiddenharm...@gmail.comwrote: On Mon, Jan 10, 2011 at 3:44 AM, Narendra Sisodiya naren...@narendrasisodiya.com wrote: At the same time, I do not want to use any restricted Libraries.. Can somebody explain license of PyQT ? http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#licenseAll I want my code to be GPLv3. If you want the code to be in GPL, then where is the problem/confusion ? Ok, So why that commercial license they have listed, for what purpose one should need that license..? I mean, I can code using PyQT and give to my customer and he can install all the needed libraries.. 1. Some companies don't want anything associated with with Free software, they would rather pay money to keep their entire software stack clean. 2. Allows Riverbank to make money from users who want to ship closed source software developed using PyQt. Actually, if you are keen on keeping the source code closed, you may want to look at PySide(http://www.pyside.org/) which is a Python binding to Qt from Nokia, the owners of QT, the company and brand. Pyside is LGPL[1] and also PySide is designed to be a drop-in replacement for PyQt. +PG [1] http://www.pyside.org/about/ ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Suggestion for GUI
On Sun, Jan 9, 2011 at 11:39 PM, Narendra Sisodiya naren...@narendrasisodiya.com wrote: On Mon, Jan 10, 2011 at 7:55 AM, Pradeep Gowda prad...@btbytes.com wrote: On Sun, Jan 9, 2011 at 6:22 PM, Narendra Sisodiya naren...@narendrasisodiya.com wrote: On Mon, Jan 10, 2011 at 3:54 AM, Vivek Khurana hiddenharm...@gmail.com wrote: On Mon, Jan 10, 2011 at 3:44 AM, Narendra Sisodiya naren...@narendrasisodiya.com wrote: At the same time, I do not want to use any restricted Libraries.. Can somebody explain license of PyQT ? http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#licenseAll I want my code to be GPLv3. If you want the code to be in GPL, then where is the problem/confusion ? Ok, So why that commercial license they have listed, for what purpose one should need that license..? I mean, I can code using PyQT and give to my customer and he can install all the needed libraries.. 1. Some companies don't want anything associated with with Free software, they would rather pay money to keep their entire software stack clean. 2. Allows Riverbank to make money from users who want to ship closed source software developed using PyQt. That's exactly I want to understand. Let take a fictitious example I purchased a book on PyQt. I wrote an excellent close software which is based on PyQt. I am start selling this proprietary software in market. people started purchasing this software from my website. They download PyQT. and they run my close software. Now in this process, neither I no my customer paid any money to PyQT. So this is OK or me or my customer are making copyright infringement. I want to understand the benefit/advantage of buying commercial license for PyQT. If I understand the GPL correctly, the situation you are describing is in violation of the GPL terms because your code depends on PyQt code to run. Compare this to the Library/Lesser GPL, where the license explicitly allows you to link against LGPL'd libraries without having to provide the code of your applications. I believe it is only fair (and legally required) to pay a licensing fee to riverbank if you are selling the software without disclosing source. After all even they have to make money for investing their time and expertise that provides value to you and the customer. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Suggestion for GUI
On Mon, Jan 10, 2011 at 12:26 AM, Narendra Sisodiya naren...@narendrasisodiya.com wrote: On Mon, Jan 10, 2011 at 10:38 AM, Pradeep Gowda prad...@btbytes.com wrote: On Sun, Jan 9, 2011 at 11:39 PM, Narendra Sisodiya naren...@narendrasisodiya.com wrote: On Mon, Jan 10, 2011 at 7:55 AM, Pradeep Gowda prad...@btbytes.com wrote: On Sun, Jan 9, 2011 at 6:22 PM, Narendra Sisodiya naren...@narendrasisodiya.com wrote: On Mon, Jan 10, 2011 at 3:54 AM, Vivek Khurana hiddenharm...@gmail.com wrote: On Mon, Jan 10, 2011 at 3:44 AM, Narendra Sisodiya naren...@narendrasisodiya.com wrote: At the same time, I do not want to use any restricted Libraries.. Can somebody explain license of PyQT ? http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#licenseAll I want my code to be GPLv3. If you want the code to be in GPL, then where is the problem/confusion ? Ok, So why that commercial license they have listed, for what purpose one should need that license..? I mean, I can code using PyQT and give to my customer and he can install all the needed libraries.. 1. Some companies don't want anything associated with with Free software, they would rather pay money to keep their entire software stack clean. 2. Allows Riverbank to make money from users who want to ship closed source software developed using PyQt. That's exactly I want to understand. Let take a fictitious example I purchased a book on PyQt. I wrote an excellent close software which is based on PyQt. I am start selling this proprietary software in market. people started purchasing this software from my website. They download PyQT. and they run my close software. Now in this process, neither I no my customer paid any money to PyQT. So this is OK or me or my customer are making copyright infringement. I want to understand the benefit/advantage of buying commercial license for PyQT. If I understand the GPL correctly, the situation you are describing is in violation of the GPL terms because your code depends on PyQt code to run. I am just typing some random string , it comes out to be a PyQT code. some fellows are interested to buy it, I never tested using PyQT nor i am giving them suggestion to install PyQT. Client are doing by their own. How come I am making any violation Ah, yes. The I was just carrying an open knife and pointing in random directions, but people keep giving me money. What did I do wrong? argument. If you are serious doing professional software development, it's worth your time to understand how copyright and licensing works. Good luck. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Distributing a python project as a binary.
On Sat, Jan 8, 2011 at 10:41 AM, kunal kunal...@gmail.com wrote: Hi all, I am just curious , and do not intend to start any flame wars. If a company wants to use python in a commercial project and does not want the source code to go public (i.e closed source ). How would one go about packaging the python project. Also as i see it, java too generates byte codes like python which is then interpreted by the JVM . Still i see a lot of projects using java and distribute them as jar files. Is there something similar in the python world like a jar file ? Or you could write the secret sauce part of the application in something like Cython and compile it into a SharedObject/DLL and use it as a library from your python code. This has the dual advantage of obfuscating your python code as binary and getting performance boost of a compiled language. Or if you are a java shop you can write Jython code and generate .jar/.war files too. Of course, if Java is indeed your poison, there are almost-as-sweet-as-python languages to make the pain go away - like Scala, while being almost as performant as Java on the JVM. IMO, If the company is paranoid about protecting IP, avoid using scripting languages. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] What kind of applications can we develop with Python
On Wed, Dec 1, 2010 at 6:52 AM, sreedhar ambati ambatisreed...@gmail.com wrote: Hi I am new to Python. I am from PHP,Microsoft .net background. Can you tell me the real power behind Python language? What kind of applications we can develop? Please quote some real time projects where industries are using Python Actually, an even more interesting question should be what you cannot do with python. Python is a general purpose language which can do everything from desktop apps, web apps, scientific and statical apps, automation, shell scripting, data analysis, and even assembly level programming [1] Python runs on everything from a 8 bit processor[2] to a supercomputer. You might have heard about this site called Youtube.com where apparently you can watch cats playing piano. It is written in Python. [1] corepy.com [2] I'm currently have one on my desk. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Access xml file form python script
On Sun, Oct 31, 2010 at 7:42 AM, Avinash TM avinas...@gmail.com wrote: Hi All, I have created a simple xml document i.e., preferences.xml as follows ?xml version=1.0? object object name=category value=cricket property name=titleCricket/property property name=subscribers element name=avinash/ element name=prashant/ /property /object /object This looks like xml generated by a Microsoft product, and not by/for a human.. How is this better than: options category name=cricket title=Cricket subscribers subscriber name=Avinash / subsriber name=Prashanth / /subscribers /category /options Why create child nodes when attributes are sufficient? +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Simplest way to do web programming in python.
On Thu, Oct 28, 2010 at 9:31 AM, Noufal Ibrahim nou...@gmail.com wrote: On Wed, Oct 27 2010, ishan chhabra wrote: Hi all, I have a set of scripts in python that visualize a search result (produce an image) given a query. I will be building a flash based interface (to surf this visualized search space) to serve this over the web. I needed the most basic web framework (no mvc and all cause i think it's an overkill) that would help write a simple webapp that would interact with the flash frontend. I don't need any persistance of data. The results are computed in realtime. Please point me in some direction. Thanks. If it's lightweight and something you just want to get out of your hair, I'd use CGI. I'd strongly recommend against CGI. There is no practical reasons to do CGI programming in 2010. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Simplest way to do web programming in python.
On Tue, Oct 26, 2010 at 2:54 PM, ishan chhabra ishan.chha...@gmail.com wrote: Hi all, I have a set of scripts in python that visualize a search result (produce an image) given a query. I will be building a flash based interface (to surf this visualized search space) to serve this over the web. I needed the most basic web framework (no mvc and all cause i think it's an overkill) that would help write a simple webapp that would interact with the flash frontend. I don't need any persistance of data. The results are computed in realtime. Please point me in some direction. Web Framework: Flask http://flask.pocoo.org/ Flash Integration: PyAMF http://pyamf.org/ +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] diffrerence between lambda function and ordinary one
On Fri, Aug 6, 2010 at 10:20 AM, Rahul R rahul8...@gmail.com wrote: i was writing some basic code . for understanding lambda functions , but couldnt understand the difference between a lambda function and an ordinary function. for example def f (x): return x**2 ... print f(8) 64 g = lambda x: x**2 print g(8) 64 wats a need for using lambda functions ..? You mean what's the need for using lambda functions? Lambda functions are anonymous functions, ie., functions without a name. Along with map, reduce, filter, lambda functions provide functional programming[1] constructs to python. You can write code like this: from operator import add print reduce(add, filter(lambda x: x%2==0, xrange(10))) to print the sum of even numbers less than 10 instead of: tot = 0 for i in xrange(10): if i%2 == 0: tot += i print tot ... Anyway, One does not need to use lambda function. Almost in all the places where you use lambda functions, you can replace it with a named function with added benefit of clarity. Python lambdas are limited to a single statement, which makes them particularly hobbled. Guido is not very fond of FP constructs, in fact he wanted to remove them from python 3. After much discussion, lambda survived in Py3. [1] http://en.wikipedia.org/wiki/Functional_programming ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Regarding web framework in Python
On Thu, Jun 3, 2010 at 3:57 AM, Gora Mohanty g...@srijan.in wrote: On Thu, 3 Jun 2010 13:15:12 +0530 Jins Thomas jinstho...@gmail.com wrote: [...] Current requirement is like we are planning to build such an application which should have 1. (Web) client gui which can connect to a database, run some perl scripts at the back end, gives back the results in the gui (results can be some tabular inputs, paragraphs, charts, schematic diagrams etc.) I would definitely recommend Django over something like web.py. Django is quite easy to get into in terms of basics, and you can explore further features as needed. With web.py, I would suspect that you would eventually end up writing your own framework. If you want to run Perl scripts, you could consider looking at Catalyst, a Perl web framework (never used it myself, but have heard many good things about it). 2. It should have some drag and drop facility and connect the objects to configure some rule sets, saveas options etc. Drag and drop should probably be a front-end task, say jQuery driven. Others can be done. Basically there are some quite a bit debates happening whether it should be a web gui, or a thick client (which connects to the database). Would some body please advice when free on 1. Whether web.py itself is the good option for building this kind of framework. 2 . How easy would it be to build such an application in python (Currently i should rate my python skills to be almost beginner level) 3. I was looking for some frameworks like vaadin in a python, does anybody knows about such a framework. Not sure what vaadin is, but as mentioned above, I would go with Django. 4. For all this frameworks, we need apache like webserver right. I found web.py's independent sample webserver, Is it advisable to use such a webserver to avoid other third party installations. You can run Django through Apache, or other web servers. 5. What's your opinion on Web client vs Thick client for such an application. If it's thick client, architects here are forcing to use TCL/Tk to build. But my feel is it's lacking look and feel. [...] Ack! Tcl/Tk in this day and age? Django is a framework, web.py is a library. The OP is a beginner and he is not sure what exactly his final solution will look like. So, it is better to start with a library and add features as you go. With django, you get a bunch of design decisions made for you, which may or may not suite your requirements. Django is not a panacea for every web development project. Vaadin is a RIA framework much like GWT. Google would have told you that. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Regarding web framework in Python
On Thu, Jun 3, 2010 at 3:45 AM, Jins Thomas jinstho...@gmail.com wrote: On Sat, Jan 30, 2010 at 12:32 AM, Pradeep Gowda prad...@btbytes.com wrote: On Fri, Jan 29, 2010 at 3:47 AM, Jins Thomas jinstho...@gmail.com wrote: Hi All, Would like to ask one suggestion from bangpypers. I have a oracle database in Unix and need to create a web based GUI to execute some queries/scripts (via buttons) and save that in csv either in Unix or in windows. I was thinking of using Django framework. Btw i'm relatively new in python. Woud anybody please suggest whether Django is a good candidate for this. I succesfully installed Django and worked with some sample codes. Is there any similar framework which is more reccomondable than Django. Atleast this time i want to get this done with python. Many times i wanted to do things in python for some reason or other reason i was forced to use some other technology. I have some doubts like 1. Django sample webserver cannot be used when it's mission critical? Will this django framework supports apache or tomcat servers. 2. Certain query results i would like to display in graphs. I had mailed before asking suggestion for creating charts/bar/pie graphs with python and got a good number of suggestions like pychart, pygoogle chart open flash etc. I was just thinking how difficult is to integrate these stuffs in Django framework. Also couldn't actually finalize a good framework to use for creating this graphs. I'm absolutely in confusion which'll be better to use. Would anybody suggest what's the usual thought process in taking decisions like this. Django is an overkill for something like this. web.py is what you should be looking at. If you already are programming in python, web.py will give you the web library without trying to introduce new concepts on URL dispatch, ORM etc., Web.py has a very decent db api for most common db operations You can fall back to raw SQL with ease. Hi all, I asked some doubts on this topic around 6 months back. Later that project itself got delayed. Now it's again back. I should apologize that mean time i had planned to ramp myself in python, but didnt work out. One reason of escapism: work load !! Current requirement is like we are planning to build such an application which should have 1. (Web) client gui which can connect to a database, run some perl scripts at the back end, gives back the results in the gui (results can be some tabular inputs, paragraphs, charts, schematic diagrams etc.) 2. It should have some drag and drop facility and connect the objects to configure some rule sets, saveas options etc. Basically there are some quite a bit debates happening whether it should be a web gui, or a thick client (which connects to the database). Would some body please advice when free on 1. Whether web.py itself is the good option for building this kind of framework. 2 . How easy would it be to build such an application in python (Currently i should rate my python skills to be almost beginner level) 3. I was looking for some frameworks like vaadin in a python, does anybody knows about such a framework. 4. For all this frameworks, we need apache like webserver right. I found web.py's independent sample webserver, Is it advisable to use such a webserver to avoid other third party installations. 5. What's your opinion on Web client vs Thick client for such an application. If it's thick client, architects here are forcing to use TCL/Tk to build. But my feel is it's lacking look and feel. Many thanks for the patience to read this. Looks like you and many in your team desire a desktop like behaviour.. So, as Noufal suggested it is better to create web services which query the backend(perl scripts, database etc.,) and provide data to clients in json/xml format. It is easier to code drag and drop like behaviour in a desktop widget than in a web app, especially if you are not a javascript/ajax expert already. It appears you may be building an app for in house use, may be even something to do with sys administration and reporting. In which case, the look and feel of tcl/tk, which has improved by leaps and bounds in 8.5, should not be a huge concern. However, If you want to have near-native UI look and feel and also have a modern widget toolkit, take a look at PyQt or wxPython. To answer your other questions in particular order, * web.py can be run with apache using mod_wsgi and mod_python and of course mod_proxy. * The equivalent of vaadin would be Pyjamas, which is a port of GWT to python. When you are a beginner, it is easy to succumb to advice by experts on the internet. So, let your own experiments guide what suits you best. Remember, Simple is better than complex; esp when you are a beginner ;) happy hacking, +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org
Re: [BangPypers] python for management studies
On Thu, Jun 3, 2010 at 1:34 PM, Pradeep Gowda prad...@btbytes.com wrote: On Thu, Jun 3, 2010 at 1:19 PM, Kenneth Gonsalves law...@au-kbc.org wrote: hi, I have been commissioned to create and implement a course (compulsory with 2 credits for first semester) on computer programming for business managers for MBA's in a new B school that is starting up. I envisage something like the nltk tutorial. Ideas and suggestions please. I will, of course, develop the course in a mercurial repo, but that is the future. The idea is that this should become a standard cp-101 for business schools. Very interesting development kenneth. Is this the NLTK tutorial you are talking about: http://nltk.googlecode.com/svn/trunk/doc/book/ch01.html Putting up the course in a hg repo is a good idea. Consider using something like Sphinx (reStructuredText + publishing friendly tweaks) for writing the text. Using Sphinx will make it very easy to publish the online version as PDF for offline reading/textbook publishing with no additional effort. Eg: http://flask.pocoo.org/docs/ and published book from the same source: http://flask.pocoo.org/docs/flask-docs.pdf The link to the aforementioned Sphinx website: http://sphinx.pocoo.org/ ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] time in seconds and milliseconds
On Mon, May 31, 2010 at 8:33 PM, murugadoss murugadoss2...@gmail.com wrote: how to represent the time in seconds and milliseconds ?A function similar to gettimeofday() in c. gettimeofday(tv, NULL) http://docs.python.org/library/time.html Which functions have you YOU tried so far? Your attempts at getting other people give you the answers is not gaining you any friends on this list. Let's see some effort from your side. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Getting process handle and thread handles from DEOS
On Mar 25, 2010, at 2:28, Goudar, Girish girish.gou...@goodrich.com wrote: Is there ant command from the Python script to get these information from the DEOS? What is DEOS? ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Simple python database library
On Wed, Mar 3, 2010 at 9:38 PM, Noufal Ibrahim nou...@gmail.com wrote: You could use the sql builder component of sql alchemy and skip the orm part. The web.db part of web.py might work as well. +1 for web.py Having used web.py for data munging tasks, I think that web.db is a step up from writing raw sql without going the whole hog towards ORMs. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Trouble installing psycopg2 in Snow Leopard
On Tue, Feb 9, 2010 at 11:07 AM, Diptanu Choudhury admin.nitj...@gmail.com wrote: 2): Symbol not found: _PQbackendPID Looks like a 32/64 bit related mixup. See:http://stubblog.wordpress.com/2009/06/07/installing-psycopg2-on-osx/ Report back if you had any success. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Python syntax highligting in Latex beamer
On Fri, Jan 29, 2010 at 10:49 AM, JAGANADH G jagana...@gmail.com wrote: Dear All Can somebody give me a clear example how to highlight Python code in latex beamer. I used listings but no result . I do not have the direct answer, but.. Documentation generated by Sphinx/restrcuturedText has python highlighting. So, it might be instructive to study the .tex generated by Sphinx. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Regarding web framework in Python
On Fri, Jan 29, 2010 at 3:47 AM, Jins Thomas jinstho...@gmail.com wrote: Hi All, Would like to ask one suggestion from bangpypers. I have a oracle database in Unix and need to create a web based GUI to execute some queries/scripts (via buttons) and save that in csv either in Unix or in windows. I was thinking of using Django framework. Btw i'm relatively new in python. Woud anybody please suggest whether Django is a good candidate for this. I succesfully installed Django and worked with some sample codes. Is there any similar framework which is more reccomondable than Django. Atleast this time i want to get this done with python. Many times i wanted to do things in python for some reason or other reason i was forced to use some other technology. I have some doubts like 1. Django sample webserver cannot be used when it's mission critical? Will this django framework supports apache or tomcat servers. 2. Certain query results i would like to display in graphs. I had mailed before asking suggestion for creating charts/bar/pie graphs with python and got a good number of suggestions like pychart, pygoogle chart open flash etc. I was just thinking how difficult is to integrate these stuffs in Django framework. Also couldn't actually finalize a good framework to use for creating this graphs. I'm absolutely in confusion which'll be better to use. Would anybody suggest what's the usual thought process in taking decisions like this. Django is an overkill for something like this. web.py is what you should be looking at. If you already are programming in python, web.py will give you the web library without trying to introduce new concepts on URL dispatch, ORM etc., Web.py has a very decent db api for most common db operations You can fall back to raw SQL with ease. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Python/Django issue
On Mon, Jan 25, 2010 at 9:51 AM, Noufal Ibrahim nou...@gmail.com wrote: On Mon, Jan 25, 2010 at 7:29 PM, Praveen Kumar praveen.python.pl...@gmail.com wrote: [..] However at least IE4.5 for the Mac, will only allow you to send and retrieve information to the server that contains the flash file. For this reason it is recommended that you place you flash file and HTML file on the same server. [..] Or use the crossdomain.xml file to specify from wher the flash applet can get/send data http://kb2.adobe.com/cps/142/tn_14213.html Assuming the answer is Flash cross domain policies: There is a Django product to make this easy. I use this: http://pypi.python.org/pypi/django-flashpolicies/ ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Execute Windows shutdown command through python !
On Tue, Dec 29, 2009 at 9:22 AM, ™aßlเίlαslเ ► abhilash.p...@gmail.com wrote: *import os os.system(shutdown /?)* *its saying shutdown is not an internal or external command or executable batch file* Is shutdown a valid command in the new OS? Atleast it looks like that from the error message. Try running `shutdown` from the command line and see whether you get the same error. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Is it possible to run python software in WinxP?
On Tue, Dec 22, 2009 at 11:00 PM, 74yrs old withblessi...@gmail.com wrote: for download at website viz http://code.google.com/p/tesseractindic/. ( On request, the said program - shall forward the same to you) You need GTK2+ libraries and PyGTK The first one is available at: http://gtk-win.sourceforge.net/home/index.php/en/Downloads direct link: ( http://downloads.sourceforge.net/gtk-win/gtk2-runtime-2.16.6-2009-12-01-ash.exe?download ) and the second one at: http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.14/ Install the GTK2+ using the given exe installer. The PyGTK tar.gz has to be untarred (unzipped) and inside you will find a setup.py file Run python.exe setup.py install From the windows command line (Start-Run-cmd) after this you will be able to install tesseractindic package and run the app. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] can not connect to Mobile Broadband
On Tue, Dec 22, 2009 at 11:55 PM, BR!j!TH briji...@gmail.com wrote: Does any one have any solution this problem ? Have you tried configuring it using the Network Manager app? You are on the wrong mailing list. And even if someone does attempt to answer, your question does not carry sufficient information to help understand the problem. Try again and on a Linux user group this time. Also, Linux User Group is that way -- ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] mobile application development
On Wed, Dec 16, 2009 at 8:39 AM, pradeep T itpradeep...@gmail.com wrote: hi friends, am a begginer of this language and dont know much. Is it possible for me to develop a mobile application using this language... The phrase mobile application encompasses so many different approaches. Even a web app written in Javascript is a mobile application in many smart phones (iPhone, Android). Being a begginer is not a problem. Being vague and clueless about what you want to know will elicit nothing more LMGTFY.com Think twice before you bang out an email and decide to waste the time of 100s of people who will read your email. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] mobile application development
On Wed, Dec 16, 2009 at 11:34 AM, Baiju M mba...@zeomega.com wrote: On Wed, Dec 16, 2009 at 7:09 PM, pradeep T itpradeep...@gmail.com wrote: hi friends, am a begginer of this language and dont know much. Is it possible for me to develop a mobile application using this language... http://opensource.nokia.com/projects/pythonfors60/ http://pymaemo.garage.maemo.org/ http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI P.S: Please do some Google search before asking. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] mobile application development
On Wed, Dec 16, 2009 at 1:55 PM, Mandar Gokhale stallo...@gmail.com wrote: *tl;dr* : If some people have vague responses, it could be because they are vaguely interested in the subject. Is that sufficient grounds to shoot them down? Yes. This is not 199x and information is freely and widely available to everybody, thanks to google. *does program phones using PyS60* That would have been an interesting question. But the OP did not ask that question. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Python place holder doubt
On Thu, Nov 12, 2009 at 3:04 AM, Aravind Muthu aravind.g...@gmail.com wrote: Try this ..i dont know exactlly correct or not. url=self.BASEURL final=+ pmid=%d + tag=ntagtype=ge %d urlparse.urljoin(url,final) There are two errors in the second line 1. what is =+ ? 2. and what is the purpose of %d at the end of the line? PS: If you are not sure about the solution working you are not obligated to reply to the mail. (it takes less than 30 seconds to verify your solution in a python console, which I did), ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Google Go
On Wed, Nov 11, 2009 at 6:18 AM, steve st...@lonetwin.net wrote: On 11/11/2009 04:17 PM, Ramdas S wrote: But I don't see the Python connection at all here. Yeah! I jumped the line without reading. Actually going through now and downloading the stuff I cant see much from Python perspective, that bloody language is full of braces, but yes syntactically its more sugary and clean seriously ?? no, really, are you serious ? you got more sugary from Titlecase.Method.Names ? (Printf now requires a damn shift key !! what was ken thompson thinking ??). Case defines scope. Capitalised variables/methods (eg:Telephone) are public. ones starting in lower case (eg:telephone) are private. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Google Go
That's what the big boys of the world wants you to believe. I had met a very senior official in the government a techy himself and spent 3 hours showing him virtues of Python and Django, hoping that they will change the RFP terms. I found out yesterday that the application has to be developed on a proven technology like Java,C++ or C#. When I spoke to the gentleman he said his consultant said that dynamically typed languages are not safe for mission critical work. The work is far from being mission-critical is another point altogether. That's because big boys define the market suitable to themselves. 1. it's easier to code more, take more time when using proven technology 2. It's easy to hire an IDE-aware monkey to do programming in proven technology. Anyway, one answer to proven technology bugaboo is Jython and IronPython. It's still Java(platform) and .NET with bi-directional compatibility. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Google Go
On Wed, Nov 11, 2009 at 7:55 AM, Anand Balachandran Pillai abpil...@gmail.com wrote: On Wed, Nov 11, 2009 at 6:06 PM, Roshan Mathews rmath...@gmail.com wrote: On Wed, Nov 11, 2009 at 5:22 PM, Anand Balachandran Pillai abpil...@gmail.com wrote: Upon 2nd reading, I also thought they did, but not a very good disambiguation there I daresay. But security benefits associated to a compiled language - I fall flat there since I don't see any correlation with a language being compiled and its security! Pretty shoddy marketing this... The Go people said this? Where are you quoting from? Not sure if go people said this. But it is in the techcrunch link posted by Sriram, in another thread, 1st paragraph. http://www.techcrunch.com/2009/11/10/google-go-language/ I didn't make it up :-) Straight from the horse's mouth: http://golang.org/doc/go_lang_faq.html#creating_a_new_language ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] But IDEs rock! (was Google Go)
On Wed, Nov 11, 2009 at 9:36 AM, Darkseid lorddae...@gmail.com wrote: 2. It's easy to hire an IDE-aware monkey to do programming in proven technology I do most of my work in Ruby (and have done for a few years now). Every day I bemoan the lack of a powerful refactoring IDE like Java has in IntelliJ. A good IDE is a massive productivity booster; you can only get so far with a text editor*, no matter how many macros you have set up. Honestly. My riff was on the monkey part, not on the IDE part. A programmer who uses IDEs for refactoring etc., is a more evolved primate, IMO ;) The bogus argument about proven technologies often stems from the belief that having a point-and-click-and-get-a-banana is a proof of maturity or enterprise-readiness . Platforms which are heavily IDE centric (eg: MS technologies) tend to encourage their developers to think inside the box (IDE) all the time. Even though most Java programmers do use Eclipse/Netbeans/IntelliJ it is not unheard of them to use vim/emacs more often than you hear a .NET developer using them. IDEs have their advantages. But more often than not, they also hide complexity behind all the boiler-code and templates. If programmers had to write XML by hand instead of having them spit-out by the IDE, we would have seen saner uses of XML in Java land, for instance. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Python place holder doubt
On Wed, Nov 11, 2009 at 12:47 PM, JAGANADH G jagana...@gmail.com wrote: url = self.BASEURL + pmid=%d + tag=ntagtype=ge %d Did you mean: url = self.BASEURL + pmid=%d % (d, ) + tag=ntagtype=ge ? Even though this might fix your problem, don't use it. To encode URLs always use urlencode: http://docs.python.org/library/urllib.html which is part of the standard library. Using + to concat more than two strings is definitely unpythonic. Also: Do NOT cross post to multiple lists. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Unstructured data and python
On Fri, Oct 16, 2009 at 2:31 PM, Carl Trachte ctrac...@gmail.com wrote: On 10/16/09, Ramdas S ram...@gmail.com wrote: Has anyone worked/seen any project which involves migrating unstructured data, mostly text files to a reasonably indexed databas preferably written in Python or has Python APIs. I am even ok if its commercial project. FWIW, when I worked in a Microsoft SQL environment, I used DTS for SQL 7 or 2000 with the win32com modules and SSIS for with IronPython for later versions. It was usually a standard process of glueing together a bunch of data in a csv file with Python, then automating the DTS or SSIS program to dump the data to a database table or series of tables. You could probably do something similar with MySQL or Postgres. The hard part was always writing the Python to do the situation-specific initial crunch of the data. I believe what you are looking for is a an ETL (extraction, tranformation and loading) application. It can be as simple as couple of python scripts, especially if it is a one-off job. You can use web.py's sql module or sqlalchemy(more work..) to generate sql statements, if you don't like writing sql statements yourself. If the data loading/cleaning/transformation has to be on a regular basis, you may want to investigate something like http://www.pentaho.com/products/data_integration/. I have had fairly decent success with using Pentaho Chef suite (link above) in doing ETL for telco OLTP data with postgresql as the destination DB. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] line understanding problem
On Thu, Oct 8, 2009 at 11:22 PM, harshal jadhav jadhav.hars...@gmail.com wrote: though i get the output but i also get the following statement gr_block sig_source_f (1) i donot understand what this line means. My aim is to capture the samples of src0. for that purpose i have given print src0 command. try this line instead: print dir(src0) this will give you the list of properties and methods available on that object. You might be able to identify the property/method that will give you access to the samples. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] [ANN][X-Post] SciPy India conference in Dec. 2009
On Wed, Oct 7, 2009 at 3:32 PM, Anand Chitipothu anandol...@gmail.com wrote: [..] If there are good CMS softwares in Python then why nobody in this group hasn't named a single one other than Plone? [..] There is Skeletonz http://orangoo.com/skeletonz/ Which is pretty user friendly from the demos I see. Some of the sites built using are : http://aspuru.unix.fas.harvard.edu/About/ and http://birc.au.dk/ which are pretty good looking sites and they are also similar to the demography of the site maintainers of FOSEE. Skeletonz's developer is amix.dk who is a well known python dev (Plurk project etc.,) And of course there is Zine whose administrative interface is closely modeled after wordpress to help people transition over from WP. Our own Jace uses it to power his blog - http://jace.zaiki.in The source for some of his improvements can be found here : http://bitbucket.org/jace Zine is also very easy to template because it uses JInja (a templating language inspired by Django's templating). MoinMoin is a good candidate too, if you know how to create new templates and hide the wiki artefacts like navigation elements. There are more, let me know what are the parameters you are using to choose your own ;) +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] [ANN][X-Post] SciPy India conference in Dec. 2009
On Wed, Oct 7, 2009 at 2:37 PM, Pradeep Gowda prad...@btbytes.com wrote: On Wed, Oct 7, 2009 at 3:32 PM, Anand Chitipothu anandol...@gmail.com wrote: [..] If there are good CMS softwares in Python then why nobody in this group hasn't named a single one other than Plone? [..] There is Skeletonz http://orangoo.com/skeletonz/ Which is pretty user friendly from the demos I see. Some of the sites built using are : http://aspuru.unix.fas.harvard.edu/About/ and http://birc.au.dk/ which are pretty good looking sites and they are also similar to the demography of the site maintainers of FOSEE. Skeletonz's developer is amix.dk who is a well known python dev (Plurk project etc.,) And of course there is Zine whose administrative interface is closely modeled after wordpress to help people transition over from WP. Our own Jace uses it to power his blog - http://jace.zaiki.in The source for some of his improvements can be found here : http://bitbucket.org/jace Zine is also very easy to template because it uses JInja (a templating language inspired by Django's templating). MoinMoin is a good candidate too, if you know how to create new templates and hide the wiki artefacts like navigation elements. There are more, let me know what are the parameters you are using to choose your own ;) I'm replying to my own post here.. But wanted to add: Zine's website is : http://zine.pocoo.org Zine is not *just* a blogging software. Zine can be configured to have a fixed home page and sections and of course a blog/news. The advantage of using Zine is, it is a WSGI aware server which can be wired together with other software including those built using django/pylons/zope etc., Zine is primarily developed by Armin Ronacher who has also brought to us Pygments (syntax highlighting), Sphinx (the official python documentation framework), so zine has some serious muscles behind it. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] SciPy India 2009 - SciPy.in
On Sun, Oct 4, 2009 at 2:03 AM, Kenneth Gonsalves law...@au-kbc.org wrote: On Sunday 04 Oct 2009 11:22:28 am Anand Balachandran Pillai wrote: 6 days... isn't it rather too long for a specific interest conference. weird: http://fossee.in/whydrupal Hadn't noticed it was written in Drupal. Well, they might have an excuse since they are focusing on Scipy rather than just Py! I am quite annoyed by the FUD about plone - granted plone is a pain to customise, but a QD CMS? All it needs is click click click - what on earth is this guy doing with buildout, restarting zope etc etc? Not that I would expect much from someone who is comfortable in drupal. SciPHP anyone? Plone has the easiest setup story of all the CMSes. You don't even need to have a database and a webserver for $deity's sake. Some how installing and configuring a database, and a webserver is easier than running an installer ! I think the key quote from the TFA is Since I had some experience with drupal, I suggested that we go with drupal, since I had some experience with its working. I worked for a couple of hours to set up a basic site on my local machine Yeah? really? what about downloading a windows installer or a mac installer for plone and doing a click-click-click as KG suggested and be done with it in minutes? The biggest joke of all has to be the fact that all the features that I see on their site, including events works out of the box on plone without installing a single external plugin. And plone's event features have lot more features than the half-assed calender i see on that site. PHP+MySQL is the BASIC of this age. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] SciPy India 2009 - SciPy.in
On Sun, Oct 4, 2009 at 3:12 AM, Sidharth Kuruvila sidharth.kuruv...@gmail.com wrote: Hey Hey, no need to dis Php, or Drupal for that matter, it's actually a mighty fine language for what it does. And they have been making it a lot better(namespaces, closures and, possibly just for Pradeep, goto). Pretty weak sauce, don't you think. How did you go from my response to Hey Hey, no need to dis Php, or Drupal for that matter? TFA is akin a person who has played baseball all his life being assigned with the task of starting a cricket team in his school. He comes over to a cricket practice session, swings the bat couple of times in the air, misses the ball and goes back to write an article saying how lame cricket is. [and vice versa]. Read gems like this: There was also the option of going with Django, which we discarded because most of our site would be static and we thought it would be too much work to do for a static site Well, if all you want is a static site, there are LOT more options. For instance, Jekyll http://jekyllrb.com/ which is familiar to all who have used github or webgen[2] or my own webgen.py[3] which Zed Shaw has used/modified to power his popular blog and lamsonproject website[4][5]. Where is the evidence for the TFA's author's honest attempt to use a python framework before dissing them and using Drupal? And what about Django CMS procedure was too cumbersome. Django CMS installation[1] is standard fare for anyone who has gone through the django 4-part tutorial. very simple and instinctive. Drupal provides an interface that is uncluttered and quite uncomplicated to navigate through. Also drupal has a whole suite of modules that provide scale the functionality of a website to great levels. -- at this point he could have as well be making tender love to Drupal. The more I read, the more I see evidence of trying to justify the use of Drupal more than doing an objective evaluation. He could have said Boss, I know Drupal best. I can do more with Drupal in the given time than any other CMS. But, since you asked me to evaluate python CMSes I'm going to cruise past them and call names so that you know that I tried. PHP is not the problem. The *users* of PHP tend to get wired in weird ways after using it exclusively like the basic/vb programmers of the yore. There is not enough evidence for us to believe that your typical PHP/Drupal developer is a connoisseur of CS concepts like closures. Owning a bat once used by Don Bradman does not guarantee that the team will beat Australia. +PG [1] http://www.django-cms.org/en/documentation/2.0/installation/ [2] http://webgen.rubyforge.org/ [3] http://github.com/btbytes/webgen.py/ [4] http://zedshaw.com [5] http://bazaar.launchpad.net/%7Ezedshaw/lamson/development/annotate/head%3A/doc/lamsonproject.org/webgen.py ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] SciPy India 2009 - SciPy.in
I have no issues with PHP. Heck, I wrote my first website[1] using PHP and a flat file (CSV) database when MySQL hosting was expensive :). Textpattern (a superb CMS written in PHP+MySQL) powers my wife's recipe website and she likes it as a user and I as a very dormant administrator. [1] http://web.archive.org/web/20030802085747/http://www.btbytes.com/ Happy hacking, +PG On Sun, Oct 4, 2009 at 10:25 AM, Sidharth Kuruvila sidharth.kuruv...@gmail.com wrote: A thousand apologies, the possibly just for Pradeep, goto, was a meant as a light joke not to be taken personally. Goto was the original issue with Basic. You hit the nail squarely on the head when you say The *users* of PHP tend to get wired in weird ways after using it. So do the users of python or any other language, in their own way. You can choose not to like Php, but there are a lot of good programmers who do use it productively. The fact is that you've obviously invested some amount of time working with various python frameworks, which make certain choices obvious to you. The author of the article obviously wasn't able to do that, Drupal seems like a sensible decision to have made. I'd agree the post is almost certainly not objective, but then most comparisons are that way, it's something we have to live with. Ps. I am talking from my own perspective, if I was asked to create a website backed by a database, I'd chose something based on Php simply because that's what I have some recent experience working with, so I spend less time wasted trying to learn the tools. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers -- Pradeep Gowda ENthEnergy LLC 9365 Counselors Row, Suite 120 Indianapolis IN 46240-6418 Phone: 317-428-1965 Fax: 317-846-3777 prad...@enthenergy.com ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Can we create proprietary database in Python
On Sat, Sep 26, 2009 at 3:15 PM, Arun Python arunpyt...@ymail.com wrote: I am a novice to Python. I have a few doubts. a) How useful is python in the development of database applications when compared to C++. b) Can we able to create proprietary or sequential database like in C++ in python for database applications which are not so huge. I would say Python is even more suited to develop database applications than C++. 0) Python dynamic typing, built-in datatypes and huge standard library will make application development far more easier than bit-twiddling with C/C++. 1) Python has excellent libraries for all mainstream (and not so mainstream) databases 2) in a DB-based app, the performance bottleneck is mostly due to the db network and not the run time speed of the language itself. sequential database -- can you give an example? If you mean Object Databases (viz., ZODB, Durus, DB4o) or key-value databases (viz., TokyoDB, Mongo, Couch), python has plenty of such native libraries/drivers. A specific problem you are trying to solve will yield better responses, IMO. Happy hacking, Pradeep ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] how to embed the python interpreter into web App
I am trying to embed the python interpreter in to a web page but could not get the way, any one can suggest me how to do this. http://werkzeug.pocoo.org/documentation/0.5.1/debug.html ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] which is better solution of the question
On Tue, Jun 16, 2009 at 10:42 AM, Pradeep Gowdaprad...@btbytes.com wrote: On Tue, Jun 16, 2009 at 9:52 AM, Abhishek Tiwaritiwariabhishe...@gmail.com wrote: I would like to know which method is better and why? Better for what purpose? 1. speed of execution? 2. elegance? The list comprehension solution is slightly more approachable (many are not familiar with the zip() function. I don't use zip on the first go, if at all.) The zip solution is succinct. Also, by the virtue of being a built-in function zip() should be faster than the second approach. I wrote a script to test this hypothesis : http://dpaste.com/55994/ The zip() version is 100 times faster on average than the other solution. # avg time taken for ans1 : 0.0035585308075 # avg time taken for ans2 : 0.306885209084 (averaged over 50 runs) +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Responding to people who lack the curiosity
On Fri, Jun 12, 2009 at 7:43 AM, vidv...@svaksha.com wrote: hmm kindly define real name[0], real identity with respect to the online world. If the owner of swtest...@gmail.com had used Manmohan Singh or Rita Rai instead of testing123 test, would you trust them more ? [0] i've been using a nick, for years and dont bother with the whois, the domain belongs to someone else :) While a name like Manmohan Singh Ph.D(oxford econ) may be treated with suspicion, I see no problem with a name like Rita Rai. I do not care for real names, as long as the nick you use is acts as smart you are in real life. The faq may be relevant for the developed nations which have much better infrastructure and resources than ours. IMPO, i find the faq rude, presumptuous and insensitive, especially when talking of a community (isnt that what linux, python, ruby, foo, foo-bar, is all about?) that wants to spread and exchange knowledge. The best thing about computers is there are no geographical boundaries. I cannot and will not wait till somebody gives my country a certificate saying you are now a developed nation. By your own argument, you should start talking with a developing nation slant to show solidarity. Obviously, you are not. What made you be better than that? A privileged education, smart friends, patient mentors, your own hard work and patience? My reply to the OP was in good faith, while assuming no incompetence on the part of the poster in question, while it was my first reaction to it too. I have interacted with enough young Indian developers (just out of college etc) to understand that for every `n` developers who write plz help there are a `k` who go on to become very good. While `kn`, I care enough to reduce the gap by sharing what I know. I'm exchanging knowledge by contributing my take on the issue, while also quoting well known references on what I say, which is how knowledge is transferred. You say your piece and back it up by the best references you can find. That is the accepted way of academia, industry and arts. You may not agree with the reference I quote, but that's your prerogative. You are free to do your own research on the topic and share your findings. By your own admission, you are trying to be borderline anonymous. I recommend you to read the 1st reference on using real names, if you haven't. May be you wouldn't have replied the way you have if you had to put your real name behind it. Cheers, +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Responding to people who lack the curiosity
On Fri, Jun 12, 2009 at 8:57 AM, Srijayanth Sridharsrijaya...@gmail.com wrote: Names are irrelevant on the internet, so I agree with both of you in a certain way. Well, there is one way to be relevant in programming circles, which is often condensed to -- show your code or GTFO. Ruby language recently lost a prodigal programmer. See _why's euology here [1] The programmer Guy Decoux was mostly known by his famous shell prompt pigeon% and `ts`, the prefix he used for his functions. His code was his communication. Of course, this is an ideal worth striving to :) Names do not matter, however identities still do. In the absence of an established identity, people will be weary about you. Your real name or an already established nick elsewhere is a good start. You say your piece and back it up by the best references you can find. That is the accepted way of academia, industry and arts. Good call. I thought so too about it on my way to work. I will stick to what I know. Art, not much :) [1] http://hackety.org/2008/09/25/legendNeverToBeSolved.html ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Responding to people who lack the curiosity
On Fri, Jun 12, 2009 at 9:36 AM, Pradeep Gowdaprad...@btbytes.com wrote: On Fri, Jun 12, 2009 at 8:57 AM, Srijayanth Sridharsrijaya...@gmail.com wrote: Names are irrelevant on the internet, so I agree with both of you in a certain way. Well, there is one way to be relevant in programming circles, which is often condensed to -- show your code or GTFO. Ruby language recently lost a prodigal programmer. See _why's euology here [1] The programmer Guy Decoux was mostly known by his famous shell prompt pigeon% and `ts`, the prefix he used for his functions. His code was his communication. Of course, this is an ideal worth striving to :) Names do not matter, however identities still do. In the absence of an established identity, people will be weary about you. Your real name or an already established nick elsewhere is a good start. You say your piece and back it up by the best references you can find. That is the accepted way of academia, industry and arts. Good call. I thought so too about it on my way to work. I will stick to what I know. Art, not much :) [1] http://hackety.org/2008/09/25/legendNeverToBeSolved.html Please read the first line as please read _why's euology of Guy Decoux [1] . The original sentence might parse differently than I thought initially. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Responding to people who lack the curiosity
On Fri, Jun 12, 2009 at 2:20 AM, Sridhar Ratnakumarsridhar.ra...@gmail.com wrote: Now do you think a person who is lazy to type a few characters in an Internet search engine (as evidenced by Is there any tutorial. Should we include any library?) would be interested at all in reading a 60,000 words document? One never knows :) I learnt about this doc while being a passive participant on linux-bangalore list years ago. While I had read some other works of ESR, the repeated references to this doc on LB prompted me to read it. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Responding to people who lack the curiosity
On Fri, Jun 12, 2009 at 8:38 PM, Kenneth Gonsalveslaw...@au-kbc.org wrote: On Friday 12 June 2009 14:30:57 Srijayanth Sridhar wrote: What are your experiences as a person from a small town? My question is more directed towards your 'programming culture' now vis-a-vis to your programming culture from your small town? I am both 'from' and mostly 'in' a small town. My experience is that one has to be totally self reliant and solely dependent on the internet. For example, I started programming python circa 2002, but the first time I met and discussed with a real live python developer was in late 2006. I _did_ see Pradeep G and swaroop in a conference in 2004, but was too scared to talk to them ;-) Till date I have _never_ asked anyone F2F about any problem in programming - there is no one available. The same goes for sysadmin and practically every other computer related task. Strangely enough, the same goes for golfers in small towns - I have yet to get even a tip from a coach. That is also why I prefer to recruit from small towns and non-elite colleges. The people are more self- reliant and not so cynical. Kenneth, I remember that LB 2004 moment. You were sitting in the first row and me Swaroop were sitting right behind you and gabbing away about some python stuff. You turned and started talking to us (something about plone /zope, I think). The scared feeling was mutual :D About asking people F2F about programming/linux, my own first experience bears repeating. This happened during the very first Bangalore-IT.com which had the Linux pavilion (1997/98?). I I had recently discovered linux and having a hard time getting SiS graphics card working on my PC. So, during one of the conf. days I boldly walked (after talking myself into it for couple of minutes) to this well known Linux person and asked him how do I get this SiS card working?. What my scared-but-practicing-to-be-bold self failed to notice is that he was talking to some one else already. He laughed and said, you should stop using that card then. Yeah, very cold-water-in-the-face moment there. I have survived. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Responding to people who lack the curiosity
On Fri, Jun 12, 2009 at 12:31 AM, Sridhar Ratnakumarsridhar.ra...@gmail.com wrote: On Thu, Jun 4, 2009 at 3:22 AM, Srijayanth Sridharsrijaya...@gmail.com wrote: I don't know the reasons either, but would like to know too. I often think the best way to handle such posters is to momentarily divert the topic of the conversation to their own interest-level, curiosity and self-learning . /snip.. I think it's best to ignore mails from users who do not care enough to use their real name/nick while asking questions. The user in question introduced himself as prasad, but we scan mail titles before reading mail content. Most people wouldn't care to read a mail from testing123 testswtest...@gmail.com, let alone answer it. Online forums are just like real life communities, where people judge you by what you say and how you say it. It's hard to relate to a anonymous, faceless name like testing 123. Use your real name. [1] If the same question is asked by some one who appears to be a real person, it might still be worth answering them, at the same time also pointing them to a net etiquette link [2]. In good faith, we can assume that the user in question is really new to using forums/mailing lists etc., Over time, most people do learn how to do their home work and in turn ask smart questions. I'll see whether our membership welcome messages can be improved to reflect this. Happy hacking, Pradeep [1] http://informationarchitects.jp/use-your-real-name-when-you-comment/ [2] http://catb.org/esr/faqs/smart-questions.html ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Zine for weblogging
Do you have a TODO List somewhere? (The bitbucket wiki maybe) so that interested parties can poke at the source code/contribute? +PG On Fri, Apr 24, 2009 at 1:52 AM, Roshan Mathews rmath...@gmail.com wrote: Nice writeup, thank you. Roshan On Fri, Apr 24, 2009 at 10:58 AM, Kiran Jonnalagadda j...@pobox.com wrote: While seeking a weblog app to replace my ageing Plone+Quills installation, I came across Zine, a Python-based WordPress clone. http://zine.pocoo.org/ ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] MIT moving from Scheme to Python
This course : http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-00Fall-2007/CourseHome/index.htm replaced this: http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-001Spring-2005/CourseHome/index.htm The assignments are terrific: http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-00Fall-2007/Assignments/index.htm Comments on Hacker news: http://news.ycombinator.com/item?id=530605 2009/3/25 Indrajith K indrajit...@gmail.com: http://blog.snowtide.com/2009/03/24/why-mit-now-uses-python-instead-of-scheme-for-its-undergraduate-cs-program ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Cloud Camp at IIM Bangalore on March 29
Sorry! I'm away from namma Bengaluru ATM :) That aside, I've been using EC2 recently to run long running computations and the cloud camp would be a great conf to attend. all the best. +PG On Fri, Mar 13, 2009 at 5:49 AM, Vinayak Hegde vinay...@gmail.com wrote: Would anyone be interested in Giving a talk on Google App-Engine ? Pradeep :) ? Are you in town ? Apologies if you have already received this. -- Announcing Cloudcamp Bangalore on March 29th 2009. More Details at http://bit.ly/WqbNB This is an unconference. There will be an invited talks track as this field is still nascent. We will have 3-4 startups presenting about how they used cloud computing to build their products. Proposed invited talks include : 1. An Introduction to Cloud Computing by Dave Nielsen. 2. Using AWS to build a search engine by Chirayu Patel 3. How to use Cloud Services to build a MMORPG by Arjun Gupte. You can send a talk proposal at vinayakh {at} gmail. {dot} com I will update the cloud camp wiki with it. -- Vinayak -- Blog @ http://thoughts.vinayakhegde.com Twitter @ http://twitter.com/vinayakh ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] IndentationError: expected an indented block
(resending reply to the list.. ) Python uses indentation for blocks your code has uneven indentation(1 space?) and no indentation in some places. You have to indent code correctly. Use FOUR spaces for indentation. eg: if len(args) == 0: print Fatal: no indication type provided. sys.exit(1) should read: if len(args) == 0: print Fatal: no indication type provided. sys.exit(1) If you are copying this code off a webpage(I say this because I see a IBM copyright at the top), look for a raw source version of the same, which retains the indentation. Read : http://www.python.org/dev/peps/pep-0008/ +PG On Wed, Mar 11, 2009 at 10:19 AM, Sandeep HS sandeep...@greenturtles.in wrote: Hello, This is Sandeep H S working in Green Turtles Technologies, B'lore. I am trying to execute a python program but unable to do so . Every time i execute that python program , I am getting error as File ind.py, line 280 dom = parseString(xmldata) ^ IndentationError: expected an indented block I am very new to Python.I think that error is occuring due mismatch of colon ( : ) or parameter xmldata fails.How to overcome this problem ? Here by i am attaching ind_test.py ie python program file. Please find the attachment and kindly solve this issue... Thanks Sandeep H S ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Reply from David Goodger about PyCon
On Sat, Feb 28, 2009 at 11:03 PM, Baiju M mba...@zeomega.net wrote: We required one web app like the one used for PyCon. Any idea whether we can use the same software and customize it ? Or is there any other free software for co-ordinating an entire conference ? https://pycon.coderanger.net/ ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] how to learn programming
Hopefully this scientific study with hard numbers conveys what I was saying in my earlier mail about Python being a better choice for learning vocational programming. This is the summary of a talk accepted for PyCon 2009. http://us.pycon.org/2009/conference/talks/ Python for CS1 Not Harmful to CS Majors (and good for everyone) Dr. Bill Punch (Michigan State University) bio; Dr. Richard J Enbody (Michigan State University) 30min Intermediate education At Michigan State Computer Science Dept. we have recently converted our CS1 course (200 students/semester, about 60% non-CS majors) to Python, previously taught in C++. Follow on courses for CS majors (CS2, etc.) still use and teach C/C++. Right around the conversion point, we had two groups of students taking the C++ CS2 course: those that took CS1 in Python and those that took CS1 in C++. We examined the performance of those two groups of students in the CS2-C++ course (covering the same topics as previously), looking for any significant differences as measured by t-test with respect to: final exam grade, overall programming project scores and final course grade. No significant differences between CS1-Python and CS1-C++ were found. Further, multiple regression analysis showed that only GPA was a good predictor of the three outcomes. Neither CS-1 Python nor CS1-C++ was a predictor. Our conclusion is that a CS1-Python course was as good a preparation for a CS2-C++ course as was a CS1-C++ course. Furthermore, CS1-Python was a far better terminal course for non-majors than CS1-C++, and both majors and non-majors were could address a wider range of practical STEM problem than previously. We have written a CS1-Python book for others who wish to teach a Python-CS1 course that emphasizes teaching Python to CS1 students with a theme of data manipulation. +PG On Sat, Jan 24, 2009 at 10:07 PM, Roshan Mathews rmath...@gmail.com wrote: On Sun, Jan 25, 2009 at 2:56 AM, Sridhar Ratnakumar sridhar.ra...@gmail.com wrote: On Sat, Jan 24, 2009 at 7:46 AM, Roshan Mathews rmath...@gmail.com wrote: The 'knowing the rules' vs. 'being proficient' argument is also made in SICP http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_sec_1.2 ... another good read, (Indian version of the dead trees version available from University Press.) Are you referring to this argument? Yes. KG was making a similar point about golf, I think. Speaking of SICP, http://eli.thegreenplace.net/2008/04/18/sicp-conclusion/ (must have been quite a feeling of achievement!) Indeed. http://eli.thegreenplace.net/2008/06/06/signed-copy-of-sicp/ :) ~Roshan ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
[BangPypers] Announcing PyOFC2
I've written a python library to generate data files used by the excellent open Flash chart 2. The project page: http://btbytes.github.com/pyofc2/ Click on the links on the left to see the resulting charts. There are a couple of advantages PyOFC2 has over the one distributed with OFC2. 1. Complete. I've implemented python wrapper classes for all chart types and elements. 2. Pythonic. The original PHP library uses setters and getters for properties etc., 3. Demo charts. Each chart type has a `test_ foo` function which shows the usage. 4. Test coverage. 5. No dependency on any python framework. The default distribution uses Cherrypy. Programming notes: This is also the first time I used python meta classes. The test cases are also used to generate the demo files you see on the website. I wouldn't call it literate programming but is self documenting. I've been using this code in a django based app for over a month. +PG [1] http://teethgrinder.co.uk/open-flash-chart-2/ ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] how to learn programming
Learning programming via C will force you to understand data structures like lists, queues and hash tables better purely for the reason that C does not provide them in the standard library. C++/Java/Python do via STL and standard libraries respectively. Generalizing C++ with C shows how misunderstood C++ is. C++ is not C with stuff bolted on. Teaching C in the first year of engineering compared to a language like Python, Lua or Ruby is a sure way of turning off students to the joys of programming. Not everybody needs to know how to implement a linked list and a queue. A vast majority of technical graduates go on to do programming either as software developers and/or engineers in other streams do NOT have to do low level programming. If they were taught to solve problems using a dynamic language like Python/Lua/Ruby instead of twiddling bits, we would see newer applications being built by non-CS graduates in their domains. Oh well, why would CS professors be concerned about productivity. A lot of my mechanical engineering classmates(who were bright students) where scared to death of FORTRAN and C, because C made it so difficult to do simple things like Computer Graphics (which is what they wanted to accomplish in the CAD lab). A library like Pygame would have allowed them to write CG apps and CAD programs without racking brains about C and pointers. +PG On Fri, Jan 23, 2009 at 10:22 AM, prasanna diwadkar pdiwad...@yahoo.comwrote: I was talking in general.I am not saying python/java programmers are lesser quality than C/C++ .Ultimately programming is a programming is a programming. Since 80s to late 90s many Indian/foreign(US etc) have been teaching programming in C/C++.When I talked to 2 ex-professors in India,they observed that the rigor when students go through using c/++ is higher than java/python.For.e.g.manipulation of linked list,hash table.IMO better programming is not just understaning the layers of abstraction but understanding some intracacies,what goes below the hood. Regards PD --- On *Thu, 1/22/09, Sridhar Ratnakumar sridhar.ra...@gmail.com* wrote: From: Sridhar Ratnakumar sridhar.ra...@gmail.com Subject: Re: [BangPypers] how to learn programming To: Bangalore Python Users Group - India bangpypers@python.org Date: Thursday, January 22, 2009, 11:50 PM On Thu, Jan 22, 2009 at 11:29 PM, Darkseid lorddae...@gmail.com wrote: have found those how have programmed in C/C++ are generally better(in problem solving) than who program in other languages. I would disagree quite strongly based on my experience. I don't thing C/C++ programmers are any worse, but they certainly aren't any better on average. What I have observed in my particular area of work (which has an emphasis on OO) is that C/C++ programmers are least likely to respect good OO practices, followed closely by Java/C# folks. I'm guessing that Prasanna was thinking of ACM ICPC kind of problems when he claimed that C/C++ is better in problem solving. These kind of problems require the contestant to write code so that they run within a given time limit.. a restriction which forces one to write it on C/C++ than a high-level language. BTW, if one is just starting to learn programming.. I hear HtDP is pretty good - http://htdp.org/ ___ BangPypers mailing listbangpyp...@python.orghttp://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] python
On Fri, Jan 9, 2009 at 2:20 PM, (श्री) Sreekanth B gnuy...@gmail.comwrote: hi kenneth, what u said may not be really true there are thousands out there in France and Germany who cannot even write a sentence in English;-) That's because they study in French/German medium schools and not in English medium schools like most of us. 16 years of using a language to learn everything from math, science to engineering should equip one with basic skills, isn't it? I'm not commenting on the original posters english ability. Kenneth expressed what anybody in hiring position would do - If this guy cannot write a nice intro mail, how good can he be? etc. So, while Kenneth's mail can come across negatively, I think he has worked enough youngsters to recognize that having good communication is as important as programming skills to get a good job. especially in a bearish job market. My two paise... FWIW,I studied in a Kannada medium school. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Congratulations to India for Landing on the Moon!
On Mon, Nov 17, 2008 at 1:29 AM, Anand Balachandran Pillai [EMAIL PROTECTED] wrote: On Sat, Nov 15, 2008 at 4:59 AM, Deepak Thukral [EMAIL PROTECTED] wrote: A job well done! (It is unknown whether Python was running onboard ;-) ISRO is in stone age as far as Computer Technology is concern (Their portal only works in IE6 and written in creepy html). I think they are toiling with C, Fortran JAVA. Probably they should inherit Python/Erlang from NASA/ESA. Hoping their new GIS Keyhole like webapp will use Python. Don't confuse the lack of sophistication of their website with any lack of sophistication in engineering. Space rocket science/engineering is a much more complex and delicate affair than typical software engineering. ISRO develops and uses complex software for mission control which is not exactly akin to developing a website - it is much more difficult to get right. Even if your website crashes, perhaps you might loose data or a few visitors and lose some uptime. However, this is not the case with the software used in space science. Everything has to work and work perfectly. Remember that simple software glitches have often caused entire rocket missions to be aborted. This has happened even for mighty NASA. The most recent one I can think of is the glitch with VxWorks that happened in one of their Mars rovers which caused the system software to reboot itself many times. In fact ISRO has done a splendid job managing to put a satellite to Moon orbit and also perform a moon impact all in the very first attempt. Recall that Russia and U.S.A have had several crash lands and aborted attempts in their moon missions. The quality control at ISRO has to be pretty damn good. I read a few articles about the images from Chandrayaan and it seems the camera they have is top-class. The images it has send are already pretty good, and it is perhaps the first moon satellite to carry a 3D (Terrain mapping) camera. I don't think any single moon (or perhaps earth) satellite is a classic example of international co-operation. Chandrayaan carries 11 payloads. To me, it looks like India is leading the way in international space co-operation. ISRO needs a big pat on the back for what they have done. Thanks Anand for a very nice summary of the project's accomplishments. I have been reading stories about Chandrayaan online, but yours has captured the essential accomplishments. +PG ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] hi all
On Fri, Nov 7, 2008 at 9:23 AM, shridhar kyrlageri [EMAIL PROTECTED] wrote: i m very new to python.. but i m very much interested in learnin this laguage.. i have worked only on C.. so kindly suggest from where should i start learnin.. i want to do some small projects using python.. please help me with this.. Start here: http://www.ibiblio.org/swaroopch/byteofpython/read/ Advance here: http://diveintopython.org/ ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] One python question (from verilog)
The syntax looks familiar, almost python like. The equivalent python code would be*: def poll_reg(bit_pos, poll_val, reg_offset): matched = 0 while matched != 1: read_data = read_reg(reg_offset) if read_data[bit_pos] === poll_val: matched = 1 else: matched = 0 return matched * Implementing read_reg is left as an exercise to the developer :p I'm not aware of any python library methods which allow one to access registers. But, the read_reg() can be implmented in C and imported into Python. Any low level operation like register access is usually delegated to . HTH, PG On Sep 19, 2008, at 7:02 PM, Deepak Patel wrote: Hello all, I want to a write a method in Python to poll a register for '1' or '0'. It is kind of very simple in verilog, but not sure if python provides flexibility or not. My algorithm (kind of Verilog syntax where I can access the bits without any extra processing) is as follows: poll_reg ( input bit_pos, input poll_val, reg_offset) { // In this bit_pos is the position of bit in my register read which are being polled to become poll_val. Poll_val can be either 0 or 1. matched = 0; while (matched != 1) begin read_data = read_reg(reg_offset); if (read_data[bit_pos] == poll_val) begin matched = 1; end else begin matched = 0; end end } Is there a way to do above in Python? Thanks, Deepak ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers Pradeep Kishore Gowda http://pradeepgowda.com [EMAIL PROTECTED] +1-317-564-4660 (Day Phone) ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] which framework is better pylon or django
On Sep 8, 2008, at 11:47 PM, Sibtey Mehdi wrote: Hi I am planning to develop a website but I don’t have any idea about the python framework. I found 2 or 3 framework (pylon, Django, turbo Gear) on net but couldn’t understand which one should be used. Can you suggest me which framework should be better to develop a simple website? By simple website, I assume a website having mostly textual+image content with perhaps a few forms for user interaction. In that case, django may be a good fit. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Python Web development collaterals...
On Jul 24, 2008, at 10:11 AM, Banibrata Dutta wrote: On your Windows plaf. you could start by installing ActivePython from ActiveState website It comes with SQLlite (Python2.6's default packaging)... and should be good enough to get you going for some basic DB apps. You could download/install Django as well... for some web-framework development. However if you insist on mysql and CGI based programming, you could download the MySQL windows installer and install it, and the Python bindings for Mysql. These are advice from a non-practising ex-programmer :) so details might be a bit fuzzy. On 7/24/08, Vishal [EMAIL PROTECTED] wrote: What is the easiest way to start experimenting with Python offerings for Web development on a Windows platform? What things will I need to get my self going for displaying a simple webpage using Python based database access (say MySql)? Could somebody list the things (softwares) required? point me to a good web development tutorial... Would like to start with simple CGI and then go on to Web 2.0 kind of path... From a practicing web-programmer -- the better way to start web programming today is web.py http://webpy.org Its close enough to CGI in the sense that you don't have to understand frameworks, MVC, MTV (as in Django), at the same time you don't have to reinvent the wheel for db handling, templating, handling requests, sessions etc. Once you grok web programming, look around. The choices are endless.. After all we are pythonistas. we don't have religions masquerading as web frameworks. Saying Hello world in web.py is as simple as: --- import web urls = ( '/(.*)', 'hello' ) class hello: def GET(self): print 'Hello world!' if __name__ == __main__: web.run(urls, globals()) --- Pradeep Kishore Gowda http://pradeepgowda.com [EMAIL PROTECTED] +1-317-489-2272 (Mobile) ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] Simple syntactic error?
On 22-May-08, at 3:14 PM, g sobers wrote: hey! Following is a small PyS60 script. The error seems related to basic syntax - state in keys() is not recognized although defined globally. Would appreciate assistance. = import appuifw, key_codes, e32, telephone state = None def keys(event): if event['keycode'] == key_codes.EKeyYes: appuifw.note(uDoesn't Matter) elif (event['keycode'] == key_codes.EKeyYes) and (state == telephone.EStatusConnected): appuifw.note(uYes was pressed and call active) def cb_calling(args): state = args[0] def quit(): app_lock.signal() telephone.call_state(cb_calling) canvas = appuifw.Canvas(event_callback = keys) appuifw.app.body = canvas appuifw.app.exit_key_handler = quit app_lock = e32.Ao_lock() app_lock.wait() == Best, wirefree See the code below state = 99 def foo(vars): ... state = vars[0] ... foo([1,2]) state 99 #-- this is what is happening to your code # so... try this... def foo(vars): ... global state ... state = vars[0] ... foo([1,2]) state 1 You have declare state as global inside the function. By default the scope of the variable is local. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] FAQ
On 09-May-08, at 9:55 PM, Sridhar Ratnakumar wrote: On Fri, May 9, 2008 at 11:46 AM, Vishal [EMAIL PROTECTED] wrote: A few days back there was a long discussion about IDEs and Editors in general. Please look at that thread. We need a wiki that filers (according to informativeness) and archives the responses for most frequently asked questions in this mailing list. Thus avoid wasting time and resource with odd subjective repetitive emails. http://bangpypers.jottit.com/ Its a wiki, as simple as it can get. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] FAQ
On 09-May-08, at 10:28 PM, Pradeep Gowda wrote: http://bangpypers.jottit.com/ Its a wiki, as simple as it can get. Oh, I forgot all about our wiki on python.org.. http://wiki.python.org/moin/BangPypers Please use the python.org wiki. ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers
Re: [BangPypers] BangPypers Digest, Vol 8, Issue 15
On 06-May-08, at 12:51 AM, Kenneth Gonsalves wrote: textmate for mac and SPE or eric4 for linux Lets me also point out that whatever you choose, dont *ever* use Notepad. Notepad is the most useless piece of software that ships with windows. I use Textmate and aquamacs (both on mac of course) and vim occasionally. For a windows new user, I recomment SciTE (which is also available via pywin IDE). I recommend it to every new student of mine and so far, I've heard no complaints. Some of them have switched to vim/emacs etc.,. But to start with SciTe is the easiest. Its super-light weight, supports lots of languages, is cross platform. An editor like SciTE which understands python, makes the space is signiicant mental block a little easy for the newbie. Also, SciTE has an easy shortcut F5 to execute code, the result of which can be seen in split window. This also makes it attractive for write-test interactive mode. On the side notes: I wrote an app using Google AppEngine and Python : http://www.btbytes.com/2008/05/announcing-teh-the-minimalist-blog- tool-using-google-app-engine +Pradeep ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers