|
|||
lilich
30.03.12 — 14:04 |
Клиент банк ДБО BS-Client v.3 Уралсиб Ошибка при печати и просмотре одна и таже
Сбой в работе программы. С чем это связано и что нужно сделать,что бы все работало? |
||
lilich
1 — 30.03.12 — 14:05 |
EBLLError : Error in external call in module ‘DAPSTAT.BLL’ at line 1476: |
||
andrewks
2 — 30.03.12 — 14:24 |
у них настраивать нужно на опенофис. щас попробую вспомнить, где |
||
andrewks
3 — 30.03.12 — 14:25 |
какая точно версия? СервисИнформация о системеCore |
||
andrewks
4 — 30.03.12 — 14:28 |
НастройкиНастройки печатиРежим печати выбери Печать согласно настройкам ОС. и свяжи .rtf с openoffice. но ещё лучше связать его с Microsoft Word Viewer (он бесплатный), ибо rtf, формируемый этой системой, кривовато открывается в опенофисе |
||
lilich
5 — 30.03.12 — 14:34 |
версия Open Offic’a? |
||
andrewks
6 — 30.03.12 — 14:36 |
(5) версия ДБО. я написал, как её можно посмотреть |
||
lilich
7 — 30.03.12 — 14:39 |
3.0.341.240 |
||
andrewks
8 — 30.03.12 — 14:42 |
(7) ух ты, какая старая. но, всё-же, попробуй (4) сделать, может, взлетит |
||
lilich
9 — 30.03.12 — 14:43 |
Захожу Настройки-Настройки печати |
||
lilich
10 — 30.03.12 — 14:44 |
Если обновить клиент банк,моможет? |
||
andrewks
11 — 30.03.12 — 14:45 |
емнип, на такой старой версии я напрямую в базе dictman’ом делал. но это весчь опасная, лучше обратись к админу из банка |
||
andrewks 12 — 30.03.12 — 14:47 |
(10) в новой версии есть (4). но это нужно решать только с админом банка, ибо их система тоже должна быть готова к повышению версии клиента |
|
TurboConf — расширение возможностей Конфигуратора 1С |
ВНИМАНИЕ! Если вы потеряли окно ввода сообщения, нажмите Ctrl-F5 или Ctrl-R или кнопку «Обновить» в браузере.
Тема не обновлялась длительное время, и была помечена как архивная. Добавление сообщений невозможно.
Но вы можете создать новую ветку и вам обязательно ответят!
Каждый час на Волшебном форуме бывает более 2000 человек.
i have the following code in a module called code_database.py
class Entry():
def enter_data(self):
self.title = input('enter a title: ')
print('enter the code, press ctrl-d to end: ')
self.code = sys.stdin.readlines()
self.tags = input('enter tags: ')
def save_data(self):
with open('entry.pickle2', 'ab') as f:
pickle.dump(self, f)
in idle the class-defined methods work fine:
>>> import code_database
>>> entry = code_database.Entry()
>>> entry.enter_data()
enter a title: a
enter the code, press ctrl-d to end:
benter tags: c
>>> entry.title
'a'
>>> entry.code
['b']
>>> entry.tags
'c'
>>>
however if i call the module from an external program and try to call the methods, they raise a NameError:
import code_database
entry = code_database.Entry()
entry.enter_data()
entry.save_data()
causes this in the terminal:
$python testclass.py
enter a title: mo
Traceback (most recent call last):
File "testclass.py", line 6, in <module>
entry.enter_data()
File "/home/mo/python/projects/code_database/code_database.py", line 8, in enter_data
self.title = input('enter a title: ')
File "<string>", line 1, in <module>
NameError: name 'mo' is not defined
Hi David,
When attempting to use «not» in a PDDL condition containing a call to an external module I get:
assert not negated
AssertionError
ERROR IN TRANSLATE
The full error message when I run https://github.com/speckdavid/shakey2016/blob/master/gki_symbolic_planning/planner_benchmarks/modular/negated-modules/domain-negated.pddl is:
process[tfdplan-1]: started with pid [26122]
Parsing…
Parsing durative-action inc
Traceback (most recent call last):
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/translate.py», line 1014, in
task = pddl.open()
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/pddl/pddl_file.py», line 44, in open
return tasks.Task.parse(domain_pddl, task_pddl)
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/pddl/tasks.py», line 50, in parse
= parse_domain(domain_pddl)
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/pddl/tasks.py», line 281, in parse_domain
parse_domain_structure(entry,the_functions,the_axioms,the_actions,the_durative_actions,the_types,the_predicates)
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/pddl/tasks.py», line 196, in parse_domain_structure
action = actions.DurativeAction.parse(entry)
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/pddl/actions.py», line 168, in parse
condition = conditions.parse_durative_condition(iterator.next())
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/pddl/conditions.py», line 71, in parse_durative_condition
parts = [parse_durative_condition(part) for part in args]
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/pddl/conditions.py», line 90, in parse_durative_condition
condition = parse_condition_aux(alist[2], False)
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/pddl/conditions.py», line 28, in parse_condition_aux
return parse_condition_aux(args[0], not negated)
File «/home/helen/Documents/ros_libs/shakey_ws/src/shakey/gki_symbolic_planning/tfd_modules/downward/translate/pddl/conditions.py», line 34, in parse_condition_aux
assert not negated
AssertionError
ERROR IN TRANSLATE
Kind regards,
Helen
In this article, we’ll talk about the «TypeError: ‘module’ object is not callable» error in Python.
We’ll start by defining some of the keywords found in the error message — module
and callable
.
You’ll then see some examples that raise the error, and how to fix it.
Feel free to skip the next two sections if you already know what modules are, and what it means to call a function or method.
What Is a Module in Programming?
In modular programming, modules are simply files that contain similar functionalities required to perform a certain task.
Modules help us separate and group code based on functionality. For example, you could have a module called math-ops.py
which will only include code related to mathematical operations.
This makes easier to read, reuse, and understand the code. To use a module in a different part of your code base, you’d have to import it to gain access to all the functionalities defined in the module.
In Python, there are many built-in modules like os
, math
, time
, and so on.
Here’s an example that shows how to use the math
module:
import math
print(math.sqrt(25))
//5.0
As you can see above, the first thing we did before using the math
module was to import it: import math
.
We then made use of the module’s sqrt
method which returns the square root of a number: math.sqrt(25)
.
All it took us to get the square root of 25 was two lines of code. In reality, the math
module alone has over 3500 lines of code.
This should help you understand what a module is and how it works. You can also create your own modules (we’ll do that later in this article).
What Does callable
Mean in the “TypeError: module object is not callable” Error?
In Python and most programming languages, the verb «call» is associated with executing the code written in a function or method.
Other similar terms mostly used with the same action are «invoke» and «fire».
Here’s a Python function that prints «Smile!» to the console:
def smile():
print("Smile!")
If you run the code above, nothing will be printed to the console because the function smile
is yet to be called, invoked, or fired.
To execute the function, we have to write the function name followed by parenthesis. That is:
def smile():
print("Smile!")
smile()
# Smile!
Without the parenthesis, the function will not be executed.
Now you should understand what the term callable
means in the error message: «TypeError: ‘module’ object is not callable».
What Does the “TypeError: module object is not callable” Error Mean in Python?
The last two sections helped us understand some of the keywords found in the «TypeError: ‘module’ object is not callable» error message.
To put it simply, the «TypeError: ‘module’ object is not callable» error means that modules cannot be called like functions or methods.
There are generally two ways that the «TypeError: ‘module’ object is not callable» error can be raised: calling an inbuilt or third party module, and calling a module in place of a function.
Error Example #1
import math
print(math(25))
# TypeError: 'module' object is not callable
In the example above, we called the math
module (by using parenthesis ()
) and passed 25 as a parameter hoping to perform a particular math operation: math(25)
. But we got the error.
To fix this, we can make use of any math method provided by the math
module. We’ll use the sqrt
method:
import math
print(math.sqrt(25))
# 5.0
Error Example #2
For this example, I’ll create a module for calculating two numbers:
# add.py
def add(a,b):
print(a+b)
The name of the module above is add
which can be derived from the file name add.py.
Let’s import the add()
function from the add
module in another file:
# main.py
import add
add(2,3)
# TypeError: 'module' object is not callable
You must be wondering why we’re getting the error even though we imported the module.
Well, we imported the module, not the function. That’s why.
To fix this, you have to specify the name of the function while importing the module:
from add import add
add(2,3)
# 5
We’re being specific: from add import add
. This is the same as saying, «from the add.py module, import the add
function».
You can now use the add()
function in the main.py file.
Summary
In this article, we talked about the «TypeError: ‘module’ object is not callable» error in Python.
This error occurs mainly when we call or invoke a module as though it were a function or method.
We started by discussing what a module is in programming, and what it means to call a function – this helped us understand what causes the error.
We then gave some examples that showed the error being raised and how to fix it.
Happy coding!
Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started
I have the following code in a single source file:
[fortran]MODULE MOD1 EXTERNAL :: H_UMAT POINTER(P_UMAT, H_UMAT) END MODULE MOD1 SUBROUTINE SUB1() USE MOD1 CALL H_UMAT() RETURN END SUBROUTINE SUB1[/fortran]
When I compile it using:
[bash]ifort -c compiler_error.f90[/bash]
I get the following output on Windows:
[bash]Intel Visual Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20090903 Package ID: w_cprof_p_11.1.046 Copyright (C) 1985-2009 Intel Corporation. All rights reserved. fortcom: Fatal: There has been an internal compiler error (C0000005). compilation aborted for compiler_error.f90 (code 1)[/bash]
If I change the implementation of SUB1 to:
[fortran]SUBROUTINE SUB1() USE MOD1, ONLY : P_UMAT EXTERNAL :: H_UMAT POINTER(PX, H_UMAT) PX = P_UMAT CALL H_UMAT() RETURN END SUBROUTINE SUB1[/fortran]
It compiles without error. For what it’s worth I observe the same behavior with IVF 11.1 on Linux as well:
[bash]: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error. compilation aborted for compiler_error.f90 (code 3)[/bash]
Am I doing something wrong? Should I be able to use an EXTERNAL via a module the way I am?
Thanks,
Brady