当我尝试在Fedora 14中的Python 2.6下安装MySQL-python-1.2.3时,我收到以下错误.
默认情况下Fedora 14附带Python 2.7,我正在使用Python 2.6运行的项目,所以我无法将Python从2.6升级到2.7.
_mysql.c:35:23: fatal error: my_config.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
完整的错误消息如下
[root@localhost MySQL-python-1.2.2]# python setup.py build
running build
running build_py
creating build
creating build/lib.linux-i686-2.6
copying _mysql_exceptions.py -> build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-i686-2.6/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-i686-2.6/MySQLdb
creating build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.6/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.6/MySQLdb/constants …Run Code Online (Sandbox Code Playgroud) 我在使用mod_wsgi部署应用程序时收到以下错误
[Thu Apr 07 11:23:32 2011] [error] [client localhost] IOError: [Errno 13] Permission denied: '/var/www/vhosts/myproject/myproject.log'
Run Code Online (Sandbox Code Playgroud) 如何在objective-c中序列化以下类,以便它可以与SBJson一起使用?
当我使用此代码时,我得到"动物不支持JSON序列化"错误.
有人能指出我哪里错了吗?
Animal.h文件的内容如下
#import <UIKit/UIKit.h>
@interface Animal : NSObject<NSCoding> {
NSString *name;
NSString *description;
NSString *imageURL;
}
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *description;
@property (nonatomic, retain) NSString *imageURL;
-(id)initWithName:(NSString *)n description:(NSString *)d url:(NSString *)u;
@end
Run Code Online (Sandbox Code Playgroud)
Animal.m文件的内容如下
#import "Animal.h"
@implementation Animal
@synthesize name, description, imageURL;
-(id)initWithName:(NSString *)n description:(NSString *)d url:(NSString *)u {
self.name = n;
self.description = d;
self.imageURL = u;
return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder
{
if(self = [super initWithCoder:aDecoder])
{
name = [[aDecoder …Run Code Online (Sandbox Code Playgroud) 我需要一个ruby等效的以下python代码
import array
my_array = array.array('B', [0x00, 0x04, 0xcc, 0x50]).tostring()
Run Code Online (Sandbox Code Playgroud)
更新:我正在尝试使用ruby-serialport gem将4个字节写入串行端口.
通过将上面的字节数组写入串口,我能够使它在python中工作.现在我想在红宝石中做同样的事情.
python ×2
apache ×1
apache2 ×1
bytearray ×1
deployment ×1
django ×1
iphone ×1
json ×1
mysql ×1
mysql-python ×1
objective-c ×1
ruby ×1
sbjson ×1