JuliaPy / JuliaPy/PythonCall.jl
[Enhancement] Allow `Python: <class 'module'>` as argument to `pyimport`
Đang mở
enhancement
- Ngôn ngữ chính
- Julia
- Star
- 1.1k
- Fork
- 86
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 3
Mô tả
With these methods:
```julia
pyimport((m, k)::Pair{Py}) = pyimport(string(m.__name__) => k)
pyimport((m, ks)::Pair{Py,<:Tuple}) = pyimport(string(m.__name__) => ks)
```
you can do something like
```julia
amodule = pyimport("amodule")
afunc = pyimport(amodule.submodule1.submodule2, "afunc")
```
You can use TAB completion at the REPL to get the submodules. This is more convenient than finding and typing the strings.
I don't know how robust `string(m.__name__)` is.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.