How to make a Python script to audio read a text file on phone ?

2013-03-17 Thread Nic
I've installed Python on my Nokia E71 (Symbian S60 3rd FP1) and found a script 
example which can read out text, see example below.
 I want to make the script to asks me for a text file instead and then reads 
out the content. I guess it works with a .txt file, dont know if other formats 
work.  Regards!


[Quote]

# Copyright (c) 2006 Jurgen Scheible
# This script performs a query with a single-field dialog (text input field)
# and lets the phone speak out the text (text to speech) that the users have 
typed in
# NOTE: this script runs only with Python S60 version 3.1.14 or above
# NOTE: this script doesn't work on all S60 phones neccessarily. Check your 
phone model if it has text to speech capability at all

import appuifw
import audio

text = appuifw.query(u"Type a word:", "text")
audio.say(text)

[End Quote]
-- 
http://mail.python.org/mailman/listinfo/python-list


graphical class diagram tool?

2006-11-14 Thread nic
Hi all
Some years ago I saw a graphical class diagram generated by
examining a python program. I *thought* that this was done with Boa
Constructor, but I may be wrong. I've download a recent version of BC
and can't find reference to this feature. Can anyone point me at other
tools to do this?

Thanks
J^n

-- 
http://mail.python.org/mailman/listinfo/python-list


Ricerca Programmatore Python

2006-05-29 Thread Nic
Please accept my apologies for the use of the Italian language.

*

Salve a tutti,

Scrivo per informarvi di una proposta di collaborazione.
Sto cercando un programmatore per la realizzazione di un mini-software
utile per analizzare e rappresentare multigrafi.
Si richiede una ottima competenza nell'utilizzo di Python con i relativi
pacchetti di rappresentazione matematica (es. matplotlib).
Per la nozione di grafo si rimanda alle seguenti pagine:
http://it.wikipedia.org/wiki/Teoria_dei_grafi (italiano).
http://en.wikipedia.org/wiki/Graph_theory (inglese).
È preferibile la residenza in provincia di Milano, in vista di un
possibile incontro.
Si tratta di una collaborazione esterna retribuita.
Gli interessati possono contattarmi direttamente ai recapiti presenti in
coda all'e-mail, inviando il relativo curriculum vitae.
Spero di avere fatto cosa gradita postando questo annuncio.
In caso contrario, mi scuso per il disturbo.

Saluti,

Giandomenico Sica
Polimetrica Onlus
Corso Milano 26
20052 Monza Mi Italia
Tel/Fax: 039.2301829
E-mail: g.sica chiocciola polimetrica.org


-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Ricerca Programmatore Python

2006-05-30 Thread Nic
I read your replies and am really sorry for the trouble.

Best regards,
Nic

"Boris Borcic" <[EMAIL PROTECTED]> ha scritto nel messaggio 
news:[EMAIL PROTECTED]
> Nic wrote:
>> Please accept my apologies for the use of the Italian language.
>
> accepted 


-- 
http://mail.python.org/mailman/listinfo/python-list


os.popen() not executing command on windows xp

2007-01-11 Thread nic
On my system (WinXP) typing the following line into command
prompt(cmd.exe) successfully scans the file test1.txt:
"c:\Program Files\Grisoft\AVG Free\avgscan.exe" "c:\program
files\temp1\test1.txt"

Yet the python script:
import os
a = os.popen('"c:\Program Files\Grisoft\AVG Free\avgscan.exe"
"c:\program files\temp1\test1.txt"')
print a.read()

Returns a blank line, and I doesn't scan the file. (Note I've used
os.popen() successfully on my system in other situations like:
os.popen('taskkill /F /IM taskname.exe')).

I have a feeling my avgscan example shown above not working has
something to do with calling a 3rd party software program (avgscan.exe)
through popen, but I don't know why this won't work, when manually
typing it in the command line does?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: os.popen() not executing command on windows xp

