Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Windows | command lines |

1 September 2024 at 16:37
Go forward : cd path\to\folder 
Go backward : cd ../..
Show lists of files and directories : dir
Show lists of files and directories with hidden files also : dir /a
Clearing screen : cls
Show specific type of files: dir *.png | dir *.jpg
Help for a specific command: ipconfig /? | cls /?
Create a new directory : mkdir myDir | mkdir path\to
Remove or delete directories: if your directory is empty rmdir myDir else rmdir /S myDir
Changing drivers : C: | D:
Show path variables: path
Show available drive names: wmic logicaldisk get name
Change color: color 0B | color 90 or back to default just use color
Creating a file : echo somecontent > file.txt
Deleting file: del filename.ext
Reading contents of a file: type file.ext\
Override to a file : echo newcontent > samefile.ext
Appending to a file : echo appendingcontent >> samefile.ext
Copying files: copy test.txt mydir
Introduction to Command Prompt:

The command line in Windows is also known as Command Prompt or CMD.

On Mac and Linux systems, it's called Terminal.

Image description

To open Command Prompt, follow these steps: Open Start, search for 'Command Prompt', and select it.

Alternatively, you can click the keyboard shortcut (Windows + R), type 'cmd', and press Enter.

Image description

Image description

The first line will indicate the version we are using and the current file location by default.

Image description

Right-click on the top title bar, and the Properties screen will appear. From there,

Image description

Image description

To move from one directory to another, use the cd command followed by the folder name.

For example, to move to the 'Desktop' directory from C:\user\ranjith, type cd desktop.

C:\user> ranjith >
Cd space desktop 

To go to the 'python' folder inside 'Desktop', type cd desktop\python.

C:\user> ranjith >
Cd desktop > python

To return to the parent directory, use cd ... For example, if you are in C:\user\ranjith\desktop\python and want to go back two levels to

C:\user\ranjith, 
type cd ..\.. 

To navigate directly to a specific directory in one line, you can provide the full path.

For example, to go directly to C:\user\ranjith\desktop\python,

you can type cd 

C:\user\ranjith\desktop\python.

Image description
To list files and directories :

use the dir command.

For example, C:\user\ranjith> dir

will show the files, folders, free space, and storage details in the current directory.

Image description

To view the contents of a specific folder, use dir followed by the folder path.

 For example, C:\user\ranjith>dir 

Image description

Image description

Desktop\Python will display all files and folders in the Python folder on the Desktop.

Image description

To view hidden or system files, you can use the dir /a command.

 For example,

 C:\user\ranjith>dir /a

will display all files, including hidden and system files.

Image description

To clear the command prompt screen, use the cls command.

For example, 

C:\user\ranjith> cls 

Image description
will clear the screen and remove previous command outputs.

Opening Files and Viewing History:

To list files of a specific type in a directory, use the dir command with a filter.

For example, 

C:\user\ranjith>dir *.png will list all PNG 

Image description

image files in the current directory.

To open a specific file, enter its filename.

Image description

For instance,

C:\user\ranjith\python>binary_search.png would open the binary_search.png file.

Image description

To navigate through your command history, use the Up and Down arrow keys. Pressing the Up arrow key will cycle through previous commands, while the Down arrow key will move forward through the commands.


To get help on a command, use the /? option.

Image description

For example,

C:\user\ranjith>ipconfig /? will show help for the ipconfig command.

Creating and Removing Folders:

To create a new folder, use the mkdir command followed by the folder name.

For example,

C:\user\ranjith>python>mkdir temp will create a folder named temp.

Image description

Image description
To remove a folder, use the rmdir command followed by the folder name.

For example,

C:\user\ranjith>python>rmdir temp will delete the temp folder.

Image description
Note that the rm command is used for files in some systems, but in Command Prompt, you use del for files and rmdir for directories.

Creating and removing directories:

To create a directory, use the command mkdir txt. 
To remove a directory and its contents, use rmdir /s txt.

This will delete all files and subfolders in the directory as well as the directory itself.

