Python论坛  - 讨论区

标题:[python-chinese] 关于[Django学习]一步一步学习(十二)的问题

2006年01月17日 星期二 21:31

wu wunc superwunc at gmail.com
Tue Jan 17 21:31:28 HKT 2006

 在 [Django学习]一步一步学习(十二)中有下面代码
      try:
           reader=csv.reader(buf)
        except:
           return render_to_response('error',{'message':'文件格式应该是csv'})
这段代码遇到非csv格式的文件,好象并没有抛异常,像下面这么写也可以吧
        filetype=file_obj['content-type']
        if filetype!='application/vnd.ms-excel':
           return render_to_response('error',{'message':'文件格式应该是csv'})
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060117/7701781a/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年01月17日 星期二 21:34

xinguoyao lixg at zoomtech.com.cn
Tue Jan 17 21:34:24 HKT 2006

Yaou:
	谢谢你帮我解决问题。:)
	在我的系统中有两个libstdc++.so.5.0库,如下:
		/usr/local/lib/sparcv9/libstdc++.so.5
		/usr/local/lib/libstdc++.so.5
	我在python的源文件目录,按照你教的方法ln -s /usr/local/lib/libstdc++.so.5 libstdc++.so.5.
	之后又make install,还是报同样的错误。
	有没有什么好的建议?
																拜上
																姚新果
																

>貌似你的libstdc++.so.5找不到了
>
>去/usr/lib 下面找找 有没有 libstdc++.so.5.0.X 之类的文件 如果有的话就
>ln -s 到libstdc++.so.5
>没有的话就安装一个libstdc++5吧
>
>Yaou
>
>
>xinguoyao wrote:
>
>>I try to install python2.4.2 on solaris.
>>After "./configure" "make" everything is ok.
>>When i try to "make install",an error accured!
>>---------------------------------------------------------------------------------------------
>>PYTHONPATH=/usr/local/lib/python2.4 ./python -Wi -tt /usr/local/lib/python2.4/compileall.py -d /usr/local/lib/python2.4 -f -x 'badsyntax|site-packages' /usr/local/lib/python2.4
>>ld.so.1: python: fatal: libstdc++.so.5: open failed: No such file or directory
>>*** Error code 137
>>make: Fatal error: Command failed for target `libinstall'
>>---------------------------------------------------------------------------------------------
>>Why?
>>What should I do?
>>3ks!
>>
>>
>>_______________________________________________
>>python-chinese
>>Post: send python-chinese at lists.python.cn
>>Subscribe: send subscribe to python-chinese-request at lists.python.cn
>>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>>Detail Info: http://python.cn/mailman/listinfo/python-chinese
>>
>>  
>>
>_______________________________________________
>python-chinese
>Post: send python-chinese at lists.python.cn
>Subscribe: send subscribe to python-chinese-request at lists.python.cn
>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>Detail Info: http://python.cn/mailman/listinfo/python-chinese

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年01月17日 星期二 21:36

limodou limodou at gmail.com
Tue Jan 17 21:36:03 HKT 2006

在 06-1-17,wu wunc<superwunc at gmail.com> 写道:
>  在 [Django学习]一步一步学习(十二)中有下面代码
>       try:
>            reader=csv.reader(buf)
>         except:
>            return
> render_to_response('error',{'message':'文件格式应该是csv'})
> 这段代码遇到非csv格式的文件,好象并没有抛异常,像下面这么写也可以吧

csv一般是以逗号分隔的文本文件,如果上传两进制文件就会出错,我是因为误传了sqlite3的数据库文件出错才加上的。

>         filetype=file_obj['content-type']
>         if filetype!='application/vnd.ms-excel':
>            return
> render_to_response('error',{'message':'文件格式应该是csv'})
>

Excel可以打开csv,但csv并不是Excel所专有的数据格式。这样的结果只能是在windows下使用了。不过我没有试过,不是很清楚。

--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年01月17日 星期二 22:21

Yaou Lee yaoulee at gmail.com
Tue Jan 17 22:21:58 HKT 2006

Hi

有这个库居然还有问题 :(

试试在环境中添加变量LD_RUN_PATH 为你的/usr/local/lib/

ps,你的是什么linux ,如果是rh,configure的时候要

./configure --enable-unicode=ucs4

Good Luck

Yaou

xinguoyao wrote:

>Yaou:
>	谢谢你帮我解决问题。:)
>	在我的系统中有两个libstdc++.so.5.0库,如下:
>		/usr/local/lib/sparcv9/libstdc++.so.5
>		/usr/local/lib/libstdc++.so.5
>	我在python的源文件目录,按照你教的方法ln -s /usr/local/lib/libstdc++.so.5 libstdc++.so.5.
>	之后又make install,还是报同样的错误。
>	有没有什么好的建议?
>																拜上
>																姚新果
>																
>
>  
>
>>貌似你的libstdc++.so.5找不到了
>>
>>去/usr/lib 下面找找 有没有 libstdc++.so.5.0.X 之类的文件 如果有的话就
>>ln -s 到libstdc++.so.5
>>没有的话就安装一个libstdc++5吧
>>
>>Yaou
>>
>>
>>xinguoyao wrote:
>>
>>    
>>
>>>I try to install python2.4.2 on solaris.
>>>After "./configure" "make" everything is ok.
>>>When i try to "make install",an error accured!
>>>---------------------------------------------------------------------------------------------
>>>PYTHONPATH=/usr/local/lib/python2.4 ./python -Wi -tt /usr/local/lib/python2.4/compileall.py -d /usr/local/lib/python2.4 -f -x 'badsyntax|site-packages' /usr/local/lib/python2.4
>>>ld.so.1: python: fatal: libstdc++.so.5: open failed: No such file or directory
>>>*** Error code 137
>>>make: Fatal error: Command failed for target `libinstall'
>>>---------------------------------------------------------------------------------------------
>>>Why?
>>>What should I do?
>>>3ks!
>>>
>>>
>>>_______________________________________________
>>>python-chinese
>>>Post: send python-chinese at lists.python.cn
>>>Subscribe: send subscribe to python-chinese-request at lists.python.cn
>>>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>>>Detail Info: http://python.cn/mailman/listinfo/python-chinese
>>>
>>> 
>>>
>>>      
>>>
>>_______________________________________________
>>python-chinese
>>Post: send python-chinese at lists.python.cn
>>Subscribe: send subscribe to python-chinese-request at lists.python.cn
>>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>>Detail Info: http://python.cn/mailman/listinfo/python-chinese
>>    
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>python-chinese
>>Post: send python-chinese at lists.python.cn
>>Subscribe: send subscribe to python-chinese-request at lists.python.cn
>>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>>Detail Info: http://python.cn/mailman/listinfo/python-chinese
>>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年01月17日 星期二 23:19

