我正在建立转速请让我知道我哪里出错了,
我的spec文件是rpms.spec,内容是:
Summary: GNU indent
Name: rpms
Version: 1
Release: 1
Source0: %{name}-%{version}.tar.gz
License: GPL
Group: Development/Tools
%description
The GNU indent program reformats C code to any of a variety of
formatting standards, or you can define your own.
%prep
%setup -q
%build
./configure
make
%install
make install
%files
%defattr(-,root,root)
/usr/local/bin/indent
%doc /usr/local/info/indent.info
%doc %attr(0444,root,root) /usr/local/man/man1/indent.1
%doc COPYING AUTHORS README NEWS
Run Code Online (Sandbox Code Playgroud)
我已经将tar文件复制到/ usr/src/redhat/SOURCES /也然后当我执行rpmbuild -ba rpms.spec时出现以下错误
rpmbuild -ba rpms.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.87218
+ umask 022
+ cd /usr/src/redhat/BUILD
+ …Run Code Online (Sandbox Code Playgroud) 如何为textarea添加"Enter textarea"等水印.
<textarea rows = "8" cols = "18" border ="0" class="input" style="border: none;" WRAP id="details" name ="details"></textarea>
Run Code Online (Sandbox Code Playgroud)
谢谢..
如何在使用jquery验证textarea时检查null,空格和换行.如果textarea为空并且只有新行或空格应该发出警报
以下代码用于文件上传有什么问题.request.FILES ['file']看起来是空的
楷模:
from django.db import models
from django import forms
class UploadFileForm(forms.Form):
title = forms.CharField(max_length=50)
file = forms.FileField(label="Your file")
Run Code Online (Sandbox Code Playgroud)
浏览次数:
def index(request):
if request.method == 'POST':
a=request.POST
logging.debug(a["title"])
logging.debug(a["file"])
form = UploadFileForm()
form = UploadFileForm(request.POST, request.FILES)
handle_uploaded_file(request.FILES['file'])
if form.is_valid():
handle_uploaded_file(request.FILES['file'])
return HttpResponseRedirect('/Files/')
else:
form = UploadFileForm()
return render_to_response('Files/index.html', {'form': form})
def handle_uploaded_file(f):
logging.debug("here1")
#destination = open('some/file/name.txt', 'wb+')
destination = open('/tmp', 'wb+')
for chunk in f.chunks():
destination.write(chunk)
destination.close()
Run Code Online (Sandbox Code Playgroud)
模板:
<form name="lang" action="/test/" method="post">
<table>
<tr><td>
<b> {{ form.file.label_tag }}</b> {{ …Run Code Online (Sandbox Code Playgroud) obj = Info(name= sub,question=response_dict["question"])
obj.save()
Run Code Online (Sandbox Code Playgroud)
保存数据后如何更新同一个表的另一个字段
obj.err_flag=1
obj.update()//Will this work
Run Code Online (Sandbox Code Playgroud) opt=[]
opt=["opt3","opt2","opt7","opt6","opt1"]
for i in range(len(opt)):
print opt[i]
Run Code Online (Sandbox Code Playgroud)
上面的输出是
opt3,opt2,opt7,opt6,opt1
Run Code Online (Sandbox Code Playgroud)
如何按升序对上面的数组进行排序
idarr = [1,2,3,4,5]
for i in range(len(idarr)):
upload.objects.filter(idarr[i])
Run Code Online (Sandbox Code Playgroud)
我们不能一次性将idarr传递给查询
如果我有以下数据库字段:id, name, emp_id.
如何在Django中进行查询以name仅使用where子句获取列的值.
谢谢...
在Python中如何实现单属性it.Please以下class.What我基本上是想了解提供了一个例子一类是,如果存在的话类的实例,它应该返回现有实例创建其他的实例那个班
class Test:
name
age
def getobj(self):
return (self.name+self.age)
t= Test()
Run Code Online (Sandbox Code Playgroud) python ×7
django ×5
django-views ×3
css ×1
html ×1
javascript ×1
jquery ×1
linux ×1
rpmbuild ×1
sorting ×1