Re: [Tutor] How to get both 2.6 scripts as well as 3.1 scripts to run at command line?

2010-09-15 Thread David Hutto
On Thu, Sep 16, 2010 at 12:11 AM, Richard D. Moores wrote: > > > On Wed, Sep 15, 2010 at 20:25, Richard D. Moores wrote: >> >> 64-bit Vista. >> >> I have no problem running 3.1 scripts at the command line. However 2.6 >> scripts seems to require 2.x. For example, I get this error showing that the

Re: [Tutor] working with empty lists

2010-09-15 Thread bob gailer
On 9/16/2010 12:05 AM, Rance Hall wrote: Im working on a little piece of test code to test an idea for a larger script. Here is what I've got so far: l = [] for i in range(0,10) l.append(i) for i in range(0,10) print('%s. %s' % (i, l[i]) This gives me: 0. 0 1. 1 2. 2 etc w

Re: [Tutor] How to get both 2.6 scripts as well as 3.1 scripts to run at command line?

2010-09-15 Thread Richard D. Moores
On Wed, Sep 15, 2010 at 20:25, Richard D. Moores wrote: > 64-bit Vista. > > I have no problem running 3.1 scripts at the command line. However 2.6 > scripts seems to require 2.x. For example, I get this error showing that the > old 2.x print won't do: > > C:\P26Working\Finished>solveCubicEquation

[Tutor] working with empty lists

2010-09-15 Thread Rance Hall
Im working on a little piece of test code to test an idea for a larger script. Here is what I've got so far: l = [] for i in range(0,10) l.append(i) for i in range(0,10) print('%s. %s' % (i, l[i]) This gives me: 0. 0 1. 1 2. 2 etc which is what I expect, but what I want is to g

Re: [Tutor] How to get both 2.6 scripts as well as 3.1 scripts to run at command line?

2010-09-15 Thread David Hutto
On Thu, Sep 16, 2010 at 12:02 AM, Bill Allen wrote: > > > On Wed, Sep 15, 2010 at 10:35 PM, David Hutto wrote: >> >> print("a is", a) >> or >> from future import * >> ___ > > Other than the Python 3 style print function, what else is contained in the >

Re: [Tutor] How to get both 2.6 scripts as well as 3.1 scripts to run at command line?

2010-09-15 Thread Bill Allen
On Wed, Sep 15, 2010 at 10:35 PM, David Hutto wrote: > print("a is", a) > or > from future import * > ___ > Other than the Python 3 style print function, what else is contained in the future module? --Bill _

Re: [Tutor] How to get both 2.6 scripts as well as 3.1 scripts to run at command line?

2010-09-15 Thread David Hutto
print("a is", a) or from future import * ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to get both 2.6 scripts as well as 3.1 scripts to run at command line?

2010-09-15 Thread Richard D. Moores
64-bit Vista. I have no problem running 3.1 scripts at the command line. However 2.6 scripts seems to require 2.x. For example, I get this error showing that the old 2.x print won't do: C:\P26Working\Finished>solveCubicEquation.py File "C:\P26Working\Finished\solveCubicEquation.py", line 19

Re: [Tutor] intercepting and recored I/O function calls

2010-09-15 Thread Alan Gauld
"Jojo Mwebaze" wrote I would like to intercept and record I/O function calls to a file.. (later to a database) with probably the names of the files that have been created, accessed / deleted in my program. I have not done something like this before.. Some Guidance is highly appreciated A

Re: [Tutor] counting elements in list

