Parallel port interfacing in python on Vista x64

2009-02-06 Thread SiWi
I have done some googling on this topic, but I haven't found anything
thats really working on Vista x64.
The most promising result I found was the Inpout32.dll:
http://logix4u.net/Legacy_Ports/Parallel_Port/A_tutorial_on_Parallel_port_Interfacing.html
But when using some code like that, I can't measure I differing state
on my breadboard circurity:
from ctypes import windll
p = windll.inpout32
p.Inp32(0x378) #default 255(all high) on my pc
p.Out32(0x378, 0) #put all low on port 2-9

Is it even possible to interface the Parallel Port on Vista64, and if
so, how does one do that?
--
http://mail.python.org/mailman/listinfo/python-list


Re: Parallel port interfacing in python on Vista x64

2009-02-06 Thread SiWi
On Feb 6, 8:55 pm, "Diez B. Roggisch"  wrote:
> SiWi schrieb:
>
> > I have done some googling on this topic, but I haven't found anything
> > thats really working on Vista x64.
> > The most promising result I found was the Inpout32.dll:
> >http://logix4u.net/Legacy_Ports/Parallel_Port/A_tutorial_on_Parallel_...
> > But when using some code like that, I can't measure I differing state
> > on my breadboard circurity:
> > from ctypes import windll
> > p = windll.inpout32
> > p.Inp32(0x378) #default 255(all high) on my pc
> > p.Out32(0x378, 0) #put all low on port 2-9
>
> > Is it even possible to interface the Parallel Port on Vista64, and if
> > so, how does one do that?
>
> Did you try pyparallel?
>
> Diez

Yep, but when trying to make a instance of the Parallel class I get an
windows error.
--
http://mail.python.org/mailman/listinfo/python-list


Sum of the factorial of the digits of a number - wierd behaviour

2009-12-09 Thread SiWi
Dear python community,
I've got a wierd problem and I hope you can help me out at it.
I wrote the following code to find the Sum of the factorial of the
digits of a number (this is for Project Euler 74):

def fac(n):
x=1
for i in range(2,n+1):
x*=i
return x

t=tuple(fac(n) for n in range(1,10))

def decimals(x):
i=1
d=[]
while x>0:
d.append(x%10)
x=x/10
return d

def sumfac(x):
return sum(t[n-1] for n in decimals(x))

The problem is that i get the following results, for which I can't see
any reason:
sumfac(145)->145 (1!+4!+5!=1 + 24 +120 = 145) - ok
sumfac(1454)-> 169 - ok
sumfac(45362) -> 872 - ok
sumfac(363600) -> 727212 - wrong, should be1454

Greetings,
SiWi.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sum of the factorial of the digits of a number - wierd behaviour

2009-12-09 Thread SiWi
On Dec 9, 6:36 pm, SiWi  wrote:
> Dear python community,
> I've got a wierd problem and I hope you can help me out at it.
> I wrote the following code to find the Sum of the factorial of the
> digits of a number (this is for Project Euler 74):
>
> def fac(n):
>     x=1
>     for i in range(2,n+1):
>         x*=i
>     return x
>
> t=tuple(fac(n) for n in range(1,10))
>
> def decimals(x):
>     i=1
>     d=[]
>     while x>0:
>         d.append(x%10)
>         x=x/10
>     return d
>
> def sumfac(x):
>     return sum(t[n-1] for n in decimals(x))
>
> The problem is that i get the following results, for which I can't see
> any reason:
> sumfac(145)->145 (1!+4!+5!=1 + 24 +120 = 145) - ok
> sumfac(1454)-> 169 - ok
> sumfac(45362) -> 872 - ok
> sumfac(363600) -> 727212 - wrong, should be1454
>
> Greetings,
> SiWi.

Oops, found it myself. You can ignote the message above.
-- 
http://mail.python.org/mailman/listinfo/python-list


Executing Python code on another computer

2010-02-19 Thread SiWi
Hello community,
I googled for an answer of the following problem, but I couldn't find
anything.
I've got a netbook and my fast workstation compter, which I usually
use for developing.
But I'd also like to take my netbook around the house and to develop
Python programms on it.
The problem is that naturally a netbook is not the fastest computer
you could find.

So I wondered if it was possible to send the Python code I'm
developing on the netbook to the workstation pc via wlan, let the
script execute on the workstation pc and write the output back on the
netbook.

Is there any possibilty to achieve that goal?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Executing Python code on another computer

2010-02-19 Thread SiWi
On Feb 19, 5:10 pm, "D'Arcy J.M. Cain"  wrote:
> On Fri, 19 Feb 2010 07:52:59 -0800 (PST)
>
> SiWi  wrote:
> > So I wondered if it was possible to send the Python code I'm
> > developing on the netbook to the workstation pc via wlan, let the
> > script execute on the workstation pc and write the output back on the
> > netbook.
>
> > Is there any possibilty to achieve that goal?
>
> Yes but it isn't really a Python question.  I suggest Google but you
> haven't given us enough information, particularly what OSs you are
> running.  If it was me I would simply use the netbook as a thin client
> for programs that I am writing and running on the main server.  In my
> case a simple xterm would do the job since vi is my IDE and bash is my
> runtime environment.  If you are using a GUI IDE you may be able to run
> the GUI app on the server with the display on the netbook.
>
> --
> D'Arcy J.M. Cain          |  Democracy is three 
> wolveshttp://www.druid.net/darcy/               |  and a sheep voting on
> +1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.

I'm normally using IDLE and sometimes PyScripter on Windows Vista. The
netbook is Windows XP. Should I switch to Vim or Emacs?
-- 
http://mail.python.org/mailman/listinfo/python-list