Python for Bioinformatics: New book announcement
I am glad to announce the second edition of Python for Bioinformatics. In today's data driven biology, programming knowledge is essential in turning ideas into testable hypothesis. Based on my extensive experience, Python for Bioinformatics, Second Edition helps biologists get to grips with the basics of software development. Requiring no prior knowledge of programming-related concepts, the book focuses on the easy-to-use, yet powerful, Python computer language. This new edition is updated throughout to Python 3 and is designed not just to help scientists master the basics, but to do more in less time and in a reproducible way. New developments added in this edition include NoSQL databases, the Anaconda Python distribution, graphical libraries like Bokeh, and the use of GitHub for collaborative development. Most of the code can be executed online using a collection of Jupyter Notebooks hosted at https://notebooks.azure.com/library/py3.us. All source code is available at GitHub (https://github.com/Serulab/Py4Bio) The intended audience of this book are bioinformatics students and graduates who are not software developers but needs to learn how to program. Software developers can also take advantage of the book, since there is also advanced and reference material. Table of contents Section I: Programming Chapter 1: ■ Introduction Chapter 2 ■ First Steps with Python Chapter 3 ■ Basic Programming: Data Types Chapter 4 ■ Programming: Flow Control Chapter 5 ■ Handling Files Chapter 6 ■ Code Modularizing Chapter 7 ■ Error Handling Chapter 8 ■ Introduction to Object Orienting Programming (OOP) Chapter 9 ■ Introduction to Biopython Section II: Advanced Topics Chapter 10 ■ Web Applications Chapter 11 ■ XML Chapter 12 ■ Python and Databases Chapter 13 ■ Regular Expressions Chapter 14 ■ Graphics in Python Section III: Python Recipes with Commented Source Code Chapter 15 ■ Sequence Manipulation in Batch Chapter 16 ■ Web Application for Filtering Vector Contamination Chapter 17 ■ Searching for PCR Primers Using Primer3 Chapter 18 ■ Calculating Melting Temperature from a Set of Primers Chapter 19 ■ Filtering Out Specific Fields from a GenBank File Chapter 20 ■ Inferring Splicing Sites Chapter 21 ■ Web Server for Multiple Alignment Chapter 22 ■ Drawing Marker Positions Using Data Stored in a Database Chapter 23 ■ DNA Mutations with Restrictions (On-Line only) Section IV: Appendices Appendix A ■ INTRODUCTION TO VERSION CONTROL Appendix B ■ PYTHONANYWHERE Appendix C ■ REFERENCE Where to buy? In Amazon (http://amzn.to/2vWazcL) or at the publisher web site (https://goo.gl/t2uoyN), save 20% with the promo code AZR94 (valid only in the publisher site and up to December 2017). For more information, include book mailing list, visit http://py3.us/ -- https://mail.python.org/mailman/listinfo/python-list
Issue 1 of "PET: English Translation" a Python magazine is out!
-- Forwarded message -- From: Roberto Alsina Date: Fri, Sep 10, 2010 at 12:00 AM Subject: [pyar] Issue 1 of "PET: English Translation" a Python magazine is out! To: python-announce-l...@python.org, Python Argentina This magazine is a community effort. It's done by Python guys in Argentina. We are quite proud of it, and we hope you like it too. You can read Issue 1 in our webpage: http://revista.python.org.ar/1/html-en/ It's available in several different formats, including PDF, ePub, Mobipocket, HTML and FB2, and is released under a CC-by-nc-sa license. It has been translated to english by us, and we are not native speakers. Hopefully Shakespeare will not raise from his grave to slap us for grievous offense against his language! But, to save us from the Wrath of Wil, feel free to point out any mistakes and unhappy turns of phrase in the comments. Now that we have the english version out, we have *much bigger* plans for our second issue. We'll keep you posted. ___ pyar mailing list p...@python.org.ar http://listas.python.org.ar/listinfo/pyar PyAr - Python Argentina - Sitio web: http://www.python.org.ar/ -- Sebastián Bassi. Lic. en Biotecnologia. Curso de Python en un día: http://bit.ly/cursopython Python Book: www.py4bio.com -- http://mail.python.org/mailman/listinfo/python-list
Re: biopython
On Mon, Jun 14, 2010 at 11:02 AM, madhuri vio wrote: > TypeError: Need a file handle, not a string (i.e. not a filename) This says that the error is that you are using a filename where you should be using a filehandle. So this line: for seq_record in SeqIO.read("ls_MTbH37Rv.fasta", "fasta"): Should be changed to: fh = open("ls_MTbH37Rv.fasta") for seq_record in SeqIO.read(fh, "fasta"): I think that in some version of Biopython you would be able to use just the name. Best, SB. Python for Bioinformatics book: http://www.tinyurl.com/biopython Python for Bioinformatics blog: http://www.py4bio.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Free chapter about Python and databases (MySQL and SQLite)
On Fri, May 28, 2010 at 9:41 AM, Tino Wildenhain wrote: > Did you consider adding a part dealing with postgresql too? > (Especially interesting in the way you can write stored functions > in python there) That is a good idea for the next version/edition. But meanwhile I could write something in my blog at www.py4bio.com Best, SB -- http://mail.python.org/mailman/listinfo/python-list
Re: Free chapter about Python and databases (MySQL and SQLite)
On Fri, May 28, 2010 at 12:37 AM, John Bokma wrote: > I feel more than uncomfortable with example code that uses: user="root" What's wrong with this? It is just an example of connection string. The reader will use his/her user/pass/dbname according to their own settings. > (e.g. p291). I never get why people write a short (IMO) /bad/ intro to > databases while there are books out there that do a way better The intended audience of this book are biologist who may be not familiarized with relational databases. Most of my colleagues (at least from the bio camp) don't even know that behind most dynamic web pages there are databases and I think that most of them will find the intro section useful. You can always skip what you know and go to the point you want. > job. To me such chapters are just a way to get more pages :-(. (=make > the book more expensive = less money to buy a /good/ book on databases) I am not sure that price in this kind of book are tied to the number of pages. There must be some relation, but this is not the main factor affecting price. > I would love to see more technical books that start at page 1 with the > topic, not with an introduction to the language (170+ pages) and some ... I see where you go, it seems you are not the target audience for this book. Anyway I appreciate your feedback. Best, SB -- http://mail.python.org/mailman/listinfo/python-list
Free chapter about Python and databases (MySQL and SQLite)
Hello, I want to announce that the publisher of "Python for Bioinformatis" (CRC Press) allowed me to publish a chapter from my book. I decided to publish the chapter about "Python and databases". I think it may be useful for somebody. The official announcement and download link is here: http://py4bio.com/2010/05/28/python_databases_mysql_sqlite/ For more information about the book: www.tinyurl.com/biopython Best, SB. -- Sebastián Bassi. Lic. en Biotecnologia. Curso de Python en un día: http://bit.ly/cursopython Non standard disclaimer: READ CAREFULLY. By reading this email, you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://mail.python.org/mailman/listinfo/python-list
Re: ElementTree write creates large one line XML file ....
On Thu, May 27, 2010 at 9:13 PM, Robert Kern wrote: > ElementTree writes exactly what you tell it to. In XML, whitespace is > significant. If you want newlines and/or indentation to make it > pretty-looking, then you need to add those to your elements. This is not always true. Let me quote an XML tutorial (by Oracle): "What is XML Whitespace? XML considers four characters to be whitespace: the carriage return (\r or ch(13)), the linefeed (\n or ch(10)), the tab(\t), and the spacebar (' '). In XML documents, there are two types of whitespace: Significant whitespace is part of the document content and should be preserved. Insignificant whitespace is used when editing XML documents for readability. These whitespaces are typically not intended for inclusion in the delivery of the document. Usually without DTD or XML schema definition, all whitespaces are significant whitespaces and should be preserved. However, with DTD or XML schema definitions, only the whitespaces in the content are significant as follows: -- John Smith Product Manager Example.com " -- http://mail.python.org/mailman/listinfo/python-list
Re: MySQLdb - weird formatting inconsistency
Hi, Could you post a minimal version of the DB (a DB dump) to test it? Just remove most information and leave on the ones needed to reproduce the error. Also remove any personal/confidential information. Then dump the DB so I can test it here. Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Re: Converting Python CGI to WSGI scripts
On Tue, Mar 16, 2010 at 2:18 PM, wrote: > I have a few dozen simple Python CGI scripts. > Are there any advantages or disadvantages to rewriting these CGI scripts as > WSGI scripts? It depends of the script. WSGI should be faster since you don't start a Python instance for each call (as in CGI). -- Sebastián Bassi. Diplomado en Ciencia y Tecnología. Curso de Python en un día: http://bit.ly/cursopython Python for Bioinformatics: http://tinyurl.com/biopython Non standard disclaimer: READ CAREFULLY. By reading this email, you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://mail.python.org/mailman/listinfo/python-list
Re: parametrizing a sqlite query
On Wed, Feb 24, 2010 at 3:41 PM, Dennis Lee Bieber wrote: > No there isn't... The problem is that you need to put the wildcards > into the parameter instead of the placeholder. Thank you, it works now. Best, SB -- http://mail.python.org/mailman/listinfo/python-list
parametrizing a sqlite query
c.execute("SELECT bin FROM bins WHERE qtl LIKE '%:keys%'",{'keys':keywords}) This query returns empty. When it is executed, keywords = 'harvest'. To check it, I do it on the command line and it works as expected: sqlite> SELECT bin FROM bins WHERE qtl LIKE '%harvest%'; 11C 11D 12F I guess there is a problem with the "%". -- http://mail.python.org/mailman/listinfo/python-list
Re: Manipulating MySQL Sets
On Sun, Dec 13, 2009 at 2:10 PM, Carsten Haese wrote: from sets import Set aSet = Set(['Small', 'Extra-small', 'Medium']) You don't need to import "Set" since it is built in now: >>> a=set([1,2,2,3,4,5]) >>> a set([1, 2, 3, 4, 5]) (I have Python 2.6.2 but I think that this is available from 2.4 or 2.5). -- http://mail.python.org/mailman/listinfo/python-list
Re: Manipulating MySQL Sets
On Sun, Dec 13, 2009 at 12:48 PM, Victor Subervi wrote: > Who said I was expecting a string? I don't know what I'm expecting! I need > to be able to parse this thing, whatever it is. You say it's a Python Set > object. How do I parse it? Googling has been disappointing. You can walk thought a set object like any iterable object like for x in myset: #do something like parse it. If you want to slice it, convert it to a list: mylist = list(myset) Or read about sets: http://docs.python.org/library/sets.html -- http://mail.python.org/mailman/listinfo/python-list
Re: [ANN] "Python for Bioinformatics" available and in stock
On Mon, Oct 19, 2009 at 5:53 AM, Piter_ wrote: > Great. > I've been waiting it. > Any place in Europe to get it? Go here: http://www.crcpress.com/product/isbn/9781584889298 And then look at the bottom of the page and choose your country, I know they have offices in London. > P.S. Is anyone writing similar book about chemometrics? Look here: http://www.crcpress.com/utility_search/search_results.jsf?_kw=chemometrics&_or=Relevance+(Desc)&_sj=+All+Subjects (short url: http://bit.ly/1gTg1B) Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Re: "Python for Bioinformatics" available and in stock
On Mon, Oct 19, 2009 at 5:43 AM, Bearophile wrote: > A more pythonic code is: ... > Note the use of xrange and names_with_underscores. In Python names are > usually lower case and their parts are separated by underscores. Regarding underscore (and code notation in general) I wrote in the book (page 6): Some code in the book will not follow accepted coding styles for the following reasons: * There are some instances where the most didactic way to show a particular piece of code conflicts with the style guide. On those few occasions, I choose to deviate from the style guide in favor of clarity. * Due to size limitation in a printed book, some names were shortened and other minor drifts from the coding styles have been introduced. * To show there are more than one way to write the same code. Coding style is a guideline, so some programmers don't follow them. You should be able to read ``bad'' code, since sooner or later you will have to read other people's code. > >From #6: > If you want to limit the space in the book the you can pack those > lines in a single line, but it's better to keep the underscores. #5 to #9 are very introductory programs that are introduced in order to show standard flow control structures (if-elif-else-for-while). I think that at this level, packing several lines into one is not the best option for learning. > >From #18: > prop = 100.*cp/len(AAseq) > return (charge,prop) > ==> > prop = 100.0 * cp / len(aa_seq) > return (charge, prop) > Adding spaces between operators and after a comma, and a zero after > the point improves readability. Yes, you are right. > >From #35: > import re > pattern = "[LIVM]{2}.RL[DE].{4}RLE" > ... > rgx = re.compile(pattern) > When the pattern gets more complex it's better to show readers to use > a re.VERBOSE pattern, to split it on more lines, indent those lines as > a program, and add #comments to those lines. This is a very nice suggestion. I will consider for next edition, but the book is about 600 pages now, so I have to consider very carefully about adding new material. > The #51 is missing. Thank you, it is corrected now. It was an HTML file instead of a .py file so the script I use didn't notice the original file. > I like Python and I think Python is fit for bioinformatics purposes, > but 3/4 of the purposes of a book like this are to teach > bioinformatics first and computer science and Python second. And This book does not teach bioinformatics, let me copy the "Who Should Read This Book" section: "This book is for the life science researcher who wants to learn how to program. He may have previous exposure to computer programming, but this is not necessary to understand this book (although it surely helps). This book is designed to be useful to several separate but related audiences, students, graduates, postdocs, and staff scientists, since all of them can benefit from knowing how to program. Exposing students to programming at early stages in their career helps to boost their creativity and logical thinking, and both skills can be applied in research. In order to ease the learning process for students, all subjects are introduced with the minimal prerequisites. There are also questions at the end of each chapter. They can be used for self-assessing how much you've learnt. The answers are available to teachers in a separate guide. Graduates and staff scientists having actual programming needs should find its several real world examples and abundant reference material extremely valuable. What You Should Already Know Since this book is called \emph{Python for Bioinformatics} it has been written with the following assumptions in mind: \begin{itemize} \item The reader should know how to use a computer. No programming knowledge is assumed, but the reader is required to have minimum computer proficiency to be able to use a text editor and handle basic tasks in your operating system (OS). Since Python is multi-platform, most instructions from this book will apply to the most common operating systems (Windows, Mac OSX and Linux); when there is a command or a procedure that applies only to a specific OS, it will be clearly noted. \item The reader should be working (or at least planning to work) with bioinformatics tools. Even low scale hand made jobs, such as using the NCBI BLAST to ID a sequence, aligning proteins, primer searching, or estimating a phylogenetic tree will be useful to follow the examples. The more familiar the reader is with bioinformatics the better he will be able to apply the concepts learned in this book. \end{itemize} > sometimes a dynamic language isn't fast enough for bioinformatics > purposes, so a book about this topic probably has to contain some Thats depend on what bioinformatic application are you working on. I think that 3D molecular modeling is a field suitable for a low level language like C or Fortran, but most bioinformatic applications like sequence annotation, primer design, sequence proce
[ANN] "Python for Bioinformatics" available and in stock
I announced that Python for Bioinformatics was ready, now I want to announce that is available and in stock in most book sellers. Worldwide, use Amazon. In Argentina, it is more convenient buying it from me at MercadoLibre: http://articulo.mercadolibre.com.ar/MLA-64715574-libro-python-for-bioinformatics-opcional-firmado-x-autor-_JM Here is my stock: http://www.flickr.com/photos/sbassi/4018649164/sizes/l/ Book announcement: Python for Bioinformatics book "Python for Bioinformatics" ISBN 1584889292 Amazon: http://www.tinyurl.com/biopython Publisher: http://www.crcpress.com/product/isbn/9781584889298 This book introduces programming concepts to life science researchers, bioinformaticians, support staff, students, and everyone who is interested in applying programming to solve biologically-related problems. Python is the chosen programming language for this task because it is both powerful and easy-to-use. It begins with the basic aspects of the language (like data types and control structures) up to essential skills on today's bioinformatics tasks like building web applications, using relational database management systems, XML and version control. There is a chapter devoted to Biopython (www.biopython.org) since it can be used for most of the tasks related to bioinformatics data processing. There is a section with applications with source code, featuring sequence manipulation, filtering vector contamination, calculating DNA melting temperature, parsing a genbank file, inferring splicing sites, and more. There are questions at the end of every chapter and odd numbered questiona are answered in an appendix making this text suitable for classroom use. This book can be used also as a reference material as it includes Richard Gruet's Python Quick Reference, and the Python Style Guide. DVD: The included DVD features a virtual machine with a special edition of DNALinux, with all the programs and complementary files required to run the scripts commented in the book. All scripts can be tweaked to fit a particular configuration. By using a pre-configured virtual machine the reader has access to the same development environment than the author, so he can focus on learning Python. All code is also available at the http://py3.us/## where ## is the code number, for example: http://py3.us/57 I've been working on this book for more than two years testing the examples under different setups and working to make the code compatible for most versions of Python, Biopython and operating systems. Where there is code that only works with a particular dependency, this is clearly noted. Finally, I want to highlight that non-bioinformaticians out there can use this book as an introduction to bioinformatics by starting with the included "Diving into the Gene Pool with BioPython" (by Zachary Voase and published originally in Python Magazine) -- Sebastián Bassi. Diplomado en Ciencia y Tecnología. Non standard disclaimer: READ CAREFULLY. By reading this email, you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python or ActionScript 3.0
On Sat, Aug 15, 2009 at 10:29 PM, Douglas Alan wrote: > Python doesn't run in your typical web browser, but it is common to > use Python for doing the server-side programming, along with a Python- > based web development framework, such as Django. > You could use Jython to make a JVM applet that would run in a browser, > but JVM applets aren't very popular for a variety of reasons, and I > doubt the performance would be very good. There is another way to run Python in a browser: MS Silverlight, it runs IronPython on web browsers. http://www.trypython.org/ -- http://mail.python.org/mailman/listinfo/python-list
Re: ANN: Python for Bioinformatics book
On Thu, Aug 6, 2009 at 11:52 AM, Bearophile wrote: > The book looks interesting, but that doesn't look like a good way to > show/offer the code. I suggest to also put it into a zip that can be > downloaded. Code is also in a directory in the DVD and also inside the virtual machine. Anyway I think it wouldn't hurt to make a zip and put it online, so i will do it. Thanks. Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
ANN: Python for Bioinformatics book
"Python for Bioinformatics" ISBN 1584889292 Amazon: http://www.tinyurl.com/biopython Publisher: http://www.crcpress.com/product/isbn/9781584889298 This book introduces programming concepts to life science researchers, bioinformaticians, support staff, students, and everyone who is interested in applying programming to solve biologically-related problems. Python is the chosen programming language for this task because it is both powerful and easy-to-use. It begins with the basic aspects of the language (like data types and control structures) up to essential skills on today's bioinformatics tasks like building web applications, using relational database management systems, XML and version control. There is a chapter devoted to Biopython (www.biopython.org) since it can be used for most of the tasks related to bioinformatics data processing. There is a section with applications with source code, featuring sequence manipulation, filtering vector contamination, calculating DNA melting temperature, parsing a genbank file, inferring splicing sites, and more. There are questions at the end of every chapter and odd numbered questiona are answered in an appendix making this text suitable for classroom use. This book can be used also as a reference material as it includes Richard Gruet's Python Quick Reference, and the Python Style Guide. DVD: The included DVD features a virtual machine with a special edition of DNALinux, with all the programs and complementary files required to run the scripts commented in the book. All scripts can be tweaked to fit a particular configuration. By using a pre-configured virtual machine the reader has access to the same development environment than the author, so he can focus on learning Python. All code is also available at the http://py3.us/## where ## is the code number, for example: http://py3.us/57 I've been working on this book for more than two years testing the examples under different setups and working to make the code compatible for most versions of Python, Biopython and operating systems. Where there is code that only works with a particular dependency, this is clearly noted. Finally, I want to highlight that non-bioinformaticians out there can use this book as an introduction to bioinformatics by starting with the included "Diving into the Gene Pool with BioPython" (by Zachary Voase and published originally in Python Magazine). -- Sebastián Bassi. Diplomado en Ciencia y Tecnología. Non standard disclaimer: READ CAREFULLY. By reading this email, you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://mail.python.org/mailman/listinfo/python-list
Re: pack an integer into a string
On Fri, Jul 24, 2009 at 7:28 PM, superpollo wrote: > is there a pythonic and synthetic way (maybe some standard module) to "pack" > an integer (maybe a *VERY* big one) into a string? like this: What do you mean to pack? Maybe Pickle is what you want. import cPickle variable = 124348654333577698 cPickle.dump(variable,open('filename', 'w')) To load it: import cPickle vaariable = cPickle.load(open('filename')) It is not "into a string", but instead of a filename, use a string with stringio -- http://mail.python.org/mailman/listinfo/python-list
Re: Does Python have certificate?
On Mon, Mar 23, 2009 at 9:15 PM, Muddy Coder wrote: > I wonder that does Python have certificate? You see, java, .NET, PHP, > and so on, they have certificates for developers to get. Python is > quite popular nowadays, I wonder is there such a thing? If so, I > certainly want to get one. I searched, and No, there is no certification for Python. Maybe in the future... -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem trying to install ReportLab with easy_install
On Sun, Feb 22, 2009 at 10:07 AM, Garrett Cooper wrote: >It's not building lib_renderPM_libart properly, or it's a typo > that supposed to be librenderPM_libart, or bad LDFLAGS... >More details need to be provided like an ls of your site-packages > directory and a partial ls of your local library directory (ls > /usr/?local/?lib/lib*render*libart*, etc). > sba...@hp:~$ ls /usr/lib/lib*ren* /usr/lib/libktorrent.la/usr/lib/libXrender.la /usr/lib/libktorrent.so/usr/lib/libXrender.so /usr/lib/libktorrent.so.0 /usr/lib/libXrender.so.1 /usr/lib/libktorrent.so.0.0.0 /usr/lib/libXrender.so.1.3.0 /usr/lib/libXrender.a sba...@hp:~$ ls /usr/lib/libart* /usr/lib/libart_lgpl_2.so.2/usr/lib/libartsflow_idl.so.1 /usr/lib/libart_lgpl_2.so.2.3.16 /usr/lib/libartsflow_idl.so.1.0.0 /usr/lib/libart_lgpl.so.2 /usr/lib/libartsflow.so.1 /usr/lib/libart_lgpl.so.2.2.0 /usr/lib/libartsflow.so.1.0.0 /usr/lib/libartscbackend.la/usr/lib/libartsgslplayobject.la /usr/lib/libartscbackend.so.0 /usr/lib/libartsgslplayobject.so.0 /usr/lib/libartscbackend.so.0.0.0 /usr/lib/libartsgslplayobject.so.0.0.0 /usr/lib/libartsc.so.0 /usr/lib/libartskde.so.1 /usr/lib/libartsc.so.0.0.0 /usr/lib/libartskde.so.1.2.0 /usr/lib/libartsdsp.so.0 /usr/lib/libartswavplayobject.la /usr/lib/libartsdsp.so.0.0.0 /usr/lib/libartswavplayobject.so.0 /usr/lib/libartsdsp_st.so.0/usr/lib/libartswavplayobject.so.0.0.0 /usr/lib/libartsdsp_st.so.0.0.0 (t6)sba...@hp:~/test/virtualenv-1.3.2/t6$ ls lib/python2.5/site-packages/ easy-install.pthsetuptools.pth setuptools-0.6c9-py2.5.egg xlwt-0.7.0-py2.5.egg This is a virtualenv created with --no-site-packages (to have a clean start). Other easy_install works, but this one, doesn't :( -- http://mail.python.org/mailman/listinfo/python-list
Problem trying to install ReportLab with easy_install
I don't understand what is wrong when I try to install ReportLab. This is under Ubuntu and all build packages are installed. Here is what I get when trying to install it: (I could install it with apt-get, but I am testing virtualenv and easy_install). (testbio149)vi...@maricurie:~/Public/testbio149$ easy_install ReportLab Searching for ReportLab Reading http://pypi.python.org/simple/ReportLab/ Reading http://www.reportlab.com/ Best match: reportLab 2.3 Downloading http://pypi.python.org/packages/source/r/reportlab/reportLab-2.3.zip#md5=7d98b26fa287a9e4be4d35d682ce64ac Processing reportLab-2.3.zip Running ReportLab_2_3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ZZcgFG/ReportLab_2_3/egg-dist-tmp-FqKULE #Attempting install of _rl_accel, sgmlop & pyHnj #extensions from '/tmp/easy_install-ZZcgFG/ReportLab_2_3/src/rl_addons/rl_accel' #Attempting install of _renderPM #extensions from '/tmp/easy_install-ZZcgFG/ReportLab_2_3/src/rl_addons/renderPM' # installing with freetype version 21 /tmp/easy_install-ZZcgFG/ReportLab_2_3/src/rl_addons/rl_accel/_rl_accel.c: In function âhex32â: /tmp/easy_install-ZZcgFG/ReportLab_2_3/src/rl_addons/rl_accel/_rl_accel.c:793: warning: format â%8.8Xâ expects type âunsigned intâ, but argument 3 has type âlong unsigned intâ /tmp/easy_install-ZZcgFG/ReportLab_2_3/src/rl_addons/rl_accel/_rl_accel.c: In function â_instanceStringWidthUâ: /tmp/easy_install-ZZcgFG/ReportLab_2_3/src/rl_addons/rl_accel/_rl_accel.c:1200:warning: pointer targets in assignment differ in signedness /tmp/easy_install-ZZcgFG/ReportLab_2_3/src/rl_addons/rl_accel/_rl_accel.c:1123:warning: âfâ may be used uninitialized in this function /tmp/easy_install-ZZcgFG/ReportLab_2_3/src/rl_addons/rl_accel/_rl_accel.c:1123:warning: âtâ may be used uninitialized in this function /tmp/easy_install-ZZcgFG/ReportLab_2_3/src/rl_addons/rl_accel/_rl_accel.c:1123:warning: âLâ may be used uninitialized in this function /usr/bin/ld: cannot find -l_renderPM_libart collect2: ld returned 1 exit status error: Setup script exited with error: command 'gcc' failed with exit status 1 (testbio149)vi...@maricurie:~/Public/testbio149$ -- http://mail.python.org/mailman/listinfo/python-list
Re: How to store passwords?
On Wed, Jan 7, 2009 at 6:42 PM, Oltmans wrote: > I'm writing a program in which I will ask users to enter user name and > password once only. It's a console based program that will run on In general you don't store the password, but a "hash" of it. Then when the user logs-in, you hash it and compare the result with the stored hash. About hash, use sha, look here: http://docs.python.org/library/hashlib.html#module-hashlib > Windows XP. Actually, I'm trying to provide the similar functionality > as "Remember me" thing in browsers. For that, I will need to store > user name and passwords on the disk. I don't have a background in I don't understand how this is supposed to work. "Remember me" in browser doesn't store passwords. > using? Moreover, I cannot use a whole library to do that due to > certain issues. However, I can use like 1--2 files that will be > shipped along with the main script. Any ideas? Any help will be really > appreciated. Thanks. The library I pointed out before is built-in. Best, SB. -- Sebastián Bassi. Diplomado en Ciencia y Tecnología. Book: Python for bioinformatics. http://tinyurl.com/biopython Vendo isla: http://www.genesdigitales.com/isla What's new in Python 3: http://tinyurl.com/5cd89r Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 -- http://mail.python.org/mailman/listinfo/python-list
Re: How to find the beginning of last line of a big text file ?
On Thu, Jan 1, 2009 at 2:19 PM, Barak, Ron wrote: > I have a very big text file: I need to find the place where the last line > begins (namely, the offset of the one-before-the-last '\n' + 1). > Could you suggest a way to do that without getting all the file into memory > (as I said, it's a big file), or heaving to readline() all lines (ditto) ? for line in open(filename): lastline = line print "the lastline is: %s",%lastline This will read all the lines, but line by line, so you will never have the whole file in memory. There may be more eficient ways to do this, like using the itertools. Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Re: IDLE home page?
On Wed, Oct 22, 2008 at 3:49 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: > Depending on the answer you get here, you might send the same observation > and question to [EMAIL PROTECTED] OK, I've just sent it. Thank you. -- http://mail.python.org/mailman/listinfo/python-list
IDLE home page?
If I put IDLE in the search box at python.org, the first hit is: http://www.python.org/idle/ But this page is a directory without any index file: Index of /idle Icon NameLast modified Size Description[DIR] Parent Directory - [ ] Makefile26-Aug-2005 10:30 90 [DIR] doc/26-Aug-2005 10:30- [TXT] links.h 26-Aug-2005 10:30 235 If I see the "ABOUT" windows (under HELP in the IDLE menu), there is also a link to http://www.python.org/idle/ (see here: http://imagebin.ca/view/0OE3jc.html) So the question is: Is there an official page for IDLE or a file is missing? -- http://mail.python.org/mailman/listinfo/python-list
Re: Commercial Products in Python
On Tue, Oct 21, 2008 at 2:50 PM, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > I was just wondering, if you wish to commercialize an application > developed in Python, what's the way to go? You choose the conditions. Nothing in Python license prevents you of selling your work. > I guess the only way is to sell the source, right? No > This is because (and tell me if I am wrong): > 1) You can't sell an executable because Python doesn't compile to native > code (the usual approach, afaik); There are py2exe utilities to compile Python applications. > 2) You can't sell the bytecode, otherwise you get the client stuck with > a specific python version (given bytecode might vary between versions) > (the alternative); Never heard of people selling bytecode, but I guess yes, it is tied to the same version where is was produced. -- Sebastián Bassi. Diplomado en Ciencia y Tecnología. Vendo isla: http://www.genesdigitales.com/isla What's new in Python 3: http://tinyurl.com/5cd89r Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 -- http://mail.python.org/mailman/listinfo/python-list
Re: python for *nix system admins
On Sat, Sep 27, 2008 at 3:32 PM, Eric Wertman <[EMAIL PROTECTED]> wrote: > I've been growing a library of my own functions, that use the names of > unix commands. They are just conveniences, of course, but I'd suggest > the same for sysadmins, it's handy. Can you share it? Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Re: Making small executive file for distribution
On Wed, Sep 24, 2008 at 10:17 AM, Marin Brkic <[EMAIL PROTECTED]> wrote: > As far as I know py2exe is the only option which can do such a thing > (make exe files from scripts). Is there a way to make those exe files > a little smaller (for a small script they easily go up to 5-10 mb). An alternative solution: Give them a copy of "portable python". It is a Python enviroment that can be used by just copying its file in a single directory (to run python from a pendrive for example), with the need to install any program It even work in Linux with wine (but you seldon need that since most modern Linux distros has a uptodate Python setup). See http://www.portablepython.com/ Best, -- Sebastián Bassi. Diplomado en Ciencia y Tecnología. Vendo isla: http://www.genesdigitales.com/isla What's new in Python 3: http://tinyurl.com/5cd89r Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 -- http://mail.python.org/mailman/listinfo/python-list
biopython
On 9/9/08, Beema Shafreen <[EMAIL PROTECTED]> wrote: > I am using Biopython to fetch pumed Id's ,The module i use is (from Bio > import Entrez) > But i am getting this error from Bio import Entrez > Traceback (most recent call last): > File "", line 1, in ? > ImportError: cannot import name Entrez Looks like is bad installed. It works for me: /home/user/MMC-SD/Kingston/py252/bin> ./python2.5 Python 2.5.2 (r252:60911, Jul 7 2008, 16:11:08) [GCC 3.3.5 (Debian 1:3.3.5-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from Bio import Entrez >>> dir(Entrez) ['File', '__builtins__', '__doc__', '__file__', '__name__', '__path__', '_open', 'efetch', 'egquery', 'einfo', 'elink', 'epost', 'esearch', 'espell', 'esummary', 'os', 'query', 'read', 'time', 'urllib'] -- Sebastián Bassi. Diplomado en Ciencia y Tecnología. Vendo isla: http://www.genesdigitales.com/isla What's new in Python 3: http://tinyurl.com/5cd89r Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 -- http://mail.python.org/mailman/listinfo/python-list
Re: Web site for comparing languages syntax
On 2/26/08, Andreas Tawn <[EMAIL PROTECTED]> wrote: > Maybe http://www.rosettacode.org ? That's a wiki. YES!!!. Thank you!! -- Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología. Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Web site for comparing languages syntax
Hello, I know there is one site with wikimedia software installed, that is made for comparing the syntax of several computer languages (Python included). But don't remember the URL. Anyone knows this site? -- Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología. Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
ANN: A Primer on Python for Life Science Researchers
I'm happy to report the release of a PLOS paper: "A Primer on Python for Life Science Researchers". It is a six page education paper introducing Python. If you have a friend that is a researchers in a biological area and you think that he may need to know Python, please send him this e-mail: URL: http://compbiol.plosjournals.org/perlserv/?request=get-document&doi=10.1371/journal.pcbi.0030199 (short URL: http://tinyurl.com/2az5d5) A Primer on Python for Life Science Researchers Bassi S PLoS Computational Biology Vol. 3, No. 11, e199 doi:10.1371/journal.pcbi.0030199 Thanks, -- Sebastián Bassi -- Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología. Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Re: Convert string to command..
On 10/18/07, Adam Atlas <[EMAIL PROTECTED]> wrote: > > Use the builtin function "eval". What is the difference with os.system()? -- Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología. Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Re: Saving parameters between Python applications?
On 9/17/07, Stodge <[EMAIL PROTECTED]> wrote: > Good idea, but I can't guarantee that the two scripts will be run from > the same directory - so where to store the pickle? It doesn't matter if is the same directory or not, as long as both programs has access to the pickle file (one program should have write access and the other program should have at least read access). -- Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología. Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Re: Saving parameters between Python applications?
On 9/16/07, Stodge <[EMAIL PROTECTED]> wrote: > python app1.py --location=c:\test1 > What I want to do is save the location parameter, so I can then do (in > the same window): > python app2.py > And have app2.py automatically have access to the value of "location". Do app1.py to save a pickle of the value you want app2 to read. -- Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología. Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Generating HTML
Hello, What are people using these days to generate HTML? I still use HTMLgen, but I want to know if there are new options. I don't want/need a web-framework a la Zope, just want to produce valid HTML from Python. Best, SB. -- Sebastián Bassi (セバスティアン). Diplomado en Ciencia y Tecnología. Curso Biologia molecular para programadores: http://tinyurl.com/2vv8w6 GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Re: Biased random?
On 8/27/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > Play with your log to get the range you want Here you can get "true" random numbers (not pseudorandom, they claim to use a quatum generaton (?)) by fetching them from: http://random.irb.hr/ They give you a python class t insert into your code, but you need to register to use it (free). I am not affiliated to them in any way, I just used it once to play with it and it worked. Best, -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Re: Python on Computation, Math and Statistics
On 8/19/07, W. Watson <[EMAIL PROTECTED]> wrote: > Google? What's that? Thanks. I like to get a insider's view when I know > experts are out there. So now I ask a deeper question. Are there matrix > computation libraries or even statistical (regression, factor analysis) > libraries? If you are so inclined you can use R functions from Python (look for R and Python in your favorite search engine). -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Re: Combinatorial of elements in Python?
On 8/15/07, Mikael Olofsson <[EMAIL PROTECTED]> wrote: > What is unclear here is in what order the keys should be visited. The > following assumes that the keys should be considered in alphanumeric order. Yes, my fault. The orden should be given by a string, like: DCDBA Using this dictionay. A={'A':['1','2'],'B':['4','5'],'C':['6','7','8'],'D':['9']} Should return: '96941' '97941' '97942' '96942' '98941' '98942' '96951' '97951' '97952' '96952' '98951' '98952' -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Re: Combinatorial of elements in Python?
On 8/15/07, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Oh but it is: > >>> ADictionary={"one":["A","B","C","D"],"two":["H","I"]} > >>> result = set() > >>> for one in ADictionary["one"]: > ... for two in ADictionary["two"]: > ... result.add(one + two) That was easy :) What about extending it for N elements inside the dictionary? Sounds like a work for a recursive function. -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Combinatorial of elements in Python?
I have 2 (or more) groups of elements, and I want to get all possible unique combinations from all of them. Is there a build-in method to do it? ADictionary={"one":["A","B","C","D"],"two":["H","I"]} I want to have all possible combinations from "one" and "two", that is: AH BI CH DI AI BH CI DH Sounds easy, but is not :) -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Re: CSV without first line?
On 7/15/07, John Machin <[EMAIL PROTECTED]> wrote: > So you imagine that there is an undocumented feature? No, I just think that is documented but I am not able to understand it. Reading the list I've learned several things that are not directly inferred from documentation (that is not the same as undocumented feature). -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
Re: Can a low-level programmer learn OOP?
On 7/13/07, Simon Hibbs <[EMAIL PROTECTED]> wrote: > place. At the end of it you'll have a good idea how OOP works, and how > Python works. Learning OOp this way is easy and painless, and what you ... But this tutorial states "I assume you know how object-oriented programming works" -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
CSV without first line?
Hi, In my CSV file, the first line has the name of the variables. So the data I want to parse resides from line 2 up to the end. Here is what I do: import csv lines=csv.reader(open("MYFILE")) lines.next() #this is just to avoid the first line for line in lines: DATA PARSING This works fine. But I don't like to do "lines.next()" just to get rid of the first line. So I wonder if the reader function on the csv module has something that could let me parse the file from the second line (w/o doing that lines.next()). -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D -- http://mail.python.org/mailman/listinfo/python-list
expat parser
I have this code: import xml.parsers.expat def start_element(name, attrs): print 'Start element:', name, attrs def end_element(name): print 'End element:', name def char_data(data): print 'Character data:', repr(data) p = xml.parsers.expat.ParserCreate() p.StartElementHandler = start_element p.EndElementHandler = end_element p.CharacterDataHandler = char_data fh=open("/home/sbassi/bioinfo/smallUniprot.xml","r") p.ParseFile(fh) And I get this on the output: ... Start element: sequence {u'checksum': u'E0C0CC2E1F189B8A', u'length': u'393'} Character data: u'\n' Character data: u'MPKKKPTPIQLNPAPDGSAVNGTSSAETNLEALQKKLEELELDEQQRKRL' Character data: u'\n' Character data: u'EAFLTQKQKVGELKDDDFEKISELGAGNGGVVFKVSHKPSGLVMARKLIH' ... End element: sequence ... Is there a way to have the character data together in one string? I guess it should not be difficult, but I can't do it. Each time the parse reads a line, return a line, and I want to have it in one variable. (the file is here: http://sbassi.googlepages.com/smallUniprot.xml) -- http://mail.python.org/mailman/listinfo/python-list
Removing NS in ElementTree
I would like to remove the namespace information from my elements and have just the tag without this information. This "{http://uniprot.org/uniprot}"; is preapended into all my output. I understand that the solution is related with "_namespace_map" but I don't know much more. >>> for x in eleroot[0]: print x.tag print x.text {http://uniprot.org/uniprot}accession Q9JJE1 {http://uniprot.org/uniprot}organism {http://uniprot.org/uniprot}dbReference None {http://uniprot.org/uniprot}sequence MPKKKPTPIQLNPAPDGSAVNGTSSAETNLEALQKKLEELELDEQQRKRL EAFLTQKQKVGELKDDDFEKISELGAGNGGVVFKVSHKPSGLVMARKLIH LEIKPAIRNQIIRELQVLHECNSPYIVGFYGAFYSDGEISICMEHMDGGS LDQVLKKAGRIPEQILGKVSIAVIKGLTYLREKHKIMHRDVKPSNILV -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D Club de la razón (www.clubdelarazon.org) -- http://mail.python.org/mailman/listinfo/python-list
Re: default config has no md5 module?
On 5/4/07, Leo Jay <[EMAIL PROTECTED]> wrote: > i want to compile a python by myself, but after configure and make, it > seems that md5 is not built by default. > > what should i do to compile md5 as an module? md5 module was deprecated, now it functions are in hashlib. (see http://docs.python.org/lib/module-hashlib.html). So you may not need to compile md5 module at all. -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D Club de la razón (www.clubdelarazon.org) -- http://mail.python.org/mailman/listinfo/python-list
Re: Writing a nice formatted csv file
On 2 May 2007 07:14:04 -0700, redcic <[EMAIL PROTECTED]> wrote: > And i get an out.txt file looking like: > 1,2,3 > 10,20,30 > Whereas what I'd like to get is: > 1,2,3, > 10, 20, 30 > which is more readable. The idea behind csv module is to produce and read csv files that are "machine readable" rather than "human readable", so I think you should write the file "by hand" to take into account those whitespace. -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D Club de la razón (www.clubdelarazon.org) -- http://mail.python.org/mailman/listinfo/python-list
Re: Python CGI and Browser timeout
On 26 Apr 2007 14:48:29 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is there a better solution to avoid browser timeouts? Raising timeout in Apache, by default is 300 seconds. Limiting jobs size (both in the html form and from script size since you should not trust on client validations). -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D Club de la razón (www.clubdelarazon.org) -- http://mail.python.org/mailman/listinfo/python-list
Re: Python CGI and Browser timeout
On 26 Apr 2007 14:48:29 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > In order to work around this problem, I started printing empty strings > (i.e. print "") so that the browser does not timeout. How do you print something while doing the query and waiting for the results? I saw some pages that display something like: "This page will be updated in X seconds to show the results" (X is an estimated time depending of server load), after a JS countdown, it refresh itself and show the result or another "This page will be updated in X seconds to show the results". -- Sebastián Bassi (セバスティアン) Diplomado en Ciencia y Tecnología. GPG Fingerprint: 9470 0980 620D ABFC BE63 A4A4 A3DE C97D 8422 D43D Club de la razón (www.clubdelarazon.org) -- http://mail.python.org/mailman/listinfo/python-list
Re: File DB instead of real database?
On 13 Apr 2007 21:14:36 -0700, Jia Lu <[EMAIL PROTECTED]> wrote: > I donot want to use a real DB like MySQL ... But I need something to > save about more than 1000 articles. > Is there any good ways? SQLite is a good option, as you were told. But what about put them in a dictionary and then cPickle it to disk? (using 2 as optimization setting in cPickle command). -- http://mail.python.org/mailman/listinfo/python-list
Re: Making a tree out of a 2 column list
On 15 Apr 2007 15:44:47 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > But errors and bugs do happen, inside data too; so often it's better > to be on safe side if the safe code is fast enough. Yes, I agree since I've seen lot of errors in data. But this data comes from a taxonomy tree made by the NCBI, that is why I assume the data is right. -- http://mail.python.org/mailman/listinfo/python-list
Re: Making a tree out of a 2 column list
On 4/15/07, Peter Otten <[EMAIL PROTECTED]> wrote: > Depending on your input data you may need to add some cycle detection. > For example, try it with > tree_path(1, {1:[2], 2:[1]}, []) I guess this should make the program enter into a endless loop. But the data won't have such a redundancy, because it was taken from a philogenetic tree. Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Re: Making a tree out of a 2 column list
On 14 Apr 2007 09:32:07 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > def tree_path(key,tree,indent): > print '\t'*indent,key > if tree.has_key(key): > for m in tree[key]: > tree_path(m,tree,indent+1) > return Thank you. It worked!. I changed it a bit to return a list with the results: def tree_path(key,tree,hijos): hijos.append(key) if tree.has_key(key): for m in tree[key]: tree_path(m,tree,hijos) return hijos Then I call it like this: MyList=tree_path(9608,tree,[]) Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Making a tree out of a 2 column list
I have a two column list like: 2,131 6,335 7,6 8,9 10,131 131,99 5,10 And I want to store it in a tree-like structure. So if I request 131, it should return all the child of 131, like 2, 10 and 5 (since 5 is child of 10). If I request 335, it should return: 6 and 7. If I request 9, it should return 8. I guess I could use tuples or dictionaries to do it, but I can't figure out how. Best, SB. -- Sebastián Bassi Diplomado Ciencia y Tecnología. Club de la razón (www.clubdelarazon.org) -- http://mail.python.org/mailman/listinfo/python-list
Re: Python editor/IDE on Linux?
On 4/13/07, Jack <[EMAIL PROTECTED]> wrote: > I wonder what everybody uses for Python editor/IDE on Linux? > I use PyScripter on Windows, which is very good. Not sure if > there's something handy like that on Linux. I need to do some > development work on Linux and the distro I am using is Xubuntu. DrPython is very nice and is already in Ubuntu repos (http://drpython.sourceforge.net/). Eric is also available in Ubuntu (http://www.die-offenbachs.de/detlev/eric.html). -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem installing Python 2.5
On 4/3/07, Jaroslaw Zabiello <[EMAIL PROTECTED]> wrote: > After executing >./configure > you have to edito >Modules/Setup > file and uncomment the following line: > #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz > Then continue with normal make; make install. Thank you. I already did this: make -i altinstall and then: make altinstall And added a comment in bug#1669349 Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Problem installing Python 2.5
I was trying to install Python 2.5 compiling from sources. I used: ./compile It run OK. Then: make altintall After a lot of output, got this: Listing /usr/local/lib/python2.5/xml/sax ... Compiling /usr/local/lib/python2.5/xml/sax/__init__.py ... Compiling /usr/local/lib/python2.5/xml/sax/_exceptions.py ... Compiling /usr/local/lib/python2.5/xml/sax/expatreader.py ... Compiling /usr/local/lib/python2.5/xml/sax/handler.py ... Compiling /usr/local/lib/python2.5/xml/sax/saxutils.py ... Compiling /usr/local/lib/python2.5/xml/sax/xmlreader.py ... Compiling /usr/local/lib/python2.5/xmllib.py ... Compiling /usr/local/lib/python2.5/xmlrpclib.py ... Compiling /usr/local/lib/python2.5/zipfile.py ... make: *** [libinstall] Error 1 It seems I am not the only one with this error: http://www.thescripts.com/forum/thread613458.html http://www.megasolutions.net/python/Python-installation-problem-(sorry-if-this-is-a-dup)-22624.aspx http://ubuntuforums.org/showthread.php?p=1912370 System: Freespire 1.0.13 (based on Debian). -- http://mail.python.org/mailman/listinfo/python-list
Re: Wikipedia and a little piece of Python History
On 21 Mar 2007 12:18:50 -0700, Paddy <[EMAIL PROTECTED]> wrote: > I just had a link to Tim peters first post on doctest: > http://groups.google.com/group/comp.lang.python/msg/1c57cfb7b3772763 AFAIK, Google doesn't offer a permalink to usenet/group post (since a mayor "upgrade" they made some time ago). So this link may change in the future and point to somewhere else. Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Re: How to parse the os.system() output in python
On 3/18/07, bruce peng <[EMAIL PROTECTED]> wrote: > how to redirect the putput of the > program to a file? like this: program_name -parameters > outfile.txt -- http://mail.python.org/mailman/listinfo/python-list
Re: How to parse the os.system() output in python
On 17 Mar 2007 17:28:56 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I use os.system() to execute a system command in python. > Can you please tell me how can I parse (in python) the output of the > os.system() ? Maybe you mean to parse the output of the program you run using os.system. If this is the case, you should redirect the putput of the program to a file (with ">") and then parse that file. Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Re: Box plot in Python
On 3/15/07, Rob Clewley <[EMAIL PROTECTED]> wrote: > Matplotlib supports boxplots in a very straightforward fashion and is > reasonably documented (just google it!) I actually just submitted a > patch for extra boxplot features in matplotlib, which you can find on > the sourceforge patch tracker. OK, I will try it. Thanks! -- http://mail.python.org/mailman/listinfo/python-list
Box plot in Python
Hello, Is there a graphic package for Python that provides support for box plots? (see http://en.wikipedia.org/wiki/Box_plot and http://en.wikipedia.org/wiki/Image:R-speed_of_light_boxplot.png for information on box plots). I have N sets of data, each with X "points". Example: Set 1: Point 1: 0.21 Point 2: 0.92 Point 3: 0.18 Point 4: 0.12 ... cut Point 203: 0.91 then: Set 2: Point 1: 0.11 Point 2: 0.3 Point 3: 0.82 Point 4: 0.11 ... cut Point 191: 0.09 I know that R would do it, but I don't know how to use R and would like to keep on working in Python. Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
Module for SVG?
Hello, I found http://www2.sfk.nl/svg as a Python module for writing SVG. Last update was in 2004 and I am not sure if there is something better. Any recommendation for generating SVG graphics? Best, SB. -- http://mail.python.org/mailman/listinfo/python-list
How to refer to Python?
I am writing a paper where I refer to Python. Is there a paper that I can refer the reader to? Or just use the Python web page as a reference? -- http://mail.python.org/mailman/listinfo/python-list
Re: Timeline for Python?
On 1 Sep 2006 00:57:04 -0700, crystalattice <[EMAIL PROTECTED]> wrote: > I'd write for 2.4, even though 2.5 should be coming out "shortly". > There aren't many significant changes to the whole language between 2.4 > and 2.5. Probably the best thing is write for 2.4 and have a sidenote > stating where 2.5 operates differently. > The Python 3 timeline is almost a moving target right now; personally, > I don't think it will be out before next winter. Maybe a beta but I > doubt the full version. Maybe I forgot to tell, but its going to take me at least 6 month to finish the book, then there is a proofreading stage with the publisher and then the release, so it will take about 1 year (about end of 2007), that is why I am thinking in 2.5 and 3. What do you think about it? -- Bioinformatics news: http://www.bioinformatica.info Lriser: http://www.linspire.com/lraiser_success.php?serial=318 -- http://mail.python.org/mailman/listinfo/python-list
Timeline for Python?
Hello all, I am working on a Python book, since it could be completed in about a year (writing time + edition + publishing) or more, I would like to know what version to target since I don't want to release a book that will be outdated just after is printed. I use 2.4 for everyday work but most webservers still carry 2.2 (and most programs runs w/o any modification, since I don't tend to use new features), but publishers know that people like to buy lasted version books. So, if the book is published in October 2007, should feature Python 3 or Python 2.5? I did read http://www.python.org/dev/peps/pep-3000/ but I still not sure about timeline. Best regards, SB. -- Bioinformatics news: http://www.bioinformatica.info Lriser: http://www.linspire.com/lraiser_success.php?serial=318 -- http://mail.python.org/mailman/listinfo/python-list
Re: Detec nonascii in a string
On 2/23/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > "äöü".decode("ascii") > should do the trick -- you get an UnicodeError when there is anything ascii > can't encode. Thank you. This is good enought for me. Best regards, SB. -- Bioinformatics news: http://www.bioinformatica.info Lriser: http://www.linspire.com/lraiser_success.php?serial=318 -- http://mail.python.org/mailman/listinfo/python-list
Detec nonascii in a string
Hello, How do I detect non-ascii letters in a string? I want to detect the condition that a string have a letter that is not here: string.ascii_letters Best regards, SB. -- Bioinformatics news: http://www.bioinformatica.info Lriser: http://www.linspire.com/lraiser_success.php?serial=318 -- http://mail.python.org/mailman/listinfo/python-list
en la misma linea
Hola, Aca con una pregunta basica: A veces veo que hay programas que tienen varias instrucciones en la misma linea, cuando lo que aprendi de Python era que se usaba el espaciado para mantener la estructura (indent). Por ejemplo: if name != 'comic': return Hay un return despues de los dos puntos, no se que significa. -- Bioinformatics news: http://www.bioinformatica.info Lriser: http://www.linspire.com/lraiser_success.php?serial=318 -- http://mail.python.org/mailman/listinfo/python-list
Re: [Info] PEP 308 accepted - new conditional expressions
On 9/30/05, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > after Guido's pronouncement yesterday, in one of the next versions of Python > there will be a conditional expression with the following syntax: > X if C else Y I don't understand why there is a new expression, if this could be accomplished with: if C: X else: Y What is the advantage with the new expression? -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list
Re: slicing functionality for strings / Python suitability for bioinformatics
On 19 Sep 2005 12:25:16 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >>> rs='AUGCUAGACGUGGAGUAG' > >>> rs[12:15]='GAG' > Traceback (most recent call last): > File "", line 1, in ? > rs[12:15]='GAG' > TypeError: object doesn't support slice assignment You should try Biopython (www.biopython.org). There is a sequence method you could try. -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list
Re: How to store "3D" data? (data structure question)
On 7/20/05, Cyril Bazin <[EMAIL PROTECTED]> wrote: > The question of the type of the data sutructure depends of your use of the > data. > You could avoid some confusion without naming your columns "lines"... Yes, that is because they are "plant lines", that is why is called "lines" :) > Anyway, here is a piece of code that read the file and count the star on > the fly: > (The result is a dict of dict of int.) THANK YOU, I will check it out! -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list
Re: How to store "3D" data? (data structure question)
On 20 Jul 2005 11:51:56 -0700, Graham Fawcett <[EMAIL PROTECTED]> wrote: > You get the idea: model the data in the way that makes it most useable > to you, and/or most efficient (if this is a large data set). I don't think this could be called a large dataset (about 40Kb all the file). It would be an overkill to convert it in MySQL (or any *SQL). I only need to parse it to reformat it. May I send the text file to your email and a sample of the needed output? It seems you understand a lot on this topic and you could do it very easily (I've been all day trying to solve it without success :( I know this is not an usual request, but this would help me a lot and I would learn with your code (I still trying to understand the zip built-in function, that seems useful). -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list
Re: How to store "3D" data? (data structure question)
On 20 Jul 2005 10:47:50 -0700, Graham Fawcett <[EMAIL PROTECTED]> wrote: > # zip is your friend here. It lets you iterate > # across your line names and corresponding values > # in parallel. This zip function is new to me, the only zip I knew was pkzip :). So will read about it. -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list
Re: How to store "3D" data? (data structure question)
On 20 Jul 2005 10:47:50 -0700, Graham Fawcett <[EMAIL PROTECTED]> wrote: > This looks a lot like 2D data (row/column), not 3D. What's the third > axis? It looks, too, that you're not really interested in storage, but > in analysis... I think it as 3D like this: 1st axis: [MARKER]Name, like TDF1, TDF2. 2nd axis: Allele, like 181, 188 and so on. 3rd axis: Line: RHA280, RHA801. I can have a star in MarkerName TDF1, Allele 181 and Line RHA280. I can have an empty (o none) in TDF1, Allele 181 and Line RHA801. What I like to know is what would be a suitable structure to handle this data? thank you very much! -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list
How to store "3D" data? (data structure question)
Hello, I have to parse a text file (was excel, but I translated to CSV) like the one below, and I am not sure how to store it (to manipulate it later). Here is an extract of the data: Name,Allele,RHA280,RHA801,RHA373,RHA377,HA383 TDF1,181, ,188, ,190, ,193,*,*,,, ,None,,,*,*,* ,, TDF2,1200,*,*,,,* ,None,,,*,*, ,, TDF3,236, ,240, ,244,*,,*,,* ,252,*,*,,, ,None*, ,, Should I use lists? Dictionary? Or a combination? The final goal is to "count" how many stars (*) has any "LINE" (a line is RHA280 for instance). RHA280 has 1 star in TDF1 and 1 star in TDF2 and 2 stars in TDF3. I am lost because I do analize the data "line by line" (for Line in FILE) so it is hard to count by column. -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list
Re: python certification
On 16 Jul 2005 09:51:55 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i want to get a small certificate or diploma in python. > it should be online cuz i live in pakistan and wont have teast centers > near me. > it should be low cost as i am not rich. > and hopefully it would be something like a a begginer certification cuz > i am new to python. I could make a program, upload it to sourceforge (or similar OSS repository) and add that to your resume. Another opcion is to help in the development of any python-based program and work enought to be included in the authors list. That could be useful too (because you learn and do some good for more people). I believe more in a working program than a paper based certificate. -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list
Re: Question about HTMLgen
Thanks, you are right! On 6/20/05, Konstantin Veretennicov <[EMAIL PROTECTED]> wrote: > > > type="image/svg+xml" name="wmap" wmode="transparent"> > > Works for me... -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list
Question about HTMLgen
Hello, I am using HTMLgen. It is very nice. But I can't make it to generate an arbitrary command. For example I want to output this: Each time I put "<" it gets escaped from HTML, instead of being inserted inside. -- http://www.spreadfirefox.com/?q=affiliates&id=24672&t=1";>La web sin popups ni spyware: Usa Firefox en lugar de Internet Explorer -- http://mail.python.org/mailman/listinfo/python-list