Re: How to use ssh-agent in windows in python?

2019-05-27 Thread coldpizza
example code for doing it in pure python: http://code.activestate.com/recipes/576810-copy-files-over-ssh-using-paramiko/ -- https://mail.python.org/mailman/listinfo/python-list

Re: How to print non-printable chars??

2011-08-18 Thread coldpizza
On Aug 13, 7:59 am, Julio Cesar Rodriguez Cruz juliocesarrodriguezc...@gmail.com wrote: Hi all, If I open an .exe file in any text editor I get lot of odd chars, what I want is to know how to output those chars if I have the hexadecimal code. I found out how to do the reverse process with the

Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-11-28 Thread coldpizza
On Nov 24, 11:08 pm, Raymond Hettinger pyt...@rcn.com wrote: I'm writing-up more guidance on how to use super() and would like to point at some real-world Python examples of cooperative multiple inheritance. Google searches take me to old papers for C++ and Eiffel, but that don't seem to be

convert Unicode filenames to good-looking ASCII

2010-05-06 Thread coldpizza
Hello, I need to convert accented unicode chars in some audio files to similarly-looking ascii chars. Looks like the following code seems to work on windows: import os import sys import glob EXT = '*.*' lst_uni = glob.glob(unicode(EXT)) os.system('chcp 437') lst_asci = glob.glob(EXT) print

Re: convert Unicode filenames to good-looking ASCII

2010-05-06 Thread coldpizza
Cool! Thanks to both Iliya and Peter! On May 6, 7:34 pm, Peter Otten __pete...@web.de wrote: coldpizza wrote: Hello, I need to convert accented unicode chars in some audio files to similarly-looking ascii chars. Looks like the following code seems to work on windows: import os

Re: How to use python to register a service (an existing .exe file)

2010-03-02 Thread coldpizza
instsrv.exe does not come with Windows by default, but I guess it should be possible to add a service using the win32 built-in `sc` command line tool. Try `sc create` from a console. The app you want to install as a service will still have to be compliant with the win32 service interface,

Re: Newbie request assistance....Python - PAMIE - Java

2009-02-20 Thread coldpizza
This is not a Pamie issue. Pamie can only see the HTML part of the page. Any object embedded in the page using the object or embed tags is not accessible to the browser, and the browser has no idea what is inside those objects - it simply passes control to the corresponding plugin, such as Java,

Re: FTP libs for Python?

2009-02-20 Thread coldpizza
Why don't you just use Curl? It does a dozen of protocols including SFTP. And if the command line version is not enough for you then there are Python bindings for Curl. On Feb 20, 4:22 pm, Thomas Allen thomasmal...@gmail.com wrote: I'm interested in writing a script to ease deployment of minor

Tkinter: stopping a background thread on demand

2009-02-19 Thread coldpizza
I am writing a Tk GUI for a console script. I start a background thread and pass it a callback function which writes debug info to a Text widget in the main Tk loop. I tried to find what is the established way to cleanly abort a child thread when the user clicks the Stop button, but apparently

Re: best set of modules for web automation without javascript

2009-02-14 Thread coldpizza
You should have a look at twill: http://twill.idyll.org It seems to be no longer maintained, but will probably do most of what you expect. And it is built on top of mechanize. On Feb 13, 4:04 pm, News123 news...@free.fr wrote: Hi, I'd like to do some web automation with python 2.5 -

Re: best set of modules for web automation without javascript

2009-02-14 Thread coldpizza
And btw, Selenium scripts can be exported to Python and run under Selenium Remote Control server. I'd say this is the most flexible and advanced way to do webtesting, since you can have a single script that runs with many browsers (opera, firefox, ie, etc), and on many platforms. And combined

'Hidden Features of Python'

2008-10-17 Thread coldpizza
Having read through the link below I finally managed to grasp some concepts that I only read about in the docs but never got to really understand. Maybe it will be helpful for people like myself who are not yet fully comfortable with some of Python's `hidden' features.

Re: 'Hidden Features of Python'