2007-01-11 Thread nic
Justin Ezequiel wrote:
> > import os
> > a = os.popen('"c:\Program Files\Grisoft\AVG Free\avgscan.exe"
> > "c:\program files\temp1\test1.txt"')
> > print a.read()
> >
>
> use raw strings
>
> e.g., instead of '"c:...\avgscan...'
> use r'"c:...\avgscan...'
>
> http://www.ferg.org/projects/python_gotchas.html#contents_item_2

Sorry I initally had retyped the code to replace some variables to make
it more clear, I already had them as raw strings:

import os
pstr = r'"c:\Program Files\Grisoft\AVG Free\avgscan.exe" "c:\program
files\temp1\test1.txt"'
a = os.popen(pstr)
print a.read()

I've confirmed the string I'm inputting to os.popen is EXACTLY the same
as the one I can successfully execute manually in command prompt, so
when I go:
print pstr, it yields:
"c:\Program Files\Grisoft\AVG Free\avgscan.exe" "c:\program
files\temp1\test1.txt"

The problem remains popen won't execute this line as it does when
inputted manually to command prompt.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: os.popen() not executing command on windows xp

2007-01-11 Thread nic
It appears os.popen() doesn't like full windows paths with spaces (e.g.
"c:/program files") so I'm going to use the subprocess module.

-- 
http://mail.python.org/mailman/listinfo/python-list


List and order

2006-05-15 Thread Nic
Hello,
I'm using the NetworkX Python package (https://networkx.lanl.gov/).
Through this package I wrote the following code:

import networkx as NX
G=NX.Graph()
G.add_edge(1,2)
G.add_edge(2,3)
G.add_edge(3,4)
ddeg=G.degree(with_labels=True)
for (u,v) in G.edges():
print ddeg[u],ddeg[v]

As result, I have:

12
22
21

I'd like to order the numbers included in the couples in a decrescent way:

12
12
22

And then to write the couples on a single line, always in a decrescent way:
12 12 22

I'm not able to do this operation. Can you help me please?
Thanks a bunch,
Nic 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: List and order

2006-05-15 Thread Nic
Hello Miki,

Many thanks for the support.
I tried to insert and execute the code, but the following error happens:

Traceback (most recent call last):
  File "grafodna.py", line 10, in ?
edges.sort(key = lambda u, v: (ddeg(u), ddeg(v)))
TypeError: () takes exactly 2 arguments (1 given)

Do you know how is it possible to delete it?
Thanks.

Nic

"Miki" <[EMAIL PROTECTED]> ha scritto nel messaggio 
news:[EMAIL PROTECTED]
> Hello Nic,
>
> Python lists has a very powerfull buid-in "sort".
>
> edges = list(G.edges())
> edges.sort(key = lambda u, v: (ddeg(u), ddeg(v)))
> for u, v in edges:
>print u,v,  # Note the training comma to avoid newline
> print
>
> HTH,
> Miki
> http://pythonwise.blogspot.com
> 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: List and order

2006-05-15 Thread Nic
Many thanks.
Both the cases are OK.
The only problem is that from:
12
22
21
In spite of writing
12 12 22
it writes
12 21 22
Do you know how is it possible to delete also this last trouble?
Thanks a bunch,
Nic

"Peter Otten" <[EMAIL PROTECTED]> ha scritto nel messaggio 
news:[EMAIL PROTECTED]
> Nic wrote:
>
>> I tried to insert and execute the code, but the following error happens:
>>
>> Traceback (most recent call last):
>>   File "grafodna.py", line 10, in ?
>> edges.sort(key = lambda u, v: (ddeg(u), ddeg(v)))
>> TypeError: () takes exactly 2 arguments (1 given)
>>
>> Do you know how is it possible to delete it?
>
> Note that
>
> lambda a, b: ...
>
> takes two arguments while
>
> lambda (a, b): ...
>
> takes one argument which must be a sequence (list, string, generator,...) 
> of
> two items.
>
> So the above should probably be
>
> edges = list(G.edges())
> edges.sort(key=lambda (u, v): (ddeg[u], ddeg[v]))
> for u, v in edges:
>print ddeg[u], ddeg[v],
> print
>
>
> Here's how I would do it:
>
> edges = [(ddeg[u], ddeg[v]) for u, v in G.edges()]
> edges.sort()
> for a, b in edges:
>print a, b,
> print
>
> (all untested)
>
> Peter 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: List and order

