Re: [Tutor] Move files to a new directory with matching folder names

2014-05-22 Thread Dave Angel
questions anon  Wrote in message:
>

Please use text mail to post, as html has a number of problems. 
 In your current message,  indentation is lost. Also don't
 top-post in this forum. Any selective quoting of previous context
 should precede your comments. 

Your logic presently tries to copy a directory with the shutil.
 copy function.  In your first post,  you used a loop. Why did you
 omit it now?


-- 
DaveA

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


[Tutor] Doubts about installing python3.1 in squeeze

2014-05-22 Thread Markos

Hi,

I'm learning Python and I'm using Debian 6.0 (squeeze)

The installed version is 2.6.6. (python -V)

I have seen some recommendations for beginners to invest in version 3.

I found package of Python 3.1 in repository for squeeze.

I am considering installing Python 3.1 with

apt-get install python3.1

But I found the site 
http://www.circuidipity.com/python2-and-python3.html information on how 
to keep the two versions using virtualenv.


Also I found in the /usr/bin python2.5 and python2.6

And in /usr/lib python2.4, python2.5 and python2.6

Can I just run apt-get install python3.1 or should I do any other 
configuration?


I'm confused.


Are there any risk to install python3.1 and some programs stop working 
on my debian squeeze?


Thanks for any tips?
Markos
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Doubts about installing python3.1 in squeeze

2014-05-22 Thread Alex Kleider

On 2014-05-22 06:17, Markos wrote:

Hi,

I'm learning Python and I'm using Debian 6.0 (squeeze)

The installed version is 2.6.6. (python -V)

I have seen some recommendations for beginners to invest in version 3.

I found package of Python 3.1 in repository for squeeze.

I am considering installing Python 3.1 with

apt-get install python3.1

But I found the site
http://www.circuidipity.com/python2-and-python3.html information on
how to keep the two versions using virtualenv.

Also I found in the /usr/bin python2.5 and python2.6

And in /usr/lib python2.4, python2.5 and python2.6

Can I just run apt-get install python3.1 or should I do any other 
configuration?


I'm confused.


Are there any risk to install python3.1 and some programs stop working
on my debian squeeze?

Thanks for any tips?
Markos


On Ubuntu both v2 and v3 are installed by default.
Have you tried typing
python3
on the command line?
If you get the interpreter, it's installed.
Then you just have to use a different shebang line in your code files:
#!/usr/bin/env python3

I don't have a debian system close at hand to test this myself.

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


[Tutor] Fwd: Option on How to create web Interface

