File Pointerr in Hindi

What is File Pointer in Python

File pointer एक position होता है, जो हमे दिखाता है कि हम file में किस जगह पर है, python में by default ये pointer किसी file के starting (यानि 0 index) पर होता है।

File Pointer Methods

python में file pointer के position के लिए f.tell() और f.seek() functions का use किया जाता है।

tell() Method

tell() method हमे file pointer का current position बताता है। जब file को open किया जाता है तो pointer का position 0 index (starting) पर होता है, but जब हम file में कुछ read या write करते है तो pointer move हो जाता है, ऐसे में हम tell() method का use करके pointer का current position देख सकते है।

seek() Method

seek() method का use करके हम pointer को किसी specific position पर ले जा सकते है। इसमे 2 parameter होते है-

  1. offset : हमे pointer को file में कितने bytes move करना है वो argument (number) हमे इसमे देंगे।
  2. whence : ये optional होता है जिसका by default value 0 होता है मतलब pointer file में beginning से move होगा। अगर हम इसमे 1 देंगे तो pointer अपने current position से move होगा, और अगर हमे 2 देंगे तो pointer उस file में end से move करेगा।

उम्मीद करते है कि आपको File Pointer अच्छे समझ मे आ गया होगा ये एक File Handling का topic है। अपने learning को continue रखने के लिए next button पर click करे,

Add a comment...

  • All Posts
  • Artificial Intelligence
  • Computer Fundamentals
  • Computer Networks
  • Data Analytics
  • Data Science
  • DBMS
  • Deep Learning
  • Digital Electronics
  • DSA with Python
  • Excel
  • Exercise
  • Git & Github
  • Machine Learning
  • Matplotlib
  • Natural Language Processing
  • NumPy
  • Operating System
  • Pandas-s
  • Power BI
  • Python Tutorial
  • Scikit-learn
  • Seaborn
  • SQL & MySQL
computer networks

Table of Contents All Chapters 1. OSI Model      1.1. Physical Layer      1.2. Data Link Layer  ...

computer networks

Table of Contents All Chapters 1. Topology 2. Types of Topology      2.1. Point to Point Topology    ...

computer networks

Table of Contents All Chapters 1. Data Communication 2. Types of Data Communication      2.1. Simplex      2.2....

digital electronics number system

Table of Contents All Chapters 1. Logic Gate 2. AND Gate      2.1. AND Gate Truth Table 3. OR...

Edit Template

Sign up to track your learning

Login to continue your learning tracking

To reset your password, please enter your email address or username below.

Scroll to Top