Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Print the number of items in a list on ubuntu terminal
Post: Print the number of items in a list on ubuntu term...

Hey all. In return of a command, I have the following output on my ubuntu terminal. Output:tshark: Display filters were specified both with "-Y" and with additional command-line arguments. 21 ...
buttercup General Coding Help 2 1,950 Jul-23-2020, 09:08 PM
    Thread: Print a certain string only the first time it appears in a test file
Post: RE: Print a certain string only the first time it ...

(Jul-22-2020, 09:48 AM)palladium Wrote: Looks like a good case for a generator. def count(f): for line in f: if 'List' in line: yield line.replace('\n','') with open('grub...
buttercup General Coding Help 5 2,781 Jul-22-2020, 05:52 PM
    Thread: Print a certain string only the first time it appears in a test file
Post: RE: Print a certain string only the first time it ...

(Jul-22-2020, 06:45 AM)bowlofred Wrote: (Jul-22-2020, 05:31 AM)buttercup Wrote: I want to print the List of ARFCNs which is available numerous times in the text. I find it odd that you pasted such...
buttercup General Coding Help 5 2,781 Jul-22-2020, 07:55 AM
    Thread: Print a certain string only the first time it appears in a test file
Post: Print a certain string only the first time it appe...

Hey all. I have a large text file that contains several repetitive statements along with other text. (Shown in python tags to get a scrollbar) P3 Rest Octets H... .... = Channel Needed 3 &...
buttercup General Coding Help 5 2,781 Jul-22-2020, 05:31 AM
    Thread: How to extract a single word from a text file
Post: RE: How to extract a single word from a text file

(Jul-21-2020, 07:41 PM)bowlofred Wrote: You replaced something in your code to try to call grgsm_livemon_headless. (At least I think you did, because you're getting that error now). Can you show t...
buttercup General Coding Help 7 3,577 Jul-22-2020, 02:30 AM
    Thread: How to extract a single word from a text file
Post: RE: How to extract a single word from a text file

(Jul-21-2020, 03:43 PM)bowlofred Wrote: Is grgsm_livemon_headless a python command or a shell command? Can you show the code where you're calling it? Right now it doesn't look like python. Im new ...
buttercup General Coding Help 7 3,577 Jul-21-2020, 07:34 PM
    Thread: How to extract a single word from a text file
Post: RE: How to extract a single word from a text file

(Jul-21-2020, 07:02 AM)bowlofred Wrote: Your first error is because you've set "x" to be the return value of print(). print() has no return value, so "x" becomes None. What did you want x to be? ...
buttercup General Coding Help 7 3,577 Jul-21-2020, 08:43 AM
    Thread: How to display results from terminal window onto tkinter.
Post: How to display results from terminal window onto t...

Hey all. Ive made a Tkinter frontend using the following code: #!/usr/bin/env python3 import tkinter as tk import subprocess import tkinter.messagebox import os path = '/home/rukha/Desktop/hacker.pn...
buttercup GUI 0 3,649 Jul-21-2020, 04:41 AM
    Thread: How to extract a single word from a text file
Post: How to extract a single word from a text file

Hey all. I have a test file called beta.txt which has the following data: ARFCN: 990, Freq: 928.2M, CID: 667, LAC: 1007, MCC: 410, MNC: 3, Pwr: -30 I wish to save the value of frequency in a va...
buttercup General Coding Help 7 3,577 Jul-21-2020, 04:32 AM
    Thread: Syntax error: "(" unexpected
Post: RE: Syntax error: "(" unexpected

(Jul-20-2020, 06:15 AM)menator01 Wrote: Tutorials here on the forum is a good place to start. Thankyou.
buttercup General Coding Help 4 2,887 Jul-20-2020, 06:25 AM
    Thread: Syntax error: "(" unexpected
Post: RE: Syntax error: "(" unexpected

(Jul-20-2020, 06:11 AM)menator01 Wrote: I do not think you will be able to mix bash and python that way. okay so how do you suggest that I go about it?
buttercup General Coding Help 4 2,887 Jul-20-2020, 06:13 AM
    Thread: Syntax error: "(" unexpected
Post: Syntax error: "(" unexpected

Hey all. Im working on my python code where I intend to read a particular column from the text file and then print the duplicate entries in that file. My data is in the following format: Output:ARFCN:...
buttercup General Coding Help 4 2,887 Jul-20-2020, 06:04 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020