Python/Django linux build consultant required

2010-04-04 Thread Si

Hi, we are a San Francisco based startup company and are looking for a
Python/Django person to help us roll out our recently completed. We're
looking for 5 years + Python experience with a knowledge of tools such
as pyinstall (or other build systems). Please contact me directly
interested. Rgds.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: serial port servo control

2006-06-23 Thread Si Ballenger
On 22 Jun 2006 08:18:08 -0700, [EMAIL PROTECTED] wrote:

>So I ordered a mini SSC II (the servo controller), in order to
>control some servos from the computer.  I was hoping to use python to
>do the control but have two questions...
>
>1) How should I write to the serial port with python? I found the
>module "pyserial":
>http://pyserial.sourceforge.net/
>on the python cheeseshop, and it looks solid but I thought you might
>have a better suggestion.
>
>2) To control the servos I have to send the SSC II a string of 3
>numbers, 3 bytes long (so 3 numbers in the range 0 - 255, each as a
>single byte, one after another).  In C I'd do this by sending 3
>char's, as they're only 1 byte, but i'm not exactly sure how to do it
>in Python.

Maybe a little off topic, but I've got a page below with some mini ssc
control info.

http://www.geocities.com/zoomkat/index.htm

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


Re: Parsing data from pyserial

2006-12-03 Thread Si Ballenger
On Sat, 2 Dec 2006 23:02:06 -0500, Lone Wolf
<[EMAIL PROTECTED]> wrote:

>I'm trying to get data through my serial port from a CMUcam.
>This gizmo tracks a color and returns a packet of data. The
>packet has nine data points (well, really eight since the first
>point is just a packet header) separated by spaces as follows: M
>xxx xxx xxx xxx xxx xxx xxx xxx
>
>Here is the code I am using (python v24):
>
>import serial
>
>ser=serial.Serial('com1',baudrate=115200, bytesize=8,
>parity='N', stopbits=1,xonxoff=0, timeout=1)
>
>ser.write("PM 1") #This sets the CMUcam to poll mode
>
>for i in range(0,100,1):
>   ser.write("TC 016 240 100 240 016 240\r\n")
>   reading = ser.read(40)
>   print reading
>   components = reading.split()
>   print components
>ser.close

In my dealing with serial gizmos I have to put a delay between
the request sent to the gizmo and the reading of the serial input
buffer for returned data. Serial ports and gizmos need some time
to do their thing.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Parsing data from pyserial

2006-12-03 Thread Si Ballenger
On Sun, 03 Dec 2006 16:52:33 -, Grant Edwards
<[EMAIL PROTECTED]> wrote:

>On 2006-12-03, Si Ballenger <[EMAIL PROTECTED]> wrote:
>
>> In my dealing with serial gizmos I have to put a delay between
>> the request sent to the gizmo and the reading of the serial input
>> buffer for returned data. Serial ports and gizmos need some time
>> to do their thing.
>
>I doubt that's the issue.  He's reading with a 1-second timeout
>value.

I would think a time delay would be needed between the below two
lines in the code if he expects to get a useable data string back
from the gizmo for the command sent to it. 

  ser.write("TC 016 240 100 240 016 240\r\n")
  reading = ser.read(40)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Parsing data from pyserial

2006-12-03 Thread Si Ballenger
On Sun, 03 Dec 2006 18:44:07 -, Grant Edwards
<[EMAIL PROTECTED]> wrote:

>On 2006-12-03, Si Ballenger <[EMAIL PROTECTED]> wrote:
>
>>>> In my dealing with serial gizmos I have to put a delay between
>>>> the request sent to the gizmo and the reading of the serial input
>>>> buffer for returned data. Serial ports and gizmos need some time
>>>> to do their thing.
>>>
>>>I doubt that's the issue.  He's reading with a 1-second timeout
>>>value.
>>
>> I would think a time delay would be needed between the below two
>> lines in the code if he expects to get a useable data string back
>> from the gizmo for the command sent to it. 
>>
>>   ser.write("TC 016 240 100 240 016 240\r\n")
>>   reading = ser.read(40)
>
>No. A delay isn't needed as long as the device responds within
>1 second.  The read() call will wait up to 1 second for the
>first byte of the response.

Per what was posted (below), it appears that the the appropriate
data is being received. It may be possible that the cam may be
sending in a mode that is not in alignment with the binary
transmission mode of the serial port. As a test I'd jumper
between the Tx and Rx pin on the serial port and then send out
the "M" line being received, then see if it will parse as
expected.  

Here is an example output: 

