Articles on Trending Technologies

Technical articles with clear explanations and examples

Top-level script environment in Python (__main__)

Nitya Raut
Nitya Raut
Updated on 27-Jun-2020 1K+ Views

A module object is characterized by various attributes. Attribute names are prefixed and post-fixed by double underscore __. The most important attribute of module is __name__. When Python is running as a top level executable code, i.e. when read from standard input, a script, or from an interactive prompt the __name__ attribute is set to '__main__'.>>> __name__ '__main__'From within a script also, we find a value of __name__ attribute is set to '__main__'. Execute the following script.'module docstring' print ('name of module:', __name__)Outputname of module: __main__However, for an imported module this attribute is set to name of the Python script. ...

Read More

Built-in objects in Python (builtins)

Anvi Jain
Anvi Jain
Updated on 27-Jun-2020 3K+ Views

The builtins module is automatically loaded every time Python interpreter starts, either as a top level execution environment or as interactive session. The Object class, which happens to be the base class for all Python objects, is defined in this module. All built-in data type classes such as numbers, string, list etc are defined in this module. The BaseException class, as well as all built-in exceptions, are also defined in it. Further, all built-in functions are also defined in the built-ins module.Since this module is imported in the current session automatically, normally it is not imported explicitly. All the built-in ...

Read More

Conditional call instructions in 8085 Microprocessor

Ankith Reddy
Ankith Reddy
Updated on 27-Jun-2020 4K+ Views

In 8085 Instruction set, depending upon one of the flag bit values (excluding AC flag bit), the conditional call instructions will branch to a subroutine. The branch takes place based on the value of Cy flag, Z flag, P flag, or S flag. There is no call instruction based on the value of AC(Auxiliary Carry) flag bit. This is because generally, no one is interested in branching to a subroutine based on this flag bit value. The conditional call instructions are 3 Bytes in length, 1 Byte for the opcode, and another 2 Bytes for the subroutine address i.e.low-order Byte ...

Read More

Call if carry (CC) in 8085 Microprocessor

Chandu yadav
Chandu yadav
Updated on 27-Jun-2020 1K+ Views

In 8085 Instruction set, CC is a mnemonic, which stands for “Call if Carry”. This instruction is used to branch to the subroutine whose 16-bit address is provided in the instruction, only if Cy flag value is 1. If Cy flag value is 0, program flow continues in the main program sequentially. It is a3-Byte instruction.Mnemonics, OperadOpcode(in HEX)BytesCC LabelDC3Let us consider the following sample code for a better explanation –AddressHex CodesMnemonicComment200031LXI SP, 5000HSP ← 5000H.Initializing the SP200100Low order Byte of the address200250High order Byte of the address20033EMVI A, 40HA ← 40H, Initializing the Accumulator with initial value 40H20044040H as operand200506MVI ...

Read More

Accessing The Unix/Linux password database (pwd)

Vrundesha Joshi
Vrundesha Joshi
Updated on 27-Jun-2020 595 Views

The pwd module in standard library of Python provides access to the password database of user accounts in a Unix/Linux operating system. Entries in this Password database are atored as a tuple-like object. The structure of tuple is according to following passwd structure pwd.h file in CPython APIIndexAttributeMeaning0pw_nameLogin name1pw_passwdOptional encrypted password2pw_uidNumerical user ID3pw_gidNumerical group ID4pw_gecosUser name or comment field5pw_dirUser home directory6pw_shellUser command interpreterThe pwd module defines the following functions −>>> import pwd >>> dir(pwd) ['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'getpwall', 'getpwnam', 'getpwuid', 'struct_passwd']getpwnam() − This function returns record in the password database corresponding to the specified user name>>> pwd.getpwnam('root') pwd.struct_passwd(pw_name ...

Read More

Return if carry (RC) in 8085 Microprocessor

Chandu yadav
Chandu yadav
Updated on 27-Jun-2020 1K+ Views

In 8085 Instruction set, RC is a mnemonic, which stands for “Return if Carry”. This instruction is used to return to the main program, only if Cy flag value is 1. If Cy flag value is 0, program flow continues in the subroutine sequentially. It is a 1-Byte instruction.Mnemonics, OperandOpcode(in HEX)BytesRCD81Let us consider the following sample code for a better explanation –AddressHex CodesMnemonicComment200031LXI SP, 5000HSP ← 5000H.Initializing the SP200100Low order Byte of the address200250High order Byte of the address200321LXI H, 4050HHL ← 4050H, Initializing the HL register pair200450Low order Byte of the address200540High order Byte of the address2006CDCALL 200BHCalling the ...

Read More

8085 Program to Check the fourth bit of a byte

George John
George John
Updated on 27-Jun-2020 2K+ Views

In this program, we will see how to check the 4th bit of an 8-bit number.Problem StatementWrite 8085 Assembly language program to check whether the fourth bit of a byte is 0 or 1.When it is 0, store 00H at any specified location, and when it is 1, store FFH at the specified location.DiscussionWe are considering the 8-bit number, and storing 00H or FFH by checking the 4th bit on the number from left. The logic behind it is very simple. We are just performing bit-wise and operation on the given data with 08H. If the result is non-zero, then the 4th ...

Read More

How can management ensure working women's safety on their premises?

Rashmi Iyer
Rashmi Iyer
Updated on 27-Jun-2020 302 Views

Women in today’s world are taking major positions in different sectors and are performing extraordinarily well in their work roles. The contribution of women is extremely crucial for the inclusive economic development of the country. The principle of Gender Equality is enshrined in our constitution and the feminist movement in the late 1970s strengthened the concept. If we want women to succeed in their work lives, it is important to create a safe atmosphere for a woman to give a holistic contribution. Let's know how:Infrastructure FacilitiesIt is extremely important to keep the infrastructure facilities extremely strong in any workplace. Proper ...

Read More

8085 Program to Multiply two numbers of size 8 bits

Chandu yadav
Chandu yadav
Updated on 27-Jun-2020 1K+ Views

In this program, we will see how to multiply two 8-bit numbers using 8085 microprocessor.Problem StatementWrite 8085 Assembly language program to multiply two 8-bit numbers stored in a memory location and store the 16-bit results into the memory.DiscussionThe 8085 has no multiplication operation. To get the result of multiplication, we should use the repetitive addition method. After multiplying two 8-bit numbers it may generate 1-byte or 2-byte numbers, so we are using two registers to hold the result.We are saving the data at location 8000H and 8001H. The result is storing at location 8050H and 8051H.InputAddressData......8000DC8001AC......Flow DiagramProgramAddressHEX CodesLabelsMnemonicsCommentsF00021, 00, 80LXI H, ...

Read More

What are the best tricks to manage multiple tasks at the same time?

Rashmi Iyer
Rashmi Iyer
Updated on 27-Jun-2020 488 Views

Life is no longer a simple journey. It is complex and tiring and requires a lot of work to be completed within a short spell of time to meet arduous deadlines. Hence, it is extremely important to understand the tricks and hacks in the art of multi-switching rather than multi-tasking which helps a person do many things in one day with dedication and concentration in totality.Make A Schedule and Write It DownMany people fail to deal with multiple affairs at the same time and get stressed out due to the simple reason of not scheduling it properly. Write it in ...

Read More
Showing 52911–52920 of 61,299 articles
Advertisements