我有以下字符串:
word = u'Buffalo,\xa0IL\xa060625'
Run Code Online (Sandbox Code Playgroud)
我不希望那里有"\ xa0".我怎么能摆脱它?我想要的字符串是:
word = 'Buffalo, IL 06025
Run Code Online (Sandbox Code Playgroud) 所以我注释掉了它给我回溯的地方。
export function* watchFileReader(){
const action = yield take("DROP_FILE")
console.log('action', action)
let file = action.file[0];
readFile(file, function(e){
sessionStorage.removeItem('img')
console.log('alskdjfalsdjkf', e.target.result)
sessionStorage.setItem('img', e.target.result)
// yield put({type: "UDATE", {img: e.target.result})
})
}
Run Code Online (Sandbox Code Playgroud)
更新:这是我承诺的使代码起作用的功能。
function readFileWithPromise(file){
return new Promise((resolve, reject) => {
readFile(file, function(e){
if (e){
resolve(e)
}else{
reject(e)
}
})
})
}
Run Code Online (Sandbox Code Playgroud) 所以我需要在popover中显示一个文本.我有以下代码使文本出现在一行中.我需要将文本换行以将它们放在多行中,但是我认为原因但到目前为止我的更新还没有成功.任何的想法?
<Popover
anchorEl={target}
open={open}
anchorOrigin={{horizontal: 'middle', vertical: 'bottom'}}
targetOrigin={{horizontal: 'left', vertical: 'bottom'}}
onRequestClose={handleRequestClose}
animation={PopoverAnimationVertical}>
<Menu
autoWidth={true}
>
<MenuItem style={{width: "200px", height: "200px"}}>
<p style={{display: "flex", flexWrap: "wrap"}}>'aslkjflajdsljflskdjflsdfjlsjdfjdfjlasjkfadlsf'</p>
</MenuItem> //this does not work....
</Menu>
Run Code Online (Sandbox Code Playgroud) 所以我有一个数据如下:
item = '//s780.scene7.com/is/image/forever/301596014_001?hei=98&wid=98'
Run Code Online (Sandbox Code Playgroud)
使用 urlparse 模块。我怎样才能用新的大小替换上面的数据,使它看起来像这样:
item = '//s780.scene7.com/is/image/forever/301596014_001?hei=360&wid=360'
Run Code Online (Sandbox Code Playgroud) 所以我认为如果我展示一个例子就更容易解释:
things = ["black", 7, "red', 10, "white", 15]
Run Code Online (Sandbox Code Playgroud)
两个基于索引是偶数还是奇数的新列表.
color = ["black", "red","white"]
size = [7,10,15]
Run Code Online (Sandbox Code Playgroud) python ×3
asynchronous ×1
javascript ×1
material-ui ×1
redux ×1
redux-saga ×1
scene7 ×1
unicode ×1
urlparse ×1