M 37 79 3 4 59 124 86 25
['59', '123', '87', '25', 'M', '37', '79', '3', '4', '59',
'124', '86', '25', 'M
']
M 38 77 3 2 59 124 86 25
['39', '85', '26', 'M', '38', '77', '3', '2', '59', '124', '86',
'25', 'M', '38'
, '7']
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Parsing data from pyserial

2006-12-03 Thread Si Ballenger
On 3 Dec 2006 17:33:59 -0800, "John Machin"
<[EMAIL PROTECTED]> wrote:

>In any case, I wouldn't call that "the appropriate data is being
>received" -- looks like chunks missing to me.

Well, below is the posted expected return data format from the
cam and below that is what has been reported to be returned from
the cam when it is polled, which appears to be a fairly
reasonable match. I assume that each xxx is a decimal number
repersenting a single byte. In the binary mode each x in the
string might be considered a byte in itelf and possibly evaluated
as such. Anyhow it should be easy to see if the received string
can be parsed on it own correctly when not being received via the
serial port. That would start to narrow down where something not
understood is comming into play.

M xxx xxx xxx xxx xxx xxx xxx xxx
M 37 79 3 4 59 124 86 25


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


Re: subprocess considered harmfull?

2005-09-25 Thread Do Re Mi chel La Si Do
Hi also !

In other fields, I also found uses which did not function with subprocess, 
but OK with popen2/4

@-salutations

Michel Claveau




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


subprocess problem

2005-09-27 Thread Do Re Mi chel La Si Do
Hi!

This script (under Win-XP + P-2.4.1) :
 import subprocess
 p1=subprocess.Popen(r'cmd /cdir *.* /S /W /B', stdout=subprocess.PIPE)
 chaineretour=p1.stdout.read()

run OK if called from DOS-console. But, from another Python's script (by COM
+ exec) give me an error.

Here, the traceback :

Traceback (most recent call last):
 File "D:\dev\Python\ponx.py", line 4446, in PRun
  exec(ccod,globals(),globals())
 File "C:\Python24\lib\subprocess.py", line 546, in __init__
   (p2cread, p2cwrite,
 File "C:\Python24\lib\subprocess.py", line 606, in __get_handles__
   p2cread =  self._make_inheritable(p2cread)
 File "C:\Python24\lib\subprocess.py", line 647, in _make_inheritable
   DUPLICATE_SAME_ACCESS)
error: (6, 'DuplicateHandle','Descripteur non valide')


I know the bug-signaled : http://python.org/sf/1124861


But... a idea for a solution ?

Thanks, and sorry for my bad english.


Michel Claveau



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


Re: subprocess problem

2005-09-29 Thread Do Re Mi chel La Si Do
Hi !

Thank you very much.

With your tip, this script :

import os
p = os.popen4(r'cmd /k')
p[0].write('dir *.bat /B\r\n')
p[0].flush()
p[0].write('dir *.cfg \r\n')
p[0].flush()
p[0].write('exit\r\n')
p[0].flush()
print ''.join(p[1].readlines())

run perfectly

@-salutations

Michel Claveau



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


Re: pyMinGW support for Python 2.4.2 (final) is available

2005-09-29 Thread Do Re Mi chel La Si Do
Hi !

No problem for me, with IE-6 + FlashGet (just to choose right-click + record 
target)

@-salutations

Michel Claveau




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


Parrot & Python ?

2005-10-02 Thread Do Re Mi chel La Si Do
Hi !

On the site of Amber :  http://xamber.org/index.html
We can to view the sentence : "Parrot version of Python"
Question :  what is "Parrot version of Python" ?

@-salutations

Michel Claveau










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


Re: Parrot & Python ?

2005-10-02 Thread Do Re Mi chel La Si Do
Hi !

Thank for links.

@-salutations

Michel Claveau 


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


Re: PIL Image can't open png file with "I"?

2005-10-07 Thread Do Re Mi chel La Si Do
Hi !


Perhaps... ";" better than ","  :
im=Image.open(r"C:\vodka3.png"); im.show()

Perhaps...  more simplist :
im=Image.open(r"C:\vodka3.png").show()

Perhaps...  other thing ?


@-salutations

Michel Claveau



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


Re: Why asci-only symbols?

2005-10-10 Thread Do Re Mi chel La Si Do
Hi !

I agree with you; I will adore capacity to call functions named in Unicode.

@-salutations

Michel Claveau



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


Re: Trouble with win32com and MS Project

2005-10-19 Thread Do Re Mi chel La Si Do
Hi !


The parameter  (ResourceID=2)  is problematic

Try :
proj.Tasks(3).Assignments.Add(2)



@-salutations

Michel Claveau



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


Re: Expanding Python as a macro language

2005-10-29 Thread Do Re Mi chel La Si Do
Hi !


Not the good answer, but, for information :

AutoIt is very better in beta-release (many versions beta exist). AutoIt 
beta can use COM call, and can use COM-server writed in Python with win32all 
(PyWin).

And, also, AutoIt exist like Active-X (in reality a COM server), who can to 
do used from Python (+ PyWin).


@-salutations

Michel Claveau



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


Re: Using graphviz to visualize trace.py output, anybody?

2005-10-30 Thread Do Re Mi chel La Si Do
Hi!

Under Windows, I call graphwiz from Python via COM, with win32all (PyWin).
Sorry, I don't know the Mac.

@-salutations

Michel Claveau



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


Re: Running autogenerated code in another python instance

2005-11-02 Thread Do Re Mi chel La Si Do
Hi!

I did not understand anything with your chatterer message.
But, perhaps, the code below will help you.

@-salutations

