Re: [Tutor] Please unsubscribe me from thi list

2018-03-15 Thread Steven D'Aprano
On Wed, Mar 14, 2018 at 06:30:04PM +, Greg Johnson wrote:

> Please unsubscribe me from thi list

At the top of each digest, it says:

To subscribe or unsubscribe via the World Wide Web, visit
https://mail.python.org/mailman/listinfo/tutor

and then again at the bottom of each email:

To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


You can unsubscribe yourself. I can't do it for you.

All the best,


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


[Tutor] PYTHON HELP

2018-03-15 Thread Prashanth Ram
Dear Sir/Madam,

I'm a beginner in Python. I have written a code to open browsers using
selenium framework. I have purchased a Virtual Private Server (VPS) with
CentOS 6.9 installed from GoDaddy.

My code is working well in localhost but when I try to open that in VPS
server I'm failing in running that code. I'm getting errors. I have
installed Chrome and it's drivers. Even though I'm facing errors.

I request your team to help me in this. Please find the attachments

Thanks & Regards,
Prashanth R
ITW Travel and Leisure Pvt Ltd.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Python Script Testing

2018-03-15 Thread Preeti Saxena
Hi,
   I am new to python. I am trying to test my program, like a coursera
submission, which takes run time arguments using "raw_input()". Is there a
way I can write all the input data into a file and pass it from command
line to the script?
1. I have to use "raw_input".
2. I do not wish to open a file inside the script as that will beat the
purpose.

Thanks for any and all the help.

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


Re: [Tutor] PYTHON HELP

2018-03-15 Thread David Rock

> On Mar 15, 2018, at 08:42, Prashanth Ram  wrote:
> 
> I'm a beginner in Python. I have written a code to open browsers using
> selenium framework. I have purchased a Virtual Private Server (VPS) with
> CentOS 6.9 installed from GoDaddy.
> 
> My code is working well in localhost but when I try to open that in VPS
> server I'm failing in running that code. I'm getting errors. I have
> installed Chrome and it's drivers. Even though I'm facing errors.
> 
> I request your team to help me in this. Please find the attachments
> 

Welcome,

Your attachments did not come through.  This list generally only works with 
in-line text.  If you post your code, what you expect and what the errors are, 
we will have a better chance of helping.

Being a tutor list, help with the selenium framework is not guaranteed, though. 
 Hopefully your issue is something basic.


— 
David Rock
da...@graniteweb.com




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


Re: [Tutor] PYTHON HELP

2018-03-15 Thread Alan Gauld via Tutor
On 15/03/18 13:42, Prashanth Ram wrote:

> My code is working well in localhost but when I try to open that in VPS
> server I'm failing in running that code. I'm getting errors. I have
> installed Chrome and it's drivers. Even though I'm facing errors.
> 
> I request your team to help me in this. Please find the attachments

This is a text based email list so any binary attachments get stripped
by the server for security reasons. Please send the code plus any error
messages as text within your emails. Alternatively post images on a web
site and send a link.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: [Tutor] Python Script Testing

2018-03-15 Thread Alan Gauld via Tutor
On 15/03/18 16:56, Preeti Saxena wrote:
> Hi,
>I am new to python. I am trying to test my program, like a coursera
> submission, which takes run time arguments using "raw_input()". Is there a
> way I can write all the input data into a file and pass it from command
> line to the script?

In normal Python yes, you can simply pass the file name as an
argument to the program or you can use input redirection to
read the data from the file as if it were input by a user.

Unfortunately neither of these options is likely to work in
a web environment - one of the disadvantages of using such
a tool. The issue is not a Python one but one with your
tutorial. I suggest you contact the authors directly to
ask if they can suggest a solution (or incorporate
such a feature).

> 1. I have to use "raw_input".
> 2. I do not wish to open a file inside the script as that will beat the
> purpose.

In real-world python you could just use input redirection:

## data.txt ##
Alan
##

## myscript.py ###
name = raw_input("What's your name? ")
print "Hello ", name
##

Executed with:

$ python myscript.py < data.txt


HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: [Tutor] Python Script Testing

2018-03-15 Thread Alex Kleider

On 2018-03-15 09:56, Preeti Saxena wrote:

Hi,
   I am new to python. I am trying to test my program, like a coursera
submission, which takes run time arguments using "raw_input()". Is 
there a

way I can write all the input data into a file and pass it from command
line to the script?
1. I have to use "raw_input".
2. I do not wish to open a file inside the script as that will beat the
purpose.


If you are using Linux or other UNIX like system (such as a Mac) the 
'HERE Document' feature [1] of the OS might prove useful:


# File: dummy.py
inputs = {}
inputs["first"] = raw_input("")
inputs["second"] = raw_input("")
for key in inputs.keys():
print inputs[key]

Then from the command line:
alex@x301n4:~$ python dummy.py << HERE
first input
second input
HERE

On my system[2] the result is:
second input
first input

[1] http://tldp.org/LDP/abs/html/here-docs.html
[2] Ubuntu 16.4LTS
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python Script Testing

2018-03-15 Thread Alan Gauld via Tutor
Please always use Reply All or Reply List when responding to list emails.

Farwarding to list...

On 15/03/18 17:47, Gaurav Parashar wrote:
> Opening the file inside the script seems the only possible solution.
> As far as I remember about the coursera course, the gave the input
> file, and we need to upload the output file, running the script on our
> local system. So, the above method should work.
>
> On 15 Mar 2018 11:13 pm, "Alan Gauld via Tutor"  > wrote:
>
> On 15/03/18 16:56, Preeti Saxena wrote:
> > Hi,
> >    I am new to python. I am trying to test my program, like a
> coursera
> > submission, which takes run time arguments using "raw_input()".
> Is there a
> > way I can write all the input data into a file and pass it from
> command
> > line to the script?
>
> In normal Python yes, you can simply pass the file name as an
> argument to the program or you can use input redirection to
> read the data from the file as if it were input by a user.
>
> Unfortunately neither of these options is likely to work in
> a web environment - one of the disadvantages of using such
> a tool. The issue is not a Python one but one with your
> tutorial. I suggest you contact the authors directly to
> ask if they can suggest a solution (or incorporate
> such a feature).
>
> > 1. I have to use "raw_input".
> > 2. I do not wish to open a file inside the script as that will
> beat the
> > purpose.
>
> In real-world python you could just use input redirection:
>
> ## data.txt ##
> Alan
> ##
>
> ## myscript.py ###
> name = raw_input("What's your name? ")
> print "Hello ", name
> ##
>
> Executed with:
>
> $ python myscript.py < data.txt
>
>
> HTH
> --
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> 
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
> 
>
>
> ___
> Tutor maillist  -  Tutor@python.org 
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
> 
>

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos

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