[Tutor] Asking for help with installation of pyttsx (text to speech)

2015-02-11 Thread Andrew K.
To whom it may concern.

I started the project CrocToy, a complex robotic toy in a form of a crocodile. 
I would like to use Python as programming platform. Having limited programming 
skills, I have troubles with software development. Particularly, right now I 
try to learn how to use pyttsx (text to speech). I would be very grateful for 
any help with installation and programming. 
Thank you very much,
Andrew
PS 
I would be very thankful if any mature Python programmer would like to 
participate in my project.
Thank you,
Andrew
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Importing from classes

2015-02-11 Thread daaku gee
Hi

When importing from other modules, I've seen syntax like:

import from  
import 

And another one:
import from   as 

Is one better than the other or is it just personal choice?

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


Re: [Tutor] Asking for help with installation of pyttsx (text to speech)

2015-02-11 Thread Alan Gauld

On 11/02/15 03:37, Andrew K. wrote:


I started the project CrocToy, a complex robotic toy in a form of a crocodile.

> I would like to use Python as programming platform.
> Having limited programming skills, I have troubles with software 
development.


This much we can help with since the list is here for those learning 
Python and programming in general.



Particularly, right now I try to learn how to use pyttsx (text to speech).


But we do limit ourselves to the standard library modules so for 
anything else you will be gambling on somebody here already having
used it. Usually you are better sending module specific queries to the 
module support forum (or the author.)



I would be very grateful for any help with installation and programming.


Do you have any specific queries? The more specific the query the more 
specific the answer will be.


Please include details of your OS and Python version.

--
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] Importing from classes

2015-02-11 Thread Alan Gauld

On 11/02/15 02:39, daaku gee wrote:


When importing from other modules, I've seen syntax like:

import from  


from  import 

Note you don't import classes from modules you import names.
(The name might be the name of a class of course!)

This form is for cases where you only want to use one or two features of 
a module and don't want to have the inconvenience of typing the module 
name in front each time you use them.



import 


This is the normal usage. It gives you indirect access to all of the 
module features using the . notation



import from   as 


import  as 
or
from  import  as 

These tend to be used where the module has a very long name that
you don't want to type out in full each time, so you give it a
shorter alias.
You might also use it if you are working on code that already has
a variable with the same name as the module/feature that you want
to import. You either rename all your variable references or you
choose an alias that does not conflict.


Is one better than the other or is it just personal choice?


'better' is often a subjective term.
There are reasons for each as described above.
What is best depends on the circumstance. If in
doubt use

import 

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] Importing from classes

2015-02-11 Thread Steven D'Aprano
On Tue, Feb 10, 2015 at 06:39:50PM -0800, daaku gee wrote:
> Hi
> 
> When importing from other modules, I've seen syntax like:
> 
> import from  
> import 
> 
> And another one:
> import from   as 

Not quite. The syntax is:

import 

import  as 

from  import   # not necessarily a class

from  import  as 


> Is one better than the other or is it just personal choice?

As far as Python is concerned, there is no difference at all. The "as 
name" version just lets you pick a different name, usually to save 
typing:

import module_with_a_really_long_name as module


Obviously the usual rule for naming things applies here too: names 
should be meaningful, they should not lie, or be confusing:

# Bad ideas.
import math as string  # What? 
import string as fred
import os as barney

Beware of names which are easily confused, or have common meanings:

- try to avoid `l` and `I` because in some fonts they look like 1
- same for `O` and 0
- i is normally used for for-loop counters and other integers
- n is also used for integers
- x and y for floats

But apart from that, the names you choose are entirely up to you.


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


[Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
Python 2.4.4, Solaris 10

I have a file of functions. Based on what is read in a data file,
different functions in the file of functions will need to be called. I
have been trying to make the following approach work, so far
unsuccessfully as, in general, each function may have a different
number of arguments that might have to be passed to it.

def func1(x1, x2, x3):
pass

def func2(y1, y2):
pass

def func3(z):
pass

call_fcn = {'a': func1, 'b': func2, 'c': func3}

call_fcn[key_letter](???)

How can I successfully pass the needed arguments needed for each
possible function with this approach? I naively tried to do something
like:

pass_args = {'a': (x1, x2, x3), 'b': (y1, y2), 'c': (z)}
call_fcn[key_letter](key_letter)

But ran into the syntax error that I was giving one argument when
(possibly) multiple arguments are expected.

Is what I am trying to do a viable approach that can be made to work?
Otherwise, I will brute-force my way through with if-elif-else
statements.

Thanks!

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


Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread Joel Goldstick
On Wed, Feb 11, 2015 at 8:27 AM, boB Stepp  wrote:

> Python 2.4.4, Solaris 10
>
> I have a file of functions. Based on what is read in a data file,
> different functions in the file of functions will need to be called. I
> have been trying to make the following approach work, so far
> unsuccessfully as, in general, each function may have a different
> number of arguments that might have to be passed to it.
>
> def func1(x1, x2, x3):
> pass
>
> def func2(y1, y2):
> pass
>
> def func3(z):
> pass
>
> call_fcn = {'a': func1, 'b': func2, 'c': func3}
>
> call_fcn[key_letter](???)
>
> How can I successfully pass the needed arguments needed for each
> possible function with this approach? I naively tried to do something
> like:
>
> pass_args = {'a': (x1, x2, x3), 'b': (y1, y2), 'c': (z)}
> call_fcn[key_letter](key_letter)
>
> But ran into the syntax error that I was giving one argument when
> (possibly) multiple arguments are expected.
>
> Is what I am trying to do a viable approach that can be made to work?
> Otherwise, I will brute-force my way through with if-elif-else
> statements.
>
> Thanks!
>
> First, its best to cut and paste your code along with the traceback for
the errors you got.

You might want to look up python *args and *kwargs.



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



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


Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread eryksun
On Wed, Feb 11, 2015 at 7:27 AM, boB Stepp  wrote:
>
> pass_args = {'a': (x1, x2, x3), 'b': (y1, y2), 'c': (z)}
> call_fcn[key_letter](key_letter)
>
> But ran into the syntax error that I was giving one argument when
> (possibly) multiple arguments are expected.

Do it like this:

pass_args = {
'a': (x1, x2, x3),
'b': (y1, y2),
'c': (z,),
}

call_fcn[key_letter](*pass_args[key_letter])

Note the 'c' tuple is written as (z,). A comma is required to create a
tuple. Also note the call uses the "* expression" syntax to merge an
iterable with the call's positional arguments. For example, f(x0,
*(x1,x2,x3)) is equivalent to f(x0, x1, x2, x3). Refer to the glossary
definition of "argument", and for a more detailed discussion, see the
section on calls in the language reference.

https://docs.python.org/2/glossary.html#term-argument
https://docs.python.org/2/reference/expressions.html#calls
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread Dave Angel

On 02/11/2015 08:27 AM, boB Stepp wrote:

Python 2.4.4, Solaris 10

I have a file of functions. Based on what is read in a data file,
different functions in the file of functions will need to be called. I
have been trying to make the following approach work, so far
unsuccessfully as, in general, each function may have a different
number of arguments that might have to be passed to it.

def func1(x1, x2, x3):
 pass

def func2(y1, y2):
 pass

def func3(z):
 pass

call_fcn = {'a': func1, 'b': func2, 'c': func3}

call_fcn[key_letter](???)

How can I successfully pass the needed arguments needed for each
possible function with this approach? I naively tried to do something
like:

pass_args = {'a': (x1, x2, x3), 'b': (y1, y2), 'c': (z)}
call_fcn[key_letter](key_letter)

But ran into the syntax error that I was giving one argument when
(possibly) multiple arguments are expected.

Is what I am trying to do a viable approach that can be made to work?
Otherwise, I will brute-force my way through with if-elif-else
statements.

Thanks!



Sure, it's viable, but the best approach depends on your goal (use 
case), and your restrictions.  Are these functions really totally 
unrelated to each other?  You not only don't have the same number of 
arguments, but the values don't even have anything in common?


There's an implied constraint that you're not permitted to change the 
functions.  Are you really constrained to only change the caller?