Michel Claveau



 def runcode(srcode):
 import sys,traceback
 sret=True
 try:
  ccod=compile(srcode, 'Paul-code', 'exec')
  flagcompile=True
 except:
  print "compilo-error"
  flagcompile=False
 if flagcompile==True:
  try:
  exec(ccod,globals(),globals())
  sret=True
  except:
  tb=sys.exc_info()[2]  #for traceback
  print str(sys.exc_info()[0])
  print traceback.format_exc()
  sret=False
 return sret


 s="""global c
 a=1000
 b=123
 c=a+b"""

 if runcode(s):
 print c





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


Re: Running autogenerated code in another python instance

2005-11-02 Thread Do Re Mi chel La Si Do
With good spaces :


def runcode(srcode):
import sys,traceback
sret=True
try:
 ccod=compile(srcode, 'Paul-code', 'exec')
 flagcompile=True
except:
 print "compilo-error"
 flagcompile=False
if flagcompile==True:
 try:
 exec(ccod,globals(),globals())
 sret=True
 except:
 tb=sys.exc_info()[2]  #for traceback
 print str(sys.exc_info()[0])
 print traceback.format_exc()
 sret=False
return sret


s="""global c
a=1000
b=123
c=a+b"""
if runcode(s):
print c

s="""global c
a=1000
b=123
c=aaa+b"""
if runcode(s):
print c


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


Re: Get the pid of a os.startfile(filename)

2005-11-08 Thread Do Re Mi chel La Si Do
Hi !

With W2K or WXP :

tasklist /FI "IMAGENAME eq exename.exe"


And, with Python, how capture this information :

def findPID(exename):
import os
a = os.popen4('tasklist /FI "IMAGENAME eq '+exename+'"')
a[0].flush()
try:
info=a[1].readlines()[3].split()
except:
info=[exename,"NotFound"]
return (info[0],info[1])

soft,pid=findPID("pythonw.exe")
print soft,' --> ',pid



@-salutations

Michel Claveau




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


Re: subprocess terminate help

2005-11-16 Thread Do Re Mi chel La Si Do
Hi!

Self-destruction of a script:

import os
os.popen('TASKKILL /PID '+str(os.getpid())+' /F')

(only in windows XP or 2K)


@-salutations

Michel Claveau



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


Re: searching for files on Windows with Python

2005-11-17 Thread Do Re Mi chel La Si Do
Hi!

But fnmatch (or glob) is unix-like. With few error in windows (sample ? 
trye '*.' )

Test this code rather:

import os
l=os.popen4('dir c:\\python\\*.pyw /S /B')[1].readlines()
print ''.join(l)


@-salutations
-- 
Michel Claveau



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


Re: Reading a subprocesses stdout on Windows

2005-11-21 Thread Do Re Mi chel La Si Do
Hi!

Let down subprocess, and remember  popen4.

Here, an example (with  CMD, under w-XP) :

import os

def lcmd(lst=None):
a = os.popen4(lst[0])
for i in lst[1:]:
if i!='':
a[0].write(i+'\r\n')
a[0].flush()
return a[1].readlines()

l=[
'CMD /K',
'DIR *.c /B',
'DATE /T',
'TIME /T',
'EXIT'
]
lret = lcmd(l)
for n in lret:
print n[:-1]



Attention : don't read data inside the loop (for)...



@-salutations

Michel Claveau



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


Re: Any way to change files in a ZIP archive?

2005-11-25 Thread Do Re Mi chel La Si Do
Hi!

See  http://mclaveau.com/ress/python/zipmci.htm

@-salutations

Michel Claveau



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


Re: Call OCX from python?

2005-11-26 Thread Do Re Mi chel La Si Do
>From WxPython, or from PythonWin.

Other way : call, & drive, Internet-Explorer, who call the ocx.

Michel Claveau



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


Re: PythonMagick on Windows

2005-12-05 Thread Do Re Mi chel La Si Do
+1

Michel Claveau



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


Scriptomatic 2.0

2005-01-16 Thread Do Re Mi chel La Si Do
Hi !

Scriptomatic 2.0 can, now, to generate scripts in Python.

Download :

http://www.microsoft.com/downloads/thankyou.aspx?FamilyID=09dfc342-648b-4119-b7eb-783b0f7d1178&displaylang=en


Note : scriptomatic is a generator of WMI's scripts, for Windows, (and
compatibles WBEM).



Good night
-- 
Michel Claveau



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


Re: OCAMl a more natural extension language for python?

2005-01-17 Thread Do Re Mi chel La Si Do
Hi !

OCAML is very complementary at Python :

unreadable vs readable
functionnel vs procedural/POO/etc.
compiled vs interpreted (or compil JIT)
very fast vs mean velocity
hard to learn vs easy to easy to learn


Yes, OCAML is very complementary, too much, much too, complementary at
Python...

But, C is not complementary to Python (in the same state of mind).



And, what do you think of... Erlang ?


@-salutations
-- 
Michel Claveau






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


Re: ElementTree cannot parse UTF-8 Unicode?

2005-01-20 Thread Do Re Mi chel La Si Do
Hi !

>>> ...Usenet to transmit it properly

newsgroups (NNTP) : yes, it does it
usenet : perhaps (that depends on the newsgroups)
clp : no





Michel Claveau


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


Re: [ANN] PyScript 0.5 released

2005-01-21 Thread Do Re Mi chel La Si Do
Hi !

