Found 34494 Articles for Programming

How to get the system configuration information relevant to an open file using Python?

Rajendra Dharmkar
Updated on 20-Jul-2023 13:02:17

182 Views

In the realm of Python programming, accessing system configuration information relevant to open files can be very useful in providing valuable insights into the operating environment. It does not matter if you are a curious developer or an avid enthusiast, this article will show you the way through the process of retrieving system configuration details related to open files using Python. By taking advantage of several Python's built-in modules and functions, we will unlock the ability to gather essential information about files in a seamless and efficient manner. We will learn this skill by discussing and practicing several code examples ... Read More

How to install JDK in Windows and set up the environment variables?

mkotla
Updated on 18-Feb-2020 07:53:47

1K+ Views

Download the latest version of Java from the official site. Run the .exe to install Java on your machine. Once you installed Java on your machine, you will need to set environment variables to point to correct installation directories −Setting Up the Path for Windows:Assuming you have installed Java in c:\Program Files\java\jdk directory − Right-click on 'My Computer' and select 'Properties'.Click the 'Environment variables' button under the 'Advanced' tab.Now, alter the 'Path' variable so that it also contains the path to the Java executable. Example, if the path is currently set to 'C:\WINDOWS\SYSTEM32', then change your path to read 'C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin'.Read More

How to copy files to a new directory using Python?

Rajendra Dharmkar
Updated on 17-Jul-2023 15:00:33

5K+ Views

The act of copying files to a new directory is a basic skill that every developer in Python should invariably possess. Whether it is the process of backing up data, organizing files or creating a new project, there are powerful tools provided by Python to make file copying an easy task. In this extensive article, you will learn the process of copying files to a new directory using Python. Detailed explanations and practical code examples, will help you gain the knowledge and confidence to handle file copying tasks successfully. Understanding File Copying Before we begin with the examples ... Read More

How is JIT compiler different from normal compiler?

Giri Raju
Updated on 30-Jul-2019 22:30:20

2K+ Views

Java uses javac (compiler) to convert the java code to byte code (.class file).When we run this code using JVM, it internally converts the byte code to system understandable code using an interpreter.Instead of executing a piece of code, again and again, JVM identifies them as “hot spots” and compiles them using Just in time compiler and, later reuses the same when required.A compiler compiles (translates) the given program to executable code (whole code at a time).A JIT compiler performs a similar task but it is used by JVM internally, to translate the hotspots in the byte code.A compiler compiles ... Read More

How do I copy a file in python?

Pranathi M
Updated on 11-May-2023 14:45:28

460 Views

One of the most prevalent activities in modern software development is copying files programmatically. In today's quick tutorial, we'll look at a few different ways to transfer files in Python using the shutil module. Shutil is a Python Standard Library module that provides a wide range of high-level file operations. Now, when it comes to file copying, the library provides a variety of options based on whether you want to copy metadata or file permissions, as well as if the destination is a directory. It falls within the umbrella of Python's basic utility modules. This module aids in the automation ... Read More

How to create a duplicate file of an existing file using Python?

Rajendra Dharmkar
Updated on 17-Feb-2020 12:49:55

888 Views

The shutil module provides functions for copying files, as well as entire folders.Calling shutil.copy(source, destination) will copy the file at the path source to the folder at the path destination. (Both source and destination are strings.) If destination is a filename, it will be used as the new name of the copied file. This function returns a string of the path of the copied file. For example, >>> import shutil >>> # Copy the file in same folder with different name >>> shutil.copy('original.txt', 'duplicate.txt') '/home/username/duplicate.txt' >>> shutil.copy('original.txt', 'my_folder/duplicate.txt') '/home/username/my_folder/duplicate.txt'Read More

What is the difference between javac, java commands?

Sreemaha
Updated on 30-Jul-2019 22:30:20

5K+ Views

The javac command is used to compile Java programs, it takes .java file as input and produces bytecode. Following is the syntax of this command. >javac sample.java The java command is used to execute the bytecode of java. It takes byte code as input and runs it and produces the output. Following is the syntax of this command. >java sample Let us consider an example create a Sample Java program with name Sample.java Sample.java public class Sample { public static void main(String args[]) { System.out.println("Hi welcome ... Read More

How to create a JAR file?

usharani
Updated on 24-Feb-2020 09:39:53

22K+ Views

You can create a JAR file using the following command.jar cf jar-file input-file(s)  You can also create JAR files using IDE’s. To create a JAR file using eclipse follow the procedure given below.Open the Jar File wizardThe Jar File wizard can be used to export the content of a project into a jar file. To bring up the Jar File wizard −In the Package Explorer select the items that you want to export. If you want to export all the classes and resources in the project just select the project.Click on the File menu and select Export.In the filter text box ... Read More

What is a JAR file?

varun
Updated on 30-Jul-2019 22:30:20

2K+ Views

A java archive file is a file format/ archiving tool which contains all the components of an executable Java application. All the predefined libraries are available in this format. To include any of these (other than rt.jar) in to your project you need to set the class path for this particular JAR file. You can create a JAR file using the command line options or using any IDE’s. Creating a Jar file You can create a Jar file using the jar command as shown below. jar cf jar-file input-file(s) Let us consider an example, create a Sample Java ... Read More

What is meant by Java being ‘write once run anywhere’ language?

seetha
Updated on 30-Jul-2019 22:30:20

276 Views

Unlike many other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This byte code is distributed over the web and interpreted by the Virtual Machine (JVM) on whichever platform it is being run on. Thus when you write a piece of Java code in a particular platform and generated an executable code .class file. You can execute/run this class file on any system the only condition is that the target system should have JVM (JRE) installed in it. In Short, If you have a ... Read More

Advertisements