Change the Style of Top Border with CSS

karthikeya Boyini
Updated on 31-Jan-2020 10:08:30

166 Views

The border-top-style property changes the style of top border.ExampleYou can try to run the following property to change the style of the top border:                            Example showing top border          

Starting a New Thread in Python

Mohd Mohtashim
Updated on 31-Jan-2020 10:08:18

488 Views

To spawn another thread, you need to call following method available in thread module −thread.start_new_thread ( function, args[, kwargs] )This method call enables a fast and efficient way to create new threads in both Linux and Windows.The method call returns immediately and the child thread starts and calls function with the passed list of args. When function returns, the thread terminates.Here,  args is a tuple of arguments; use an empty tuple to call function without passing any arguments. kwargs is an optional dictionary of keyword arguments.Example#!/usr/bin/python import thread import time # Define a function for the thread def print_time( threadName, delay):    count = 0   ... Read More

Usage of CSS Table Layout Property

Ankith Reddy
Updated on 31-Jan-2020 10:07:41

83 Views

The table-layout property is to help you control how a browser should render or lay out a table. This property can have one of the three values: fixed, auto or inherit.ExampleYou can try to run the following code to implement CSS table-layout property                    table.auto {             table-layout: auto          }          table.fixed{             table-layout: fixed          }                                           1000000000000000000000000000             10000000             100                                                   1000000000000000000000000000             10000000             100                    

Difference between CSS Border Collapse and Border Separate

Samual Sam
Updated on 31-Jan-2020 10:06:18

227 Views

The following image justifies the difference between collapse and separate. The separate value of the border-collapse property separates the borders of the cells:ExampleYou can try to run the following code to understand the difference between border-collapse separate and collapse value:                    table.one {             border-collapse:collapse;          }          table.two {             border-collapse:separate;          }          td.a {             border-style:dotted;             border-width:2px;             border-color:#000000;             padding: 20px;          }          td.b {             border-style:solid;             border-width:2px;             border-color:#333333;             padding:20px;          }                              Border Collapse           India           Australia                            Border Separate           India           Australia          

Send HTML Email Using Python

Mohd Mohtashim
Updated on 31-Jan-2020 10:05:04

777 Views

When you send a text message using Python, then all the content are treated as simple text. Even if you include HTML tags in a text message, it is displayed as simple text and HTML tags will not be formatted according to HTML syntax. But Python provides option to send an HTML message as actual HTML message.While sending an e-mail message, you can specify a Mime version, content type and character set to send an HTML e-mail.ExampleFollowing is the example to send HTML content as an e-mail. Try it once −#!/usr/bin/python import smtplib message = """From: From Person To: ... Read More

Database Handling Errors in Python

Mohd Mohtashim
Updated on 31-Jan-2020 10:03:40

4K+ Views

There are many sources of errors. A few examples are a syntax error in an executed SQL statement, a connection failure, or calling the fetch method for an already canceled or finished statement handle.The DB API defines a number of errors that must exist in each database module. The following table lists these exceptions.Sr.No.Exception & Description1WarningUsed for non-fatal issues. Must subclass StandardError.2ErrorBase class for errors. Must subclass StandardError.3InterfaceErrorUsed for errors in the database module, not the database itself. Must subclass Error.4DatabaseErrorUsed for errors in the database. Must subclass Error.5DataErrorSubclass of DatabaseError that refers to errors in the data.6OperationalErrorSubclass of DatabaseError ... Read More

Usage of CSS border-spacing Property

Lakshmi Srinivas
Updated on 31-Jan-2020 10:02:56

69 Views

The border-spacing specifies the width between table cells. It can take either one or two values; these should be units of length.ExampleYou can try to run the following code to set the width of table cells:                    table.one {             border-collapse:separate;             width:300px;             border-spacing:15px 40px;          }                              The border-spacing property           India           UK                

Disconnecting Database in Python

Mohd Mohtashim
Updated on 31-Jan-2020 10:02:53

6K+ Views

To disconnect Database connection, use close() method.db.close()If the connection to a database is closed by the user with the close() method, any outstanding transactions are rolled back by the DB. However, instead of depending on any of DB lower level implementation details, your application would be better off calling commit or rollback explicitly.

Commit and Rollback Operation in Python

Mohd Mohtashim
Updated on 31-Jan-2020 10:02:15

693 Views

COMMITCommit is the operation, which gives a green signal to database to finalize the changes, and after this operation, no change can be reverted back.Here is a simple example to call commit method.db.commit()ROLLBACKIf you are not satisfied with one or more of the changes and you want to revert back those changes completely, then use rollback() method.Here is a simple example to call rollback() method.db.rollback()

Perform Database Transactions Using Python

Mohd Mohtashim
Updated on 31-Jan-2020 10:01:40

1K+ Views

Transactions are a mechanism that ensures data consistency. Transactions have the following four properties −Atomicity − Either a transaction completes or nothing happens at all.Consistency − A transaction must start in a consistent state and leave the system in a consistent state.Isolation − Intermediate results of a transaction are not visible outside the current transaction.Durability − Once a transaction was committed, the effects are persistent, even after a system failure.The Python DB API 2.0 provides two methods to either commit or rollback a transaction.ExampleYou already know how to implement transactions. Here is again similar example −# Prepare SQL query to DELETE required records sql ... Read More

Advertisements