The good URL is :  http://pyscript.sourceforge.net

:-)


-- 
Michel Claveau




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


Re: add indexes on the fly to lists

2005-01-25 Thread Do Re Mi chel La Si Do
Hi !

If you want only "search and found" element, look dictionnary ; if you want
also to have the order, see the module set.

Good night
-- 
Michel Claveau


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


Re: How to post news articles with NNTPlib

2005-01-28 Thread Do Re Mi chel La Si Do
Hi !


nntplib.NNTP(newsserver,port,user,passe)



-- 
Michel Claveau



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


Re: Thread in python

2005-02-04 Thread Do Re Mi chel La Si Do
Hi !

Look the smart/fun use of threads make by
http://candygram.sourceforge.net

It's good for to know...


@-salutations
-- 
Michel Claveau










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


Re: Python Processes for Win32

2005-02-05 Thread Do Re Mi chel La Si Do
Hi !

Look for "service" in PyWin


@-salutations
-- 
Michel Claveau



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


Re: Thanks for PIL (and other stuff)

2005-06-24 Thread Do Re Mi chel La Si Do
+1

-- 
Michel Claveau



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


Re: Office COM automatisation - calling python from VBA

2005-06-24 Thread Do Re Mi chel La Si Do
Hi !


Perso, j'utilise ça  (VBA) :

Sub TestPonx()
  Dim oa As Object
  Set oa = CreateObject("Ponx.Mci")
  Cells(2, 4) = oa.PRet("123+45+6")
  Set oa = Nothing
End Sub


"Ponx.Mci" est le nom du serveur COM Python
PRet()  est équivalent à  eval()


Michel Claveau






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

Re: Excellent Site for Developers

2005-06-25 Thread Do Re Mi chel La Si Do

rather... super troll



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


Re: calldll compiled for Python 2.4 for Windows

2005-07-01 Thread Do Re Mi chel La Si Do
Hi !

Use Ctypes


Michel Claveau





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


Re: how to change a script while it is running

2005-07-07 Thread Do Re Mi chel La Si Do
Hi !

Try :


def ff(a):
print a*2

ff(111)

exec('''def ff(a):
print a*3
''',globals(),globals())

ff(111)



@-salutations

Michel Claveau





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


Re: Options to integrate Python modules into native windows applications

2005-07-08 Thread Do Re Mi chel La Si Do
Hi !


I use, intensively, Python, via COM & PyWin32, from Paradox (Object-Pal), 
VBScript,  Excel, Word, Internet-explorer, AutoIt, etc.
It is simple, powerful and extensible dynamically.


@-salutations
--
Michel Claveau




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


Re: Options to integrate Python modules into native windows applications

2005-07-08 Thread Do Re Mi chel La Si Do
Re Hi !


I had only test (little) Python for .Net ; OK, it's run. It is possible to 
make winform from Python. And I had try to use Python for .Net from my 
COM-server, and from VBscript. OK also.

Plus,  I had try to call my Python-server-COM, from C# : OK it's run.  C# 
can use Python.

And, I had try to make, in Internet-Explorer, a page, with Html+javascript, 
who call the Python-server-COM, and at the same time, contains an 
object-assembly dotNET, who call also the server-COM. It is twisted, but 
it's run OK (that opens two sessions of the server-COM, which communicate by 
mmap).

* sorry for my bad english *


@-salutations

Michel Claveau




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


Re: Options to integrate Python modules into native windows applications

2005-07-08 Thread Do Re Mi chel La Si Do
Hi !

>>> Your english is fine.
Ce n'est pas mon anglais. Babelfish m'a beaucoup aidé.

@-salutations
-- 
Michel Claveau
mél : http://cerbermail.com/?6J1TthIa8B
sites : http://mclaveau.com   http://bergoiata.org   http://ponx.org





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

Re: problems with python 2.4 help

2005-07-15 Thread Do Re Mi chel La Si Do
Hi !

See :
http://www.gossamer-threads.com/lists/python/bugs/350314




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


Re: Python and Tablet PC: limitations?

2005-07-22 Thread Do Re Mi chel La Si Do
Hi !

I am a Tablet-PC's user. I am a Python programmer. I am happy, with this 
combo.
For use Tablet's extensions, I use Internet-Explorer, drived by Python (via 
.HTA). Your problem is not Python, but, perhaps, Mozilla ?

@-salutations

Michel Claveau



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


Re: Create a variable "on the fly"

2005-07-27 Thread Do Re Mi chel La Si Do
Hi !

Try :

OSCAR='the grouch'
print OSCAR


useless to thank me

Michel Claveau 


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


Re: COM access sooo slow !?

2005-08-15 Thread Do Re Mi chel La Si Do
Hi !

I use a COM server, made with Python & Win32all (PyWin32). The speed of 
function's call is : 5 seconds, for 100 000 calls.
Only the first call is slow (due to time to load Python...)

Config : W-XP, P.2.4.1, 1.6 GHz, 512MB RAM

@-salutations & sorry for my bad english

Michel Claveau 


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


Re: stopping a python windows service

2005-08-16 Thread Do Re Mi chel La Si Do
Hi !

Use SC.exe  (windows-XP)  (with popen ?)
For help :sc  /?


You can, also, try :
qprocess  /?
tasklist  /?
taskkill  /?
etc.

@-salutations

Michel Claveau



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


Re: PIL: retreive image resolution (dpi)

2005-08-22 Thread Do Re Mi chel La Si Do
Hi !


The size of a image is an element ; but resolution is another. It is the 
link, between the image and the reality. Size AND resolution can to give the 
scale.

Exemple : when you scan a document, the size (in pixels) is not sufficient, 
for to reproduce the document. Size + resolution, yes.


@-salutations

Michel Claveau



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


Re: Exploring outlook using python

2005-08-24 Thread Do Re Mi chel La Si Do
Hum...

If it's Outlook, look for COM/Dispatch, with PyWin32
If it's Outlook-Express, search a MAPI module, like said Peter Hansen.

@-salutations

Michel Claveau



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


Re: Any projects to provide Javascript-style client-side browser accessvia Python?

2005-08-26 Thread Do Re Mi chel La Si Do
Hi !


>>> So anyone know if there are projects underway on this?

Yes, I work on this way. But it's a long work, because I have few time...

But there are certainly other projects.


@-salutations

Michel Claveau 


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


Re: Windows/win32all, unicode and long filenames

2005-08-28 Thread Do Re Mi chel La Si Do
Hi !


You are true.
But, more, don't believe : for use with CD-Rom/DVD, a path cannot to have 
more than 64 caracteres.


@-salutations

Michel Claveau 


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


Re: python and ajax

2005-08-29 Thread Do Re Mi chel La Si Do
Hi !


Here :  http://wikipython.flibuste.net/moin.py/AJAX


@-salutations

Michel Claveau 


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


Re: trouble with time --again

2005-08-30 Thread Do Re Mi chel La Si Do
Hi !


Try :

import datetime
date1 = datetime.datetime(2005,01,01,8,20,0)
print date1.strftime('%Y-%m-%d %H:%M:%S')



@-salutations

Michel Claveau 


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


Open-Office ; Python & Win (plain/text)

2005-09-01 Thread Do Re Mi chel La Si Do



Open-Office 2.0 bêta-2 français pour Windows (en fait, la 1.9.125 ) est 
sortie.
Vous la trouverez là :

http://oootranslation.services.openoffice.org/pub/OpenOffice.org/2.0beta2rc/OOo_2.0beta2_Win32Intel_install_fr.zip

Je cite ce lien, car j'ai réussi à piloter Open-Office, depuis Python, avec 
PyWin32.
Vous trouverez ci dessous le script expérimental (code "brut" et méchant ; 
mais c'est la faisabilité qui importe ici).

Ce script fonctionne avec le fichier Open-office  C:\\ootest.odt  qui 
contient :


- 

BBB
CCC
111%TXT1%111
22
%CADRE1%
333



Aaz aze ABC djhevgd fude uftyf
ofh efzehiufre hiufre
zefoz hfzr hruifh
ABC ABC gyuguyg ufg eruzyfgerABCABC
efeorzehfzrehiufreh
ABC
-




Recréez ce fichier, puis lancez le script ci-dessous.
Ensuite, ben... lisez le code-source, et débrouillez-vous...
---
Michel Claveau
PS : je poste ce message en HTML, puis en plain/text, pour faciliter les 
choses.





-
# -*- coding: cp1252 -*-

import win32com.client
import time


def insertIntoCell( strCellName, strText, objTable):
objCellText = objTable.getCellByName( strCellName)
objCellCursor = objCellText.createTextCursor()
objCellCursor.setPropertyValue("CharColor",16777215)
objCellText.insertString(objCellCursor, strText, False)


objServiceManager = win32com.client.Dispatch("com.sun.star.ServiceManager")
objDesktop = objServiceManager.CreateInstance("com.sun.star.frame.Desktop")

args = []

#si nouveau document, ligne suivante
#objDocument = objDesktop.loadComponentFromURL("private:factory/swriter", 
"_blank", 0, args)
"""
  //swriter pour le traitement de texte.
  //scalc pour le tableur
  //sdraw pour l'éditeur de dessin
  //simpress pour l'éditeur de présentation (équivalent de PowerPoint)
  //smath pour l'éditeur de formule mathématique
  //swriter/Global Document document maitre
  //swriter/web Pour l'éditeur HTML
"""
#si document existant
objDocument = objDesktop.loadComponentFromURL("file:///C:/ootest.odt", 
"_blank", 0, args)


