ANN: psutil 1.0.0 released

2013-07-10 Thread Giampaolo Rodola'
.0.0.tar.gz * API Reference: http://code.google.com/p/psutil/wiki/Documentation Please try out this new release and let me know if you experience any problem by filing issues on the bug tracker. Thanks in advance and hooray for the new Solaris support! ;-) All the best, --- Giampaolo Rodola&#x

Re: ANN: psutil 1.0.0 released

2013-07-11 Thread Giampaolo Rodola'
> Congratulations on the 1.0.0 release! Thanks a lot. =) > Btw. any change you can put up a prebuilt installer for a 64-bit built > with Python 3.3? You have one for Python 3.2 > (http://code.google.com/p/psutil/downloads/list), but the version for Python > 3.3 is not there. Unfortunately I'm

ANN: psutil 5.3.0 with full unicode support is out

2017-09-03 Thread Giampaolo Rodola'
Hello all, I'm glad to announce the release of psutil 5.3.0: https://github.com/giampaolo/psutil A blogpost describing the main changes is available here: http://grodola.blogspot.com/2017/09/psutil-530-with-full-unicode-support-is.html About = psutil (process and system utilities) is a cross-

Re: ANN: psutil 5.3.0 with full unicode support is out

2017-09-03 Thread Giampaolo Rodola'
unky characters, so "practicality beats purity" in this case. On Sun, Sep 3, 2017 at 11:38 PM, eryk sun wrote: > On Sun, Sep 3, 2017 at 9:58 AM, Giampaolo Rodola' > wrote: > > > > - #1040: all strings are encoded by using OS fs encoding

Re: ANN: psutil 5.3.0 with full unicode support is out

2017-09-04 Thread Giampaolo Rodola'
reasoning makes sense? I mean returning str all the time and provide a strategy to convert the string to unicode in Python 2? On Mon, Sep 4, 2017 at 2:54 PM, eryk sun wrote: > On Sun, Sep 3, 2017 at 11:09 PM, Giampaolo Rodola' > wrote: > > > > This is an example which fil

ANN: released psutil 5.0.0, introducing a 2x speedup for process methods

2016-11-06 Thread Giampaolo Rodola'
Hello all, I'm glad to announce the release of psutil 5.0.0: https://github.com/giampaolo/psutil This release introduces important speedups making psutil from 2x to 6x faster depending on what platform you're on. A full blog post can be found here: http://grodola.blogspot.com/2016/11/psutil-500-is-

ANN: psutil 4.2.0 with Windows service support is out

2016-05-15 Thread Giampaolo Rodola'
Full blog post: http://grodola.blogspot.com/2016/05/psutil-420-windows-services-and-python.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

ANN: psutil 4.2.0 with Windows service support is out

2016-05-15 Thread Giampaolo Rodola'
Full blog post: http://grodola.blogspot.com/2016/05/psutil-420-windows-services-and-python.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

Re: proposal: bring nonlocal to py2.x

2014-01-13 Thread Giampaolo Rodola'
On Mon, Jan 13, 2014 at 3:47 PM, Neal Becker wrote: > py3 includes a fairly compelling feature: nonlocal keywork > But backward compatibility is lost. It would be very helpful > if this was available on py2.x. > > -- > https://mail.python.org/mailman/listinfo/python-list > It's not gonna happe

ANN: released psutil 3.3.0 with OpenBSD support

2015-11-24 Thread Giampaolo Rodola'
Full story here: http://grodola.blogspot.com/2015/11/openbsd-support-for-psutil.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

ANN: psutil 4.0.0 released - how to get "real" process memory and environ in Python

2016-02-17 Thread Giampaolo Rodola'
Full blog post: http://grodola.blogspot.com/2016/02/psutil-4-real-process-memory-and-environ.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-11 Thread Giampaolo Rodola'
On Wed, Dec 10, 2014 at 5:59 PM, Bruno Cauet wrote: > Hi all, > Last year a survey was conducted on python 2 and 3 usage. > Here is the 2014 edition, slightly updated (from 9 to 11 questions). > It should not take you more than 1 minute to fill. I would be pleased if > you took that time. > > Her

Re: Python 2.x and 3.x use survey, 2014 edition

2014-12-13 Thread Giampaolo Rodola'
On Thu, Dec 11, 2014 at 10:32 PM, Ben Finney wrote: > > "Giampaolo Rodola'" writes: > > > I still think the only *real* obstacle remains the lack of important > > packages such as twisted, gevent and pika which haven't been ported > > yet. > >

ANN: psutil 2.2.0 released

2015-01-06 Thread Giampaolo Rodola'
Hello all, I'm glad to announce the release of psutil 2.2.0. In this new release I decided to drop support for Python 2.4 and 2.5 for good. Whoever is still on Python 2.4 and 2.5 can use old 2.1.3 version: https://pypi.python.org/pypi?name=psutil&version=2.1.3&:action=files Main features and bugfi

ANN: psutil 2.0.0 released

2014-03-10 Thread Giampaolo Rodola'
Hi there folks, I'm pleased to announce the 2.0.0 release of psutil: http://code.google.com/p/psutil/ === About === psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, disks, network) in Pyth

Re: which async framework?

2014-03-11 Thread Giampaolo Rodola'
On Tue, Mar 11, 2014 at 11:17 AM, Sturla Molden wrote: > Chris Withers wrote: > > Hi All, > > > > I see python now has a plethora of async frameworks and I need to try > > and pick one to use from: > > > > - asyncio/tulip > > - tornado > > - twisted > > Looking at Tornado's examples on the web I

Re: [Python-Dev] [RELEASED] Python 3.4.0

2014-03-17 Thread Giampaolo Rodola'
The what's new looks truly amazing, with pathlib and asyncio being my favourite additions. Thanks for all the hard work. On Mon, Mar 17, 2014 at 5:57 PM, Ryan Gonzalez wrote: > YES!!! +1 to the authors of the statistics and pathlib modules. > > > On Mon, Mar 17, 2014 at 1:29 AM, Larry Hastings

Upload Windows binaries on pypi from Linux

2013-09-26 Thread Giampaolo Rodola'
I have a Python extension module (psutil) written in C which I compile for different Python versions (from 2.4 to 3.3) and want to upload them on pypi. The Windows machine is not connected to internet so after I generate the Windows binaries (via setup.py bdist_wininst) I move the .exe files from

ANN: psutil 1.1.0 released

2013-09-28 Thread Giampaolo Rodola'
ps://pypi.python.org/pypi?:action=display&name=psutil#downloads * API Reference: http://code.google.com/p/psutil/wiki/Documentation Please try out this new release and let me know if you experience any problem by filing issues on the bug tracker. All the best, --- Giampaolo Rodola' http://code.google.com/p/pyftpdlib/ http://code.google.com/p/psutil/ http://code.google.com/p/pysendfile/ -- https://mail.python.org/mailman/listinfo/python-list

Re: [ANN] ftputil 3.0a1 released

2013-09-30 Thread Giampaolo Rodola'
Glad to hear there's someone else other than me who still cares about the almost forgotten FTP protocol! =) --- Giampaolo https://code.google.com/p/pyftpdlib/ https://code.google.com/p/psutil/ https://code.google.com/p/pysendfile/ On Sun, Sep 29, 2013 at 8:00 PM, Stefan Schwarzer wrote: > ftpu

ANN: psutil 3.0.0 is out

2015-06-13 Thread Giampaolo Rodola'
Hi there folks, I'm pleased to announce release 3.0.0 release of psutil: http://grodola.blogspot.com/2015/06/psutil-30.html === About === psutil (python system and process utilities) is a cross-platform library for retrieving information on running processes and system utilization (CPU, memory, d

Re: python process accounting

2013-04-30 Thread Giampaolo Rodola'
2013/4/30 Rita : > Hi, > > I was wondering if it possible to write a python wrapper which will account > my processes. I would like to account for all the children processes (fork) > by looking at their /proc/ info. Such as memory, io, open files, stats. > > So, instead of me running "/bin/sleep 10

Integrating a GUI with an asyncore-based server

2007-10-16 Thread Giampaolo Rodola'
Hi there. Just for the heck of it I'd like to write a simple front-end for an asyncore-based server I wrote by using Tkinter. I wrote a simple graphical interface consisting of two buttons: "Start server" and "Stop server". The first button should start the asyncore main loop while the second shoul

Integrating a GUI with an asyncore-based server

2007-10-16 Thread Giampaolo Rodola'
Hi there. Just for the heck of it I'd like to write a simple front-end for an asyncore-based server I wrote by using Tkinter. I wrote a simple graphical interface consisting of two buttons: "Start server" and "Stop server". The first button should start the asyncore main loop while the second shoul

Adding idle timeout capabilities to asyncore

2007-10-22 Thread Giampaolo Rodola'
Hi there. We're talking about an asyncore-based server. Just for the heck of it I'd like to set a timeout which will disconnects the clients if they're inactive (i.e., no command or data transfer in progress) for a long period of time. I was thinking about putting the timeout value into an attribut

Re: Adding idle timeout capabilities to asyncore

2007-10-24 Thread Giampaolo Rodola'
On 23 Ott, 17:34, Josiah Carlson <[EMAIL PROTECTED]> wrote: > On 22 Ott, 12:28, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > > > > > > Hi there. > > We're talking about an asyncore-based server. > > Just for the heck of it I'd

os.readlink returning value

2007-11-01 Thread Giampaolo Rodola'
I was reading os.readlink doc which says: readlink( path) Return a string representing the path to which the symbolic link points. The result may be either an absolute or relative pathname; if it is relative, it may be converted to an absolute pathname using os.path.join(os.path.dirname(path), re

Re: os.readlink returning value

2007-11-02 Thread Giampaolo Rodola'
On 2 Nov, 05:30, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 01 Nov 2007 22:51:14 -0300, Giampaolo Rodola' <[EMAIL PROTECTED]> > escribió: > > > I was reading os.readlink doc which says: > > > readlink( path) > > > Retu

Re: __file__ vs __FILE__

2007-11-03 Thread Giampaolo Rodola'
On 3 Nov, 04:21, klenwell <[EMAIL PROTECTED]> wrote: > I apologize in advance for coming at this from this angle but... > > In PHP you have the __FILE__ constant which gives you the value of the > absolute path of the file you're in (as opposed to the main script > file.) With the function dirname

Re: __file__ vs __FILE__

2007-11-04 Thread Giampaolo Rodola'
On 3 Nov, 15:46, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sat, 03 Nov 2007 10:07:10 -0300, Giampaolo Rodola' <[EMAIL PROTECTED]> > escribió: > > > On 3 Nov, 04:21, klenwell <[EMAIL PROTECTED]> wrote: > >> In PHP you ha

ftplib ssl/tls support?

2007-11-09 Thread Giampaolo Rodola'
I noticed that poplib, smtplib, httplib, imaplib and probably others include support for ssl connections. Are there future plans for ftplib ssl/tls support? -- http://mail.python.org/mailman/listinfo/python-list

Joining open source python projects

2007-11-19 Thread Giampaolo Rodola'
Hi there, I don't know if such a thing has been already discussed, in which case I'm sorry. I was wondering if there's a place for python open source projects that need help. It thought it would be very nice having a place where developers could submit "help requests" for their projects and let the

os.path.islink documentation error?

2007-11-27 Thread Giampaolo Rodola'
os.path.islink documentation says: "Return True if path refers to a directory entry that is a symbolic link. Always False if symbolic links are not supported." It's not clear to me why it is mentioned the DIRECTORY term. Shouldn't os.path.islink be used to just check if the *path* passed as argum

Is os.lstat available on all platforms?

2007-11-29 Thread Giampaolo Rodola'
Hi there. In a code of mine I'd like to use os.lstat whenever possible. My only concern is if it's available on all platforms. It could be safe using always os.lstat instead of: try: os.lstat except AttributeError: os.stat ...? As far as I know where symlinks are not supported os.lstat sh

Re: Is os.lstat available on all platforms?

2007-11-29 Thread Giampaolo Rodola'
I'd just want to be sure that even on a strange python implementation I won't ever get an AttributeError exception because os.lstat is not defined. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.path.islink documentation error?

2007-11-29 Thread Giampaolo Rodola'
:) You're right... My skimpy English cheated me. -- http://mail.python.org/mailman/listinfo/python-list

Check if a symlink is broken or circular

2007-11-30 Thread Giampaolo Rodola'
Hi there, I would like to know if such function would be correct for verifying if a link is broken and/or circular. def isvalidlink(path): assert os.path.islink(path) try: os.stat(path) except os.error: return 1 return 0 -- http://mail.python.org/mailman/listinfo/p

Re: Check if a symlink is broken or circular

2007-12-01 Thread Giampaolo Rodola'
On 1 Dic, 00:10, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > I would like to know if such function would be correct for verifying > > if a link is broken and/or circular. > > > def isvalidlink(path): > > assert os.path.islink(path) > > try: > > os.stat(path) > > except os.e

Re: Generating API documentation as a textfile

2007-12-03 Thread Giampaolo Rodola'
On 3 Dic, 11:26, Samuel <[EMAIL PROTECTED]> wrote: > Does anyone know an easy way to extract the API documentation that is > embedded into a Python file as a text file? > > -Samuel Something like this? print >> open('file.txt', 'w'), dir.__doc__ -- http://mail.python.org/mailman/listinfo/python-

Re: ftplib.nlst gives error on empty directory

2007-12-07 Thread Giampaolo Rodola'
On 7 Dic, 10:42, loial <[EMAIL PROTECTED]> wrote: > Trying to use ftplib.FTP.nlst() method to list the files in > a directory on a FTP server. > > It works fine except when there are no files in the directory. Then it > gives the error > > ftplib.error_perm: 550 No files found. > > How can I handl

[search for reviewers] asyncore delayed calls feature

2007-12-18 Thread Giampaolo Rodola'
Hi, I post this message here in the hope someone using asyncore could review this. Since the thing I miss mostly in asyncore is a system for calling a function after a certain amount of time, I spent the last 3 days trying to implement this with the hopes that this could be included in asyncore in

pypi and easy_install

2007-12-19 Thread Giampaolo Rodola'
Hi, I noticed tonight that I can't download/install a package of mine hosted on pypi by using easy_install. By running "ez_setup.py pyftpdlib" I get: --- snippet -- options (after parsing config files): no commands known yet options (after parsing command line): option dict for 'aliases' command:

Re: pypi and easy_install

2007-12-19 Thread Giampaolo Rodola'
On 20 Dic, 03:47, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Dec 19, 9:44 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > > > On Dec 19, 8:07 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > download_url = 'http://code.google.c

Re: pypi and easy_install

2007-12-20 Thread Giampaolo Rodola'
On 20 Dic, 04:33, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > On 20 Dic, 03:47, Istvan Albert <[EMAIL PROTECTED]> wrote: > > > On Dec 19, 9:44 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > > > > On Dec 19, 8:07 pm, "Giampaolo Ro

Understanding memory leak reports

2007-12-21 Thread Giampaolo Rodola'
Hi, I'm in a big trouble since I don't know how to find some memory leaks I just discovered in a program of mine. By putting: import gc gc.set_debug(gc.DEBUG_LEAK) ..at the end of a script which imports a module I wrote it seems I have some memory leaks scattered around. The message printed on sc

Re: Understanding memory leak reports

2007-12-21 Thread Giampaolo Rodola'
On 21 Dic, 20:10, [EMAIL PROTECTED] wrote: > On Dec 21, 12:44 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > I'm in a big trouble since I don't know how to find some memory leaks > > I just discovered in

Re: Understanding memory leak reports

2007-12-21 Thread Giampaolo Rodola'
On 22 Dic, 01:27, Ross Ridge <[EMAIL PROTECTED]> wrote: > Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > >I'm in a big trouble since I don't know how to find some memory leaks > ... > >The message printed on screen is the following: > > >g

Re: choosing random dynamic port number

2008-01-04 Thread Giampaolo Rodola'
On 3 Gen, 23:21, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Emin.shopper Martinian.shopper wrote: > > Is there a good way to choose/assign random dynamic port numbers in python? > > > I had in mind something like the following, but if multiple programs are > > generating random port numbers, is the

stupid/style/list question

2008-01-08 Thread Giampaolo Rodola'
I was wondering... To flush a list it is better doing "del mylist[:]" or "mylist = []"? Is there a preferred way? If yes, why? -- http://mail.python.org/mailman/listinfo/python-list

Re: stupid/style/list question

2008-01-08 Thread Giampaolo Rodola'
On 8 Gen, 16:45, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Giampaolo Rodola' wrote: > > To flush a list it is better doing "del mylist[:]" or "mylist = []"? > > Is there a preferred way? If yes, why? > > The latter creates a new list obj

How to get user home directory on Windows

2008-01-12 Thread Giampaolo Rodola'
Hi all, I'm trying to use the pywin32 extension to find out the user's home directory but currently I didn't find a solution yet. What I'd need to do is not getting the home directory of the currently logged in user but something like: >>> get_homedir("frank") "C:\home\users\frank" >>> get_homedir

Re: How to get user home directory on Windows

2008-01-12 Thread Giampaolo Rodola'
On 12 Gen, 17:44, Christian Heimes <[EMAIL PROTECTED]> wrote: > Giampaolo Rodola' wrote: > > Is there a way to do that? > > home = os.path.expanduser("~") > > Christian That gives the home of the *current logged in user*. I need another thing. -- http

Re: How to get user home directory on Windows

2008-01-12 Thread Giampaolo Rodola'
Update. I found a way for getting the home directory of the user but it requires to validate the user by providing username+password: def get_homedir(username, password): token = win32security.LogonUser( username, None, password, win32security.LOGON32_LOGON_NETW

Threaded server

2008-01-13 Thread Giampaolo Rodola'
Hi, I'm trying to run an asynchronous FTP server I wrote into a thread for being able to run a test suite against it. The code below is the threaded FTP server code I'm using: --- snippet --- class FTPd(threading.Thread): def __init__(self): self.active = False threading.Thre

Re: Threaded server

2008-01-14 Thread Giampaolo Rodola'
On 14 Gen, 12:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > >  I'm trying to run an asynchronous FTP server I wrote into a thread for > >  being able to run a test suite against it. > >  The code belo

Re: How to get user home directory on Windows

2008-01-14 Thread Giampaolo Rodola'
Thanks to Tim Golden suggestions I solved my problem. ...In case it would help someone: import _winreg import win32security username = 'Administrator' sid = win32security.ConvertSidToStringSid( win32security.LookupAccountName(None, username)[0] ) key = _winreg.OpenKey( _win

Python FTP server library 0.3.0 released

2008-01-17 Thread Giampaolo Rodola'
/list Thanks, -- Giampaolo Rodola' < g.rodola [at] gmail [dot] com > -- http://mail.python.org/mailman/listinfo/python-list

Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Giampaolo Rodola'
Hi, I'm trying to solve a jython-related issue and I discovered a different behavior affecting os.path.isabs between CPython and Jython. C:\Python23>python.exe Python 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Giampaolo Rodola'
On Feb 1, 9:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > > I'm trying to solve a jython-related issue and I discovered a > > different behavior affecting os.path.isabs between CPython an

Re: Why os.path.isabs("/") on Windows returns True?

2008-02-01 Thread Giampaolo Rodola'
On Feb 1, 10:34 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-02-01, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > > > > > > On Feb 1, 9:55 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2008-02-01, Giampaolo Rodola&#x

Change user on UNIX

2008-03-20 Thread Giampaolo Rodola'
Hi all. Is there any way to su or login as a different user within a python script? I mainly need to temporarily impersonate another user to execute a command and then come back to the original user. I tried to google a little bit about it but I still didn't find a solution. Thanks in advance. -

Impersonate another user (Guest) on Windows

2008-03-24 Thread Giampaolo Rodola'
Hi, I'm trying to write a plug-in for a ftp server of mine to permit the integration with accounts defined on the Windows system. What I basically need is impersonating a user, execute e filesystem call (e.g. create a directory via os.mkdir()) and then switch back to the original user (Administrato

Re: Change user on UNIX

2008-03-27 Thread Giampaolo Rodola'
Sorry for replying so late. I'll try to describe what I'm actually trying to implement so that maybe it can help you understand a little better. The application is an asynchronous FTP server implementation. I decided that it would be desirable to change the current implementation so that every tim

Re: download timeout vs. socket timeout

2009-01-10 Thread Giampaolo Rodola'
On 10 Gen, 03:07, "p." wrote: > i'm using urllib2 in python 2.4 > > wondering how people typically deal with the case in which a download > is too slow. setting the socket timeout only covers those cases where > there is no response in the socket for whatever the timeout period is. > what if, howe

Re: download timeout vs. socket timeout

2009-01-10 Thread Giampaolo Rodola'
I'm sorry. I realized they had already replied when it was too late. --- Giampaolo http://code.google.com/p/pyftpdlib -- http://mail.python.org/mailman/listinfo/python-list

Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
Hi, I'm sure the message I'm going to write will seem quite dumb to most people but I really don't understand the str/bytes/unicode differences introduced in Python 3.0 so be patient. What I'm trying to do is porting pyftpdlib to Python 3.x. I don't want to support Unicode. I don't want pyftpdlib

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
On 17 Gen, 02:24, MRAB wrote: > If you're truly working with strings of _characters_ then > 'str' is what you need, but if you're working with strings of _bytes_ > then 'bytes' is what you need. I work with string of characters but to convert bytes into string I need to specify an encoding and t

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
On 17 Gen, 03:09, Steven D'Aprano wrote: > On Fri, 16 Jan 2009 17:32:17 -0800, Giampaolo Rodola' wrote: > > On 17 Gen, 02:24, MRAB wrote: > > >> If you're truly working with strings of _characters_ then 'str' is what > >> you need, but if

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
On 17 Gen, 03:40, Steve Holden wrote: > Giampaolo Rodola' wrote: > > On 17 Gen, 02:24, MRAB wrote: > > >> If you're truly working with strings of _characters_ then > >> 'str' is what you need, but if you're working with strings of _bytes

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-16 Thread Giampaolo Rodola'
On 17 Gen, 04:43, Terry Reedy wrote: > Giampaolo Rodola' wrote: > > That would help to avoid replacing "" with b"" almost everywhere in my > > code. > > Won't 2to3 do that for you? I used 2to3 against my code but it didn't cover the "

Re: Totally confused by the str/bytes/unicode differences introduced in Pythyon 3.x

2009-01-17 Thread Giampaolo Rodola'
On 17 Gen, 05:26, John Machin wrote: > On Jan 17, 3:08 pm, Steve Holden wrote: > > > Giampaolo Rodola' wrote: > > > On 17 Gen, 04:43, Terry Reedy wrote: > > >> Giampaolo Rodola' wrote: > > >>> That would help to avoid replacing "&qu

Re: vb2py status?

2009-01-17 Thread Giampaolo Rodola'
On 17 Gen, 11:05, Vito De Tullio wrote: > axtens wrote: > > So is vb2py dead? If not, any idea when it'll support python 3? > > I don't know this vb2py, but you can do a 2 pass conversion > > [vb] -> (vb2py) -> [py2] -> (2to3) -> [py3] > > -- > By ZeD ...and presumibly get something which doesn't

[ANN] Python FTP Server library (pyftpdlib) 0.5.1 released

2009-01-21 Thread Giampaolo Rodola'
http://code.google.com/p/pyftpdlib/wiki/Tutorial * FAQs: http://code.google.com/p/pyftpdlib/wiki/FAQ * RFCs compliance paper: http://code.google.com/p/pyftpdlib/wiki/RFCsCompliance * Issue tracker: http://code.google.com/p/pyftpdlib/issues/list * Mailing list: http://groups.google.com/group/pyftpdlib

Re: Monitor a FTP site for arrival of new/updated files

2009-01-26 Thread Giampaolo Rodola'
On 25 Gen, 21:11, Steve Holden wrote: > pyt...@bdurham.com wrote: > >  Any suggestions on a best practice way to monitor a remote FTP site for > > the arrival of new/updated files? I don't need specific code, just some > > coaching on technique based on your real-world experience including > > sug

Re: unable to print Unicode characters in Python 3

2009-01-27 Thread Giampaolo Rodola'
On 26 Gen, 19:16, jefm wrote: > Hi, > while checking out Python 3, I read that all text strings are now > natively Unicode. > In the Python language reference (http://docs.python.org/3.0/reference/ > lexical_analysis.html) I read that I can show Unicode character in > several ways. > "\u" supp

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-29 Thread Giampaolo Rodola'
> Where are the community projects supporting Python? -- besides the > core devlopment. http://pypi.python.org/pypi ...which accidentally says "There are currently 5597 packages here." Not bad uh? --- Giampaolo http://code.google.com/p/pyftpdlib -- http://mail.python.org/mailman/listinfo/pytho

Re: 'Address already in use' ... with TCPServer

2009-01-30 Thread Giampaolo Rodola'
On 30 Gen, 10:16, "Gabriel Genellina" wrote: > En Fri, 30 Jan 2009 05:43:33 -0200, Mabooka-Mabooka Mbe-Mbe   > escribió: > > >   setsockopt(REUSEADDR)... > > > What I came up with so far is this: > from SocketServer import * > s = TCPServer( ('', 32123), None) > dir(s) > > ['Reques

Re: Where to host a (Python) project?

2009-01-31 Thread Giampaolo Rodola'
On 31 Gen, 12:46, andrew cooke wrote: > Hi, > > I have a new project, that I just released in beta > (http://www.acooke.org/lepl- a recursive decent parser with full > backtracking).  At the moment I am using pypi and setuptools for > distribution (it's a pure python package) and I am happy with

Re: Monitor Internet connections in XP/Vista

2009-02-02 Thread Giampaolo Rodola'
On 2 Feb, 10:05, pranav wrote: > Hi Folks, > > I am designing a project for Windows XP/Vista, one part of which is a > background process that monitors internet connections. If the user > tries to connect to any particular site, say myDummySite.com in then > some actions are taken, based on fixed

Re: Upgrade 2.6 to 3.0

2009-02-04 Thread Giampaolo Rodola'
On 5 Feb, 01:18, Tim Rowe wrote: > 2009/2/4 Scott David Daniels : > > > joviyach wrote: > > >> I am fairly new to Python, the first version I loaded was 2.6. I have > >> since downloaded 3.0 and I was wondering what the best practice for > >> upgrading is? I am using Windows XP Pro for my OS. > >

Re: ANN: Python 2.6 Quick Reference available

2009-02-11 Thread Giampaolo Rodola'
On Feb 10, 8:38 pm, Richard Gruet <"rgruet at free dot fr"> wrote: > The Python 2.6 Quick Reference is available in HTML and PDF formats > athttp://rgruet.free.fr/#QuickRef. > > This time I was helped by Josh Stone for the update. > > As usual, your feedback is welcome (pqr at rgruet.net). > > Che

Re: Problem building Python extension

2009-02-13 Thread Giampaolo Rodola'
On Feb 13, 10:53 am, David Cournapeau wrote: > On Fri, Feb 13, 2009 at 6:30 PM,   wrote: > > Hi all, > > > I'm trying to build my first python extensionon a win32 system. I > > followed the description > > inhttp://starship.python.net/crew/mwh/toext/your-first-extension.html, > > but after runnin

Re: How to verify whether a process got hanged or still alive.

2009-02-16 Thread Giampaolo Rodola'
On 16 Gen, 00:04, neel wrote: > Hi There, > > I want to check the health of IEprocessusing python. I am running an > application on IE. I have to verify that the application is not > crashing the IE. Is there any module which can help me in getting > theprocessstatus? > > Thanks, > Neel By proc

Quick question about None and comparisons

2008-11-24 Thread Giampaolo Rodola'
Sorry for the title but I didn't find anything more appropriate. To have a less verbose code would it be ok doing: if a > b: ...instead of: if a is not None and a > b: ...? Is there any hidden complication behind that? Thanks in advance --- Giampaolo code.google.com/p/pyftpdlib/ -- http://ma

Re: Start learning 2.6 or wait for 3.0?

2008-11-24 Thread Giampaolo Rodola'
Definitively 2.X. Whether 2.5 or 2.6 doesn't really matter. --- Giampaolo http://code.google.com/p/pyftpdlib/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick question about None and comparisons

2008-11-25 Thread Giampaolo Rodola'
Ok thanks. I'll avoid to do that. --- Giampaolo http://code.google.com/p/pyftpdlib/ -- http://mail.python.org/mailman/listinfo/python-list

Using thread in an asyncronous application

2008-11-27 Thread Giampaolo Rodola'
Hi, I'm the maintainer of an asynchronous FTP server implementation based on asyncore. Some days ago I thought it would be interesting to add a class offering the possibility to run the asyncore loop into a thread so that a user can run the server without blocking the entire application. It could b

Re: Using thread in an asyncronous application

2008-11-29 Thread Giampaolo Rodola'
On 29 Nov, 02:24, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Nov 27, 9:03 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > I'm the maintainer of an asynchronous FTP server implementation based > > on as

How to know when it's possible to bind a socket on an unprivileged port?

2008-12-11 Thread Giampaolo Rodola'
Hi, For a purpose of testing I need a function which could tell me whether it is possible to bind sockets on privileged ports or not. I wrote down this simple function. It seems reasonably working to me but I'd like to hear your opinion first. Thanks in advance. import socket, errno def bind_on

Re: How to know when it's possible to bind a socket on an unprivileged port?

2008-12-11 Thread Giampaolo Rodola'
On 11 Dic, 19:09, "Giampaolo Rodola'" wrote: > Hi, > For a purpose of testing I need a function which could tell me whether > it is possible to bind sockets on privileged ports or not. > I wrote down this simple function. It seems reasonably working to me > but I

Re: How to know when it's possible to bind a socket on an unprivileged port?

2008-12-11 Thread Giampaolo Rodola'
Another way (probably more reliable): def bind_on_privileged_ports(): """Return True if it is possible to bind sockets on privileged ports (< 1024).""" for port in range(1, 1024)[::-1]: print port try: s = socket.socket() s.bind((HOST, port))

Re: Python is slow

2008-12-11 Thread Giampaolo Rodola'
On 11 Dic, 13:06, Luis M. González wrote: > On Dec 10, 3:42 pm, cm_gui wrote: > > > > > > >http://blog.kowalczyk.info/blog/2008/07/05/why-google-should-sponsor-... > > > I fully agree with Krzysztof Kowalczyk . > > Can't they build a faster VM for Python since they love the language > > so much?

ethical questions about global variables

2008-12-15 Thread Giampaolo Rodola'
Hi, in a module of mine (ftpserver.py) I'd want to add a (boolean) global variable named "use_gmt_times" to decide whether the server has to return times in GMT or localtime but I'm not sure if it is a good idea because of the "ethical" doubts I'm gonna write below. In first place I've never liked

Re: ethical questions about global variables

2008-12-16 Thread Giampaolo Rodola'
On 16 Dic, 07:23, Michele Simionato wrote: > On Dec 16, 3:45 am, "Giampaolo Rodola'" wrote: > > > Hi, > > in a module of mine (ftpserver.py) I'd want to add a (boolean) global > > variable named "use_gmt_times" to decide whether the server h

Re: Free place to host python files?

2008-12-16 Thread Giampaolo Rodola'
On 16 Dic, 15:56, feba wrote: > On Dec 16, 8:29 am, s...@pobox.com wrote: > > >     feba> I'm getting started in python, and it would be helpful to have a > >     feba> place to put up various code snippets I've made, so I don't have > >     feba> to send them individually to each person I want to

Re: ethical questions about global variables

2008-12-16 Thread Giampaolo Rodola'
d be, rather than dealing with all sorts > of global variables floating around - which gets annoying pretty > quickly. > > On Dec 15, 9:45 pm, "Giampaolo Rodola'" wrote: > > > > > Hi, > > in a module of mine (ftpserver.py) I'd want to add a

Re: New Python 3.0 string formatting - really necessary?

2008-12-19 Thread Giampaolo Rodola'
On 19 Dic, 17:01, walterbyrd wrote: > I have not worked with Python enough to really know. But, it seems to > me that more I look at python 3.0, the more I wonder if it isn't a > step backwards. > > To me, it seems that this: > > print "%s=%d" % ('this',99) > > Is much easier, and faster, to type,

How to "kill" orphaned threads at program exit

2008-12-28 Thread Giampaolo Rodola'
Hi, I know that it's not possible to "kill" threads but I'm wondering if does exist some workaround for my problem. I have a test suite which does a massive usage of threads. Sometimes happens that one test fails, the test suite keeps running until the end, and when it's finished the program hangs

Re: How to "kill" orphaned threads at program exit

2008-12-28 Thread Giampaolo Rodola'
On 28 Dic, 18:47, Roy Smith wrote: > In article > , > "Giampaolo Rodola'" wrote: > > > Hi, > > I know that it's not possible to "kill" threads but I'm wondering if > > does exist some workaround for my problem. > > I have a

Re: Why not Ruby?

2008-12-31 Thread Giampaolo Rodola'
On 31 Dic, 18:55, Xah Lee wrote: > Just spent 3 hours looking into Ruby today. Here's my short impression > for those interested. > > * Why Not Ruby? > http://xahlee.org/UnixResource_dir/writ/why_not_Ruby.html > > plain text version follows: > -- > > Why Not Ru

  1   2   >