2008-10-17 Thread coldpizza
If you are using and IDE, such as Eclipse, PyScripter, etc, then CTR +click on 'this' should do the trick. In ipython you can do 'import this' and then type 'this??' Or if you are *not* lazy, you could try locating the file in the Python tree. import this # btw look at this module's source :)

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-29 Thread coldpizza
exhausted itself and I am not going to follow it up. If anyone is interested in taking it on, then please do. Best, coldpizza On Jan 29, 6:01 am, Terry Reedy [EMAIL PROTECTED] wrote: André [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] |Here's a version that |1. does not require new

py3k feature proposal: field auto-assignment in constructors

2008-01-27 Thread coldpizza
There is a pattern that occurs fairly often in constructors in Python and other OOP languages. Let's take an example: class Server(object): def __init__(self, host, port, protocol, bufsize, timeout): self.host = host self.port = port self.protocol = protocol

Re: How to detect a remote webpage is accessible? (in HTTP)

2008-01-18 Thread coldpizza
I suppose that if the file is really big and you don't need to read all of it then instead of f.readlines() you could use f.read(256) to read just the first 256 bytes. On Jan 18, 7:28 am, Astan Chee [EMAIL PROTECTED] wrote: How about: import socket, urllib2 timeout = 10

Re: UTF-8 in basic CGI mode

2008-01-17 Thread coldpizza
with mod_python and it works transparently with no explicit charset translation required. On Jan 16, 4:31 pm, Sion Arrowsmith [EMAIL PROTECTED] wrote: coldpizza  [EMAIL PROTECTED] wrote: I am using this 'word' variable like this: print u'''input type=text name=blabla value=%s''' % (word

UTF-8 in basic CGI mode

2008-01-15 Thread coldpizza
Hi, I have a basic Python CGI web form that shows data from a SQLite3 database. It runs under the built-in CGIWebserver which looks like this: [code] import SimpleHTTPServer import SocketServer SocketServer.TCPServer((, 80),SimpleHTTPServer.SimpleHTTPRequestHandler).serve_forever() [/code] The

UTF-8 in basic CGI mode

2008-01-15 Thread coldpizza
Hi, I have a basic Python CGI web form that shows data from a SQLite3 database. It runs under the built-in CGIWebserver which looks something like this: [code] from BaseHTTPServer import HTTPServer from CGIHTTPServer import CGIHTTPRequestHandler HTTPServer(8000,

Re: How to display unicode with the CGI module?

2007-11-25 Thread coldpizza
Unicode != UTF-8. ... `encode()` method is your friend. Thanks a lot for help! I am always confused as to which one to use: encode() or decode(); I have initially tried decode() and it did not work. It is funny that encode() and decode() omit the name of the other encoding (Unicode ucs2?),

How to display unicode with the CGI module?

2007-11-24 Thread coldpizza
Hi! I am using the built-in Python web server (CGIHTTPServer) to serve pages via CGI. The problem I am having is that I get an error while trying to display Unicode UTF-8 characters via a Python CGI script. The error goes like this: UnicodeEncodeError: 'ascii' codec can't encode character

Re: database persistence with mysql, sqlite

2007-09-24 Thread coldpizza
On Sep 24, 7:23 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], coldpizza wrote: So far, with mysql I use 'SELECT * FROM TABLE LIMIT L1, L2' where L1 and L2 define the range for the 'Next' and 'Previous' commands. I have to run

database persistence with mysql, sqlite

2007-09-22 Thread coldpizza
Hi, I want to run a database query and then display the first 10 records on a web page. Then I want to be able to click the 'Next' link on the page to show the next 10 records, and so on. My question is how to implement paging, i.e. the 'Next/Prev' NN records without reestablishing a database

sqlite3 db update extremely slow

2007-07-16 Thread coldpizza
I am trying to fill a sqlite3 database with records, and to this end I have written a class that creates the db, the table and adds rows to the table. The problem is that the updating process is *extremely* slow, and occasionally I get the message database locked. I tried removing

Re: sqlite3 db update extremely slow

2007-07-16 Thread coldpizza
added records? And how do set the encoding for the retrieved records? Is it always utf-8 by default? On Jul 16, 11:21 pm, Roel Schroeven [EMAIL PROTECTED] wrote: coldpizza schreef: I am trying to fill a sqlite3 database with records, and to this end I have written a class that creates the db