Assuming that you seriously want to be able to do this, the only use 
case I can imagine are:

   1) you're writing an interpreter
   2) you're interfacing some network channel, where something at the 
opposite end is sending you messages that you have to turn into local 
function calls, and return results.  A kind of RPC.


In each case, there are probably better ways.  But you want this way, so 
here goes:  (code is untested)


pass_arg_dictionary = {'a': (x1, x2, x3), 'b': (y1, y2), 'c': (z)}
pass_args = pass_arg_dictionary[key_letter]  #a list
call_fcn[key_letter]( *pass_args )


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


Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
On Wed, Feb 11, 2015 at 8:44 AM, eryksun  wrote:
> On Wed, Feb 11, 2015 at 7:27 AM, boB Stepp  wrote:
>>
>> pass_args = {'a': (x1, x2, x3), 'b': (y1, y2), 'c': (z)}
>> call_fcn[key_letter](key_letter)
>>
>> But ran into the syntax error that I was giving one argument when
>> (possibly) multiple arguments are expected.
>
> Do it like this:
>
> pass_args = {
> 'a': (x1, x2, x3),
> 'b': (y1, y2),
> 'c': (z,),
> }
>
> call_fcn[key_letter](*pass_args[key_letter])
>
> Note the 'c' tuple is written as (z,). A comma is required to create a
> tuple. Also note the call uses the "* expression" syntax to merge an
> iterable with the call's positional arguments. For example, f(x0,
> *(x1,x2,x3)) is equivalent to f(x0, x1, x2, x3). Refer to the glossary
> definition of "argument", and for a more detailed discussion, see the
> section on calls in the language reference.

I was trying to puzzle out this "* expression" syntax from "Learning
Python, 4th Ed." from a more general table of function
argument-matching forms (author's table 18-1) when your post arrived.
Your explanation cleared things up immediately. Thanks!


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


Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
On Wed, Feb 11, 2015 at 8:45 AM, Dave Angel  wrote:
> On 02/11/2015 08:27 AM, boB Stepp wrote:
[...]
>
> Sure, it's viable, but the best approach depends on your goal (use case),
> and your restrictions.  Are these functions really totally unrelated to each
> other?  You not only don't have the same number of arguments, but the values
> don't even have anything in common?

The file/module containing functions extract information from another
software application (with its own scripting language) and ask that
software to perform certain calculations in its scripting language.
The dictionary keys are conventional symbols for types of calculations
that someone might request. I have a current set of requested
calculations, but this will likely be augmented with new ones in the
future. Depending on the request, there might be no arguments passed,
meaning there is a simple request for information from the software
application that requires only a look-up, or the actual software
application may have to do calculations requiring one or more passed
values. Which and how many values depends on the type of calculation
requested.

> There's an implied constraint that you're not permitted to change the
> functions.  Are you really constrained to only change the caller?

I think this is the case, but I am open to other ideas.

> Assuming that you seriously want to be able to do this, the only use case I
> can imagine are:
>1) you're writing an interpreter

I was not thinking explicitly in this way, but in effect I am
translating requests in Python code into a proprietary scripting
language, and vice versa.

[...]

> In each case, there are probably better ways...

I am open to suggestions!

Thanks!


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


Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread Dave Angel

On 02/11/2015 10:29 AM, boB Stepp wrote:

On Wed, Feb 11, 2015 at 8:45 AM, Dave Angel  wrote:

On 02/11/2015 08:27 AM, boB Stepp wrote:

[...]


Sure, it's viable, but the best approach depends on your goal (use case),
and your restrictions.  Are these functions really totally unrelated to each
other?  You not only don't have the same number of arguments, but the values
don't even have anything in common?


The file/module containing functions extract information from another
software application (with its own scripting language) and ask that
software to perform certain calculations in its scripting language.
The dictionary keys are conventional symbols for types of calculations
that someone might request. I have a current set of requested
calculations, but this will likely be augmented with new ones in the
future. Depending on the request, there might be no arguments passed,
meaning there is a simple request for information from the software
application that requires only a look-up, or the actual software
application may have to do calculations requiring one or more passed
values. Which and how many values depends on the type of calculation
requested.


