|
|
|
[Python] Global name 'cos' is not defined
|
|||
|---|---|---|---|
|
#18+
Я только начал изучать питон. Столкнулся с такой проблемой: Есть модуль, в котором описан класс с методом, использующим тригонометрические функции. Делаю import module, cоздаю объект t=module.Class(), пишу t.method(x), в ответ мне Код: plaintext 1. Помогите пожалста люди сведущие. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 25.07.2008, 13:46 |
|
||
|
[Python] Global name 'cos' is not defined
|
|||
|---|---|---|---|
|
#18+
> и в самом модуле и from math import cos, sin пробовал Это правильно, но важно понимать что питон делает импорт только один раз, а ты вносишь поправки в модуль, сохраняешь его, пишешь по-новой в интер-ре и ... ничего нового не видишь; надо делать restart интер-ра или reload(module) Reload a previously imported module. The argument must be a module object, so it must have been successfully imported before. This is useful if you have edited the module source file using an external editor and want to try out the new version without leaving the Python interpreter. The return value is the module object (the same as the module argument). ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 25.07.2008, 14:31 |
|
||
|
|

start [/forum/topic.php?fid=16&msg=35452415&tid=1345131]: |
0ms |
get settings: |
9ms |
get forum list: |
17ms |
check forum access: |
6ms |
check topic access: |
6ms |
track hit: |
108ms |
get topic data: |
18ms |
get forum data: |
4ms |
get page messages: |
31ms |
get tp. blocked users: |
1ms |
| others: | 218ms |
| total: | 418ms |

| 0 / 0 |