2006-05-16 Thread Nic
Perfect. Thanks.
Nic

"Peter Otten" <[EMAIL PROTECTED]> ha scritto nel messaggio 
news:[EMAIL PROTECTED]
> Nic wrote:
>
>> The only problem is that from:
>> 12
>> 22
>> 21
>> In spite of writing
>> 12 12 22
>> it writes
>> 12 21 22
>> Do you know how is it possible to delete also this last trouble?
>
> I thought that the two 12 were a typo, but it seems you want to reorder 
> the
> nodes inside an edge, too. Here's a fix that normalizes the edge before
> sorting the list of edges:
>
> edges = [sorted((ddeg[u], ddeg[v])) for u, v in G.edges()]
> edges.sort()
> for a, b in edges:
> print a, b,
> print
>
> Peter
>
> 


-- 
http://mail.python.org/mailman/listinfo/python-list


Python and Combinatorics

2006-05-16 Thread Nic
Hello,
I've a problem in defining a good Python code useful to articulate the 
following algorithm.
Can you help  me please?
Thanks a bunch,
Nic

1. Insert a number "n".
Example: 3

2. List all the numbers < or = to n.
Example: 1,2,3.

3. Combine the listed numbers each other.
Example:
12
13
23

4. For each combination associate two letters a and b.
Example:
12a
12b
13a
13b
23a
23b

5. Combine the new combinations each other, provided that combinations 
including the same couple of numbers (e.g. 12a and 12b) cannot be combined.
Example:
12a 13a 23a
12a 13b 23a
12a 13b 23b
12b 13a 23a
12b 13b 23a
12b 13b 23b

PS
12a 13a 23a and13a 23a 12a are the same thing. 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and Combinatorics

2006-05-16 Thread Nic
I forgot them. Sorry.
They should be included.
Nic

"Peter Otten" <[EMAIL PROTECTED]> ha scritto nel messaggio 
news:[EMAIL PROTECTED]
> Nic wrote:
>
> [Algorithm that I may have misunderstood]
>
>> 12a 13a 23a
>> 12a 13b 23a
>> 12a 13b 23b
>> 12b 13a 23a
>> 12b 13b 23a
>> 12b 13b 23b
>
> What about 12a 13a 23b and 12b 13a 23b?
>
> Peter
>
> PS: Please don't top-post. 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and Combinatorics

2006-05-16 Thread Nic
Thanks a bunch.
Both the codes are fine.
Only one question, if you allow.
In my example I've chosen the number 3.
How should I change the Python code in order to select another number (e.g. 
7)?
Thanks.
Nic 


-- 
http://mail.python.org/mailman/listinfo/python-list


Is there an equivalent to Java Webstart in Python?

2005-12-05 Thread Nic Bar
Hi everybody,
I want to develop a WEB based Python user appication that nees to be
downloaded and started grom a web server using a browser.
Does anybody know if there is an equivalent of Java WebStart for
python applications?

Nic
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there an equivalent to Java Webstart in Python?

2005-12-05 Thread Nic Bar
The problem with Jython is that I can only live inside the aplet
virtual machine,
I need a full features application with access to the local computer
resources.
Regarding IronPyhton, there is no released version yet.
I am looking for something that can be used now and plataform
independent (assuming the correct version of python is already
installed on the local computer)

Thanks

Nic


On 5 Dec 2005 02:45:04 -0800, "James" <[EMAIL PROTECTED]> wrote:

>Use Jython or IronPython.
>(Almost) One click web deployment is only available for Java and .NET
>platforms at the moment.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Is there an equivalent to Java Webstart in Python?

2005-12-05 Thread Nic Bar
The idea is that I don't want to have the user installing anything in
his machine.
The only thing he/she may install is the virtual machine.
THis way I can modify the application as necessary without the need to
redeploy on each and one of the installed machines.

Nic



On 5 Dec 2005 04:02:45 -0800, "Renato" <[EMAIL PROTECTED]>
wrote:

>What use is Java WebStart, exactly?
>
>Just make a .exe installer with everything (for windows), using for
>example py2exe and InnoSetup, and a distutils compliant package for the
>others.

-- 
http://mail.python.org/mailman/listinfo/python-list