ch
'因为传递进来的参数,已经去掉了双引号,所以还必须再次为长文件名添加上
cmd$=""
i=0
Do
i=i+1
'Print i;": "; Command(i)
t$=Command(i)
If InStr(t$, " ") Then
If Left$(t$,3) = "-c " Then
cmd$+="-c" + chr$(34)+ Right$(t$, Len(t$)-3) + Chr$(34) + " "
Else
cmd$+=chr$(34)+ t$ + Chr$(34) + " "
End If
Else
cmd$+=t$ + " "
End if
Loop Until Command(i)=""
'print exepath
'print "ROOTSYS = " + exepath
'sleep
setenviron ("CHHOME=" + exepath)
'print "env=", environ( "CHHOME")
'print exepath + "\bin\ch.exe"
exec (exepath + "\bin\ch.exe" , cmd$)
python
ver=22
'因为传递进来的参数,已经去掉了双引号,所以还必须再次为长文件名添加上
cmd$=""
i=0
Do
i=i+1
'Print i;": "; Command(i)
t$=Command(i)
If InStr(t$, " ") Then
If Left$(t$,3) = "-c " Then
cmd$+="-c" + chr$(34)+ Right$(t$, Len(t$)-3) + Chr$(34) + " "
Else
cmd$+=chr$(34)+ t$ + Chr$(34) + " "
End If
Else
cmd$+=t$ + " "
End if
Loop Until Command(i)=""
'Print "cmd$=",cmd$
_ver$=Str$(ver)
PythonHome$=EXEPATH + "\Python" + _ver$
Rem path=D:\Tool\Python23;D:\Tool\Python23\Lib\site-packages\vtk_python;D:\Tool\Python23\Enthought\MingW\bin;%path%
path$=PythonHome$ + ";"
path$+="%path%"
SetEnviron path$
Rem ['', 'D:\\tool\\python23\\python23.zip', 'D:\\tool\\python23\\DLLs', 'D:\\tool\\python23\\lib', D:\\tool\\python23\\lib\\plat-win', 'D:\\tool\\python23\\lib\\lib-tk', 'D:\\tool\\python23', 'D:\\tool\\python23\\lib\\site-packages', 'D:\\tool\\python23\\lib\\site-packages\\Numeric', 'D:\\tool\\python23\\lib\\site-packages\\PIL', 'D:\\tool\\python23\\lib\\site-packages\\dislin', 'D:\\tool\\python23\\lib\\site-packages\\ChartDirector\\lib', 'D:\\tool\\python23\\lib\\site-packages\\win32', 'D:\\tool\\python23\\lib\\site-packages\\win32\\lib', 'D:\\tool\\python23\\lib\\site-packages\\Pythonwin', 'D:\\tool\\python23\\lib\\site-packages\\qt', 'D:\\tool\\python23\\lib\\site-packages\\vtk_python', 'D:\\tool\\python23\\lib\\site-packages\\wx-2.6-msw-unicode']
pythonpath$=";"
pythonpath$+=PythonHome$+"\python"+_ver$+".zip;"
pythonpath$+=PythonHome$+"\DLLs;"
pythonpath$+=PythonHome$+"\lib;"
pythonpath$+=PythonHome$+"\plat-win;"
pythonpath$+=PythonHome$+"\lib-tk;"
pythonpath$+=PythonHome$+";"
pythonpath$+=PythonHome$+"\lib\site-packages;"
'Print PythonHome$+"\lib\site-packages\*.pth"
pthfile$ = dir( PythonHome$+"\lib\site-packages\*.pth", &h01 or &h02 or &h04 or &h20)
'Print "pthfile$=",pthfile$
Do
pthfile$=PythonHome$+"\lib\site-packages\"+pthfile$
'Print "pthfile$=",pthfile$
Open pthfile$ For Input as #1
'Line Input #1, libdir$
libdir$=Trim$(libdir$)
'Print "libdir$=",libdir$
While libdir$<>""
If left$(libdir$,1)<>"#" Then
pythonpath$+=PythonHome$+"\lib\site-packages\"+libdir$+";"
End If
Line Input #1, libdir$
libdir$=Trim$(libdir$)
'Print "libdir$=",libdir$
Wend
pthfile$ = dir( )
Close
Loop While Len( pthfile$ ) > 0
pythonpath$="PYTHONPATH=" + pythonpath$
If Len(pythonpath$)>1 Then
pythonpath$=left$(pythonpath$,Len(pythonpath$)-1)
End If
'Print "pythonpath$=",pythonpath$
SetEnviron pythonpath$
'Print "PYTHONPATH=", Environ( "PYTHONPATH")
'sleep
'Print "launch the true python interpreter"
exec( PythonHome$ + "\python.exe " ,cmd$)
CINT/ROOT
'因为传递进来的参数,已经去掉了双引号,所以还必须再次为长文件名添加上
cmd$=""
i=0
Do
i=i+1
'Print i;": "; Command(i)
t$=Command(i)
If InStr(t$, " ") Then
If Left$(t$,3) = "-c " Then
cmd$+="-c" + chr$(34)+ Right$(t$, Len(t$)-3) + Chr$(34) + " "
Else
cmd$+=chr$(34)+ t$ + Chr$(34) + " "
End If
Else
cmd$+=t$ + " "
End if
Loop Until Command(i)=""
'print exepath
'print "ROOTSYS = " + exepath
'sleep
setenviron ("ROOTSYS=" + exepath)
'print "env=", environ( "ROOTSYS")
'print exepath + "\bin\root.exe"
exec (exepath + "\bin\root.exe" , "-l " + cmd$)
使用tcc编译4th
set CC=tcc
set OBJ4TH=errs_4th.o save_4th.o load_4th.o free_4th.o comp_4th.o name_4th.o dump_4th.o exec_4th.o open_4th.o hgen_4th.o cgen_4th.o
%CC% errs_4th.c -c -o errs_4th.o
%CC% save_4th.c -c -o save_4th.o
%CC% load_4th.c -c -o load_4th.o
%CC% free_4th.c -c -o free_4th.o
%CC% comp_4th.c -c -o comp_4th.o
%CC% name_4th.c -c -o name_4th.o
%CC% dump_4th.c -c -o dump_4th.o
%CC% exec_4th.c -c -o exec_4th.o
%CC% open_4th.c -c -o open_4th.o
%CC% hgen_4th.c -c -o hgen_4th.o
%CC% cgen_4th.c -c -o cgen_4th.o
:4th
%CC% 4th.c %OBJ4TH% -o 4th.exe
goto end
:4thc
%CC% 4thc.c %OBJ4TH% -o 4thc.exe
:4thd
%CC% 4thd.c %OBJ4TH% -o 4thd.exe
:4thx
%CC% 4thx.c %OBJ4TH% -o 4thx.exe
:4thg
%CC% 4thg.c %OBJ4TH% -o 4thg.exe
:end
你可以使用这个链接引用该篇文章 http://publishblog.blogchina.com/blog/tb.b?diaryID=5396621