Vb6 type to python

2022-11-30 Thread luca72.b...@gmail.com
Hello i have a byte file, that fill a vb6 type like:
Type prog_real
codice As String * 12'hsg
denom  As String * 24'oo
codprof As String * 12   'ljio
note As String * 100
programmer As String * 11
Out As Integer
b_out As Byte'TRUE = Sec   FALSE= mm
asse_w As Byte   '3.zo Asse --> 0=Z  1=W
numpassi  As Integer 'put
len As Long  'leng
p(250) As passo_pg
vd(9) As Byte'vel.
qUscita(9) As Integer'quote 
l_arco As Long   'reserved
AxDin As Byte'dime
End Type

How i can convert to python
-- 
https://mail.python.org/mailman/listinfo/python-list


is there somebody that have experince with python and canopen

2022-04-15 Thread luca72.b...@gmail.com
We are searching for someone that can develop a python program for use 
servomotor for automotive.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PyQt pass data from class

2016-11-15 Thread luca72 via Python-list
Thanks for your reply

Is the latter, can you explain how i can do it.

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


PyQt pass data from class

2016-11-15 Thread luca72 via Python-list
Hello i need to this

class Form(QWidget, Ui_Form):
"""
Class documentation goes here.
"""
def __init__(self, parent=None):
"""
Constructor

@param parent reference to the parent widget
@type QWidget
"""
super(Form, self).__init__(parent)
self.setupUi(self)
self.tabWidget.setCurrentIndex(0)
combo = QComboBox()
self.disegno = Cornice()

class Cornice(QPainter):

def __init__(self, parent=None):

lista_dati = []

in the class Form i have a lineEdit

in the class Cornice i need to write something link

self.lineEdit.setText('blabla') that is in the class Form

in wich way i can have access to the lineedit of class Form without event from 
class Cornice

Many Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Qtimer and extra argument

2016-10-26 Thread luca72 via Python-list
thanks


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


Re: Qtimer and extra argument

2016-10-26 Thread luca72 via Python-list
I get () missing 1 required positional argument: 's'
-- 
https://mail.python.org/mailman/listinfo/python-list


Qtimer and extra argument

2016-10-26 Thread luca72 via Python-list
Hello i hope that yo can reply to this question also if the argument is pyqt

i have a simple test:
def start_timer(self):
self.timer = QTimer()
testo = 'pressed'
self.timer.singleShot(1000, self.metto_testo)

def test(self, testo):
self.lineEdit.setText(testo)


How i can pass the variable testo to the def test?
If i use :
self.timer.singleShot(1000, self.metto_testo(testo)
i get error

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


import

2016-05-30 Thread luca72 via Python-list
Hello i'm not sure that is the right group but i try
i use pyqt5 with eric

i have two form in the first form i have add :
from form_two import Form_two 
and for pass varible to second form i have add in the function

def test(self)
   self.ft= Form_two() #so i can acces to Object in form_two
   self.ft.tableView.setModel(.) and it work

But i need to pass also value from form two to object in in the firs
but when i add 
from form_one import Form (in form two)
 i get the error Unhandled import error cannot import name Form  (but the class 
name is correct)

Thanks
Luca
-- 
https://mail.python.org/mailman/listinfo/python-list


write file to a server

2015-01-28 Thread luca72
Hello i'm under windows, i have to write a file from my computer to a local 
server like taht \\DOCUMENTALE\my_folder\.
How i have to proceed ?

Thanks 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: write file to a server

2015-01-28 Thread luca72
thanks for the reply i have resolve with the r'.'
i have another question on linux i write cp -Ruv source destination

There is one way to do it in python?
with shutil there is copythree but if the dest dir exist he give back an error.
Can you give me some ideas

Thanks

Luca
-- 
https://mail.python.org/mailman/listinfo/python-list


installeventfilter

2011-10-11 Thread luca72
helo i have this form how i can install the event filter:
Class Form(QWidget, Ui_Form):

Class documentation goes here.

def __init__(self, parent = None):

Constructor

QWidget.__init__(self, parent)
self.setupUi(self)

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


matplotlib on osx 10.6

2011-10-07 Thread luca72
hello i try to install matplotlib on osx 10.6 , i have also installed
freetype libpng and numpy but i get this error:
BUILDING MATPLOTLIB
matplotlib: 1.1.0
python: 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
[GCC
4.2.1 (Apple Inc. build 5646)]
  platform: darwin

REQUIRED DEPENDENCIES
 numpy: 1.2.1
 freetype2: found, but unknown version (no pkg-config)
* WARNING: Could not find 'freetype2' headers
in any
* of '.', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES
libpng: found, but unknown version (no pkg-config)
* Could not find 'libpng' headers in any of
'.'
   Tkinter: Tkinter: 67083, Tk: 8.5, Tcl: 8.5
  Gtk+: no
* Building for Gtk+ requires pygtk; you must
be able
* to import gtk in your build/install
environment
   Mac OS X native: yes
Qt: no
   Qt4: Qt: 4.7.0, PyQt4: 4.8.2
 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
  datetime: present, version unknown
  dateutil: present, version unknown
  pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
dvipng: no
   ghostscript: /bin/sh: gs: command not found
 latex: no

[Edit setup.cfg to suppress the above messages]

pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends',
'matplotlib.backends.qt4_editor', 'matplotlib.projections',
'matplotlib.testing', 'matplotlib.testing.jpl_units',
'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d',
'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1',
'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.tri',
'matplotlib.delaunay', 'pytz']
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc - build/lib.macosx-10.6-
universal-2.6/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf - build/
lib.macosx-10.6-universal-2.6/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -
Os -Wall -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -
DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/System/
Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/
numpy/core/include -I. -I/System/Library/Frameworks/Python.framework/
Versions/2.6/Extras/lib/python/numpy/core/include/freetype2 -I./
freetype2 -I/System/Library/Frameworks/Python.framework/Versions/2.6/
include/python2.6 -c src/ft2font.cpp -o build/temp.macosx-10.6-
universal-2.6/src/ft2font.o
In file included from src/ft2font.h:16,
 from src/ft2font.cpp:3:
/usr/local/include/ft2build.h:56:38: error: freetype/config/
ftheader.h: No such file or directory
In file included from src/ft2font.cpp:3:
src/ft2font.h:17:10: error: #include expects FILENAME or FILENAME
src/ft2font.h:18:10: error: #include expects FILENAME or FILENAME
src/ft2font.h:19:10: error: #include expects FILENAME or FILENAME
src/ft2font.h:20:10: error: #include expects FILENAME or FILENAME
src/ft2font.h:21:10: error: #include expects FILENAME or FILENAME
In file included from src/ft2font.cpp:3:
src/ft2font.h:35: error: ‘FT_Bitmap’ has not been declared
src/ft2font.h:35: error: ‘FT_Int’ has not been declared
src/ft2font.h:35: error: ‘FT_Int’ has not been declared
src/ft2font.h:91: error: expected ‘,’ or ‘...’ before ‘’ token
src/ft2font.h:91: error: ISO C++ forbids declaration of ‘FT_Face’ with
no type
src/ft2font.h:138: error: ‘FT_Face’ does not name a type
src/ft2font.h:139: error: ‘FT_Matrix’ does not name a type
src/ft2font.h:140: error: ‘FT_Vector’ does not name a type
src/ft2font.h:141: error: ‘FT_Error’ does not name a type
src/ft2font.h:142: error: ‘FT_Glyph’ was not declared in this scope
src/ft2font.h:142: error: template argument 1 is invalid
src/ft2font.h:142: error: template argument 2 is invalid
src/ft2font.h:143: error: ‘FT_Vector’ was not declared in this scope
src/ft2font.h:143: error: template argument 1 is invalid
src/ft2font.h:143: error: template argument 2 is invalid
src/ft2font.h:149: error: ‘FT_BBox’ does not name a type
src/ft2font.cpp:51: error: ‘FT_Library’ does not name a type
src/ft2font.cpp:114: error: variable or field ‘draw_bitmap’ declared
void
src/ft2font.cpp:114: error: ‘FT_Bitmap’ was not declared in this scope
src/ft2font.cpp:114: error: ‘bitmap’ was not declared in this scope
src/ft2font.cpp:115: error: ‘FT_Int’ was not declared in this scope
src/ft2font.cpp:116: error: ‘FT_Int’ was not declared in this scope
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/
python/numpy/core/include/numpy/__multiarray_api.h:958: warning: ‘int
_import_array()’ defined but not used
In file included 

file deleted

2011-04-13 Thread luca72
hello i'm working with eric, running a program eric crash and when i
try to open my project again with eric i see that myproject.py is
deleted, but my project is still running there is a way to find
myprogram.py file aving it in execution?
-- 
http://mail.python.org/mailman/listinfo/python-list