There's an implied constraint that you're not permitted to change the
functions.  Are you really constrained to only change the caller?


I think this is the case, but I am open to other ideas.


Assuming that you seriously want to be able to do this, the only use case I
can imagine are:
1) you're writing an interpreter


I was not thinking explicitly in this way, but in effect I am
translating requests in Python code into a proprietary scripting
language, and vice versa.

[...]


In each case, there are probably better ways...


I am open to suggestions!



So where does the data for these parameters come from?  In other words, 
who is your user?  Why isn't that user just calling the functions 
directly?  You mention you're getting the function code-letters from a 
data file.  Are you getting the data for the parameters from there as well?


If all the data, and the corresponding function codes, are coming from 
the data file, then you must be deserializing that file in some way. 
And unless the data is always strings, there's more work to do there 
than in the wrapping of the calls themselves.


There are libraries for serializing and deserializing arbitrary data. 
Some use xml, some use json, axon, csv, YAML, and probably tons of 
others.  Likewise there are protocols such as SOAP, for remote procedure 
calls.


Is the file entirely linear, or are you going to be doing branching, 
subroutining, etc?  If there's any more complexity, you need to see the 
whole picture before you just do the call.


Do any of these functions have return values?  How are you handling that?


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


Re: [Tutor] How to pass varying number of arguments to functions called by a dictionary?

2015-02-11 Thread boB Stepp
On Wed, Feb 11, 2015 at 10:58 AM, Dave Angel  wrote:
> On 02/11/2015 10:29 AM, boB Stepp wrote:
>>
>> On Wed, Feb 11, 2015 at 8:45 AM, Dave Angel  wrote:
>>>
>>> On 02/11/2015 08:27 AM, boB Stepp wrote:

[...]

>>> In each case, there are probably better ways...
>>
>>
>> I am open to suggestions!
>>
>
> So where does the data for these parameters come from?  In other words, who
> is your user?  Why isn't that user just calling the functions directly?  You
> mention you're getting the function code-letters from a data file.  Are you
> getting the data for the parameters from there as well?

The user uses their software application to create a treatment plan
that they want to evaluate versus agreed values for a variety of
parameters. These agreed values will exist in a data file that I
create. It is likely that there will eventually be multiple such data
files as the planner may be asked to compare their plan versus
multiple sets of consensus data, which can come from a variety of
sources. But right now I will have just one data file that our group
has agreed to use. The user calls my program. The only choices he
would get to make are if we move to more than one set of data to
compare plans to. Which functions that get called will depend on the
data file and existing information in the plan the user created. The
passed values to functions will come both from the data file and
previously extracted information from the user's plan.

> If all the data, and the corresponding function codes, are coming from the
> data file, then you must be deserializing that file in some way. And unless
> the data is always strings, there's more work to do there than in the
> wrapping of the calls themselves.

The data is currently entirely in string format. I am currently
constructing the file as a template that will also provide the format
for the final display window. Basically, the program will copy
anything needed for GUI, filling in any information fields that are
plan-dependent, and only include organ structures that the user
contoured in his plan, evaluating dose to these in accordance with the
data table(s) I have been told to include. The data file will not be
large. In the end there will probably be no more than 2 or 3 screens
worth of data.

> There are libraries for serializing and deserializing arbitrary data. Some
> use xml, some use json, axon, csv, YAML, and probably tons of others.
> Likewise there are protocols such as SOAP, for remote procedure calls.

I was told in an earlier question I posted from several months ago
that my proposed file design resembled the json format. I am keeping
that in the back of my mind as I continue to work my way through this
project.

> Is the file entirely linear, or are you going to be doing branching,
> subroutining, etc?  If there's any more complexity, you need to see the
> whole picture before you just do the call.

For a given organ, the consensus data being used will require one or
more checks with the actual plan data. This will vary for each
possible organ. So based on the data format I use, it will signal the
data reader the number and type of checks to do as well as what values
the plan results will be compared to. So there is some complexity
here.

> Do any of these functions have return values?  How are you handling that?

