如何运行多个python脚本?目前我像这样运行一个python script1.py.
我试过了python script1.py script2.py,但这不起作用:只运行第一个脚本.另外,我尝试过使用这样的单个文件;
import script1
import script2
python script1.py
python script2.py
Run Code Online (Sandbox Code Playgroud)
然而,这也不起作用.
我正在尝试将我的iOs项目转换为使用ARC,但是下面收到一个lipo错误是命令和错误
命令:
CreateUniversalBinary /Users/samichaudry/Library/Developer/Xcode/DerivedData/CartoonQuiz-bqmbxfcdkldmbqawgrfmjtebypuk/Build/Products/Debug-iphoneos/CartoonQuiz.app/CartoonQuiz normal "armv7 armv7s"
cd "/Users/samichaudry/Projetcs/CartoonQuiz/Application/V1.01 New Design Universal/Application"
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
lipo -create /Users/samichaudry/Library/Developer/Xcode/DerivedData/CartoonQuiz-bqmbxfcdkldmbqawgrfmjtebypuk/Build/Intermediates/CartoonQuiz.build/Debug-iphoneos/CartoonQuiz.build/Objects-normal/armv7/CartoonQuiz /Users/samichaudry/Library/Developer/Xcode/DerivedData/CartoonQuiz-bqmbxfcdkldmbqawgrfmjtebypuk/Build/Intermediates/CartoonQuiz.build/Debug-iphoneos/CartoonQuiz.build/Objects-normal/armv7s/CartoonQuiz -output /Users/samichaudry/Library/Developer/Xcode/DerivedData/CartoonQuiz-bqmbxfcdkldmbqawgrfmjtebypuk/Build/Products/Debug-iphoneos/CartoonQuiz.app/CartoonQuiz
Run Code Online (Sandbox Code Playgroud)
错误:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo: can't figure out the architecture type of: /Users/samichaudry/Library/Developer/Xcode/DerivedData/CartoonQuiz-bqmbxfcdkldmbqawgrfmjtebypuk/Build/Intermediates/CartoonQuiz.build/Debug-iphoneos/CartoonQuiz.build/Objects-normal/armv7/CartoonQuizCommand /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo failed with exit code 1
Run Code Online (Sandbox Code Playgroud) 好的,所以我已经制作和应用程序,我想添加一个首选项窗口到我的应用程序,可以从菜单栏访问.
任何人都可以为我提供有关如何做到这一点的教程或指南,谢谢,萨米.
我需要一点帮助,我现在有一个方法; 我的Mac OS X应用程序中的updateTrackInfo获取当前在iTunes中播放的艺术家名称,曲目名称和曲目的持续时间
但是,我希望应用程序监听分发的iTunes通知; com.apple.iTunes.playerInfo然后在iTunes分发通知时调用方法updateTrackInfo.请有人帮助我,我需要在标题和实现文件中写什么.
谢谢,萨米.
遵循Ray Wenderlich关于使用iOS 7实现Game Center的教程
但是,我没有得到登录的提示,也没有欢迎回来横幅出现,尝试了很多教程,似乎无法让它与iOS 7一起工作.
这是我的代码
GCHelper.h
#import <Foundation/Foundation.h>
#import <GameKit/GameKit.h>
@interface GCHelper : NSObject {
BOOL gameCenterAvailable;
BOOL userAuthenticated;
}
@property (assign, readonly) BOOL gameCenterAvailable;
+ (GCHelper *)sharedInstance;
- (void)authenticateLocalUser;
@end
Run Code Online (Sandbox Code Playgroud)
GCHelper.m
#import "GCHelper.h"
@implementation GCHelper
@synthesize gameCenterAvailable;
#pragma mark Initialization
static GCHelper *sharedHelper = nil;
+ (GCHelper *) sharedInstance {
if (!sharedHelper) {
sharedHelper = [[GCHelper alloc] init];
}
return sharedHelper;
}
- (BOOL)isGameCenterAvailable {
// check for presence of GKLocalPlayer API
Class gcClass = (NSClassFromString(@"GKLocalPlayer")); …Run Code Online (Sandbox Code Playgroud) 如何保存点的颜色,以便在打开和关闭应用程序时,点是用户最后设置的颜色?
有人可以向我解释如何使用NSUserDefaults以及在哪种方法中声明NSUserDefaults.
到目前为止我有这个:
NSData *data = [NSArchiver archivedDataWithRootObject:color];
[[NSUserDefaults standardUserDefaults] setObject:data forKey:@"MyColor"];
NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:@"MyColor"];
NSColor *color = [NSUnarchiver unarchiveObjectWithData:data];
Run Code Online (Sandbox Code Playgroud)
我遵循的教程链接:http: //www.mactech.com/articles/mactech/Vol.25/25.04/2504RoadtoCode/index.html
我正在尝试调用该dist()方法但是我一直收到错误,说dist()必须返回一个值.
// creating array of cities
double x[] = {21.0,12.0,15.0,3.0,7.0,30.0};
double y[] = {17.0,10.0,4.0,2.0,3.0,1.0};
// distance function - C = sqrt of A squared + B squared
double dist(int c1, int c2) {
z = sqrt ((x[c1] - x[c2] * x[c1] - x[c2]) + (y[c1] - y[c2] * y[c1] - y[c2]));
cout << "The result is " << z;
}
void main()
{
int a[] = {1, 2, 3, 4, 5, 6};
execute(a, 0, sizeof(a)/sizeof(int));
int …Run Code Online (Sandbox Code Playgroud) 嗨,我正试着读一个plist的值,这就是我的plist看起来像atm
<plist version="1.0">
<array>
<dict>
<key>Title</key>
<string>Mickey Mouse</string>
<key>Image</key>
<string>mickeymouse.png</string>
<key>Hint1</key>
<string>Hint 1</string>
<key>Hint2</key>
<string>Hint 2</string>
<key>Hint3</key>
<string>Hint 3</string>
</dict>
<dict>
<key>Title</key>
<string>Peter Pan</string>
<key>Image</key>
<string>peterpan.png</string>
<key>Hint1</key>
<string>Hint 1</string>
<key>Hint2</key>
<string>Hint 2</string>
<key>Hint3</key>
<string>Hint 3</string>
</dict>
</array>
</plist>
Run Code Online (Sandbox Code Playgroud)
这个我正在使用的代码然而它只是崩溃了.
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NSString *questionNumber = [NSMutableString stringWithFormat:@"Item 0"];
NSString *path = [[NSBundle mainBundle] pathForResource:@"Level1" ofType:@"plist"];
NSMutableArray *array = [[NSMutableArray alloc] initWithContentsOfFile:path];
NSDictionary *questionNumberDictionary = [array objectForKey:questionNumber];
NSString *questionTitle = [questionNumberDictionary objectForKey:@"Title"];
NSString *questionImage = [questionNumberDictionary objectForKey:@"Image"]; …Run Code Online (Sandbox Code Playgroud) objective-c ×3
xcode ×2
architecture ×1
c++ ×1
distance ×1
game-center ×1
ios ×1
ios7 ×1
itunes ×1
leaderboard ×1
linux ×1
lipo ×1
macos ×1
nsarray ×1
nscolor ×1
nsdictionary ×1
plist ×1
preferences ×1
python ×1
save ×1
shell ×1
square-root ×1
window ×1
xcode4.6 ×1