pyc to py

2011-04-13 Thread luca72
I have pyc file written with python 2.6.5 and i need to return to py
file, can you give me some ideas tools script etc.
Luca
-- 
http://mail.python.org/mailman/listinfo/python-list


Signal on qt

2011-04-12 Thread luca72
hello i have this:
def mytest(self):
for a in xrange(self.tableWidget.rowCount()):
self.combo_test = QtGui.QComboBox()
self.connect(self.combo_test,
QtCore.SIGNAL(currentIndexChanged(int)), self.metto_test)
self.combo_test.addItems(self.lista_def)
self.tableWidget.setCellWidget(a, 4, self.combo_test)
def metto_test(self, index):
print index

I he no connection what is wrong?

Thanks

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


invio di una stringa

2011-03-30 Thread luca72
ciao  a tutti
sniffando i dati del protocollo irc con wireshark noto che a un certo
punto per il resume di un trasferimento un noto programma manda questa
stringa:
PRIVMSG Ex|testtrasf|001 :\001DCC RESUME prova_trasferimento.pdf 58772
5016204\001
a questo punto il server risponde.
Utilizzando i socket io riesco a connettermi al server ed a inviargli
tuti i messaggi che voglio, ma quando mando il comando sopra scritto
il server non mi risponde.
 La mia domanda è \001 a cosa corrisponde?
penso che l'inghippo sia li, perche gli altri comandi che non hanno lo
\001 vengono digeriti bene?
Grazie Luca
-- 
http://mail.python.org/mailman/listinfo/python-list


problem installing a module

2011-03-22 Thread luca72
Hello i try to install pyvisa under winxp sp3
i get this error:
home_dir =os.environ['HOME']
return self.data[key.upper()]
key error : 'HOME'

i have installed a lot of tyme pyvisa and this is the first time that
i get this error.
Thanks

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


pyqt unhandled RuntimeError \no access to protected functions or signals for objects not created from Python

2010-09-03 Thread luca72
Hello i have also write to pyqt mailing list but maybe you can help me
to solve this question:
I have write a tcpserver but wheni try to read by the signal
readyRead() e get the error
this the part of the program:
def nuova_connessione(self):
print 'Nuova connessione'
self.nuovo_socket =
self.mio_server.nextPendingConnection()
print self.nuovo_socket
self.connect(self.nuovo_socket,
QtCore.SIGNAL(connected()), self.
connessione)
self.connect(self.nuovo_socket,
QtCore.SIGNAL(readyRead()), self.
leggo_risposta)
self.connect(self.nuovo_socket,
QtCore.SIGNAL(disconnected), self.
sconnesso)
self.connect(self.nuovo_socket,
QtCore.SIGNAL(error(Qtcore.
QAbsatctSocket::SocketError)), self.server_errore)

def leggo_risposta(self):
   cosa_leggo = self.nuovo_socket.readData(self.nuovo_socket.
bytesAvailable())
can you help me
Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


pyqt signals

2010-09-03 Thread luca72
Hello i have write this but i not able to connect the emit of the
class Socket to the Form class, can you help me?

class Socket(QtNetwork.QTcpSocket):
def __init__(self, parent=None):
super(Socket, self).__init__(parent)
self.connect(self, QtCore.SIGNAL(readyRead()),
self.leggi_richiesta)

def leggi_richiesta(self):
messaggio = self.readData(self.bytesAvailable())
print 'dati_letti = ', messaggio
self.emit(QtCore.SIGNAL(messaggio), messaggio)
print 'segnale emesso'

class Form(QWidget, Ui_Form):

Class documentation goes here.

def __init__(self, parent = None):

Constructor


connesso_in_arr =False
self.coda = False
QWidget.__init__(self, parent)
self.setupUi(self)
self.dati = False
self.lu = TcpServer()
self.lu
self.connect(Socket(self), QtCore.SIGNAL('messaggio'),
self.leggo_risposta)


def leggo_risposta(self, messaggio):
self.plainTextEdit_2.appendPlainText(messaggio)

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


stupid question about html page

2010-07-01 Thread luca72
hello
with webbrowser i open the html or php etc page, how i can save the
opened page with python?

Thanks

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


Re: stupid question about html page

2010-07-01 Thread luca72
On 1 Lug, 10:16, Mithrandir mithrandiragainw...@mailinator.com
wrote:
 luca72 lucabe...@libero.it wrote in news:abfb7720-6132-4b7b-8084-
 5c1a48164...@y11g2000yqm.googlegroups.com:

  hello
  with webbrowser i open the html or php etc page, how i can save the
  opened page with python?

  Thanks

  Luca

 Not sure of a way to capture info from a browser (like Firefox.) I know
 though that you can save the source of an page with:

 import urllib
 urllib.urlretrieve(http://www.example.com/;, Fun.html)

 You still need a web browser to read it formatted. (If you are on a web
 page in Firefox, and want to save it, click FileSave Page As...)

 If you want to save a picture from the Net see:

 http://www.daniweb.com/code/snippet216796.html

 Good luck!

 --
 People should read 
 more.https://secure.wikimedia.org/wikipedia/en/wiki/User:MithrandirAgain
 All that is gold does not glitter,
 not all those who wander are lost;
 the old that is strong does not wither,
 deep roots are not reached by the frost.
 From the ashes a fire shall be woken,
 a light from the shadows shall spring;
 renenwed shall be blade that was broken,
 the crownless again shall be king.

Thanks for your reply, the problem is that i don't want to save it
with file- save.
there is any way to save the page by script.
please note that when i save the page with firefox, it save the html
page and also make a folder with the script used in the page, how i
can make it also with python script?
Thanks

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


pysms

2010-05-06 Thread luca72
Hello
Has anyone used pysms can you tell me with wich gsm module it works?

Thanks

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


Re: socked and bytes operation

2010-04-24 Thread luca72


i attach some part of the server so maybe you can help me to
understand :
Packet description (before encryption)

Messages sent back and forth between newcamd and a cardserver always
consist of
a three byte header and (optional) data bytes. The header always
starts with a
command tag byte. This is always the first byte (byte 1) of a message.
In case of an ECM or EMM this is simply the table id of the ECM (0x80,
0x81)
or EMM (0x82 - 0x8f). Other commands use cmd tags starting from 0xe0
like this:

#define CWS_FIRSTCMDNO 0xe0

typedef enum
{
MSG_CLIENT_2_SERVER_LOGIN = CWS_FIRSTCMDNO,
MSG_CLIENT_2_SERVER_LOGIN_ACK,
MSG_CLIENT_2_SERVER_LOGIN_NAK,
MSG_CARD_DATA_REQ,
MSG_CARD_DATA,
MSG_SERVER_2_CLIENT_NAME,
MSG_SERVER_2_CLIENT_NAME_ACK,
MSG_SERVER_2_CLIENT_NAME_NAK,
MSG_SERVER_2_CLIENT_LOGIN,
MSG_SERVER_2_CLIENT_LOGIN_ACK,
MSG_SERVER_2_CLIENT_LOGIN_NAK,
MSG_ADMIN,
MSG_ADMIN_ACK,
MSG_ADMIN_LOGIN,
MSG_ADMIN_LOGIN_ACK,
MSG_ADMIN_LOGIN_NAK,
MSG_ADMIN_COMMAND,
MSG_ADMIN_COMMAND_ACK,
MSG_ADMIN_COMMAND_NAK,
MSG_KEEPALIVE = CWS_FIRSTCMDNO + 0x1d,
} net_msg_type_t;


Client to Server Login

This describes how to login . Remember each card has its
own dedicated TCP port, this is how you choose, which card you want.

Client - Server 1/5 - 090f - Thu Jan  8 17:20:17 CET 2004
encryption: none
--
00: 77 9d cc 5d d2 0d 59 2e dc ed b8 17 c1 ab w  ]  Y.   (this
are the bites that i receive ofter the connection)

After opening a TCP connection to the server, the client first
receives 14
random bytes. These bytes are to be XORed to the Triple-DES key from
the config
file. (cardserver: DESKEY = 0102030405060708091011121314). The result
forms the
Triple DES key to be used to send Username and Password to the
cardserver, I
call it the login key.

for make this i do :
import socket,crypt, itertools
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.connect(('192.168.1.11',11502))
ricevo = sock.recv(8192)
stringa = '0102030405060708091011121314'
ricevo = map(ord, ricevo)
print ricevo
#print '\n'
#luca= []
stringa = map(ord, stringa)
print stringa

plain_chars = []

for cypher_char, key_char in zip(ricevo, itertools.cycle(stringa)):
plain_char = (cypher_char) ^ (key_char)
plain_chars.append(plain_char)
print plain_chars

i get:
[133, 234, 201, 215, 129, 130, 252, 113, 15, 226, 29, 193, 67, 103]


Client - Server 1/5 - 090f - Thu Jan  8 17:20:18 CET 2004
encryption: login
--
00: e0 00 29 64 75 6d 6d 79 00 24 31 24 61 62 63 64 )dummy $1$abcd
10: 65 66 67 68 24 6e 70 53 45 54 51 73 72 49 6d 33   efgh$npSETQsrIm3
20: 35 4d 51 66 69 55 49 41 64 6e 2e 00   5MQfiUIAdn.

Next the client has to send a packet with cmd =
MSG_CLIENT_2_SERVER_LOGIN (e0)
including username and password in the data field.
The username is sent as a C-String (NULL terminated), the password
follows directly after the zero termination byte of the username. The
password has to be put through the glibc crypt() function, using salt
$1$abcdefgh$. The password in the data field has to be NULL terminated
and the
packet encrypted with the login key.

cryptPw = crypt(plainPw, $1$abcdefgh$);

If i understand right i have to do this :

ris = cript.crypt(password,$1$abcdefgh$)
than
sock.send('e0'+password+ris)
and than read again
is this correct?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: socked and bytes operation

2010-04-22 Thread luca72
On 21 Apr, 20:42, John Nagle na...@animats.com wrote:
 luca72 wrote:
  Hello i have this question :
  i connect to the server in this way:
  sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  sock.connect(('192.168.1.11',11502))
  rcv = sock.recv(8124)
  here i get 14 random bytes , in a string with strange chars like :
  ¬¨^.á‹•Ò
  a„ãj
  I think because sock.recv return a string.
  Now i have to xor this 14 bytes with a key stored in file as a sting.
  Can you help me to understand how to do it.

      Port 11502?  What are you talking to?  An eSoft Distributed
 Intelligent Architecture node? Unlikely. Let me guess. A Counter-Strike
 server.

                                 John Nagle

i'm tolking to a cardserv in a dvb decoder with linux inside
-- 
http://mail.python.org/mailman/listinfo/python-list


string caracters:

2010-04-22 Thread luca72
i get a string from a web server and i save it in to a file, that i
open the file and i read the string:
the string looks like :
http://lhti.gs/JKBTYD
after the read i use webbrowser open (sting), but i get the error
because at the end of the string are added '%0D%0A', and if i ask for
the len of the sting it include also the'%0D%0A.
My question is how i can cut the last part of the string if it is
every time different?

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


Re: python glibc crypt() function

2010-04-21 Thread luca72
On 20 Apr, 19:38, Peter Otten __pete...@web.de wrote:
 luca72 wrote:
  Hello i have to do this :
  glibc crypt() function, using salt $1$abcdefgh$

  cryptPw = crypt(plainPw, $1$abcdefgh$)
Thanks
The result is correct i obtain the same with ctypes and crypt module,
so i think that is better to use the crypt module is correct?

Luca


  I can do it in python, with package i need?
  Thanks
  import ctypes                                                    
  lib = ctypes.CDLL(libcrypt.so.1)                                
  crypt = lib.crypt
  crypt.restype = ctypes.c_char_p
  crypt(password, $1$abcdefgh$)

 '$1$abcdefgh$G//4keteveJp0qb8z2DxG/'

 Is that what it's supposed to return?

 Peter

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


socked and bytes operation

2010-04-21 Thread luca72
Hello i have this question :
i connect to the server in this way:
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.connect(('192.168.1.11',11502))
rcv = sock.recv(8124)
here i get 14 random bytes , in a string with strange chars like :
¬¨^.á‹•Ò
a„ãj
I think because sock.recv return a string.
Now i have to xor this 14 bytes with a key stored in file as a sting.
Can you help me to understand how to do it.

Thanks

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


python glibc crypt() function

2010-04-20 Thread luca72
Hello i have to do this :
glibc crypt() function, using salt $1$abcdefgh$

cryptPw = crypt(plainPw, $1$abcdefgh$)

I can do it in python, with package i need?
Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


python and enigma2

2010-04-12 Thread luca72
Hello i have a dvb decoder with enigma2 inside, The enigma2 plugin can
be made with python.
In my plugin i have to use pyserial, but in the decoder the python2.5
reply in this way:
r...@bm750:/var/pyserial-2.5-rc2# python setup.py install
Traceback (most recent call last):
  File setup.py, line 8, in module
from distutils.core import setup
ImportError: No module named distutils.core

How i can install distutils?

Thanks

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


Re: python and enigma2

2010-04-12 Thread luca72
On 12 Apr, 19:10, luca72 lucabe...@libero.it wrote:
 Hello i have a dvb decoder with enigma2 inside, The enigma2 plugin can
 be made with python.
 In my plugin i have to use pyserial, but in the decoder the python2.5
 reply in this way:
 r...@bm750:/var/pyserial-2.5-rc2# python setup.py install
 Traceback (most recent call last):
   File setup.py, line 8, in module
     from distutils.core import setup
 ImportError: No module named distutils.core

 How i can install distutils?

 Thanks

 Luca

Sorry i try to install setuptolls i get this :
r...@bm750:/var# sh setuptools-0.6c11-py2.5.egg
exec: 8: python2.5: not found

I see anly the python executable andno other folder can you hel me

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


pythonpath

2010-03-01 Thread luca72
Sorry for my stupid question if i have to load module from a folder i
have to append it to the sys path the folder?
ex:
if my  folder module is  /home/lucak904/Scrivania/Luca/enigma2
i do this :
import sys
sys.path.append('/home/lucak904/Scrivania/Luca/enigma2')
If this is correct why when i write:
form enigma2 import *
i get no module named enigma2

Thanks
Luca

I'm under linux


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


read from bin file

2009-12-17 Thread luca72
I have a bin file that i read as:
in_file = open('primo.ske', 'rb')
leggo = luca.readlines()

i get a list like :
['\x00\x80p\x8b\x00\x00\x01\x19\x9b\x11\xa1\xa1\x1f\xc9\x12\xaf\x81!
\x84\x01\x00\x01\x01\x02\xff\xff\x80\x01\x03\xb0\x01\x01\x10m\x7f\n',
etc...]

but if i try to print  luca[0]
i get not the the string in the list but i get some like  ఉ{
how i can get a string like the string in the list?
Thanks Luca
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: subprocess kill

2009-12-05 Thread luca72
On 5 Dic, 03:06, Carl Banks pavlovevide...@gmail.com wrote:
 On Dec 4, 3:44 pm, luca72 lucabe...@libero.it wrote:



  On 5 Dic, 00:14, luca72 lucabe...@libero.it wrote:

   On 5 Dic, 00:03, luca72 lucabe...@libero.it wrote:

On 4 Dic, 23:23, Mike Driscoll kyoso...@gmail.com wrote:

 On Dec 4, 3:50 pm, luca72 lucabe...@libero.it wrote:

  Hello i'm using subprocess in this way:
  self.luca = subprocess.Popen(['/usr/bin/
  dvbtune'+frase_sint],shell=True, 
  stdout=self.f_s_l,stderr=self.f_s_e )

  then i kill:
  self.luca.Kill()

  but the process is still active and the file self.f_s_l increase it
  size because the process is not killed.

  How i can kill the process?
  Regards

  Luca

 Seehttp://lmgtfy.com/?q=python+kill+subprocess+linux

 When I do that on my machine, the 2nd result has the answer:

http://stackoverflow.com/questions/1064335/in-python-2-5-how-do-i-kil...

 ---
 Mike Driscoll

 Blog:  http://blog.pythonlibrary.org

Hello Mike i have also test but they never kill the process the file
(stdout=self.f_s_l) increase it's size, haveyou some idea.
also if i close the program the process is still active.

Regards

Luca

   i'm able only to kill via shell like kill -9 process pid, Why?

  Now the only way to solve the problem is to call a c program that kill
  the process via subprocess in other case i can't close it, i have also
  try with

  subprocess.Popen(['kill -9 dvbtune'] shell=True), but the process is
  still active

 This is not working because the kill command does not accept the name
 of a program.  You have to give it a process id.

 As for your general question, we really can't answer it.  There a lot
 of reasons a process might not die when you try to kill it: it could
 be trapping and ignoring signals (which is rude but it happens), it
 could be stuck in a critical section, the program might be threaded
 and not handling signals well, the program might have forked itself
 and the original process id has disappeared, etc.  We can't read your
 mind or divine what's running on your computer, so we can't answer
 your question.  We can only suggest things that might be wrong.  It's
 up to you to investigate and/or dig deeper.

 Carl Banks

The firs thing that i have tested is with the process id get by
Popen.pid ,but it don't works.
Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


subprocess kill

2009-12-04 Thread luca72
Hello i'm using subprocess in this way:
self.luca = subprocess.Popen(['/usr/bin/
dvbtune'+frase_sint],shell=True, stdout=self.f_s_l,stderr=self.f_s_e )

then i kill:
self.luca.Kill()

but the process is still active and the file self.f_s_l increase it
size because the process is not killed.

How i can kill the process?
Regards

Luca

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


Re: subprocess kill

2009-12-04 Thread luca72
On 4 Dic, 23:23, Mike Driscoll kyoso...@gmail.com wrote:
 On Dec 4, 3:50 pm, luca72 lucabe...@libero.it wrote:

  Hello i'm using subprocess in this way:
  self.luca = subprocess.Popen(['/usr/bin/
  dvbtune'+frase_sint],shell=True, stdout=self.f_s_l,stderr=self.f_s_e )

  then i kill:
  self.luca.Kill()

  but the process is still active and the file self.f_s_l increase it
  size because the process is not killed.

  How i can kill the process?
  Regards

  Luca

 Seehttp://lmgtfy.com/?q=python+kill+subprocess+linux

 When I do that on my machine, the 2nd result has the answer:

 http://stackoverflow.com/questions/1064335/in-python-2-5-how-do-i-kil...

 ---
 Mike Driscoll

 Blog:  http://blog.pythonlibrary.org

Hello Mike i have also test but they never kill the process the file
(stdout=self.f_s_l) increase it's size, haveyou some idea.
also if i close the program the process is still active.

Regards

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


Re: subprocess kill

2009-12-04 Thread luca72
On 5 Dic, 00:03, luca72 lucabe...@libero.it wrote:
 On 4 Dic, 23:23, Mike Driscoll kyoso...@gmail.com wrote:



  On Dec 4, 3:50 pm, luca72 lucabe...@libero.it wrote:

   Hello i'm using subprocess in this way:
   self.luca = subprocess.Popen(['/usr/bin/
   dvbtune'+frase_sint],shell=True, stdout=self.f_s_l,stderr=self.f_s_e )

   then i kill:
   self.luca.Kill()

   but the process is still active and the file self.f_s_l increase it
   size because the process is not killed.

   How i can kill the process?
   Regards

   Luca

  Seehttp://lmgtfy.com/?q=python+kill+subprocess+linux

  When I do that on my machine, the 2nd result has the answer:

 http://stackoverflow.com/questions/1064335/in-python-2-5-how-do-i-kil...

  ---
  Mike Driscoll

  Blog:  http://blog.pythonlibrary.org

 Hello Mike i have also test but they never kill the process the file
 (stdout=self.f_s_l) increase it's size, haveyou some idea.
 also if i close the program the process is still active.

 Regards

 Luca

i'm able only to kill via shell like kill -9 process pid, Why?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: subprocess kill

2009-12-04 Thread luca72
On 5 Dic, 00:14, luca72 lucabe...@libero.it wrote:
 On 5 Dic, 00:03, luca72 lucabe...@libero.it wrote:



  On 4 Dic, 23:23, Mike Driscoll kyoso...@gmail.com wrote:

   On Dec 4, 3:50 pm, luca72 lucabe...@libero.it wrote:

Hello i'm using subprocess in this way:
self.luca = subprocess.Popen(['/usr/bin/
dvbtune'+frase_sint],shell=True, stdout=self.f_s_l,stderr=self.f_s_e )

then i kill:
self.luca.Kill()

but the process is still active and the file self.f_s_l increase it
size because the process is not killed.

How i can kill the process?
Regards

Luca

   Seehttp://lmgtfy.com/?q=python+kill+subprocess+linux

   When I do that on my machine, the 2nd result has the answer:

  http://stackoverflow.com/questions/1064335/in-python-2-5-how-do-i-kil...

   ---
   Mike Driscoll

   Blog:  http://blog.pythonlibrary.org

  Hello Mike i have also test but they never kill the process the file
  (stdout=self.f_s_l) increase it's size, haveyou some idea.
  also if i close the program the process is still active.

  Regards

  Luca

 i'm able only to kill via shell like kill -9 process pid, Why?

Now the only way to solve the problem is to call a c program that kill
the process via subprocess in other case i can't close it, i have also
try with

subprocess.Popen(['kill -9 dvbtune'] shell=True), but the process is
still active

Regards

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


dvb3

2009-11-28 Thread luca72
hello i try to use the python-dvb3 bindings, but i have some problem:
fe = dvb3.frontend.Frontend(0)
type = tipo_1 = fe.get_dvbtype()
now i need to set the parameters
parametri = dvb3.frontend.QPSKParameters(frequency=frequency,
inversion=2 , symbol_rate=27500,  fec_inner=9)
but when i use
fe.set_frontend(parametri)
i get the error
The debugged program raised the exception IOError
(22, 'Invalid argument')
File: frontend.pyx, Line: 364

thedef is as follow :
 def set_frontend(self, parameters):
global cfrontend
cdef cfrontend.dvb_frontend_parameters p
if pack_parameters(p, parameters) == 0:
raise ParameterError, Incorrect parameter type
if ioctl(self.fd, cfrontend.FE_SET_FRONTEND, p) == -1:
raise_ioerror()

can you hel me

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


hex int and string

2009-11-27 Thread luca72
hello i have a problem

i have this

str = 'D3'
and i need to trasform in 0xd3 type int and not type string how i can
do this?
if i do
hex(int(str,16) ) i obtain a string and this is not what i need.

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


Re: hex int and string

2009-11-27 Thread luca72
i'm using pyscard

and for send a command he need a list like this:

cmd = [0xdd,0xff, etc]

the problem is that i get a text
like dd
and i need to trasform it in 0xdd for the list and if i use hex i have
a sting that is not what i need

Luca

On 27 Nov, 10:22, Ben Finney ben+pyt...@benfinney.id.au wrote:
 luca72 lucabe...@libero.it writes:
  str = 'D3'

 Be careful when choosing names. Here you have clobbered the existing
 string type binding to the name ‘str’.

  and i need to trasform in 0xd3 type int and not type string how i can
  do this?

 You already have the answer; you used it in your example below. I can
 only assume you're wanting something additional; what is that?

  if i do hex(int(str,16) ) i obtain a string and this is not what i
  need.

 You either want it as an int, or you want it as a string. Which is it?

      foo = 'D3'
      int(foo, 16)
     211
      0xD3
     211
      int(foo, 16) == 0xD3
     True

 --
  \            “Human reason is snatching everything to itself, leaving |
   `\                     nothing for faith.” —Saint Bernard, 1090–1153 |
 _o__)                                                                  |
 Ben Finney

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


Re: hex int and string

2009-11-27 Thread luca72
i have checked and pyscard accept also the decimal notation,

Thanks

Luca

On 27 Nov, 10:38, Lie Ryan lie.1...@gmail.com wrote:
 On 11/27/2009 8:28 PM, luca72 wrote:

  i'm using pyscard

  and for send a command he need a list like this:

  cmd = [0xdd,0xff, etc]

  the problem is that i get a text
  like dd
  and i need to trasform it in 0xdd for the list and if i use hex i have
  a sting that is not what i need

   # Do you know that when you write
   somelist = [0xdd, 0xff, 0x34]
   # python read it as
   somelist
 [221, 255, 52]

 All int in python (and in fact most computers) is stored as binary
 digits; when you need a textual representation the binary digits is
 transformed into string (even decimal representation [!]). When python
 evaluates an integer literal expression, it converts them from whatever
 base it is originally in [1] to binary.

 [1] determined by the prefix: 0b - binary, 0x - hexadecimal, 0o -
 octal, and unprefixed - decimal.

 thus:
   [0xdd, 0xff, 0x34] == [221, 255, 52]
 True

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


Re: ctypes list library

2009-06-25 Thread luca72
Hello but find_library find only the lib. but if i need to load from a
list of lib how i have to do.
My proble is that i have 5 lib (a,b,c,d,e), if i load the a i get lib
b not found, if for first i load the b and than the a i get the same
error how i have to proceed.

Thanks

Luca

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


ctypes list library

2009-06-22 Thread luca72
There is a command for ctypes that help me to know the entry points
inside a library.

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


Re: ctypes list library

2009-06-22 Thread luca72
Thanks for your reply.
I have another question i can load a list of library?
Thanks

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


Re: ctypes list library

2009-06-22 Thread luca72
Can you tell me how load a list of library

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


c array

2009-04-29 Thread luca72
hello i'm using ctypes

i have this c function
PREF0 short usb_tc08_get_single (
  short   handle,
  float * temp,
  short * overflow_flags,
  short   units);
where :
nt main(void)
{
short handle = 0; /* The handle to a TC-08 returned by
usb_tc08_open_unit() */
char selection = 0;   /* User selection from teh main menu */
float temp[9];/* Buffer to store temperature readings from
the TC-08 */
int channel, reading; /* Loop counters */
int retVal = 0;   /* Return value from driver calls indication
success / error */
USBTC08_INFO unitInfo;/* Struct to hold unit information */

how i can pass the value using c types?
strumento = ctypes.cdll.LoadLibrary('libusbtc08.so') and here is ok
but when i call the function
strumento.short usb_tc08_get_single(arg1, arg2,arg3,arg4)
arg1 is 0 arg2 2 is a carray i dont know how to convert, arg3 is none
and arg 4 is a string here is the c example
usb_tc08_get_single(handle, temp, NULL, USBTC08_UNITS_CENTIGRADE)
--
http://mail.python.org/mailman/listinfo/python-list


ctypes

2009-04-29 Thread luca72
can you explain how to use this function :
this is the api documentation :
PREF0 short usb_tc08_get_single (
  short   handle,
  float * temp,
  short * overflow_flags,
  short   units);

This is the sample made in c:
int main(void)
{
short handle = 0; /* The handle to a TC-08 returned by
usb_tc08_open_unit() */
char selection = 0;   /* User selection from teh main menu */
float temp[9];/* Buffer to store temperature readings
from
the TC-08 */
int channel, reading; /* Loop counters */
int retVal = 0;   /* Return value from driver calls
indication
success / error */
USBTC08_INFO unitInfo;/* Struct to hold unit information */

usb_tc08_get_single(handle, temp, NULL, USBTC08_UNITS_CENTIGRADE);
i do
strumento = ctypes.cdll.LoadLibrary('/home/luca/Desktop/luca/
progetti_eric/Pico/libusbtc08-1.7.2/src/.libs/libusbtc08.so')
strumento.usb_tc08_get_single.argtypes = [ctypes.c_short,
ctypes.c_float, ctypes.c_short, ctypes.c_short] is this correct?
strumento.usb_tc08_get_single.restype = ctypes.c_short is this
correct?
now how i can use the function?
leggo = strumento.usb_tc08_get_single(0, temp,
'NULL','USBTC08_UNITS_CENTIGRADE')
how i can define ad pas the value temp, null,USBTC08_UNITS_CENTIGRADE

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


ctypes

2009-04-29 Thread luca72
hello i have this api
PREF0 short usb_tc08_get_single (
  short   handle,
  float * temp,
  short * overflow_flags,
  short   units);

this is a sample program made in c
int main(void)
{
short handle = 0; /* The handle to a TC-08 returned by
usb_tc08_open_unit() */
char selection = 0;   /* User selection from teh main menu */
float temp[9];/* Buffer to store temperature readings from
the TC-08 */
int channel, reading; /* Loop counters */
int retVal = 0;   /* Return value from driver calls indication
success / error */
USBTC08_INFO unitInfo;/* Struct to hold unit information */

usb_tc08_get_single(handle, temp, NULL, USBTC08_UNITS_CENTIGRADE);

handle is c_short, but how a can define temp and the other two value?

myist.usb_tc08_get_single.argtypes = [ctypes.c_short, ctypes.c_float,
ctypes.c_short, ctypes.c_short] --is correct?
myist.usb_tc08_get_single.argtypes.restype = c_short   --- is
correct?

but whe i call myist.usb_tc08_get_single(0,
[9],NULL,USBTC08_UNITS_CENTIGRADE )

i get argument 2 wrong type
can you explain how to execute this function
Thanks

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


encoding

2008-11-25 Thread luca72
hello i'm writing an irc client, i use for encoding the utf-8 but i
never see all the typed sign in the correct way, anyone know the
standard encodind for the irc channels?

Regards

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


Ip format

2008-11-20 Thread luca72
Hello i have this ip 1578568204

how socket function i can have the ip dotted-quad string?

i have try socket.inet_aton get no error but only this ^ETB FF

Thanks luca

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


Re: Ip format

2008-11-20 Thread luca72
Many thanks for your help
I have also find the correct socket function:
ip 1578568204
ip = socket.inet_aton(ip)
ip_dot = socket.inet_ntoa(ip)


Thanks Luca


On 20 Nov, 12:36, Tim Chase [EMAIL PROTECTED] wrote:
  Hello i have this ip 1578568204

  how socket function i can have the ip dotted-quad string?

  i have try socket.inet_aton get no error but only this ^ETB FF

 I've got the following program I threw together for one of my
 junior developers:

    from sys import argv, exit
    if len(argv)  2:
      print Usage:
      print \t%s ip_address % argv[0]
      print \t%s int % argv[0]
      print \nThe first form translates a dotted-quad format into
 int format
      print \nThe second form translates from int form to a
 dotted-quad
      exit(1)

    src = argv[1]

    if src.count('.') == 3:
      a,b,c,d = map(lambda s: 0xff and int(s), src.split('.'))
      print (
        (a  (8*3)) |
        (b  (8*2)) |
        (c  (8*1)) |
        d)
    else:
      i = int(src)
      a = 0xff  (i  (8*3))
      b = 0xff  (i  (8*2))
      c = 0xff  (i  (8*1))
      d = 0xff  (i)
      print '%s.%s.%s.%s' % (a,b,c,d)

 The code you're looking for is in the bottom else: clause.
 Yes, that could be optimized to just c = 0xff  (i  8) in the
 3rd case, but it made it easier for my junior developer to
 understand what was going on.

 There might be some library function to do these transformations
 for you, but after a quick look, I didn't find anything.

 -tkc

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


cxfreeze

2008-11-04 Thread luca72
Hello
i try to use cxfreeze under linux with a easy project made with qt i
run this :
cxfreeze --install-dir=dist  main.py
and i get the error
ImportError: No module named PyQt4._qt

so i try : cxfreeze --install-dir=dist --include-modules='PyQt4._qt'
main.py
but i get the same error
i try also including the sip module but i get the same error.

Can you help me

Thaks

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


Ascii codec can't encode

2008-10-30 Thread luca72
hello i have this problem:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 8: ordinal not in range(128)
Generally i solve the problem inserting :
# -*- coding: ISO-8859-1 -*-
at the top of the file but now he don't work can you help me

thanks

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


Re: Ascii codec can't encode

2008-10-30 Thread luca72
On 30 Ott, 10:27, luca72 [EMAIL PROTECTED] wrote:
 Hy the code is this:

 Pok\xe9mon

 Luca

Sorry is the é
--
http://mail.python.org/mailman/listinfo/python-list


Re: Ascii codec can't encode

2008-10-30 Thread luca72
Hello Again

the code is this
# -*- coding: ISO-8859-1 -*-
from BeautifulSoup import BeautifulSoup
import urllib
sito = urllib.urlopen('http://text.net/')
esamino = BeautifulSoup(sito)
luca = esamino.findAll('tr', align='center')
lunghezza = len(luca)
messaggio_per_scar = open('me', 'wb')
file_ricerca = open('ri', 'wb')
for dati in range(lunghezza):
gino = luca[dati]
test = gino.findAll(text=True)
print test
valori_a = gino.find(a)[onclick].split(')
print valori_a
nome_boot = valori_a[1]
print nome_boot
frase_scar = '/msg '+nome_boot+' xdcc send '+test[0]+'\n\r'
messaggio_per_scar.write(frase_scar)
nome = test[2]
if nome ==' ':
nome = test[4]
frase_ric = nome+' '+test[1]+' '+test[0]+'\n\r'
file_ricerca.write(frase_ric)  #here i have the error
messaggio_per_scar.close()
file_ricerca.close()

Regards

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


Re: Ascii codec can't encode

2008-10-30 Thread luca72
Hy the code is this:

Pok\xe9mon

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


Re: Ascii codec can't encode

2008-10-30 Thread luca72
the arror are:

 Error in sys.excepthook:
Traceback (most recent call last):
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClientBase.py, line 1006, in __unhandled_exception
self.mainThread.user_exception(None, (exctype,excval,exctb), 1)
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugBase.py, line 538, in user_exception
self._dbgClient.eventLoop()
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClientBase.py, line 921, in eventLoop
self.readReady(self.readstream.fileno())
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
AsyncIO.py, line 67, in readReady
self.handleLine(s)
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClientBase.py, line 311, in handleLine
self.__dumpVariables(int(frmnr), int(scope), filter)
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClientBase.py, line 1128, in __dumpVariables
vlist = self.__formatVariablesList(keylist, dict, scope, filter)
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClientBase.py, line 1594, in __formatVariablesList
valtypestr = unicode(type(value))[1:-1]
TypeError: unbound method __unicode__() must be called with
NavigableString instance as first argument (got nothing instead)

Original exception was:
Traceback (most recent call last):
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClient.py, line 38, in module
debugClient.main()
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClientBase.py, line 1900, in main
self.__interact()
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClientBase.py, line 897, in __interact
self.eventLoop()
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClientBase.py, line 921, in eventLoop
self.readReady(self.readstream.fileno())
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
AsyncIO.py, line 67, in readReady
self.handleLine(s)
  File /usr/lib/python2.5/site-packages/eric4/DebugClients/Python/
DebugClientBase.py, line 445, in handleLine
execfile(sys.argv[0], self.debugMod.__dict__)
  File /home/luca11/Desktop/prova.py, line 36, in module
file_ricerca.write(frase_ric)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 8: ordinal not in range(128)

I have solve in this way:

file_ricerca = codecs.open('ri', 'wb', 'ISO-8859-15', 'repalce')

That is not exact what i want because instead of the 'é' i get '?' but
the loop contine.
Thanks

Luca


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


Re: beutifulsoup

2008-10-30 Thread luca72
hello
Another stupit question instead of use
sito = urllib.urlopen('http://www.prova.com/')
esamino = BeautifulSoup(sito)

i do
 sito = urllib.urlopen('http://onlygame.helloweb.eu/')
 file_sito = open('sito.html', 'wb')
 for line in sito :
 file_sito.write(line)
 file_sito.close()

how can i pass the file sito.html to beautifulsoup?

Regards

Luca

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


beutifulsoup

2008-10-29 Thread luca72
Hello
I try to use beautifulsoup
i have this:
sito = urllib.urlopen('http://www.prova.com/')
esamino = BeautifulSoup(sito)
luca = esamino.findAll('tr', align='center')

print luca[0]

tr align=centerth width=5%a onclick=t('Only|G|BoT|05','#1'); 
href=##1/a/thtd width=10%44.4MB/tdtd width=90% 
align=leftfont color=orange Pc-prova.rar /font/td/tr

I need to get the following information:
1)Only|G|BoT|05
2)#1
3)44.4MB
4)Pc-prova.rar
with: print luca[0].a.stringi get #1
with print luca[0].td.stringi get 44.4MB
can you explain me how to get the others two value
Thanks
Luca
--
http://mail.python.org/mailman/listinfo/python-list


xchat

2008-10-27 Thread luca72
Hello

i have installed xchat on suse11 i see that there is the possibility
to use python for make some script, i see also that the python
interface is loaded, but when in python i type import xchat i get that
the module don't exist.
where is the module?
I try also to ask in the xchat forum but i get no reply so i try here

Thanks

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


import cherrypy2

2008-06-06 Thread luca72
Hello i can't import cherrypy2 but i don't know why this is the sys
path:

'', '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
setuptools-0.6c7-py2.5.egg', '/home/pirataja/opo.net/python/lib/
python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg', '/home/pirataja/
opo.net/python/lib/python2.5/site-packages/TurboKid-1.0.4-py2.5.egg',
'/home/pirataja/opo.net/python/lib/python2.5/site-packages/
TurboJson-1.1.2-py2.5.egg', '/home/pirataja/opo.net/python/lib/
python2.5/site-packages/TurboCheetah-1.0-py2.5.egg', '/home/pirataja/
opo.net/python/lib/python2.5/site-packages/simplejson-1.9.1-py2.5-
linux-i686.egg', '/home/pirataja/opo.net/python/lib/python2.5/site-
packages/RuleDispatch-0.5a0.dev_r2306-py2.5-linux-i686.egg', '/home/
pirataja/opo.net/python/lib/python2.5/site-packages/PasteScript-1.6.2-
py2.5.egg', '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
FormEncode-1.0.1-py2.5.egg', '/home/pirataja/opo.net/python/lib/
python2.5/site-packages/DecoratorTools-1.7-py2.5.egg', '/home/pirataja/
opo.net/python/lib/python2.5/site-packages/configobj-4.5.2-py2.5.egg',
'/home/pirataja/opo.net/python/lib/python2.5/site-packages/
CherryPy-2.3.0-py2.5.egg', '/home/pirataja/opo.net/python/lib/
python2.5/site-packages/kid-0.9.6-py2.5.egg', '/home/pirataja/opo.net/
python/lib/python2.5/site-packages/Cheetah-2.0.1-py2.5-linux-
i686.egg', '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
PyProtocols-1.0a0dev_r2302-py2.5-linux-i686.egg', '/home/pirataja/
opo.net/python/lib/python2.5/site-packages/PasteDeploy-1.3.1-
py2.5.egg', '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
Paste-1.7-py2.5.egg', '/home/pirataja/opo.net/python/lib/
python25.zip', '/home/pirataja/pirata-jacopo.net/python/lib/
python2.5', '/home/pirataja/opo.net/python/lib/python2.5/plat-
linux2',
'/home/pirataja/opo.net/python/lib/python2.5/lib-tk',
'/home/pirataja/opo.net/python/lib/python2.5/lib-dynload', '/home/
pirataja/opo.net/python/lib/python2.5/site-packages']

For my is all ok but whe i do import cherrypy2 i get no mudule name
cherrypy2

Regards

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


Re: import cherrypy2

2008-06-06 Thread luca72
On 6 Giu, 10:31, Chris [EMAIL PROTECTED] wrote:
 On Jun 6, 10:22 am, luca72 [EMAIL PROTECTED] wrote:



  Hello i can't import cherrypy2 but i don't know why this is the sys
  path:

  '', '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
  setuptools-0.6c7-py2.5.egg', '/home/pirataja/opo.net/python/lib/
  python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg', '/home/pirataja/
  opo.net/python/lib/python2.5/site-packages/TurboKid-1.0.4-py2.5.egg',
  '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
  TurboJson-1.1.2-py2.5.egg', '/home/pirataja/opo.net/python/lib/
  python2.5/site-packages/TurboCheetah-1.0-py2.5.egg', '/home/pirataja/
  opo.net/python/lib/python2.5/site-packages/simplejson-1.9.1-py2.5-
  linux-i686.egg', '/home/pirataja/opo.net/python/lib/python2.5/site-
  packages/RuleDispatch-0.5a0.dev_r2306-py2.5-linux-i686.egg', '/home/
  pirataja/opo.net/python/lib/python2.5/site-packages/PasteScript-1.6.2-
  py2.5.egg', '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
  FormEncode-1.0.1-py2.5.egg', '/home/pirataja/opo.net/python/lib/
  python2.5/site-packages/DecoratorTools-1.7-py2.5.egg', '/home/pirataja/
  opo.net/python/lib/python2.5/site-packages/configobj-4.5.2-py2.5.egg',
  '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
  CherryPy-2.3.0-py2.5.egg', '/home/pirataja/opo.net/python/lib/
  python2.5/site-packages/kid-0.9.6-py2.5.egg', '/home/pirataja/opo.net/
  python/lib/python2.5/site-packages/Cheetah-2.0.1-py2.5-linux-
  i686.egg', '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
  PyProtocols-1.0a0dev_r2302-py2.5-linux-i686.egg', '/home/pirataja/
  opo.net/python/lib/python2.5/site-packages/PasteDeploy-1.3.1-
  py2.5.egg', '/home/pirataja/opo.net/python/lib/python2.5/site-packages/
  Paste-1.7-py2.5.egg', '/home/pirataja/opo.net/python/lib/
  python25.zip', '/home/pirataja/pirata-jacopo.net/python/lib/
  python2.5', '/home/pirataja/opo.net/python/lib/python2.5/plat-
  linux2',
  '/home/pirataja/opo.net/python/lib/python2.5/lib-tk',
  '/home/pirataja/opo.net/python/lib/python2.5/lib-dynload', '/home/
  pirataja/opo.net/python/lib/python2.5/site-packages']

  For my is all ok but whe i do import cherrypy2 i get no mudule name
  cherrypy2

  Regards

  Luca

 because it's import cherrypy and not import cherrypy2

sorry but from another python installation i import cherrypy2 as
cherrypy and all works

Regards

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


Re: import cherrypy2

2008-06-06 Thread luca72
No i haven't install lino

but if frmp the python of this computer  i make import cherrypy2 i
import it without problem this is the python path:

[EMAIL PROTECTED]:~ python
Python 2.5.1 (r251:54863, Jan 10 2008, 18:00:49)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type help, copyright, credits or license for more information.
 import cherrypy2
 import sys
 sys.path
['', '/usr/lib64/python2.5/site-packages/setuptools-0.6c7-py2.5.egg',
'/usr/lib64/python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg', '/
usr/lib64/python2.5/site-packages/TurboKid-1.0.4-py2.5.egg', '/usr/
lib64/python2.5/site-packages/TurboJson-1.1.2-py2.5.egg', '/usr/lib64/
python2.5/site-packages/TurboCheetah-1.0-py2.5.egg', '/usr/lib64/
python2.5/site-packages/simplejson-1.8.1-py2.5-linux-x86_64.egg', '/
usr/lib64/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2306-py2.5-
linux-x86_64.egg', '/usr/lib64/python2.5/site-packages/
PasteScript-1.6.2-py2.5.egg', '/usr/lib64/python2.5/site-packages/
FormEncode-1.0.1-py2.5.egg', '/usr/lib64/python2.5/site-packages/
DecoratorTools-1.7-py2.5.egg', '/usr/lib64/python2.5/site-packages/
configobj-4.5.2-py2.5.egg', '/usr/lib64/python2.5/site-packages/
CherryPy-2.3.0-py2.5.egg', '/usr/lib64/python2.5/site-packages/
kid-0.9.6-py2.5.egg', '/usr/lib64/python2.5/site-packages/
Cheetah-2.0.1-py2.5-linux-x86_64.egg', '/usr/lib64/python2.5/site-
packages/PyProtocols-1.0a0dev_r2302-py2.5-linux-x86_64.egg', '/usr/
lib64/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg', '/usr/
lib64/python2.5/site-packages/Paste-1.6-py2.5.egg', '/usr/local/lib64/
python2.5/site-packages/pagedemo1-1.0-py2.5.egg', '/usr/lib/
python25.zip', '/usr/lib64/python2.5', '/usr/lib64/python2.5/plat-
linux2', '/usr/lib64/python2.5/lib-tk', '/usr/lib64/python2.5/lib-
dynload', '/usr/lib64/python2.5/site-packages', '/usr/lib64/python2.5/
site-packages/Numeric', '/usr/lib64/python2.5/site-packages/PIL', '/
usr/lib64/python2.5/site-packages/gtk-2.0', '/usr/lib64/python2.5/site-
packages/wx-2.8-gtk2-unicode', '/usr/local/lib64/python2.5/site-
packages']


Regards

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


pyuno and calc

2007-11-06 Thread luca72
Hello
Can you tell me where i can find some example that's show how to open
an existing oocalc document and get some data from it?

Thanks Luca

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


Re: PyQt ProgressBar

2007-10-16 Thread luca72
No one can help pls

Regards

Luca


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


PyQt ProgressBar

2007-10-15 Thread luca72
Hello i have made anly one test like this:


 from time import sleep
 barra = QtGui.QProgressBar()
 barra.setMinimum(0)
 barra.setMaximum(10)
 for a in range(10):
   sleep(1)
   barra.setValue(a)
   app.processEvents()

But the bar remain fix to 0% don't increase.

can you tell me how to prooced

Regards

Luca

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


cxfreeze

2007-10-12 Thread luca72
Hello i use under linux cx-freeze
My python program import a small module were i set the encoding to iso
8859-1.
When i make the executable with cxfreeze and i run it i get this
error:
Traceback (most recent call last):
  File /home/luca72/Desktop/Luca/python/cx_Freeze-3.0.3/initscripts/
Console.py, line 27, in module
exec code in m.__dict__
  File main.py, line 4, in module
  File form_pack_impl.py, line 13, in module
  File sitecustomize.py, line 3, in module
LookupError: unknown encoding: iso-8859-1

Can you help me

Regards

Luca

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


QPicture and Qpainter PyQt4

2007-09-17 Thread luca72
Hello at all
I have made this small tests:

this is the form implementation:

# -*- coding: utf-8 -*-


Module implementing Form.


from PyQt4.QtGui import QWidget
from PyQt4.QtCore import pyqtSignature
from PyQt4 import *
from disegni import PictureFrame

from Ui_form import Ui_Form

class Form(QWidget, Ui_Form):

Class documentation goes here.

def __init__(self, parent = None):

Constructor

QWidget.__init__(self, parent)
self.setupUi(self)

@pyqtSignature()
def on_pushButton_clicked(self):

Slot documentation goes here.

# TODO: not implemented yet
#raise Not implemented yet
#gr = QtGui.QPainter()
picture = QtGui.QPicture()
gr = QtGui.QPainter()
gr.begin(picture)
gr.setPen(QtGui.QPen(QtCore.Qt.black, 1, QtCore.Qt.SolidLine))
gr.drawLine(70,100,150,100)
gr.end()
picture.save('dis.pic')
self.frame.update()

and this is the clas that implements the paint event:

from PyQt4.QtGui import QWidget
from PyQt4.QtCore import pyqtSignature
from PyQt4 import *

class PictureFrame(QtGui.QFrame):

  def __init__(self, parent = None):
QFrame.__init__(self, parent)
picture = QtGui.QPicture()

  def paintEvent(self, event):
picture.load('dis.pic')
gr = QtGui.QPainter()
gr.begin(self.frame)
gr.drawPicture(0, 0, picture)
gr.end()

But nothing is paint.
Can you give me some help

Regards

Luca

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


Sip4.7

2007-09-06 Thread luca72
Hello
i have python2.5 with sip4.6 installed on a linux machine, i need to
install sip4.7 but i get a lot of error like this:

sip.h:525: error: expected specifier-qualifier-list before
'PyMethodDef'
sip.h:609: error: expected specifier-qualifier-list before
'sipForceConvertToFunc'
sip.h:666: error: expected specifier-qualifier-list before 'PyObject'
sip.h:902: error: expected specifier-qualifier-list before
'PyTypeObject
sipint.h:81: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
sipint.h:86: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
sipint.h:87: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '*' token
siplib.c:39: error: expected ')' before '*' token
siplib.c:41: error: expected ')' before '*' token
siplib.c:43: error: expected ')' before '*' token
siplib.c:45: error: expected ')' before '*' token
siplib.c:48: error: expected ')' before '*' token
plib.c:285: error: expected specifier-qualifier-list before 'PyObject'
siplib.c:290: error: expected '=', ',', ';', 'asm' or '__attribute__'
before 'sipWrapperType_Type'

Have you some idea why?

Regards

Luca

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


csv module

2007-08-24 Thread luca72
Hello at all i have a problem with the csv module, really i don't
undestud the writerows:

if i have to write only one row i do as follow:
def scrivo_csv(self):
import csv
q_righe = self.tableWidget.rowCount()
for row in range(q_righe) :
e_vuota = self.tableWidget.item(row, 5)
if e_vuota == None :
ultima = row
break
writerdocs = open(some.csv, wb)
scritt = csv.writer(writerdocs, delimiter='|')
q_colonne = self.tableWidget.columnCount()
ss = 0
while ss  row :
riga = []
for val in range(q_colonne):
esiste = self.tableWidget.item(ss, val)
if esiste == None :
luca = ''
else :
luca = str(QtGui.QTableWidgetItem.text(esiste))
riga.append(luca)
scritt.writerow(riga)
ss+=1
This work only with one row in the tablewidget, but if i have more
than one row how i have to proceed?

Thanks for the help

Luca

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


Re: unify els database

2007-07-09 Thread luca72
Many thanks

I will try with Jython

Regards

Luca


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


Re: unify els database

2007-07-03 Thread luca72
Hello and thanks for your answer, the unify db is on unix-sco and i
need to connect with linux machine with python

Regards

Luca

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


QPainter

2007-06-20 Thread luca72
Hello
using qt3 i do the follow for paint some line in a frame

gr = QPainter(self.frame3)
gr drawLine(30,10,30,490)
and the line is draw.

Whit qt4 :
 gr = QtGui.QPainter(self.frame3)
 #gr.setPen(QtGui.QPen(QtCore.Qt.black, 1, QtCore.Qt.SolidLine))
 gr.drawLine(30,10,30,490)
and nothing is draw but i have no error

The frame is the same with the same dimension and relative dimension.

where is the error?

Regards

Luca

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


ni pci-6010 Analog Input Multifunction DAQ

2007-06-19 Thread luca72
Hello

there is someone that have experience with the ni-pci-6010 Analog
Input Multifunction DAQ and python?

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


qt4 setFlags

2007-06-14 Thread luca72
Hello

I make this code:
row = self.tableWidget.rowCount()
for a in range(row):
self.tableWidget.item(row, 0).setFlags(Qt.IsSelectable)

i have this erroror :

global name Qt is not definied

Regards

Luca

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


qpushbutton

2007-06-06 Thread luca72
hello again
i have another stupid question.
How i can set a qpushbutton invisible?
thanks Luca

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


qt doevent

2007-05-31 Thread luca72
Hello at all
I try to use qt , but i have problem, i don't find the command like
wx.Yield() in wx or doevent in vb.
Can you tell me the same command in qt

Regards

Luca

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


file resume

2007-04-16 Thread luca72
Hello at all:
if i have one file written in binary mode, how can i append others
binary data to this file after the its closure.
ex
my_file = open('blabal', 'wb')
then i write something and then
my_file.close()
now if i need to open it again and append other binary data how can i
proceed?


Regards

Luca

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


matplotlib real time grap.

2006-11-16 Thread luca72
Hello at all.
I need to do a real time plot where on the frame i have this like limit
line:
import math
dati = []
for freq in range(int(freqiniziale), (int(freqfinale )+ 1)):
forza = float(massa) * ((2*math.pi*freq)**2)/10
dati.append(forza)
ax1 = subplot(111)
plot(dati)
xlabel('Frequenza HZ')
ylabel('Deg')
title('Grafico Calibrazione')
ax2 = twinx()
plot([0.1,0.2,0.3],'r-')
ylabel('Forza')
ax2.yaxis.tick_right()
#dlg = wx.FileDialog(self, Choose a file, ., , *.*,
wx.SAVE)
#try:
  #  if dlg.ShowModal() == wx.ID_OK:
#filename = dlg.GetPath()

  #  savefig(filename+'.pdf')
#finally:
  #  dlg.Destroy()
show()

with this i have the grap on the screen but i have to update every time
that i receive others data coming from two instruments (10 seconds),
how i can update the grap?

Regards

Luca

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


Re: Pycrypto

2006-06-26 Thread luca72
Hello again

You know if is possible save all the encryption process in a text file
and not only the result?

This will be wery helpful for compare the pycrypto step by step
operation, with the hand made operation and see where hand made make a
mistake

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


Pycrypto

2006-06-16 Thread luca72
Hello
I have to make an easy operation but reading the pycrypto doc. a never
see AES example
I have to cript this key 'ea523a664dabaa4476d31226a1e3bab0' with the
AES.
Can you help me for make it with pycrypto

Regards Luca

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


Re: Pycrypto

2006-06-16 Thread luca72

Thanks

Luca

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


Re: Pycrypto

2006-06-16 Thread luca72

Excuse me  again,
If the string is not a sting but hex number how i have to proced :

look this page:
http://www.cs.eku.edu/faculty/styer/460/Encrypt/JS-AES.html

Regards Luca

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


Re: Pycrypto

2006-06-16 Thread luca72

Hello again i have solve doing this:

from Crypto.Cipher import AES
stri=(chr(int('9b',16))+chr(int('d3',16))+chr(int('2d',16))+chr(int('24',16))+chr(int('af',16))+chr(int('c9',16))+chr(int('e9',16))+chr(int('d7',16))+chr(int('46',16))+chr(int('69',16))+chr(int('71',16))+chr(int('32',16))+chr(int('45',16))+chr(int('5f',16))+chr(int('27',16))+chr(int('0b',16)))
luca = str(stri)
crypt = AES.new(luca, AES.MODE_ECB)
testo=(chr(int('ea',16))+chr(int('52',16))+chr(int('3a',16))+chr(int('66',16))+chr(int('4d',16))+chr(int('ab',16))+chr(int('aa',16))+chr(int('44',16))+chr(int('76',16))+chr(int('d3',16))+chr(int('12',16))+chr(int('26',16))+chr(int('a1',16))+chr(int('e3',16))+chr(int('ba',16))+chr(int('b0',16)))
testo = str(testo)
c = crypt.encrypt(testo)

I don't know if this is the best way , but anyway it work

Regards

Luca

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


Re: Pycrypto

2006-06-16 Thread luca72


 In [26]:import binascii

 In [27]:binascii.unhexlify('ea523a664dabaa4476d31226a1e3bab0')
 Out[27]:'\xeaR:fM\xab\xaaDv\xd3\x12\xa1\xe3\xba\xb0'
 
 Ciao,
   Marc 'BlackJack' Rintsch

Ciao Marc

Grazie Thanks

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


Re: Direct acces to db unify on unix sco

2006-04-28 Thread luca72
Thanks

Luca

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


Direct acces to db unify on unix sco

2006-04-27 Thread luca72
Is it possible or i must use odbc?

Rergards Luca

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


Re: wx.checklistbox

2006-04-03 Thread luca72
Hello Frefrik
It works but sometimes it insert a blank row so the file is like:

item1

item2
item3


item4
etc..

I don't inderstand  why.

But supposing that we can't solve this, is it possible to delete blanlk
items in the checkListBox?

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


Re: wx.checklistbox

2006-04-03 Thread luca72
I have solve in this way i'm sure it's not the best, but it works:

 lista1leggi = open('/lista1.txt', 'r')
mt = lista1leggi.readlines()
lunghezzamt = len(mt)
lucianino = 0
while lucianino  (lunghezzamt - 1):
if mt[lucianino] == '\n':
del mt[lucianino]
lucianino = lucianino - 1
lunghezzamt = lunghezzamt - 1
else: lucianino = lucianino + 1

pippo = self.checkListBox1.AppendItems(mt)

Ragards Luca

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


Re: wx.checklistbox

2006-04-01 Thread luca72
i have again one simple problem:
 the script is this:

 def output(self):
global lista2
lista2 = open('/lista2', 'w')
iteminlista2 = self.checkListBox2.GetStrings()
lista2.writelines(iteminlista2)

def input1(self):
lista2leggi = open('/lista2', 'r')
cd = lista2leggi.readlines()
self.checkListBox2.AppendItems(cd)



The write file is like:

item1item2item3

when i read the and i put the item in the checklistbox , i don't find :

item1
item2
item3

but :

item1item2item3

How to do for have it like :

item1
item2
item3

Regards

Luca

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


Re: wx.checklistbox

2006-04-01 Thread luca72
Thank Fredrik

I try and then i will inform you

Luca

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


wx.checklistbox

2006-03-31 Thread luca72
Hello
I write one file using:...(i think that is ok for write all the
lines of my list)
luca = open('/tmp/luca', 'w')
luca.writelines(list)

when i open the application again i use:

leggi = open('/tmp/luca', 'r')
leggi.readlines()

How can i store this line in to a wx.checkbox.

Thanks Luca

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


Re: wx.checklistbox

2006-03-31 Thread luca72
Sorry Philippe 
is a Wx.checklistbox

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


Re: wx.checklistbox

2006-03-31 Thread luca72
I have solved with appen.items()
Regards

Luca

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


Re: wx.checklistbox

2006-03-31 Thread luca72
sorry
appenditems

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


excel application

2006-03-29 Thread luca72
Hello here is the code:

from win32com.client import Dispatch
packing = Dispatch(Excel.Application)
packing.Visible = 1
packing.Workbooks.Add()
#packing.Worksheets.Add()
packing.ActiveSheet.Range(A1).ColumnWidth = 8
packing.ActiveSheet.Range(B1).ColumnWidth = 12
packing.ActiveSheet.Range(C1).ColumnWidth = 6
packing.ActiveSheet.Range(D1).ColumnWidth = 6
packing.ActiveSheet.Range(E1).ColumnWidth = 6
packing.ActiveSheet.Range(F1).ColumnWidth = 60
packing.ActiveSheet.Range(G1).ColumnWidth = 13
packing.ActiveSheet.Range(H1).ColumnWidth = 10
packing.ActiveSheet.Range(A8:H9).Select()
packing.ActiveSheet.Selection.Borders(xlDiagonalDown).LineStyle
= xlNone

The error messege is

global name xlNone is not definied

what I have mistaken?

Regards 

Luca

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


Re: excel application

2006-03-29 Thread luca72
Thanks a lot Luciano

Regards Luca

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


Re: excel application

2006-03-29 Thread luca72
Thanks Peter

Regards

Luca

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


Re: Pyserial again

2006-03-07 Thread luca72
Here is my code ; why after the readline the port close?

ser = serial.Serial(0)
ser.baudrate = 9600
ser.parity = serial.PARITY_ODD
ser.stopbits = serial.STOPBITS_TWO
ser.bytesize =serial.EIGHTBITS
ser.setRTS(level = 0)
ser.setDTR(level = 0)
ser.timeout = 1

ser.readline()

Why after this the port close.

Regards Luca

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


Re: Pyserial again

2006-03-07 Thread luca72
def OnButton1Button(self, event):

   ser = serial.Serial(0)
 ser.baudrate = 9600
 ser.parity = serial.PARITY_ODD
 ser.stopbits = serial.STOPBITS_TWO
 ser.bytesize =serial.EIGHTBITS
 ser.setRTS(level = 0)
 ser.setDTR(level = 0)
 ser.timeout = 1

 ser.readline() 

no code before

Regards

Luca

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


  1   2   >