hoxide Ma hoxide at gmail.com
Tue Jan 17 23:19:45 HKT 2006

solaris
没自带的python啊?
ld的问题~~


在 06-1-17,Yaou Lee<yaoulee at gmail.com> 写道:
> Hi
>
> 有这个库居然还有问题 :(
>
> 试试在环境中添加变量LD_RUN_PATH 为你的/usr/local/lib/
>
> ps,你的是什么linux ,如果是rh,configure的时候要
>
> ./configure --enable-unicode=ucs4
>
> Good Luck
>
> Yaou
>
> xinguoyao wrote:
>
> >Yaou:
> >       谢谢你帮我解决问题。:)
> >       在我的系统中有两个libstdc++.so.5.0库,如下:
> >               /usr/local/lib/sparcv9/libstdc++.so.5
> >               /usr/local/lib/libstdc++.so.5
> >       我在python的源文件目录,按照你教的方法ln -s /usr/local/lib/libstdc++.so.5 libstdc++.so.5.
> >       之后又make install,还是报同样的错误。
> >       有没有什么好的建议?
> >                                                                                                                               拜上
> >                                                                                                                               姚新果
> >
> >
> >
> >
> >>貌似你的libstdc++.so.5找不到了
> >>
> >>去/usr/lib 下面找找 有没有 libstdc++.so.5.0.X 之类的文件 如果有的话就
> >>ln -s 到libstdc++.so.5
> >>没有的话就安装一个libstdc++5吧
> >>
> >>Yaou
> >>
> >>
> >>xinguoyao wrote:
> >>
> >>
> >>
> >>>I try to install python2.4.2 on solaris.
> >>>After "./configure" "make" everything is ok.
> >>>When i try to "make install",an error accured!
> >>>---------------------------------------------------------------------------------------------
> >>>PYTHONPATH=/usr/local/lib/python2.4 ./python -Wi -tt /usr/local/lib/python2.4/compileall.py -d /usr/local/lib/python2.4 -f -x 'badsyntax|site-packages' /usr/local/lib/python2.4
> >>>ld.so.1: python: fatal: libstdc++.so.5: open failed: No such file or directory
> >>>*** Error code 137
> >>>make: Fatal error: Command failed for target `libinstall'
> >>>---------------------------------------------------------------------------------------------
> >>>Why?
> >>>What should I do?
> >>>3ks!
> >>>
> >>>
> >>>_______________________________________________
> >>>python-chinese
> >>>Post: send python-chinese at lists.python.cn
> >>>Subscribe: send subscribe to python-chinese-request at lists.python.cn
> >>>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> >>>Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >>>
> >>>
> >>>
> >>>
> >>>
> >>_______________________________________________
> >>python-chinese
> >>Post: send python-chinese at lists.python.cn
> >>Subscribe: send subscribe to python-chinese-request at lists.python.cn
> >>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> >>Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >>
> >>
> >>------------------------------------------------------------------------
> >>
> >>_______________________________________________
> >>python-chinese
> >>Post: send python-chinese at lists.python.cn
> >>Subscribe: send subscribe to python-chinese-request at lists.python.cn
> >>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> >>Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>


--
==========================================================

A student of Math in Soochow University in China.
Intrested in Math, Python, Octave, Lisp, Maxima, Prolog and .NET/MONO.

Blog: http://blog.sina.com.cn/blog/1142604745
Wiki: http://wiki.woodpecker.org.cn/moin/Hoxide

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年01月18日 星期三 18:54

shhgs shhgs.efhilt at gmail.com
Wed Jan 18 18:54:17 HKT 2006

install的时候要root权限


On 1/17/06, hoxide Ma <hoxide at gmail.com> wrote:
> solaris
> 没自带的python啊?
> ld的问题~~
>
>
> 在 06-1-17,Yaou Lee<yaoulee at gmail.com> 写道:
> > Hi
> >
> > 有这个库居然还有问题 :(
> >
> > 试试在环境中添加变量LD_RUN_PATH 为你的/usr/local/lib/
> >
> > ps,你的是什么linux ,如果是rh,configure的时候要
> >
> > ./configure --enable-unicode=ucs4
> >
> > Good Luck
> >
> > Yaou
> >
> > xinguoyao wrote:
> >
> > >Yaou:
> > >       谢谢你帮我解决问题。:)
> > >       在我的系统中有两个libstdc++.so.5.0库,如下:
> > >               /usr/local/lib/sparcv9/libstdc++.so.5
> > >               /usr/local/lib/libstdc++.so.5
> > >       我在python的源文件目录,按照你教的方法ln -s /usr/local/lib/libstdc++.so.5 libstdc++.so.5.
> > >       之后又make install,还是报同样的错误。
> > >       有没有什么好的建议?
> > >                                                                                                                               拜上
> > >                                                                                                                               姚新果
> > >
> > >
> > >
> > >
> > >>貌似你的libstdc++.so.5找不到了
> > >>
> > >>去/usr/lib 下面找找 有没有 libstdc++.so.5.0.X 之类的文件 如果有的话就
> > >>ln -s 到libstdc++.so.5
> > >>没有的话就安装一个libstdc++5吧
> > >>
> > >>Yaou
> > >>
> > >>
> > >>xinguoyao wrote:
> > >>
> > >>
> > >>
> > >>>I try to install python2.4.2 on solaris.
> > >>>After "./configure" "make" everything is ok.
> > >>>When i try to "make install",an error accured!
> > >>>---------------------------------------------------------------------------------------------
> > >>>PYTHONPATH=/usr/local/lib/python2.4 ./python -Wi -tt /usr/local/lib/python2.4/compileall.py -d /usr/local/lib/python2.4 -f -x 'badsyntax|site-packages' /usr/local/lib/python2.4
> > >>>ld.so.1: python: fatal: libstdc++.so.5: open failed: No such file or directory
> > >>>*** Error code 137
> > >>>make: Fatal error: Command failed for target `libinstall'
> > >>>---------------------------------------------------------------------------------------------
> > >>>Why?
> > >>>What should I do?
> > >>>3ks!
> > >>>
> > >>>
> > >>>_______________________________________________
> > >>>python-chinese
> > >>>Post: send python-chinese at lists.python.cn
> > >>>Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > >>>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > >>>Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>_______________________________________________
> > >>python-chinese
> > >>Post: send python-chinese at lists.python.cn
> > >>Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > >>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > >>Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >>
> > >>
> > >>------------------------------------------------------------------------
> > >>
> > >>_______________________________________________
> > >>python-chinese
> > >>Post: send python-chinese at lists.python.cn
> > >>Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > >>Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > >>Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >>
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> --
> ==========================================================
>
> A student of Math in Soochow University in China.
> Intrested in Math, Python, Octave, Lisp, Maxima, Prolog and .NET/MONO.
>
> Blog: http://blog.sina.com.cn/blog/1142604745
> Wiki: http://wiki.woodpecker.org.cn/moin/Hoxide
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年01月24日 星期二 00:38