2014-05-22 Thread Danny Yoo
(Forwarding to Python-tutor; currently I'm a bit busy at this moment.)


-- Forwarded message --
From: fabu desay 
Date: Thu, May 22, 2014 at 1:26 AM
Subject: Re: [Tutor] Option on How to create web Interface
To: Danny Yoo 


Thanks A bunch But is there like a sandbox for me to try it on my local server?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Doubts about installing python3.1 in squeeze

2014-05-22 Thread C Smith
Sorry, typing is hard.
*You will need to use virtualenv

On Thu, May 22, 2014 at 2:40 PM, C Smith  wrote:
> You can't use apt-get or similar to install 3.1.
> You will need to virtualenv.
>
> On Thu, May 22, 2014 at 12:22 PM, Alex Kleider  wrote:
>> On 2014-05-22 06:17, Markos wrote:
>>>
>>> Hi,
>>>
>>> I'm learning Python and I'm using Debian 6.0 (squeeze)
>>>
>>> The installed version is 2.6.6. (python -V)
>>>
>>> I have seen some recommendations for beginners to invest in version 3.
>>>
>>> I found package of Python 3.1 in repository for squeeze.
>>>
>>> I am considering installing Python 3.1 with
>>>
>>> apt-get install python3.1
>>>
>>> But I found the site
>>> http://www.circuidipity.com/python2-and-python3.html information on
>>> how to keep the two versions using virtualenv.
>>>
>>> Also I found in the /usr/bin python2.5 and python2.6
>>>
>>> And in /usr/lib python2.4, python2.5 and python2.6
>>>
>>> Can I just run apt-get install python3.1 or should I do any other
>>> configuration?
>>>
>>> I'm confused.
>>>
>>>
>>> Are there any risk to install python3.1 and some programs stop working
>>> on my debian squeeze?
>>>
>>> Thanks for any tips?
>>> Markos
>>
>>
>> On Ubuntu both v2 and v3 are installed by default.
>> Have you tried typing
>> python3
>> on the command line?
>> If you get the interpreter, it's installed.
>> Then you just have to use a different shebang line in your code files:
>> #!/usr/bin/env python3
>>
>> I don't have a debian system close at hand to test this myself.
>>
>> alex
>>
>> ___
>> Tutor maillist  -  Tutor@python.org
>> To unsubscribe or change subscription options:
>> https://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Doubts about installing python3.1 in squeeze

2014-05-22 Thread C Smith
You can't use apt-get or similar to install 3.1.
You will need to virtualenv.

On Thu, May 22, 2014 at 12:22 PM, Alex Kleider  wrote:
> On 2014-05-22 06:17, Markos wrote:
>>
>> Hi,
>>
>> I'm learning Python and I'm using Debian 6.0 (squeeze)
>>
>> The installed version is 2.6.6. (python -V)
>>
>> I have seen some recommendations for beginners to invest in version 3.
>>
>> I found package of Python 3.1 in repository for squeeze.
>>
>> I am considering installing Python 3.1 with
>>
>> apt-get install python3.1
>>
>> But I found the site
>> http://www.circuidipity.com/python2-and-python3.html information on
>> how to keep the two versions using virtualenv.
>>
>> Also I found in the /usr/bin python2.5 and python2.6
>>
>> And in /usr/lib python2.4, python2.5 and python2.6
>>
>> Can I just run apt-get install python3.1 or should I do any other
>> configuration?
>>
>> I'm confused.
>>
>>
>> Are there any risk to install python3.1 and some programs stop working
>> on my debian squeeze?
>>
>> Thanks for any tips?
>> Markos
>
>
> On Ubuntu both v2 and v3 are installed by default.
> Have you tried typing
> python3
> on the command line?
> If you get the interpreter, it's installed.
> Then you just have to use a different shebang line in your code files:
> #!/usr/bin/env python3
>
> I don't have a debian system close at hand to test this myself.
>
> alex
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Option on How to create web Interface

2014-05-22 Thread Chris “Kwpolska” Warrick
On Thu, May 22, 2014 at 12:54 AM, Alan Gauld  wrote:
> But basically this just creates a text file in a folder somewhere.
> Its only when that is accessed via a web server that it gets
> sent to a browser, and only as a static file.
>
> If you wanted to do it dynamically you'd have a file called
> something like mypage.cgi which looked like:
>
> print("My web page")
> print("This the body")
>
> And provided the web server was configured to run python
> on cgi files you could access it as
>
> http://myserver.addresss/mypage.cgi

Sadly, this is not the modern way to do it.  These days, it’s
recommended to use something like Flask, or Django, or whatnot.  CGI
is ancient, and problematic.

-- 
Chris “Kwpolska” Warrick 
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Doubts about installing python3.1 in squeeze

2014-05-22 Thread Chris “Kwpolska” Warrick
On Thu, May 22, 2014 at 8:41 PM, C Smith  wrote:
> Sorry, typing is hard.
> *You will need to use virtualenv
>
> On Thu, May 22, 2014 at 2:40 PM, C Smith  wrote:
>> You can't use apt-get or similar to install 3.1.
>> You will need to virtualenv.

…or maybe not.  The correct way is compiling it on your own (the usual
Unix way, but using `make altinstall` for the install step).
virtualenv won’t help in this case, it’s not what virtualenv is for.

-- 
Chris “Kwpolska” Warrick 
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Option on How to create web Interface

2014-05-22 Thread Alan Gauld

On 22/05/14 19:47, Chris “Kwpolska” Warrick wrote:

On Thu, May 22, 2014 at 12:54 AM, Alan Gauld  wrote:

But basically this just creates a text file in a folder somewhere.
Its only when that is accessed via a web server that it gets
sent to a browser, and only as a static file.

If you wanted to do it dynamically you'd have a file called
something like mypage.cgi which looked like:

print("My web page")
print("This the body")

And provided the web server was configured to run python
on cgi files you could access it as

http://myserver.addresss/mypage.cgi


Sadly, this is not the modern way to do it.  These days, it’s
recommended to use something like Flask, or Django, or whatnot.  CGI
is ancient, and problematic.



CGI is still how many frameworks operate under the covers.
They just hide it well. But I agree that using a framework
is the only sane way to build a significant web app nowadays
and I was not promoting original CGI as a solution.

However, the OP seemed to be asking about the low level
details of how a web app works and using a framework
(both by design and intent) hides all of that from you
whereas an old fashioned CGI app exposes it.
Hence my illustration.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

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