473,382 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

how to execute Python in VIM

hi,

im a newbie to VIM(gVIM under WINXP), i want to execute python in vim
like press F5 in SciTE.

i try to search in google and config as follows in my _vimrc:
-----------------------------------------------------------
map <f5>:D:\python24\python.exe %

if has("autocmd")
autocmd FileType python setlocal et | setlocal sta | setlocal sw=4
autocmd FileType python compiler pyunit
autocmd FileType python setlocal makeprg=python\ ./alltests.py
autocmd BufNewFile,BufRead test*.py setlocal makeprg=python\ %
endif

----------------------------------------------------------

but neither F5 nor MAKE works.....

who can help me ?

thanks in advance

Jul 18 '05 #1
5 3271
i change the path

autocmd FileType python setlocal makeprg=\"d:\\Python24\\python.exe\"\

autocmd BufNewFile,BufRead test*.py setlocal
makeprg=\"d:\\Python24\\python.exe\"\ %

Jul 18 '05 #2
ok

i find it

map <F12> <Esc>:!d:\python24\python.exe %<CR>
but it comes with a new pop-up windows........dame~

Jul 18 '05 #3
DENG wrote:
ok

i find it

map <F12> <Esc>:!d:\python24\python.exe %<CR>
but it comes with a new pop-up windows........dame~


I'm no windows expert - but maybe pythonw.exe helps here?
--
Regards,

Diez B. Roggisch
Jul 18 '05 #4
> > map <F12> <Esc>:!d:\python24\python.exe %<CR>


but it comes with a new pop-up windows........dame~


I'm no windows expert - but maybe pythonw.exe helps here?


I find that using pythonw.exe and the silent prefix in Vim works best
for me:

map <F5> <Esc>:silent !pythonw.exe %<CR>

Regards,

Aaron

Jul 18 '05 #5
thanks Aaron

i've changed that, but this time, even worse...

when i press F5, the pop-up windows appears, and then, it disppears
very quickly...(less than 1 second)

i cant see anything~ :(

Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sheila King | last post by:
I have searched for an answer to this question on the comp.lang.python archives at Google Groups, and also looked through the (sparse) MySQLdb documentation, and cannot confirm for a FACT what I...
2
by: Tim Williams | last post by:
I'm trying to write a simple python program to access a MySQL database. I'm having a problem with using MySQLdb to get the results of a SQL command in a cursor. Sometimes the cursor.execute works,...
3
by: robert | last post by:
Hello, Anybody knows if it's possible to execute python code from an db. db=MySQLdb.connect(host="localhost",user="r",passwd="j",db="v") c=db.cursor() c.execute("""SELECT * FROM table...
9
by: PyPK | last post by:
Hi if I have a function called tmp=0 def execute(): tmp = tmp+1 return tmp also I have def func1(): execute() ....
17
by: somialis | last post by:
I have a test environment in python. it is executed by the following command on the command prompt. 1) First i have to go to the dir where the .py file is 2) then i simply execute python...
5
by: johnny | last post by:
Anyone know how I can make Machine A python script execute a python script on Machine B ?
3
by: joe jacob | last post by:
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added <Directory...
0
by: David | last post by:
- Are there any peculiarities with using curs.executemany(...) vs. multiple How many times are you calling execute vs a single executemany? The python call overhead will add up for thousands of...
0
by: srinivasan srinivas | last post by:
This is ok. Is there any other way to find it out? Thanks, Srini ----- Original Message ---- From: Gerhard Häring <gh@ghaering.de> To: python-list@python.org Sent: Friday, 20 June, 2008...
7
by: ChaosKCW | last post by:
Hi I am trying to use pymssql, and have an issue where by the execute (not the fetch) is appearing to load all records into memory. if I execute con = pymssql.connect(...) cur =...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.