Liu Jun gz19990909 at 163.com
Tue Jan 24 00:38:05 HKT 2006

我觉得应该是在/usr/lib目录下建立一个link到/usr/local/lib/libstdc++.so.5去。
再试时看?

xinguoyao 写道:
> Yaou:
> 	谢谢你帮我解决问题。:)
> 	在我的系统中有两个libstdc++.so.5.0库,如下:
> 		/usr/local/lib/sparcv9/libstdc++.so.5
> 		/usr/local/lib/libstdc++.so.5
> 	我在python的源文件目录,按照你教的方法ln -s /usr/local/lib/libstdc++.so.5 libstdc++.so.5.
> 	之后又make install,还是报同样的错误。
> 	有没有什么好的建议?
> 																拜上
> 																姚新果
> 																
>
>   
>> 貌似你的libstdc++.so.5找不到了
>>
>> 去/usr/lib 下面找找 有没有 libstdc++.so.5.0.X 之类的文件 如果有的话就
>> ln -s 到libstdc++.so.5
>> 没有的话就安装一个libstdc++5吧
>>
>> Yaou
>>
>>
>> xinguoyao wrote:
>>
>>     
>>> I try to install python2.4.2 on solaris.
>>> After "./configure" "make" everything is ok.
>>> When i try to "make install",an error accured!
>>> ---------------------------------------------------------------------------------------------
>>> PYTHONPATH=/usr/local/lib/python2.4 ./python -Wi -tt /usr/local/lib/python2.4/compileall.py -d /usr/local/lib/python2.4 -f -x 'badsyntax|site-packages' /usr/local/lib/python2.4
>>> ld.so.1: python: fatal: libstdc++.so.5: open failed: No such file or directory
>>> *** Error code 137
>>> make: Fatal error: Command failed for target `libinstall'
>>> ---------------------------------------------------------------------------------------------
>>> Why?
>>> What should I do?
>>> 3ks!
>>>
>>>
>>> _______________________________________________
>>> python-chinese
>>> Post: send python-chinese at lists.python.cn
>>> Subscribe: send subscribe to python-chinese-request at lists.python.cn
>>> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>>> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>>>
>>>  
>>>
>>>       
>> _______________________________________________
>> python-chinese
>> Post: send python-chinese at lists.python.cn
>> Subscribe: send subscribe to python-chinese-request at lists.python.cn
>> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>>     
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> python-chinese
>> Post: send python-chinese at lists.python.cn
>> Subscribe: send subscribe to python-chinese-request at lists.python.cn
>> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
>> Detail Info: http://python.cn/mailman/listinfo/python-chinese



[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号