Image description

Use Ctrl + Left Arrow to move the cursor to the beginning of the line and Ctrl + Right Arrow to move it to the end. 

Image description

Image description

To check the version, use var.

Image description

 To start multiple command boxes, use Start.

Image description

Image description

To exit, use Exit.

Image description


Drives and Color Commands:

To list all drives, use: wmic logicaldisk get name. This will show all available drives.

c:\user> ranjith > 
wmic logicaldisk get name

Image description

To switch to a different drive, type the drive letter followed by a colon (e.g., E:).

C:\user> ranjith >  E:

To list files in the current drive, use: dir.

E :\> dir

To view hidden files, use: dir /a.

E :\> dir /a

Image description

To see a directory tree, use: tree.

Image description

E :\> tree 

Changing Text and Background Colors:

E :\> color /?

Image description

Image description

To change the color of text and background, use: color /? to see help options.

For example, color a changes the text color to green.

Image description

E :\> color
E :\> color a

color fc sets a bright white background (if 'f' is not given, it defaults to black) and changes text color to bright red.

Image description

E :\> color fc

Image description

These commands help manage files and customize the appearance of your command prompt

File Attributes:

To view file attributes and get help, use: attrib /?.

Image description

C:\user> ranjith >  YouTube > attrib /? 

Image description
To see the attributes of a file, use: attrib sample.txt.

Image description

Image description

C:\user> ranjith >  Desktop >youtube >
attrib sample. txt

Replace sample.txt with your file name.
To add the "hidden" attribute to a file, use: attrib +h sample.txt.

Image description

C:\user> ranjith >  Desktop >youtube >
attrib +h sample. txt 

To remove the "hidden" attribute, use: attrib -h sample.txt.

Image description

Image description

C:\user> ranjith >  Desktop >youtube >
attrib +r - h sample. txt

Deleting and Creating Files:

To delete a file, use: del sample.txt.

Image description

C:\user> ranjith >  Desktop >youtube >
del sample. txt

del - delete <FileName >

To create a new file, use: echo. > sample.txt. This creates an empty file.

Image description

C:\Users\mrkis\Desktop\Youtube>
echo > sample.txt

To write text to a file, use: echo Kishore > sample.txt. This writes "Kishore" to the file.

Image description

Image description

C:\Users\mrkis\Desktop\Youtube>
echo Kishore > sample.txt

Image description

Image description

C:\Users\mrkis\Desktop\Youtube>
type sample.txt

To view the contents of the file, use: type sample.txt.
Appending Text to Files:

Image description

C:\Users\mrkis\Desktop\Youtube>echo hello>sample.txt

To add text to the end of a file without overwriting existing content, use: echo world >> sample.txt.

C:\Users\mrkis\Desktop\Youtube>type sample.txt

This will add "world" to the end of sample.txt.

Image description

To see the updated content, use: type sample.txt.
Copying Files:

To copy a file to another location or with a new name, use: copy sample.txt test2.txt. This copies sample.txt to a new file named test2.txt in the same directory. If you want to specify a different directory, provide the path instead of just the filename.

Image description

Image description

C:\Users\mrkis\Desktop\Youtube>
copy sample.txt test2

This guide helps with managing file attributes, performing file operations, and

Copying Files Between Disks:

To copy a file from one disk to another, use: copy sample.txt E:. This copies sample.txt from the current location to the E: drive.
Using XCOPY for Copying Directories:

To copy files and directories, including subdirectories, use: xcopy test1 test2 /s. This copies test1 (which can be a file or directory) to test2, including all subfolders and files.
Moving Files:

C:\Users\mrkis\Desktop\Youtube>
copy sample.txt e:
E - another disk

To move files from one location to another, use: move test1 test2. This command moves test1 to test2. If test2 is a folder, test1 will be moved into it. If test2 is a file name, test1 will be renamed to test2.
In summary:

C:\Users\mrkis\Desktop\Youtube>
xcopy test1 test2 /s
copy sample.txt test2
Sample. txt - endha file ah copy seiya vendum. 