2010-09-15 Thread Steven D'Aprano
On Thu, 16 Sep 2010 03:23:01 am Shashwat Anand wrote: > On Wed, Sep 15, 2010 at 1:14 PM, kumar s wrote: > > Hi group: > > > > I have a list: > > > > k = ['T', 'C', 'T', 'T', 'T', 'T', 'T', 'T', 'T', 'C', 'T', 'T', > > 'T', 'C', 'T', > > 'T', 'T', 'C', 'C', 'T', 'T', 'T', 'C', 'T', 'T', 'T', 'T',

Re: [Tutor] First complexity program

2010-09-15 Thread Viacheslav Chumushuk
On Wed, Sep 15, 2010 at 09:31:45PM +0300, Григор Колев wrote: > Hi. Hi, Grigoriy. > I try to make a program to connect my POS system with Geovision video > server. I can connect directly with serial port but on the POS no have > free serial. > My POS can send information like file on video ser

[Tutor] First complexity program

2010-09-15 Thread Григор Кол ев
Hi. I try to make a program to connect my POS system with Geovision video server. I can connect directly with serial port but on the POS no have free serial. My POS can send information like file on video server. I can read this file with Python. It is first problem: My script can looking the di

Re: [Tutor] counting elements in list

2010-09-15 Thread Shashwat Anand
On Wed, Sep 15, 2010 at 1:14 PM, kumar s wrote: > Hi group: > > I have a list: > > k = ['T', 'C', 'T', 'T', 'T', 'T', 'T', 'T', 'T', 'C', 'T', 'T', 'T', 'C', > 'T', > 'T', 'T', 'C', 'C', 'T', 'T', 'T', 'C', 'T', 'T', 'T', 'T', 'T', 'T'] > > the allowed elements are A or T or G or C. List can hav

[Tutor] counting elements in list

2010-09-15 Thread kumar s
Hi group: I have a list: k = ['T', 'C', 'T', 'T', 'T', 'T', 'T', 'T', 'T', 'C', 'T', 'T', 'T', 'C', 'T', 'T', 'T', 'C', 'C', 'T', 'T', 'T', 'C', 'T', 'T', 'T', 'T', 'T', 'T'] the allowed elements are A or T or G or C. List can have any number of A or T or G or C My aim is to get a string o

Re: [Tutor] list dll functions?

2010-09-15 Thread ALAN GAULD
Find the Pythonwin IDE executable and run it - its a better IDE than IDLE in my opinion, especially if you are on Windows. Once it is started you can go to the Tools->COM Browser menu item and it starts an explorer type Window. The top level "folders" are: Registered Objects Running Objects Reg

Re: [Tutor] Writing to Sound

2010-09-15 Thread kb1pkl
-Original Message- From: Alan Gauld To: tutor Sent: Wed, Sep 15, 2010 5:26 am Subject: Re: [Tutor] Writing to Sound "Corey Richardson" wrote First off, here is what I'm doing. I'm taking pi (3.141592 etc. etc. etc.), taking two values at a time, and then mapping the two values to

Re: [Tutor] what happened to the cards module

2010-09-15 Thread Evert Rol
> Hi Evert: > > I've been looking for a card playing framework for a long time. When I saw > "import Cards" and that he was shuffling, dealing cards, etc, I immediately > downloaded Python. Could this be available in Pygames? It depends where you "him" shuffling & dealing cards. Pygames doesn'

Re: [Tutor] selecting elements from dictionary

2010-09-15 Thread Adam Bark
On 15/09/10 15:31, Hs Hs wrote: Dear Steven, Thanks for your help. however I have a question, using: for key, value in xdic.items(): if 1 in value and 2 in value or 3 in value: print key also print keys that have values such as [1,2,3]. In cases where there is [1,2,3] and [1,2]

Re: [Tutor] selecting elements from dictionary

2010-09-15 Thread Evert Rol
> using: > > for key, value in xdic.items(): > if 1 in value and 2 in value or 3 in value: > print key > > > also print keys that have values such as [1,2,3]. > > In cases where there is [1,2,3] and [1,2] also reported. > > How can I extract those keys that have values only [1,2]

Re: [Tutor] selecting elements from dictionary

2010-09-15 Thread Hs Hs
Dear Steven, Thanks for your help. however I have a question, using: for key, value in xdic.items(): if 1 in value and 2 in value or 3 in value: print key also print keys that have values such as [1,2,3]. In cases where there is [1,2,3] and [1,2] also reported. How can I ext

[Tutor] intercepting and recored I/O function calls

2010-09-15 Thread Jojo Mwebaze
Hello Tutor I would like to intercept and record I/O function calls to a file.. (later to a database) with probably the names of the files that have been created, accessed / deleted in my program. I have not done something like this before.. Some Guidance is highly appreciated Johnson __

Re: [Tutor] selecting elements from dictionary

2010-09-15 Thread Steven D'Aprano
On Wed, 15 Sep 2010 12:10:59 pm Hs Hs wrote: > I want to print only those items that have [1,2] and [1,3] in any > order, such as [1,2] or [2,1], [3,1] or [1,3] > > >>> for item in xdic.keys(): > > ... if [1,2] in xdic[item]: > ... print item > > I get a wrong answer, That's bec

Re: [Tutor] what happened to the cards module

2010-09-15 Thread Steven D'Aprano
On Wed, 15 Sep 2010 10:09:25 am jsoa...@safe-mail.net wrote: > I downloaded Python 2.6.6 for windows but I can't access the "Cards" > module for playing card games. There is no "Cards" module in the standard library. You'll need to go back to wherever you found it in the first place. Google might

Re: [Tutor] Writing to Sound

2010-09-15 Thread Alan Gauld
"Corey Richardson" wrote First off, here is what I'm doing. I'm taking pi (3.141592 etc. etc. etc.), taking two values at a time, and then mapping the two values to pitch and length. I'm then using winsound.Beep to beep for x ms, at y frequency. So far I understand. What I want to do, is

Re: [Tutor] list dll functions?

2010-09-15 Thread Alan Gauld
"Alex Hall" wrote Out of curiosity: I know I can call dll functions from python using the win32 lib, but is there any way to simply "examine" a loaded dll to see all of the functions and attributes it exposes for use? There are various tools around to do that and hopefully some documentation

Re: [Tutor] how best to implement paginated data in CLI

2010-09-15 Thread Alan Gauld
"Rance Hall" wrote In reviewing the app I'm hoping to replace I found the size of the client list is under 100 records. Given this new information, do you still think that db cursors is the way to go? Using the cursor is a more scaleable solution but if you are sure you only ever have 100

Re: [Tutor] what happened to the cards module

2010-09-15 Thread Evert Rol
> I downloaded Python 2.6.6 for windows but I can't access the "Cards" module > for playing card games. > > Did it get renamed? If so, how can I find it? I don't think there's a Cards module in the standard library. At least, I've never seen it, nor can I find any mention about it on the python

Re: [Tutor] list dll functions ?

2010-09-15 Thread patrice laporte
Dependdencyy walker is a good tool, but as you have seen it doesn't give you function's signature. If you explore a MS dll, you should to have a look at MSDN and read about the function description. A bit out of subject : There is no way to find the function's signature only from exploring the bin

[Tutor] what happened to the cards module

2010-09-15 Thread jsoares
I downloaded Python 2.6.6 for windows but I can't access the "Cards" module for playing card games. Did it get renamed? If so, how can I find it? Thanks. John Soares jsoa...@safe-mail.net ___ Tutor maillist - Tutor@python.org To unsubscribe or chang

Re: [Tutor] FW: wierd replace problem

2010-09-15 Thread Roelof Wobben
> Date: Tue, 14 Sep 2010 22:15:40 +0100 > From: wpr...@gmail.com > To: tutor@python.org > Subject: Re: [Tutor] FW: wierd replace problem > > > > On 14 September 2010 21:10, Roelof Wobben >> wrote: > I understand it but I try to understand why in a file there is t