Getting information into and out of the planning software can only be
done indirectly. Because of this the functions will "print" planning
software scripting commands to a temporary file. Once all such
operations are done, this temporary file gets run (a reload script),
which then actually does the work within the planning software. If
information then needs to get from the planning software back to a
Python program, then I have two options: 1) Save from within the
planning software to a temp file that the Python program can access,
or, 2) pass these values via a Unix command to a Python program.



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


[Tutor] Using goto or labels in Python?

2015-02-11 Thread Raphael Raphael
Hello,

Is there a way in which people have found to use goto or labels in Python?thank 
you.

Sent from my iPhone

> On Feb 11, 2015, at 12:27 PM, tutor-requ...@python.org 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: Wondering if there is a print in location command for
>  terminal? (eryksun)
>   2. Timeline Script in Python (Siya Radebe)
>   3. Re: Timeline Script in Python (Alan Gauld)
>   4. Asking for help with installation of pyttsx (text to speech)
>  (Andrew K.)
>   5. Importing from classes (daaku gee)
>   6. Re: Asking for help with installation of pyttsx (text to
>  speech) (Alan Gauld)
>   7. Re: Importing from classes (Alan Gauld)
>   8. Re: Importing from classes (Steven D'Aprano)
> 
> 
> --
> 
> Message: 1
> Date: Tue, 10 Feb 2015 08:29:56 -0600
> From: eryksun 
> To: Alan Gauld 
> Cc: tutor@python.org
> Subject: Re: [Tutor] Wondering if there is a print in location command
>forterminal?
> Message-ID:
>
> Content-Type: text/plain; charset=UTF-8
> 
>> On Tue, Feb 10, 2015 at 3:02 AM, Alan Gauld  
>> wrote:
>> msvcrt wraps the Microsoft Vis C Runtime functions which don't
>> include positional commands.
>> 
>> Conio was a DOS library developed by the compiler makers as a way to access
>> the BIOS calls and has a gotoXY() and similar functions. It first appeared,
>> as I recall, in Turbo Pascal but was later picked
>> up by the C compilers as well.
>> There are at least 2 libraries on PyPi that simulate conio
> 
> OK, the only conio I was aware of was the conio.h API provided by
> various C runtime libraries on Windows, as described here:
> 
> https://en.wikipedia.org/wiki/Conio.h
> 
> 
> --
> 
> Message: 2
> Date: Tue, 10 Feb 2015 18:29:46 +0200
> From: Siya Radebe 
> To: tutor@python.org
> Subject: [Tutor] Timeline Script in Python
> Message-ID: <4af81c6c-bb16-4278-91e7-a70010d1a...@goodhost.co.za>
> Content-Type: text/plain;charset=us-ascii
> 
> Hi,
> 
> Can you please help with a timeline script in python, in conjunction with how 
> to use their timeline library?
> 
> I would love advise of how to best approach this, in going about developing 
> an event/ activity stream timeline
> 
> I found two different libraries, one from Python, and other from Django which 
> is best, and how do i go about developing the script to show a timeline of 
> events?
> 
> https://pypi.python.org/pypi/timeline/0.0.1 
> 
> 
> https://pypi.python.org/pypi/django-admin-timeline 
> 
> 
> Looking forward to your favorable response
> 
> Kind Regards,
> Siya
> 
> --
> 
> Message: 3
> Date: Tue, 10 Feb 2015 18:59:15 +
> From: Alan Gauld 
> To: tutor@python.org
> Subject: Re: [Tutor] Timeline Script in Python
> Message-ID: 
> Content-Type: text/plain; charset=windows-1252; format=flowed
> 
>> On 10/02/15 16:29, Siya Radebe wrote:
>> Hi,
>> 
>> Can you please help with a timeline script in python, in conjunction with 
>> how to use their timeline library?
> 
> Thus list is for those learning the Python language and its standard 
> library.
> Any information about third party modules will depend on whether anyone 
> here has used it, usually you are better asking on a dedicated forum (or 
> via email to the author) Django has a user forum, the PyPI package may not.
> 
> 
>> I would love advise of how to best approach this, in going about developing 
>> an event/ activity stream timeline
> 
> I think you need to be more specific about what you want to do.
> Are you building it in real-time or from a database analysis?
> What volume of events do you need to deal with?
> etc...
> 
> 
> 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
> 
> 
> 
> 
> --
> 
> Message: 4
> Date: Tue, 10 Feb 2015 22:37:28 -0500
> From: "Andrew K." 
> To: 
> Subject: [Tutor] Asking for help with installation of pyttsx (text to
>speech)
> Message-ID: 
> Content-Type: text/plain;charset="koi8-r"
> 
> To whom it may concern.
> 
> I started the project CrocToy, a complex robotic toy in a form of a 
> crocodile. I would like to use Python as programming platform. Having limited 
> programming skills, I have troubles with software development. Partic

Re: [Tutor] Timeline Script in Python

2015-02-11 Thread Siya 360

> Hi,
> 
> Can you please help with a timeline script in python, in conjunction with how 
> to use their timeline library?
> 
> I would love advise of how to best approach this, in going about developing 
> an event/ activity stream timeline
> 
> I found two different libraries, one from Python, and other from Django which 
> is best, and how do i go about developing the script to show a timeline of 
> events?
> 
> https://pypi.python.org/pypi/timeline/0.0.1 
> 
> 
> https://pypi.python.org/pypi/django-admin-timeline 
> 
> 
> Looking forward to your favorable response
> 
> Kind Regards,
> Siya

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


Re: [Tutor] Using goto or labels in Python?

2015-02-11 Thread Alan Gauld

On 11/02/15 10:44, Raphael Raphael wrote:

Hello,


Hello, please do not post the entire digest to ask a new question.
Some people pay by the byte.
Just send a new mail to tutor@python.org.



Is there a way in which people have found to use goto or labels in Python?thank 
you.


No. Python does not have a goto because using goto is
considered bad programming practice and is never necessary
(although *very* occasionally it can be simpler and clearer
to use goto IMHO).

What are you trying to do that you think needs a goto and we
can see if there is a clearer way to write it without goto.


--
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] Using goto or labels in Python?

