| Author |
Python? |
Ragamuffin
Member

Posts: 46
Location: South Wales
Joined: 23.08.07 Rank: Elite |
|
Hey, i've got a friend thats trying to do her uni assignment with a bit of pythoon and i don't have a clue myself.
she wants to get this code to work but can't
>>> for line in open ('auth.txt'):
if 'oracle' in line:
print "lines : ", lines
she said shes trying to find out how many times people attempted to log into the oracle account and create a log of it.
Could anyone shed some light on this please?
she needs this done by tuesday
Thanks
|
|
| Author |
RE: Python? |
stealth-
Member

Posts: 999
Location: Eh?
Joined: 10.04.09 Rank: God |
|
Um, you need to be more specific with what you want the output to be. Do you want it to output the number of lines that include the word "oracle", or print out the lines that include the word "oracle"?
That code is a mess, she really needs to pay attention in class o.0
The irony of man's condition is that the deepest need is to be free of the anxiety of death and annihilation; but it is life itself which awakens it, and so we must shrink from being fully alive.
http://www.stealth-x.com |
|
| Author |
RE: Python? |
Ragamuffin
Member

Posts: 46
Location: South Wales
Joined: 23.08.07 Rank: Elite |
|
Output the lines the include oracal, i belive.
That code is a mess, she really needs to pay attention in class o.0
And i could agree more lol but shes struggling with it |
|
| Author |
RE: Python? |
spyware
Member

Posts: 4190
Location: The Netherlands
Joined: 14.04.07 Rank: God Warn Level: 90
|
|
Didn't HBH have a stance on stupid homework questions?

"The chowner of property." - Zeph “Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.” - Carl Sagan “Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert |
|
| Author |
RE: Python? |
stealth-
Member

Posts: 999
Location: Eh?
Joined: 10.04.09 Rank: God |
|
Ragamuffin wrote:
>>> for line in open ('auth.txt'):
if 'oracle' in line:
print "lines : ", lines
Okay, tell her to look at the last line of her code.
"lines" is not a variable.....
The irony of man's condition is that the deepest need is to be free of the anxiety of death and annihilation; but it is life itself which awakens it, and so we must shrink from being fully alive.
http://www.stealth-x.com |
|
| Author |
RE: Python? |
Arabian
Member

Posts: 322
Location: inside you.
Joined: 22.09.10 Rank: God |
|
>>> for line in open ('auth.txt' ):
if 'oracle' in line:
print "lines : ", lines
Is she retarded? If her aim is to print out a value every time a user signs into an Oracle account,
A ) there is no account provided to scan for input.
B ) She's attempting to scan and print out how many times 'oracle' occurs in 'auth.txt'.
Either you heard what she wanted to do wrong, or she's so far off that I don't even wanna help.
Hare Lambda!
Edited by Arabian on 26-02-11 02:44 |
|
| Author |
RE: Python? |
ynori7
Future Emperor of Earth

Posts: 1481
Location: #valhalla
Joined: 08.10.07 Rank: Diabolical |
|
|
Ragamuffin wrote:
she said shes trying to find out how many times people attempted to log into the oracle account and create a log of it.
You can do this from oracle:
select USER_NAME||’ - ‘||MESSAGE||’ - ‘||to_char(LOG_DATE,’dd.mm.yyyy hh24:mi:ss’)||’ - ‘||IP_ADDRESS “Login Failures”
from ORASSO.WWSSO_AUDIT_LOG_TABLE$
where log_date > (sysdate - 7)
and MESSAGE = ‘Login failed’
order by log_date;
You may have to tell the database to audit login attempts. Just google "oracle audit failed login attempts" and you'll find explanations.
|
|