我用SQLite Date Browse
应用程序创建表...
当我想datetime
从timestamp
列中检索值时,SQLite返回unicod类型...
这是我的插入代码:
def Insert(self,mode,path,vname,stime,ftime):
con = sqlite3.connect(PATH_DataBase) # @UndefinedVariable
con.execute('INSERT INTO SendList VALUES(?,?,?,?,?)',(mode,path,vname,stime,ftime))
con.commit()
con.close()
dt1 = datetime.datetime(2013,01,01,01,01,01,0)
dt2 = datetime.datetime(2015,01,01,01,01,01,0)
c = 0
for f in os.listdir('/home/abbas/test/'):
c += 1
slist.Insert(common.MODE_Bluetooth_JAVA, '/home/abbas/test/'+f,'flower'+str(c) , dt1, dt2)
Run Code Online (Sandbox Code Playgroud)
现在这是我的桌子:
但是当我想starttime
与datetime.now()python 比较时,给我错误:
TypeError: can't compare datetime.datetime to unicode
我想通过bluez API在C中编写程序
我使用这个网站进行教程:
这是我的代码:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
int main(int argc, char **argv)
{
int dev_id = hci_get_route(NULL);
int res_scan=NULL;
int count;
inquiry_info *device_info=NULL;
res_scan = hci_inquiry(dev_id,3,255,NULL,&device_info,IREQ_CACHE_FLUSH);
printf("%i\n",res_scan);
for(count = 0;count < res_scan;count++)
{
char *name;
printf("count Before : %i\n",count);
ba2str(&(device_info+count)->bdaddr,&name);
printf("count After : %i\n",count);
printf("%s\n",&name);
}
}
Run Code Online (Sandbox Code Playgroud)
和控制台:
2
count Before : 0
count After : 1111833143
00:17:EB:5D:1B:86
Run Code Online (Sandbox Code Playgroud)
为什么count
值后ba2str(&(device_info+count)->bdaddr,&name);
获得随机值?
在该来源我链接这个问题不会发生!?
我在项目上工作,包括一个Windows客户端应用程序和ASP网页...
Windows应用程序在网页服务器上执行.Windows客户端和ASP网页在同一台服务器上协同工作,并在同一个共享文件上工作...
我想安全访问这些文件,windows app等待网页完成文件和/或网页上的工作等待windows app完成这些文件的工作..
我EventWaitHandle waithandle=new EventWaitHandle(true, EventResetMode.AutoReset, "SI_handle");
在Windows应用程序和ASP网页中使用
并且在ASP网页和Windows应用程序上使用waithandle.WaitOne();
之前访问文件和waithandle.Set();
完成工作后的文件.
我的问题是Windows应用程序o网页永远等待waithandle.WaitOne();
和应用程序或网页冻结它.
我错了什么?
像这样的窗口或网页代码:
if (File.Exists(xml_path))
{
waithandle.WaitOne();
// work on file
waithandle.Set();
}
Run Code Online (Sandbox Code Playgroud)