2015-02-11 Thread Mark Lawrence

On 11/02/2015 18:14, Alan Gauld wrote:

On 11/02/15 10:44, Raphael Raphael wrote:

Hello,


Hello, please do not post the entire digest to ask a new question.
Some people pay by the byte.
Just send a new mail to tutor@python.org.



Is there a way in which people have found to use goto or labels in
Python?thank you.


No. Python does not have a goto because using goto is
considered bad programming practice and is never necessary
(although *very* occasionally it can be simpler and clearer
to use goto IMHO).


http://entrian.com/goto/ but note the warning in bright red right at the top
https://github.com/cdjc/goto never tried this one

The one time that I'd consider goto is jumping to an error handler.



What are you trying to do that you think needs a goto and we
can see if there is a clearer way to write it without goto.



Definitely :)

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: [Tutor] Asking for help with installation of pyttsx (text to speech)

2015-02-11 Thread Mark Lawrence

On 11/02/2015 03:37, Andrew K. wrote:

To whom it may concern.

I started the project CrocToy, a complex robotic toy in a form of a crocodile. 
I would like to use Python as programming platform. Having limited programming 
skills, I have troubles with software development. Particularly, right now I 
try to learn how to use pyttsx (text to speech). I would be very grateful for 
any help with installation and programming.
Thank you very much,
Andrew
PS
I would be very thankful if any mature Python programmer would like to 
participate in my project.
Thank you,
Andrew



As Alan has already said this very much depends on your versions of 
Python and OS.


If you're on any *nix type system the simplest mechanism is simply

pip install pyttsx

More on pip here https://pip.pypa.io/en/latest/installing.html

On Windows you've two options that I'm aware of.

Either download pyttsx-1.1-py2-none-any.whl from 
http://www.lfd.uci.edu/~gohlke/pythonlibs/ and install it using pip. 
This is Python 2 specific.


Or for Python 3.4 install Visual Studio Express 2010 and again use:-

pip install pyttsx

I would *NOT* recommend the latter approach for you as a beginner, but 
then there is nothing to stop you trying.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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