[Tutor] which is best python 2 or python3

2016-05-23 Thread Palanikumar Gopalakrishnan
Hi buddies,
I read one article on internet which is said python 2
and python3 is totally different in programming.
As a beginner which i prefer for my learning,  python 2 or python3 ?

--
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Help:python based framework show error

2016-07-02 Thread Palanikumar Gopalakrishnan
Hi dudes,
I run the python based framework routersploit , it shows
the following error.

Traceback (most recent call last):
File "./rsf.py", line 11, in 
routersploit()
File "./rsf.py", line 7, in routersploit
rsf = RoutersploitInterpreter()
File "/home/tester/routersploit/routersploit/interpreter.py", line
155, in __init__
super(RoutersploitInterpreter, self).__init__()
File "/home/tester/routersploit/routersploit/interpreter.py", line 25,
in __init__
self.setup()
File "/home/tester/routersploit/routersploit/interpreter.py", line 39, in setup
readline.read_history_file(self.history_file)
IOError: [Errno 13] Permission denied



Thanks in Advance
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Module webbrowser.os

2016-11-02 Thread Palanikumar Gopalakrishnan
Hi Guys,
 I recently tested with some code , which open browser

import webbrowser
webbrowser.open("https://www.google.com";)

After that i want to experiment with webbrowser.os  module, But dont know
how to execute it.So I use dir(webbrowser.os) to find some details. Then i
tried the following

webbrowser.os(umask)

But It retruns the following error



*Traceback (most recent call last):  File "", line 1, in
NameError: name 'umask' is not defined*





-- 

*Warm Regards,*

*Palanikumar Gopalakrishnan *[image: ✌]
*Developer*
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Module webbrowser.os

2016-11-03 Thread Palanikumar Gopalakrishnan
On Wed, Nov 2, 2016 at 7:36 AM,  wrote:

> Send Tutor mailing list submissions to
> tutor@python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body 'help' to
> tutor-requ...@python.org
>
> You can reach the person managing the list at
> tutor-ow...@python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
>
> Today's Topics:
>
>1. Re: Python code (Danny Yoo)
>2. Re: implementing sed - termination error (c...@zip.com.au)
>3. Module webbrowser.os (Palanikumar Gopalakrishnan)
>4. Re: implementing sed - termination error (Peter Otten)
>5. Re: Module webbrowser.os (Alan Gauld)
>6. Re: Module webbrowser.os (Steven D'Aprano)
>
>
> -- Forwarded message --
> From: Danny Yoo 
> To: Haley Sandherr 
> Cc: Tutor@python.org
> Date: Tue, 1 Nov 2016 21:58:08 -0700
> Subject: Re: [Tutor] Python code
> On Nov 1, 2016 4:57 PM, "Haley Sandherr"  wrote:
> >
> > Hello, I am new to python and need help with this question:
> >
> > Compose a function odd ( ) that takes three bool arguments and returns
> True if an odd number of arguments are True and False otherwise.
>
> Do you understand all of the terms in the question?  Are there terms in the
> question that you don't know?
>
> Try a simpler, related problem if you are getting stuck: it may help point
> the way forward.
>
> For example, your original question has three arguments.  Can you do the
> problem variation that just has one boolean argument?  Call this odd1().
> You can see that it's like the original problem.
>
> If you can do this, try writing odd2(): a function that can deal with two
> arguments. Can you do this?
>
> What other similar functions have you seen so far?
>
> These questions are intended to help us calibrate our mental model of what
> you currently understand.  Please tell us more do we can give you
> appropriate answers.
>
>
>
> -- Forwarded message --
> From: c...@zip.com.au
> To: bruce 
> Cc: Python Tutor Mailing List 
> Date: Wed, 2 Nov 2016 16:22:21 +1100
> Subject: Re: [Tutor] implementing sed - termination error
> On 01Nov2016 20:18, bruce  wrote:
>
>> Running a test on a linux box, with python.
>> Trying to do a search/replace over a file, for a given string, and
>> replacing the string with a chunk of text that has multiple lines.
>>
>> From the cmdline, using sed, no prob. however, implementing sed, runs
>> into issues, that result in a "termination error"
>>
>
> Just terminology: you're not "implementing sed", which is a nontrivial
> task that would involve writing a python program that could do everything
> sed does.  You're writing a small python program to call sed to do the work.
>
> Further discussion below.
>
> The error gets thrown, due to the "\" of the newline. SO, and other
>> sites have plenty to say about this, but haven't run across any soln.
>>
>> The test file contains 6K lines, but, the process requires doing lots
>> of search/replace operations, so I'm interested in testing this method
>> to see how "fast" the overall process is.
>>
>> The following psuedo code is what I've used to test. The key point
>> being changing the "\n" portion to try to resolved the termination
>> error.
>>
>> import subprocess
>>
>> ll_="ffdfdfdfg"
>> ll2_="12112121212121212"
>> hash="a"
>>
>> data_=ll_+"\n"+ll2_+"\n"+qq22_
>> print data_
>>
>
> Presuming qq22_ is not shown.
>
> cc='sed -i "s/'+hash+'/'+data_+'/g" '+dname
>> print cc
>> proc=subprocess.Popen(cc, shell=True,stdout=subprocess.PIPE)
>> res=proc.communicate()[0].strip()
>>
>
> There are two fairly large problems with this program. The first is your
> need to embed newlines in the replacement pattern. You have genuine
> newlines in your string, but a sed command would look like this:
>
>  sed 's/a/ffdfdfdfg\
>  12112121212121212\
>  q/g'
>
> so you need to replace the newlines with "backslash and newline".
>
> Fortunately strings have a .replace() method which you can use for this
> purpose. Look it up:
>
>  https://docs.python.org/3/library/stdtypes.html#str.replace
>
> You can use it to make data_ h

[Tutor] IndentationError: unexpected indent

2016-11-08 Thread Palanikumar Gopalakrishnan
Hi Guys,
 I tried this code from internet, Its returns following please
guide me to solve this error

-- 

*Warm Regards,*

*Palanikumar Gopalakrishnan *[image: ✌]
*Developer*
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Fwd: IndentationError: unexpected indent

2016-11-08 Thread Palanikumar Gopalakrishnan
Hi Guys,
 I tried this code from internet, Its returns following please
guide me to solve this error











* passwordFile = open('File.txt') secretPassword =
passwordFile.read() print('Enter your password.') typedPassword = input()
if typedPassword == secretPassword:print('Access granted')if
typedPassword == '12345':   print('That password is one that an idiot
puts on their luggage.')  else:print('Access denied')*



-- 

*Warm Regards,*

*Palanikumar Gopalakrishnan *[image: ✌]
*Developer*





-- 

*Warm Regards,*

*Palanikumar Gopalakrishnan *[image: ✌]
*Developer*
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] How to get url call back from the browser

2017-03-01 Thread Palanikumar Gopalakrishnan
*import SimpleHTTPServer
import SocketServer

PORT = 8000

Handler = SimpleHTTPServer.SimpleHTTPRequestHandler

httpd = SocketServer.TCPServer(("", PORT), Handler)

print "serving at port", PORT
httpd.serve_forever()*



I use this code to run simple *http server.* If i enter in browser in
*localhost:8000.
*It will show the contents of current directory. But If i enter url like
this *localhost:8000/sometext* . It will returns 404 error. I want to get
this string in my python code to do somthing based this callback. Please
guide me to solve this issue

-- 

*Warm Regards,*

*Palanikumar Gopalakrishnan *[image: ✌]
*Developer*
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor