Visual Report Editor

2006-02-16 Thread Pawel
Hello,
I plan to make Visual Reporting Editior, a new product for
corporate-class systems. Data will be in XML and in my application,
designer should be able to make fascinating templates of reports. I
will use Python and MSVS 2005 Pro. My question is, which libaries will
be useful in my job. I plan to buy Qt and make visual layer of
application using Qt. I'm making businessplan soI have to decide which
tool will be useful. Is Qt best choice, maybe I should buy something
different?

Pawel

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


Re: Can local function access local variables in main program?

2007-11-03 Thread Pawel
Stargaming wrote:
> You can make this work using the `global` statement::
> 
> >>> def foo():
> ... global x
> ... print x
> ... x = 0

Is there any way to disable global for x? Something like that:
>>> x = 12345
>>> def foo():
... global x
... print x
... noglobal(x)  # ???
... x = 0# now this is local x 
>>> foo()
12345
>>> print x
12345

-- 
In pariete - manus et crus cerebrumque
 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: access to serial port

2005-02-02 Thread Pawel Chrobak

> Keywords: python serial
>

Great, I needed exactly this information ( pyserial) . Thanks a lot ;)


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


Bug in the documentation (?)

2006-09-09 Thread Pawel Oleksik

Hi, Snake Tamers

According to http://www.python.org/doc/2.4.1/lib/typesseq-strings.html (and
next releases):

"""
The conversion types are:

Conversion  Meaning Notes
[...]
x   Unsigned hexadecimal (lowercase).   (2)
X   Unsigned hexadecimal (uppercase).   (2)

"""


But actually:

Python 2.4.1 (#1, Apr 10 2005, 22:30:36) 
[GCC 3.3.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> '%x' % -123456
'-1e240'

so it is a _signed_ hexadecimal.
However, sometimes it would be convinient to get the unisgned conversion
(especially, since id(..) can return a negative value).
This way is rather clumsy:

>>> '%x' % (id('abcd')+0x1)
'b7b75380'

Do you see any better solution?

p.o.

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


Paramiko, termios - interactive shell connection.

2008-10-19 Thread Pawel Gega

Hi,

I am coding a small SSH client, I ve got some issues with creating 
pseudo terminal on server side, or at least I suppose that's the problem.

That is the 'ps auxf' run on SSH server:

   root  4317  0.0  0.3  33744   876 ?Ss   11:36   0:00
   /usr/sbin/sshd
   *### **4525** is the proper connection done with standard ssh
   client   *|
   root  4525  0.3  1.1  53036  2896 ?Ss   11:37   0:00  \_
   sshd: [EMAIL PROTECTED]/0**
   root  4532  0.0  0.8  15700  2060 pts/0Ss   11:37   0:00 
   |   \_ -bash
   root  4987  0.0  0.4  12596  1024 pts/0R+   11:38   0:00 
   |   \_ ps auxf  
   *### ..and 4733 is the connection made with my python script , as

   you can see it is not using PTS *
   root  4733  0.0  1.0  52940  2676 ?Ss   11:37   0:00  \_
   sshd: pgega [priv]
   pgega 4741  0.0  0.6  52940  1600 ?S11:37   0:00 
   |   \_ sshd: pgega

   root  4745  0.0  0.9  33768  2252 ?Ss   11:37   0:00  \_
   sshd: [accepted]

Do you see anything worng with my script ? Here is the source code:

Regards,
Pawel Gega

   ##

   #! /usr/bin/env python

   import paramiko
   import termios
   import sys
   import tty

   hostname = 'h1m'
   port = 22
   username = 'pgega'
   password = 'xxx'
   known_hosts = '/home/pgega/.ssh/known_hosts'

   def shell(chan):
   import select

   oldtty = termios.tcgetattr(sys.stdin)
   try:
   tty.setraw(sys.stdin.fileno())
   tty.setcbreak(sys.stdin.fileno())
   chan.settimeout(0.0)

   while True:
   r, w, e = select.select([chan, sys.stdin], [], [])
   if chan in r:
   try:
   x = chan.recv(1024)
   if len(x) == 0:
   print '\r\n*** EOF\r\n',
   break
   sys.stdout.write(x)
   sys.stdout.flush()
   except socket.timeout:
   pass
   if sys.stdin in r:
   x = sys.stdin.read(1)
   if len(x) == 0:
   break
   chan.send(x)

   finally:
   termios.tcsetattr(sys.stdin, termios.TCSADRAIN, oldtty)

   if __name__ == '__main__':
   paramiko.util.log_to_file('psshc-interactive_shell.log')
   trn = paramiko.Transport((hostname,port))
   trn.connect(username=username, password=password)
   chn = trn.open_channel(kind='direct-tcpip',
   dest_addr=('h1m',22), src_addr=('hm',22))
   shell(chn)
   chn. close()

   ##



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