Re: [Tutor] need help

2012-11-01 Thread Alex Clark

On 2012-11-01 21:24:52 +, Matthew Ngaha said:

working through my tutorial ive been told to set up a simple webserver. 
i can't even get started because the 1st line of code its asked me to 
do fails with a syntax error. here's the code:

 
python3 -m http.server
 
any ideas what is going wrong? it asked me to make some simple .html 
files, then in the same directory run that line of code. I havent any 
experience with web servers, so i might not understand advanced 
instructions:(



Works for me with 3.3:


aclark@Alexs-MacBook-Pro:~/ > python3.3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 ...




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



--
Alex Clark · https://www.gittip.com/aclark4life/


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


Re: [Tutor] Introduction

2012-08-18 Thread Alex Clark

Hi Ray,

On 2012-08-18 16:36:40 +, Ray said:


Hello. I am new to the mailing list and to Python. My knowledge of
Python comes almost strictly from Nick Parlante's classes on YouTube
that I've watched over the last week or so.

I'm not certain why I'm diving into Python. My only coding experience
has been using Bash scripts on my Ubuntu system for the past half dozen
years, and so far I'm not particularly convinced that Python has any
advantage FOR ME over what I have been using.

In my Bash scripts I make generous use of sed and grep, with the
occasional use of awk -- batch renaming of files, pulling exif date
information from (manually) downloaded jpegs and adding that date to the
front of file names, removing url '%' coding on photos and replacing it
with "real" text, and the occasional foray into network stuff in
conjunction with vlc or netcat. By no means am I a pro with Bash - only
in the last six months have I really began to understand how to use
arrays rather than temp files - but I can usually accomplish what I set
out to do no matter how ugly the coding!

The potential cross-platform use of Python is probably one of the major
reasons for my interesttho' I don't think I write anything anyone
else would want...and although, as I look at my Python code so far, it's
definitely hard-coded for a Linux system :-p. So much for that reasoning

But here I am - I am looking forward to learning from everyone, but keep
the terminology as simple as possible, if you please - I'm only now
beginning to understand what objects arelol



Welcome! Based on what you describe above, you might enjoy `Text 
Processing in Python`:



- http://gnosis.cx/TPiP/


Alex



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



--
Alex Clark · http://pythonpackages.com


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


[Tutor] ANN: pythonpackages.com beta

2012-07-30 Thread Alex Clark

Hi Python Tutor folks,


I am reaching out to various Python-related programming communities in
order to offer new help packaging your software.

If you have ever struggled with packaging and releasing Python software
(e.g. to PyPI), please check out this service:


- http://pythonpackages.com


The basic idea is to automate packaging by checking out code, testing,
and uploading (e.g. to PyPI) all through the web, as explained in this
introduction:


- http://docs.pythonpackages.com/en/latest/introduction.html


Also, I will be available to answer your Python packaging questions most
days/nights in #pythonpackages on irc.freenode.net. Hope to meet/talk
with all of you soon.



Alex



--
Alex Clark · http://pythonpackages.com/ONE_CLICK

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


[Tutor] Turbo Gears 2 Training this Saturday in DC

2010-05-12 Thread Alex Clark
Hi Folks,

For those of you not on the python-general list, and if live in the Washington, 
D.C. USA
area, we (the Zope/Python Users Group of DC) are having a `Turbo Gears 2` 
training this
weekend:

http://www.meetup.com/python-meetup-dc/messages/10123013/

The following day there will be a sprint, which we can cater to beginners if 
anyone
is interested.

If so, please contact me: acl...@aclark.net

You can register for the class here:

http://tg2-class.eventbrite.com/

Hope to see you there!

Alex

-- 
Alex Clark · http://aclark.net
Author of Plone 3.3 Site Administration · http://aclark.net/plone-site-admin

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


Re: [Tutor] PIL problem

2010-05-07 Thread Alex Clark
On 2010-05-07, Jim Byrnes  wrote:
> Running Unbuntu 9.10. The Synaptic Pkg Mgr reports python-imaging - 
> 1.1.6-3ubuntu1 - Python Imaging Library is installed.
>
> But trying to import PhotoImage gives these results:
>
>
> >>> from ImageTk import PhotoImage
> Traceback (most recent call last):
>File "", line 1, in 
> ImportError: No module named ImageTk
>
> What have I gotten wrong?


Try import PIL.ImageTk

(if you look inside the package, you will notice ImageTk is inside a directory 
called PIL)


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


-- 
Alex Clark · http://aclark.net
Author of Plone 3.3 Site Administration · http://aclark.net/plone-site-admin

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


Re: [Tutor] date problems

2010-04-28 Thread Alex Clark
On 2010-04-28, Eric Meigs  wrote:
> This is a multi-part message in MIME format.
> --===0277013919==
> Content-Type: multipart/alternative;
>   boundary="060806000801070600050409"
>
> This is a multi-part message in MIME format.
> --060806000801070600050409
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
>
> I want to create a program to tell me when I am supposed to do things.
> I have a text file with dates like  4-4-2010' as well as other data. I 
> want to read in this date into my code and then compare it with 
> 'date.today()'
> example 'if /variable/ >= today:'
> I don't see how to read in a string and get it into a format for comparison.

So you have two questions here, one "how to read in a string" and two "get it 
into a format for comparison"?

It seems to me you could do something like this:

from datetime import datetime

input = open('dates.txt','rb')
list = input.read()
dates = list.split()[0] # chars before the first whitespace 
items = list.split()[-1] # everything after the first whitespace

if datetime.now().strftime('%m-%d-%Y') == dates:
print 'Do %s today!' % items

(from http://github.com/aclark4life/Python-Tutor/blob/master/eric-meigs.py)

> I can do all of the other code.
>
> Eric
>
> --060806000801070600050409
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: 7bit
>
>
>
>
>
>
>
>
>I want to create a program to tell
> me when I am supposed to do things.
> I have a text file with dates like  4-4-2010' as well as other data. I
> want to read in this date into my code and then compare it with
> 'date.today()' 
> example 'if variable >= today:' 
> I don't see how to read in a string and get it into a format for
> comparison.
>
> I can do all of the other code.
>
> Eric
>
>
>
>
> --060806000801070600050409--
>
> --===0277013919==
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
> --===0277013919==--
>


-- 
Alex Clark · http://aclark.net
Author of Plone 3.3 Site Administration · http://aclark.net/plone-site-admin

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