S - sub files

copy source destination copies files.
xcopy source destination /s copies files and directories, including subdirectories.
move source destination moves files or renames them

Image description

Image description
Image description

பைத்தான் பயிற்சி வகுப்பின் மூலம் விளையாட்டு நிரல் எழுத முடிந்து

கணியம் அறக்கட்டளை ஏற்பாடு செய்த பைத்தான் பயிற்சி வகுப்பின் மூலம் தொல்காப்பிய மெய்ம்மயக்கத்திற்கு ஒரு விளையாட்டு நிரல் எழுத முடிந்தது. அது இன்னும் ஊக்கத்தை அளித்தது. பயிற்றுநர் செய்யது சாபர் அவர்கள் நன்றிக்குரியவர்.
from meymayakkamfinal1 import *

print ("மெய்ம்மயக்கம் விளையாட்டை விளையாடலாமா")
print ("மெய்ம்மயக்க விளையாட்டை விளையாடப் படிநிலைகளுள் ஒன்றைத் தெரிவுசெய்க")

படிநிலைகள் = [
"1. க்+க",
"2. ங்+கங",
"3. ச்+ச",
"4. ஞ்+சஞய",
"5. ட்+கசடப",
"6. ண்+கசஞடணபமயவ",
"7. த்+த",
"8. ந்+தநய",
"9. ப்+ப",
"10. ம்+பமயவ",
"11. ய்+கசதபஞநமயவங",
"12. ர்+கசதபஞநமயவங",
"13. ழ்+கசதபஞநமயவங",
"14. வ்+வ",
"15. ல்+கசபலயவ",
"16. ள்+கசபளயவ",
"17. ற்+கசபற",
"18. ன்+கசஞபமயவறன",
"19. ர, ழ குற்று ஒற்று ஆகா"
]

print (படிநிலைகள் )

விதிகள் = [meymayakkam1, meymayakkam2, meymayakkam3, meymayakkam4, meymayakkam5, meymayakkam6, meymayakkam7, meymayakkam8, meymayakkam9, meymayakkam10, meymayakkam11, meymayakkam12, meymayakkam13, meymayakkam14, meymayakkam15, meymayakkam16, meymayakkam17, meymayakkam18, meymayakkam19]

விளையாடும்_களமுறை = 5

while விளையாடும்களமுறை > 0:
விளையாடும்
களமுறை = விளையாடும்_களமுறை - 1

தெரிவுசெய் = input("விளையாடும் விதியைத் தெரிவுசெய் : ")
print (தெரிவுசெய் )
உள்ளீட்டுச்சொல் = input("ஒரு சொல்லைத் தருக : ")

if தெரிவுசெய் == "1" and meymayakkam1(உள்ளீட்டுச்சொல்):
        print ("மெய்ம்மயக்க விதி1இன்படி சரியான சொல்")
elif தெரிவுசெய் == "2" and meymayakkam2(உள்ளீட்டுச்சொல்):
        print ("மெய்ம்மயக்க விதி2இன்படி சரியான சொல்")
else:
    print ("மெய்ம்மயக்க விதிகளின்படி இது தவறான சொல். மீண்டும் விளையாடுங்கள்.")

6.Functions | py

18 July 2024 at 07:17

function

A function is a block of code which only runs when it is called.

You can pass data, known as parameters, into a function.

A function can return data as a result.

def python():
print("Hello world")

Calling a Function:

``def python():
print("Hello world, python ")

Python ()``

Arguments

Information can be passed into functions as arguments.

Arguments are specified after the function name, inside the parentheses. You can add as many arguments as you want, just separate them with a comma.

`def p_name(name, age):
Print ("name :" +name +"age :" +age)
p_name ("dhoni", "39" )

Output:

Name: Dhoni age: 39`

Tasks:
Image description

Playlist :
https://www.youtube.com/live/dGyoEQsc4iQ?si=9dArLhgssryp-eOl

❌
❌