Re: New to Vim and Vim-Python
On Oct 24, 12:25 pm, Daniel Folkes <[EMAIL PROTECTED]> wrote: > I am new to using Vim's scripts. > > I was wondering if anyone uses Vim-Python and how to use it? This > includes things like key bindings and such. > > Thanks in advance, > Daniel Folkes > [EMAIL PROTECTED] I'm not exactly sure what you are talking about. Do you mean writing Vim scripts in Python? I googled, Vim-Python and found a presentation about it. http://www.tummy.com/Community/Presentations/vimpython-20070225/vim.html Or do you mean writing Python with Vim? There's this blog entry about it. http://www.petersblog.org/node/461 I enjoy writing python with Vim. The omni-complete works pretty well. The TagList plug-in is pretty helpful: http://www.vim.org/scripts/script.php?script_id=273 Mini-buffer explorer is a good plug-in too: http://www.vim.org/scripts/script.php?script_id=159 SnippetsEmu is useful when I remember to trigger it for function defs and class defs. http://www.vim.org/scripts/script.php?script_id=1318 I also mapped a key to run the existing buffer through Pyflakes. map :new r!c:/Python25/python c:/Python25/scripts/ pyflakes # You could use your favorite syntax checker like Pychecker or Pylint instead of Pyflakes. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is PEP-8 a Code or More of a Guideline?
On May 30, 12:36 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "Maric Michaud" <[EMAIL PROTECTED]> wrote: > > Typist is fine, although MCP that I am, I tend to think of > typist as female... > - Hendrik What does being a Microsoft Certified Professional(MCP) have to do with thinking of a typist as female? =) -- http://mail.python.org/mailman/listinfo/python-list
Re: Python & Oracle
On Mar 14, 12:01 pm, Facundo Batista <[EMAIL PROTECTED]> wrote: > Hi! I need to connect to Oracle. > > I found this binding, > > http://www.zope.org/Members/matt/dco2 > > that is the recommended in the Python page. > > But that page seems a bit confuse to me. In the upper right corner says > that the last release is PreRelease 1, from 2001-11-15. > > At the bottom, however, it says that 1.3 beta was released 2003-02-10, > and is a development version (the last stable is 1.2, from 2002-10-02), > four and a half years ago. > > The question is: is this connector the recommended one? it's aged > because it's stable and no more changes are necessary, or it just dead? > Works Ok? > > Thank you!! Regards, > > -- > . Facundo > . > Blog:http://www.taniquetil.com.ar/plog/ > PyAr:http://www.python.org/ar/ If that doesn't work for you, try cx_oracle. -- http://mail.python.org/mailman/listinfo/python-list
Re: Are Python's reserved words reserved in places they dont need to be?
Paul Rubin wrote: > Antoon Pardon <[EMAIL PROTECTED]> writes: > > This is just an idea of mine, nothing I expect python to adapt. > > But just suppose the language allowed for words in bold. A word > > in bold would be considered a reserved word, a word in non bold > > would be an identifier. > > Heh, sounds like ColorForth, in which words meant different things > depending on what color they were written in (www.colorforth.com). > Madness, if you ask me ;-). Yikes! I'm color blind! (I've heard that 10% of the male population is color blind.) I'd be a very poor ColorForth programmer. =) -- http://mail.python.org/mailman/listinfo/python-list
Re: Python IDE for linux
Neil Isaac wrote: > I have been writing python my little python scripts in gedit and running them > using the command line. At this point I'm thinking that I would like to start > using a real IDE. I don't need anything special or fancy, but would like it > to manage projects, etc... > > I do know about kdevelop and emacs/vi(m)/nano/pico, but I use gnome most of > the time and would rather (but not require) that the ide use anything other > than qt. Aside from just IDEs, I would love to hear about > eclipse/jedit/(anjuta?) plugins. > I haven't done anything with it, but doesn't ERIC3 use qt? You might also take a look at Activestate's Komodo. -- http://mail.python.org/mailman/listinfo/python-list
Re: New python.org website
Oops...it is live. Cool! -- http://mail.python.org/mailman/listinfo/python-list
Re: New python.org website
I think the new site is great. I really don't understand all the nit picking that's going on from the armchair web designers. The new site is clean and professional. It needs to go live soon! -- http://mail.python.org/mailman/listinfo/python-list
templates
For some of the web programming I've done in Python, I've used htmltmpl. I had some experience with it in Perl, and found a Python version. http://htmltmpl.sourceforge.net/ I like that there's nearly a complete separation between the presentation and the code. This is great when one person is designing the pages and another is writing the code to drive those pages. However, that's usually not the case for me. I'm usually doing both, and I'm thinking there's got to be something possibly better out there. I'm curious about other templating systems. I wouldn't be opposed to a little bit of code in the template. I just don't want to go to the other extreme of something like PHP or ASP. i.e. all code in the template. What web templating systems do you use and why? Mike (Note: I posted this on the tutor mailing list week, but I didn't get any replies, so I thought I'd try here.) -- http://mail.python.org/mailman/listinfo/python-list
Re: New Python.org website ?
Steve Holden wrote: > http://beta.python.org > Looks great! Looking forward to the day when it goes live. Note: The pics don't bother me. -- http://mail.python.org/mailman/listinfo/python-list
Re: Tutorials for Python + PostgreSQL
Michele Simionato wrote: > Steve: > > I want to learn more about enterprise-level programming using Python > > and PostgreSQL. From what I've searched, it seems that psycho is > > interesting to improve runtime too. Do you have tutorials, articles and > > tips to learn this combination? I've been working with PostgreSQL for 2 > > years, and with Python for 6 months. > > Thank you, > > Since Psyco is meant to speedup Python code, whereas the psycopg > adapter is > C-coded, I strongly doubt you will get any improvement from the > combination. > > Michele Simionato I think he's referring to psycopg, a python postgre database adapter http://initd.org/projects/psycopg1 -- http://mail.python.org/mailman/listinfo/python-list
Re: I Need Motivation Part 2
[EMAIL PROTECTED] wrote: > i m losing my motivation with python because there are sooo many > modules If you think Python has too many modules, then you better stay away from Perl and CPAN. =) -- http://mail.python.org/mailman/listinfo/python-list
Re: Book "Python and Tkinter Programming"
striker wrote: > Does anyone who has this book willing to sell it. Please e-mail me the > condition and any other details if you are interested. > Thanks, > Kevin half.com has a couple of people selling it. One for $35.24 and another for $129.97. -- http://mail.python.org/mailman/listinfo/python-list
Re: ssh or other python editor
[EMAIL PROTECTED] wrote: > H! > > I'm using a windows machine. > And a FreeBSD server where I run my python scripts. > > I'm working/making my python scripts in a windows OS with putty now. > But I really want the python text colors and tab spacing like the > python windows IDE but the problem is that I can't find a good program. > > Thanks So you're using Putty to telenet/ssh into the FreeBSD server, but what editor on you using on the FreeBSD server? I use VIM on my Windows workstation to edit files on a linux server. I have a network drive mounted to the linux server. Samba needs to be running on the server. If the FreeBSD server has samba running, you can mount a drive and use your Python Windows IDE. If samba isn't available/set-up, you can try using FTP. You can then use Crimson Editor which does the syntax coloring and can ftp to/from a server. -- http://mail.python.org/mailman/listinfo/python-list
Re: pain
"a manager telling me what tools to use to do my job is a bad manager by definition because he should realize that the people who best know what tools to use are the peope who use the tools*." I'm sorry, this doesn't make much sense to me. In an ideal world where all developers are all knowing and know every language inside and out, then allowing each developer to choose his tools(languages) would work. You don't see a problem with programmer Joe using Perl, Brad using Python, Carl uses Smalltalk, Nate uses Java, Steve using Ruby, and Ed using Haskell? "* Did you know that most good chef cooks have their own knive set? And what do you think is the reason a restaurant manager don't tell them to use the company in-house Amefa blades instead of his global knives? " This is a very poor analogy. The next chef doesn't have to re-cook what the previous chef has done(well, that didn't work either)...er...This has nothing to do with programming. The manager may have his reasons for choosing the tools. Perhaps nearly all projects that have been developed and are in development are using paticular tools. It's easy for team members to work on any project.(I'm speaking more of languages and frameworks not down to the editors and IDEs.) It would be nice if the team could decide on tools, and sometimes that's appropriate. Maybe they want to migrate to a new language or framework. Maybe there's a throw away project that could be a test for the new language or framework. If you want to try a new/different language, you need to show the benefit other than "it's cool/new". -- http://mail.python.org/mailman/listinfo/python-list
Re: Python IDE's
The thing that nudged me into trying VIM was the book, The Pragmatic Programmer. It mentioned Emacs and VIM and the value of learning a powerful editor and sticking with it. I had tried Emacs three times long ago, and it didn't click with me. I decided to try VIM, and it made a lot more sense to me. Yep, there's a steep learning curve. I learned a lot of the basic command in a day or so, then gradually learned more and more. I'm always finding something new about it. There's tons of scripts, plug-ins, and tips at the vim.org site. A couple of important things to me are: Cross platform: I work with Windows, Linux, VMS, and Mac Works with mulitple languages: I write Python, Perl, XHTML/HTML, CSS, Javascript, SQL, COBOL, DCL, and occasionally VBScript. I will point out that both Emacs and VIM do their best to keep your hands on the keyboard which supposedly keeps you more productive since you don't have to waste time grabbing the mouse to perform many tasks. That philosophy is alien to many people and does take some getting used to. I think both of these editors have their roots in the pre-mouse days. http://brianray.chipy.org//Python/pythonandvim.html has a blog about VIM with Python built in. You can script VIM with Python. http://www.vim.org/scripts/script.php?script_id=910 is a script that allows you to use PyDoc from within VIM, so you can look up documentation on modules while coding. http://www.vim.org/scripts/script.php?script_id=850 pydiction is a special dictionary file of Python modules for use with vim's completion feature. http://www.vim.org/scripts/script.php?script_id=127 is a plug in for running Python scripts from within VIM. http://www.vim.org/scripts/script.php?script_id=1096 allows you to run PyChecker from within VIM. Code folding, auto indentation, syntax highlighting are standard features in VIM. Anyway, it's worth checking out VIM. If it doesn't click with you, look at Emacs. I'd imagine that it has as many plug-ins/scripts for Python as VIM. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python IDE's
VIM or Emacs. I use VIM on Windows, Mac, and VMS. I'd consider it more of an editor than an IDE, but there are many IDE features available with plug ins. -- http://mail.python.org/mailman/listinfo/python-list
Re: On fighting fire with fire...
but..but...It's so much more fun to unleash your anger and fire back with all guns blazing fanning the flame war that most discussion groups degenerate into after a couple of responses. =) Actually, I had some self restraint yesterday. I wanted to write a ripping response to an antagonistic flame bait message on another group. I wrote it, decided it wouldn't help much, and deleted it. I guess I got it out of my system by just writing it. We need more people like you in many discussion groups. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python IDE
You should probably stick with Xemacs. I use VIM, but I would be surprised if Xemacs doesn't have those features you want. Also, it's probably better to learn one editor well than a little bit of a bunch of different editors. -- http://mail.python.org/mailman/listinfo/python-list
Re: Modules for inclusion in standard library?
I'll 2nd the vote for Pychecker. -- http://mail.python.org/mailman/listinfo/python-list
Re: Getting binary data out of a postgre database
whew! tempFile.write(str(rec[0])) works! printing rec[0].__class__ puts out pyPgSQL.PgSQL.PgBytea Thanks for the help! -- http://mail.python.org/mailman/listinfo/python-list
Re: Getting binary data out of a postgre database
Sorry for the late reply. I didn't check the group/list over the weekend. Anyway, I added a print rec[0] just after the fetchone. Then I ran it from the command line, and it spewed a bunch of binary gibberish nearly locking up Putty. To me, it seems like it's coming out in the right format, but I'm not sure what I'm doing wrong. If you have any ideas, I'd really appreciate it. Thanks, Mike -- http://mail.python.org/mailman/listinfo/python-list
Getting binary data out of a postgre database
Well, I've managed to get an image into a postgre database, but now I'm having trouble getting it out. #! /usr/bin/env python from pyPgSQL import PgSQL def main(): connectdb = PgSQL.connect('server:port:database:username:password') cur = connectdb.cursor() sqlStatement = """SELECT image from images where image_id = 1""" cur.execute(sqlStatement) rec = cur.fetchone() # TODO make temp file name include image_id. # TODO use tempfile module # TODO clean up old temp files tempFileName = "1.jpg" tempFile = open(tempFileName, "w") tempFile.write(rec[0]) tempFile.close() cur.close() print "Content-type: text/html\n\n" print http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml";> """ if __name__ == '__main__': main() Traceback (most recent call last): File "./dispimage.py", line 39, in ? main() File "./dispimage.py", line 16, in main tempFile.write(rec[0]) TypeError: argument 1 must be string or read-only character buffer, not instance So, rec[0] is an instance, but an instance of what? Since I needed to use the PgSQL.PgBytea method on the image before inserting it into the database, do I need to use a similar method to undo what PgBytea did to it, or am I incorrectly writing this binary data? I tried PgSQL.PgUnQuoteBytea(rec[0]), but that didn't work. Can anyone show me the TypeError of my ways? Is there a good example somewhere that shows getting binary data out of a database? Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: Grouping code by indentation - feature or ******?
Tim Tyler wrote: > What do you guys think about Python's grouping of code via indentation? > > Is it good - perhaps because it saves space and eliminates keypresses? > > Or is it bad - perhaps because it makes program flow dependent on > invisible, and unpronouncable characters - and results in more > manual alignment issues by preventing code formatters from managing > indentation? > > Python is certainly pretty unorthodox in this area. > > How would you have dealt with the issue of how to group statements? > -- > __ > |im |yler http://timtyler.org/ [EMAIL PROTECTED] Remove lock to reply. You might read Eric Raymond's Why Python? article [http://www.linuxjournal.com/article/3882] I would agree with him in that it just seems natural. -- http://mail.python.org/mailman/listinfo/python-list
lies about OOP
I know this might not be the correct group to post this, but I thought I'd start here. A co-worker considers himself "old school" in that he hasn't seen the light of OOP.(It might be because he's in love with Perl...but that's another story.) He thinks that OOP has more overhead and is slower than programs written the procedural way. I poked around google, but I don't know the magic words to put in to prove or disprove his assertion. Can anyone point me toward some resources? We do web programming. I suspect that OO apps would behave as good as procedural apps, and you'd get the benefit of code reuse if you do it properly. Code reuse now consists of cutting and pasting followed by enough modification that I wonder if it was worth it to cut and paste in the first place. Thanks. -- http://mail.python.org/mailman/listinfo/python-list