objText = objDocument.GetText()
objCursor = objText.createTextCursor()
objText.insertString(objCursor, "Vous avez les salutations de PONX.\nCeci 
est la deuxième ligne.\n", 0)
objText.insertString(objCursor, "Troisième ligne.\n", 0)
objText.insertString(objCursor, "4è ligne [EMAIL PROTECTED]", 0)



# Tableau

#Crée un tableau de 4 colonnes x 4 lignes
objTable= objDocument.createInstance( "com.sun.star.text.TextTable")
objTable.IsWidthRelative = True
objTable.RelativeWidth = 80   # largeur de 80 %
objTable.BackColor = 255*256*256+255*256+204  # fond en jaune clair
objTable.HoriOrient = 2  # 0 LEFT   1 RIGHT   2 CENTER
objTable.initialize(8, 4)   # lignes / colonnes

#Insère la table
objText.insertTextContent(objCursor, objTable, 0)

#1ère ligne
objRows = objTable.getRows()
objRow0 = objRows.getByIndex(0)

#Couleur de fond
objTable.setPropertyValue("BackTransparent", 0)
objTable.setPropertyValue("BackColor", 255*256*256+255*256+204)

#Autre couleur de fond, pour la première ligne
objRow0.setPropertyValue("BackTransparent", 0)
objRow0.setPropertyValue("BackColor", 6710932)
objRow0.setPropertyValue("IsAutoHeight", False)
objRow0.setPropertyValue("Height", 3000)   #30 mm

#Remplissage 1ère ligne
insertIntoCell("A1","FirstColumn",objTable)
insertIntoCell("B1","SecondColumn",objTable)
insertIntoCell("C1","ThirdColumn",objTable)
insertIntoCell("D1","SUM",objTable)

#Remplissage suite
objTable.getCellByName("A2").setValue(22.5)
objTable.getCellByName("B2").setValue(5615.3)
objTable.getCellByName("C2").setValue(-2315.7)
objTable.getCellByName("D2").setFormula("sum(||)")

objTable.getCellByName("A3").setValue(21.5)
objTable.getCellByName("B3").setValue(615.3)
objTable.getCellByName("C3").setValue(-315.7)
objTable.getCellByName("D3").setFormula("sum()")

objTable.getCellByName("A4").setValue(121.5)
objTable.getCellByName("B4").setValue(-615.3)
objTable.getCellByName("C4").setValue(415.7)
objTable.getCellByName("D4").setFormula("sum ")


#on sélectionne la colonne C
sCell = objTable.createCursorByCellName("C1")
sCell.goDown(4, True)
sCell.BackColor = 255*256*256+200*256+200  #rouge clair

""" ça ne marche pas (spécif OO-2.0 ?)
cols = objTable.getColumns()
col = cols.getByIndex(2)
""

Re: Help for NewBies at WikiBooks

2005-09-03 Thread Do Re Mi chel La Si Do
Hi !

I had read the article on Python's concept  "Metaclass": zero error in 
the content !

@-salutations

Michel Claveau



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


Re: Python compiled?

2005-09-05 Thread Do Re Mi chel La Si Do
Hi !


One of the greatest reason which encouraged me to choose Python is its 
interpreted nature  (more exactly its nature of dynamic language).

The utilities of distribution, or packaging, are enough numerous to solve 
this kind of problem.

The existence of Py2exe (inter alia), could concillier the needs...


@-salutations

Michel Claveau



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


Re: subprocess solved all my problems

2005-09-09 Thread Do Re Mi chel La Si Do
Hi !

Thank you for this interesting message.

@-salutations

Michel Claveau



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


Re: execute commands and return output

2005-09-10 Thread Do Re Mi chel La Si Do
Hi !

Look (the doc for) Popen2, Popen3, Popen4 & Subprocess

@-salutations

Michel Claveau 


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


Re: IDisatch and pythoncom

2005-09-10 Thread Do Re Mi chel La Si Do
Hi !


Perhaps :  .Dispactch  vs  .Dispatch  ?


@-salutations

Michel Claveau


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


Re: getting words from readline

2005-09-10 Thread Do Re Mi chel La Si Do
Hi !

Look :   .split()

@-salutations

Michel Claveau 


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


Re: Curses on Windows

2005-02-06 Thread Do Re Mi chel La Si Do
same symptoms


@-salutations
-- 
Michel Claveau



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


Re: PHP Embedded In Python

2005-02-08 Thread Do Re Mi chel La Si Do
And :

http://lesuisse.net/pyphp-0.1.tgz

?


@-salutations
-- 
Michel Claveau


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


Re: Concurrent Python

2005-02-12 Thread Do Re Mi chel La Si Do
Hi !

You can found few ideas here :

http://candygram.sourceforge.net


@-salutations
-- 
Michel Claveau


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


Re: [NooB] a Variable in multiple quotes...

2005-02-13 Thread Do Re Mi chel La Si Do
It's OK for me


@-salutations
-- 
Michel Claveau


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


Re: keeping a COM server alive

2005-02-14 Thread Do Re Mi chel La Si Do
Hi !

I had also make a Python-COM-server.
But, when I launch several clients, I obtain several instances of my
COM-server.

Finally, there are advantages and disadvantages in this established fact.
But I can't use this way for to exchange data between several clients. For
that, I use a TCP local server.

@-salutations
-- 
Michel Claveau



note : the same problem come with Microsoft's dictionnary COM server.




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


Re: DHTML control from Python?

2005-02-14 Thread Do Re Mi chel La Si Do
See Pamie :

 http://pamie.sourceforge.net




@-salutations
-- 
Michel Claveau



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


Re: DHTML control from Python?

2005-02-14 Thread Do Re Mi chel La Si Do
Oh, Sorry, I had read too fast.
I see, now, the word "Mac".
Apologies.

Michel Claveau



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


Re: keeping a COM server alive

2005-02-15 Thread Do Re Mi chel La Si Do
Hi !

Sorry, but I receive the mailing list, I had readed THE book (Prog...Win32),
I questioned M.Hammond, I traversed the archives...
But I have no solution.

And, also, a COM server which answers several clients is very smart to
design; in particular because of the temporal re-entry  (re-entrance ?)

@-salutations
-- 
Michel Claveau



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


Re: detecting the change in desktop resolution - how?

2005-02-21 Thread Do Re Mi chel La Si Do
Hi !

On windows, and PyWin, this script give the H/V current resolution :



import win32com.client
oWMI = win32com.client.Dispatch("WbemScripting.SWbemLocator")
owbem = oWMI.ConnectServer(".","root\cimv2")
collec = owbem.ExecQuery("Select * from Win32_PrinterConfiguration")
print "Horizontal Resolution: ", collec[0].HorizontalResolution
print "Vertical Resolution: ", collec[0].VerticalResolution




@-salutations
-- 
Michel Claveau





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


Re: UTF-8 / German, Scandinavian letters - is it really this difficult?? Linux & Windows XP

2005-02-21 Thread Do Re Mi chel La Si Do
Hi !

For test your system, please, read this url :
http://sivanataraja.free.fr/config/test.htm  (french)
http://www.alanwood.net/unicode/  (english)

And many explains : http://en.wikipedia.org/wiki/Unicode


And, to reassure you:  I had no problème for use unicode chars with Tk (my
tests on : French, German/Deutch, Cyrillic (russian), Grec).


@-salutations
-- 
Michel Claveau





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


Re: Communication between python scripts

2005-03-01 Thread Do Re Mi chel La Si Do
Hi !

A socket (TCP) server is very easy, and 30 x faster than XML-RPC.

@-salutations
-- 
Michel Claveau


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


Re: Communication between python scripts

2005-03-01 Thread Do Re Mi chel La Si Do

Hi !

A socket (TCP) server is more simplist than XML-RPC, and 30 x faster.

@-salutations
-- 
Michel Claveau



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


Re: Shared Memory Example (Python, ctypes, VC++)

2005-03-19 Thread Do Re Mi chel La Si Do
Thanks.




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


Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Do Re Mi chel La Si Do
Hi


if key not in d:
d[key] = {subkey:value}
else:
d[key][subkey] = value


and

d[(key,subkey)] = value

?


Michel Claveau


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


Re: How to create an object instance from a string??

2005-03-19 Thread Do Re Mi chel La Si Do
Hi !


Also :


classname = "Dog"
exec("b="+classname+"()")
b.bark()

or

classname = "Dog"
exec("cl="+classname)
b=cl()
b.bark()



Michel Claveau




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


Re: How to create an object instance from a string??

2005-03-19 Thread Do Re Mi chel La Si Do
Hi !


Sorry, but :

The statement exec does not have impact on the style.

Like with exefile or import (and other), the style is determined by the 
contents.  Rather judge "exec" (or import, or execfile) than the contents, 
it is an error of causality.


@-salutations
--
Michel Claveau





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


Re: 1 + 2 = 3

2005-03-20 Thread Do Re Mi chel La Si Do
4


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


Re: exec src in {}, {} strangeness

2005-03-20 Thread Do Re Mi chel La Si Do
Hi !


Try :

exec f in globals(),locals()
or
exec(f,globals(),locals())
or
exec f in globals(),globals()
or
exec(f,globals(),globals())



@-salutations

Michel Claveau 


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


IconvCodec, UTF-32 & P4 ?

2005-03-20 Thread Do Re Mi chel La Si Do
Hi !

Iconvcodec was good, for to work with UTF-32, with Python 2.3
But, which tool, for the same use, with Python 2.4  ?
Thanks for suggestions.

Michel Claveau 


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


Re: IconvCodec, UTF-32 & P4 ?

2005-03-21 Thread Do Re Mi chel La Si Do
re-Hi


When I look  http://cjkpython.i18n.org  I found only binaries for P2.1, P2.2 
& P2.3  (I am on windows)

If I run the P2.3's version, on my Python 2.4 config, the package said that 
he don't found Python2.3.

And, I don't have compiler for work with source.
If benefactor of humanity has do a binary for windows/Python 2.4,  they 
would be fabulous.


Thanks

Michel Claveau



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


Re: How to create an object instance from a string??

2005-03-21 Thread Do Re Mi chel La Si Do
Hi !

Finally, it's the best solution.

Michel Claveau 


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


Re: problems with  character

2005-03-22 Thread Do Re Mi chel La Si Do
a  aaa'
0123456


It's OK



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


Re: problems with  character

2005-03-22 Thread Do Re Mi chel La Si Do
And this run OK for me :

s = 'a  aaa'
print s
print s.replace('Â', '')



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


Re: IronPython 0.7 released!

2005-03-23 Thread Do Re Mi chel La Si Do
Hi !


I am curious :

1)I can't download the file ("error in the GotDotNet system").
2)   On http://ironpython.com, there are no new version


@-salutations
-- 
Michel Claveau





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


Re: execfile() on file subclass or string

2005-03-24 Thread Do Re Mi chel La Si Do
Hi !


little idea :
You can save the string, in temp-directory (see tempfile module), then, 
use execfile


Michel Claveau 


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


Re: Twisted version 2.0

2005-03-24 Thread Do Re Mi chel La Si Do
Same question.


Michel Claveau




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


Re: What's the best GUI toolkit in Python,Tkinter,wxPython,QT,GTK?

2005-03-27 Thread Do Re Mi chel La Si Do
+1


Michel Claveau



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


Trouble with RC2

2005-03-28 Thread Do Re Mi chel La Si Do
Hi !


I have sevral problems with P4-RC2.

Typical case, I have a script who run OK with P4 "standard" ; but, on a new 
install, with P4-RC2, I obtain :

Traceback (most recent call last):
  File "C:\PONX\ponx.py", line 60, in ?
import pdebug
  File "C:\PONX\pdebug.py", line 224
for tmpArg in args[1:]:
  ^
SyntaxError: invalid syntax


If I overwrite with P4 "standard", the problem disappears.

I had problems, with three new installs :  on Windows-server-2003, 
Windows-XP-Pro, Windows-2000.

I can reproduce the problem at will.  But it is long time, because I formate 
the CPU of test to each test.



*** Sorry for my poor and bad english (therefore, boosted by google) ***



@-salutations

Michel Claveau





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


Re: BF interpreter in Python

2005-03-29 Thread Do Re Mi chel La Si Do
Hi !


Good idea.  I take this interpreter with jubilation.
Can I add your URL at http://mclaveau.com/esolang ?


Other question : do you know  PATH ?  (http://pathlang.sourceforge.net)


@-salutations

Michel Claveau



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


Re: Trouble with RC2

2005-03-29 Thread Do Re Mi chel La Si Do
Hi !


Yes, P4RC2 is a error ; it is Python 2.4.1 release candidate 2
Yes, P2.4 is Python 2.4


The scripts use ONLY space-indentation.

But the important points are :
- if I install Python 2.4 on the rc2 (overwrite), then problem 
disappears, with the SAME scripts.
- the problem is only with if the p2.4.1rc2 install is the first install 
(no Python previously)
- I had others problems, but difficult to encircle (example : COM-server 
in Python, with no problem in run, but errors with use ("no interface"), 
with rc2 'first install'; and without problem if P4, or P2.3.5 was 
installed ).

For the scripts : they are too big (3500 lines +700 lines + 850 lines) for 
to send them (and they require many modules)...


*** Sorry for my poor and bad english ***


@-salutations
-- 
Michel Claveau



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


Re: [maintenance doc updates]

2005-03-29 Thread Do Re Mi chel La Si Do
Hi !


Thanks.

But, for previous versions of Python, I downloaded a CHM version; and, at 
http://docs.python.org/download.html, I don't found this format.

is this a lapse of memory?

Would it be possible to have a continuity in the availability of the 
formats?

Thanks again.


Michel Claveau



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


Re: Python 2.4 killing commercial Windows Python development ?

2005-04-11 Thread Do Re Mi chel La Si Do
Hi !

This DLL come also with MS-JVM engine, who is free.  Therefore...

-- 
Michel Claveau



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


Re: Python 2.4 killing commercial Windows Python development ?

2005-04-11 Thread Do Re Mi chel La Si Do
And, also, with  dotNET-framework



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


Re: Using python from a browser

2005-04-14 Thread Do Re Mi chel La Si Do
Hi !

I confirm for IE.  Others, I don't know.

@-salutations

Michel Claveau






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


Re: goto statement

2005-04-20 Thread Do Re Mi chel La Si Do
+1



Michel Claveau



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


Re: Using Ming on Windows

2005-04-24 Thread Do Re Mi chel La Si Do
Hi !

You can to generate SWF (flash) files, with swfobjs.dll

See :
   http://bukoo.sourceforge.net
and
   http://www.angelfire.com/nt/teklord/swfexport.htm


I succeeded, therefore, it is easy...


Michel Claveau



 


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


Re: Import DiscID on Windows

2005-04-25 Thread Do Re Mi chel La Si Do
Hi !


Look  ctypes, for call the DLLs


@-salutations
-- 
Michel Claveau



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


Re: How To Read Excel Files In Python?

2005-12-13 Thread Do Re Mi chel La Si Do
Hi!


I had few modif. your code :

import time
from win32com.client import Dispatch
xlApp = Dispatch("Excel.Application")
xlApp.Visible=True
xlWb = xlApp.Workbooks.Open("Read.xls")
print "D3:",xlWb.ActiveSheet.Cells(3,4).Value
time.sleep(2)
xlWb.Close(SaveChanges=0)
xlApp.Quit()

This run OK on my computers.



@-salutations

Michel Claveau



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


Re: access to preallocated block of memory?

2005-12-14 Thread Do Re Mi chel La Si Do
>>> vxworks tasks writes to a reserved area of memory.

Is it compatible with the mmap module ?



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


Visual Python : finished ?

2005-12-15 Thread Do Re Mi chel La Si Do
Hi!

See :
 http://www.activeperl.com/Products/Visual_Perl/?mp=1


@+

MCI





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


  1   2   >