我试图通过以下方式在C++中使用"map"容器:
注意:如果我使用map foo测试以下代码; 它工作正常.
码:
#include <string>
#include <iostream>
#include <map>
#include <fstream>
using namespace std;
int main()
{
// typedef map<string, int> mapType2;
// map<string, int> foo;
typedef map<string, ofstream> mapType;
map<string, ofstream> fooMap;
ofstream foo1;
ofstream foo2;
fooMap["file1"] = foo1;
fooMap["file2"] = foo2;
mapType::iterator iter = fooMap.begin();
cout<< "Key = " <<iter->first;
}
Run Code Online (Sandbox Code Playgroud)
错误:
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ios_base.h:
In member function `std::basic_ios<char, std::char_traits<char> >& std::basic_ios<char, std::char_traits<char> >::operator=(const std::basic_ios<char, std::char_traits<char> >&)':
C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/bits/ios_base.h:741:
error: `std::ios_base& std::ios_base::operator=(const std::ios_base&)' is private
hash.cpp:88: error: within …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种在python中创建边框的方法.我在Python中有任何库可以导入以创建边框.
请注意,我不想使用任何图像蒙版来创建此效果(例如,我不想使用任何图像编辑软件包,如GIMP来创建边框图像蒙版).
这是我正在寻找的:
import fooImageBorders
import Image
foo = Image.open("someImage.jpg")
foo2 = fooImageBorders.bevel(foo, color = black)
Run Code Online (Sandbox Code Playgroud)
...我可以编写自己的方法来添加边框..但是如果已经有类似这样的东西有一套全面的边框选项,我想利用它.
我看了PIL文档,找不到办法做到这一点.我有windows xp,如果你没有cygwin,似乎没有办法为Python 2.6安装PythonMagick.
谢谢!
有谁知道如何在Mac OSX for Python 2.6上安装PyGObject.目前在darwinports上可用的发行版使用的是Python2.4.我想要一个使用Python2.6的包
或者,是否有人尝试从Mac上的源安装它?