Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: python- read specific words from log file
Post: RE: python- read specific words from log file
(Dec-30-2017, 05:58 PM)anna Wrote: tried small code, not able to search other parameters like USERNAME and Message
import re
file = open("test.txt", "r")
#mac = re.compile(r'(?:[0-9A-F]{2}[:]){5}(?... |
|
Terafy |
General Coding Help |
18 |
13,043 |
Dec-30-2017, 09:40 PM |
|
|
Thread: Function call
Post: RE: Function call
missing round brackets
add (function1() , function2())also you need to change the string to a numeric when you add them. |
|
Terafy |
Homework |
3 |
3,206 |
Dec-29-2017, 11:02 PM |
|
|
Thread: Need help developing a game with Raspberry Pi 3
Post: RE: Need help developing a game with Raspberry Pi ...
(Dec-27-2017, 04:36 PM)nilamo Wrote: (Dec-27-2017, 01:55 PM)Terafy Wrote: Why not just create a GUI?
• Have a picture of a punching bag at rest.
• Have event handlers that calls a function when yo... |
|
Terafy |
Homework |
4 |
3,265 |
Dec-28-2017, 05:43 AM |
|
|
Thread: Completly lost about to fail my class!
Post: RE: Completly lost about to fail my class!
I would like to add, when you program in any language make sure your code is case sensitive.
If you copy exercise word for word:
def print_lyrics():
print "I'm a lumberjack, and I'm okay."
print "I s... |
|
Terafy |
Homework |
7 |
4,525 |
Dec-28-2017, 05:39 AM |
|
|
Thread: Need help developing a game with Raspberry Pi 3
Post: RE: Need help developing a game with Raspberry Pi ...
Why not just create a GUI?
• Have a picture of a punching bag at rest.
• Have event handlers that calls a function when you press a certain key. This could be replace later on.
• Replace picture of a ... |
|
Terafy |
Homework |
4 |
3,265 |
Dec-27-2017, 01:55 PM |
|
|
Thread: Parsing serial data "Attribute Error"
Post: RE: Parsing serial data "Attribute Error"
I assuming you are trying to receive messages. It should look something like this...
import serial
data = serial.Serial("/dev/ttyACM0", 9600) #This initialized the connection.
if not data.isOpen()... |
|
Terafy |
General Coding Help |
2 |
3,430 |
Dec-27-2017, 12:54 AM |
|
|
Thread: Python Interface for HWM14
Post: RE: Python Interface for HWM14
Well... I'm using python 3.6.3 IDLE. I get a different error.
Error:Traceback (most recent call last):
File "C:\Users\WONG\Desktop\Random\pyHWM14-master\test.py", line 4, in <module>
from... |
|
Terafy |
General Coding Help |
4 |
5,330 |
Dec-26-2017, 10:21 PM |
|
|
Thread: Python Interface for HWM14
Post: RE: Python Interface for HWM14
Is pyhwm2014 folder in the same directory as the python script? |
|
Terafy |
General Coding Help |
4 |
5,330 |
Dec-26-2017, 08:41 AM |
|
|
Thread: White Space Help
Post: RE: White Space Help
(Dec-25-2017, 08:53 PM)wavic Wrote: Try to change line 4 that way:
parser.add_argument("description", nargs="+")or
parser.add_argument("description", nargs="*")
you also need to change the descripti... |
|
Terafy |
General Coding Help |
9 |
6,300 |
Dec-25-2017, 11:04 PM |
|
|
Thread: White Space Help
Post: RE: White Space Help
Try running it like this:
python fire.py "TEST PAGES INTERNAL 15:28:40 on 12/24/17" "TEST_PAGES_INTERNAL_2017_12_24_15_28_33.mp3" |
|
Terafy |
General Coding Help |
9 |
6,300 |
Dec-25-2017, 10:36 AM |
|
|
Thread: Python Text based Game
Post: RE: Python Text based Game
With OOP you need to create and instance. Because I don't know what the class name or if it has any argument. I'm just assume you got a class called:game without any argument
Joebloe = game()
Joebloe.... |
|
Terafy |
General Coding Help |
1 |
3,157 |
Dec-22-2017, 10:10 PM |
|
|
Thread: Word search in grid
Post: RE: Word search in grid
I think you misunderstood what squenson was saying.
It is a bad idea to take other people code and use them if you do not understand what the code does. You are better off starting again and writing... |
|
Terafy |
Homework |
9 |
6,528 |
Dec-22-2017, 09:36 PM |
|
|
Thread: Word search in grid
Post: RE: Word search in grid
When you use line.split() you removed the text file newline (\n). Thus there is no '\n' inside the wordlist. |
|
Terafy |
Homework |
9 |
6,528 |
Dec-22-2017, 02:36 PM |
|
|
Thread: Word search in grid
Post: RE: Word search in grid
2nd code, line 29: Could add print(wordlist)
I think there is no '\n' |
|
Terafy |
Homework |
9 |
6,528 |
Dec-22-2017, 02:16 PM |
|
|
Thread: If/else problems
Post: RE: If/else problems
Yes, it a good standard practice. But the data he provided didn't have that problem so it wasn't necessary to do so.
Yes, I on board! Kind of annoyed that we did not manage to get the previous one in... |
|
Terafy |
Homework |
48 |
19,728 |
Dec-22-2017, 12:51 PM |
|
|
Thread: If/else problems
Post: RE: If/else problems
def c():
found = False
jobs = input("Enter the job title: ")
#right here!
jobs = jobs.capitalize()
for b in employees:
if jobs == b[2]:
## what wi... |
|
Terafy |
Homework |
48 |
19,728 |
Dec-22-2017, 12:35 PM |
|
|
Thread: If/else problems
Post: RE: If/else problems
Yes you could go with
.upper()
.lower()
and the best one to suit your need is:
.capitalize()
print('WiZaRd'.lower())
print('WiZaRd'.upper())
print('WiZaRd'.captialize())Output:wizard
WIZARD
Wizard |
|
Terafy |
Homework |
48 |
19,728 |
Dec-22-2017, 12:25 PM |
|
|
Thread: Getting Attribute Error In My Code
Post: RE: Getting Attribute Error In My Code
The error is in the Student class
def toString(self):
return 'Hello I am {}, I am {} years old, my favorite class is {}, and today I feel {}.'.format(self.__name, self.__age, self.__fav_class, self.__... |
|
Terafy |
General Coding Help |
1 |
3,379 |
Dec-22-2017, 07:11 AM |
|
|
Thread: Unit 18 Procedural Programming Python
Post: RE: Unit 18 Procedural Programming Python
1) You are going to have a infinite loop. Need to move days = days - 1 inside the while loop.
2) .randint need to have input argument as well. .randint(a, b) |
|
Terafy |
Homework |
4 |
3,980 |
Dec-21-2017, 10:53 PM |
|
|
Thread: If/else problems
Post: RE: If/else problems
(Dec-21-2017, 05:02 PM)squenson Wrote: You did quite a lot of progress while I was away (train travel)!
I tried to help him finish on time... but we missed the deadline. **sad**
def c():
found ... |
|
Terafy |
Homework |
48 |
19,728 |
Dec-21-2017, 10:35 PM |