Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9234341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:46:02+00:00 2026-06-18T06:46:02+00:00

Here is my code: for line in open(logfile): if ESSID in line: begin =

  • 0

Here is my code:

for line in open(logfile):
        if "ESSID" in line:
            begin = line.replace(" ", "")
            mid = begin.replace("ESSID:", "")
            final = mid.replace('"', "")
            print final
            self.APList.SetStringItem(self.index, 0, final)
            line = open(ilogfile).readline()
            if begin in line:
                connect = "yes"
            else:
                connect = "no"
            self.APList.SetStringItem(self.index, 3, connect)  

here is the file it’s scanning (well, one of them.):

wlp2s0    IEEE 802.11bgn  ESSID:"MomAndKids"
      Mode:Managed  Frequency:2.462 GHz  Access Point: E0:91:F5:7D:C9:14
      Bit Rate=18 Mb/s   Tx-Power=20 dBm
      Retry  long limit:7   RTS thr=2347 B   Fragment thr:off
      Encryption key:off
      Power Management:off
      Link Quality=62/70  Signal level=-48 dBm
      Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
      Tx excessive retries:0  Invalid misc:603   Missed beacon:0

The main code I’m trying to test:

line = open(ilogfile).readline()
            if begin in line:
                connect = "yes"
            else:
                connect = "no"

I’ve tried using “final” instead of “begin” and reading the whole file instead of the first line (using both “final” and “begin” variables.) Neither worked. Why is this not working?

For full source, it is available at:
https://github.com/codywd/WiFiz/blob/master/main.py

Edit: The indentation is only broken in stackoverflow, not in the actual code.

Edit 2: The other file contains this:

wlp2s0    Scan completed :
          Cell 01 - Address: E0:91:F5:7D:C9:14
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=66/70  Signal level=-44 dBm
                    Encryption key:on
                    ESSID:"MomAndKids"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=00000278820a146f
                    Extra: Last beacon: 80ms ago
                    IE: Unknown: 000A4D6F6D416E644B696473
                    IE: Unknown: 010882840B162430486C
                    IE: Unknown: 03010B
                    IE: Unknown: 2A0104
                    IE: Unknown: 2F0104
                    IE: Unknown: 32040C121860

The relevant portion is at the top of that file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:46:03+00:00Added an answer on June 18, 2026 at 6:46 am

    The following seemed to work fine:

    line = open(ilogfile).readline()
    
    if final.strip() in line.strip():
        connect = "yes"
    else:
        connect = "no"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is my code: string line; ifstream toOpen; toOpen.open(allfiles.txt, ios::in); int fileCounter=0; if(toOpen.is_open()){ while(!toOpen.eof()){
Got this line of code here but its not working. private void Button_Click(object sender,
here is my code:(get file line num and word count) import System.IO import Data.Maybe
Here is my code that adds a line to the grid by pressing the
here is my current line of code: $(<li>).text($(this).text()).appendTo(#theList); Which results in <ul id=theList> <li>blah</li>
Here's my code. See the line that is commented out. When the element id
Hey I have this code right here: http://pastie.org/534470 And on line 109 I get
Here's the line from App.Config: <add key=CheckFileFormatString value=P{0}\t&quot;{1}, {2}&quot;\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}/> Here's the code that puts
Here is the code for (j = 0; j < n_sign; j++) { line
Here is the code: string str; cin>>str; cout<<first input:<<str<<endl; getline(cin, str); cout<<line input:<<str<<endl; The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.