CDDB.py binaries for Python 2.4
Howdy, I'm using Python 2.4 on W2K I would love to use the tools at http://cddb-py.sourceforge.net/ the newest Win binaries are for Python 2.0 The dll won't load, I assume this is due to version mismatch. I'm not set up with a C compiler. Does anyone know of a source of current binaries for this package? Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
Status of Epydoc
Howdy, I would very like to use Epydoc 3.0, however I've found a couple bugs and the mailing list; http://sourceforge.net/mailarchive/forum.php?forum_id=39919 doesn't seem to be working, the last couple messages I've posted haven't shown up. Does anyone know the status of Epydoc 3.0 development? Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
Problems with ElementTree and ProcessingInstruction
Howdy, I want to generate the following file; stuff How should I be doing this? As far as I can tell, ElementTree() requires everything to be inside the root element (leo_file) Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
Re: Problems with ElementTree and ProcessingInstruction
On Jan 28, 7:46 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> At Sunday 28/1/2007 11:28, Kent Tenney wrote:
>
> >I want to generate the following file;
>
> >
> >
> >stuff
>
> >How should I be doing this?open("filename","w").write(' >encoding="utf-8"?>\n'
> '\n'
> 'stuff\n')
Right.
I can use ElementTree.write('filename') and
prepend the instructions to the resulting file.
It leaves me curious as to the purpose/usage of
ProcessingInstruction()
Thanks,
Kent
>
> :)
>
> >As far as I can tell, ElementTree() requires everything
> >to be inside the root element (leo_file)Just keep the first two lines on my
> >example...
>
> --
> Gabriel Genellina
> Softlab SRL
>
> __
> Preguntá. Respondé. Descubrí.
> Todo lo que querías saber, y lo que ni imaginabas,
> está en Yahoo! Respuestas (Beta).
> ¡Probalo ya!http://www.yahoo.com.ar/respuestas
--
http://mail.python.org/mailman/listinfo/python-list
sending to an xterm
Howdy,
I want to open an xterm, send it a command and have it execute it.
I thought pexpect would do this, but I've been unsuccessful.
term = pexpect.spawn('xterm')
starts an xterm, but
term.sendline('ls')
doesn't seem to do anything.
Suggestions?
Thanks,
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Re: sending to an xterm
Derek Martin pizzashack.org> writes: > > On Fri, Aug 08, 2008 at 08:25:19PM +0000, Kent Tenney wrote: > > Howdy, > > > > I want to open an xterm, send it a command and have it execute it. > > You can't do that. xterm doesn't execute shell commands passed on > stdin... It can, however, execute one passed on the command line. > > Instead of just running xterm, you can run "xterm -e 'cmd foo bar'" > where cmd is the program to run and foo and bar are its arguments. > The problem is that as soon as the program exits, xterm will exit > also. > OK, I see that. (getting off topic) any chance of keeping the xterm open after running the command? Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
Re: sending to an xterm
Derek Martin pizzashack.org> writes: > > On Fri, Aug 08, 2008 at 08:25:19PM +0000, Kent Tenney wrote: > > Howdy, > > > > I want to open an xterm, send it a command and have it execute it. > > You can't do that. xterm doesn't execute shell commands passed on > stdin... It can, however, execute one passed on the command line. > > Instead of just running xterm, you can run "xterm -e 'cmd foo bar'" > where cmd is the program to run and foo and bar are its arguments. > The problem is that as soon as the program exits, xterm will exit > also. > Sorry to reply before getting googly This appears to be a solution; xterm -e "ls; bash" http://www.linuxforums.org/forum/misc/115239-getting-prompt-after-xterm-e-command.html -- http://mail.python.org/mailman/listinfo/python-list
datetime from uuid1 timestamp
Howdy, I have not found a routine to extract usable date/time information from the 60 bit uuid1 timestamp. Is there not a standard solution? Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
Re: datetime from uuid1 timestamp
> Howdy, > > I have not found a routine to extract usable > date/time information from the 60 bit uuid1 timestamp. > > Is there not a standard solution? I submitted an ASPN recipe to do it. http://code.activestate.com/recipes/576420/ -- http://mail.python.org/mailman/listinfo/python-list
Suggestion for improved ImportError message
Howdy, I was just bit by from image import annotate ImportError: cannot import name annotate I found the problem via import image print image.__file__ which made it clear that the wrong image module had been found. It would be nice if ImportError announced this up front. cannot import name annotate from /usr//image.pyc Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
Re: datetime from uuid1 timestamp
> I'm interested in the use case for this. > Why would you want to extract the exact timestamp from the uuid? Because I can :-] At this point it's primarily academic, but I'll be creating lots of files and naming them with uuid's. I like the capability of determining creation date solely from the filename. Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
Re: Suggestion for improved ImportError message
> > Then go for it You can prepare a patch and ask on python-dev > > if the developers are interested. hehe, I'll get a C level patch accepted right after I out-swim Mike Phelps. > > > > I was never hacking the import things on C level before, > > but a hint: you have to modify import_from function from > > Python/ceval.c Am I correct in thinking that PyPy would mean low level stuff like this will be Python instead of C? That would be nice. > > > > My quick attempt: Quick indeed! Very cool. Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
Trying to run a sudo command from script
Howdy,
A script running as a regular user sometimes wants
to run sudo commands.
It gets the password with getpass.
pw = getpass.getpass()
I've fiddled a bunch with stuff like
proc = subprocess.Popen('sudo touch /etc/foo'.split(), stdin=subprocess.PIPE)
proc.communicate(input=pw)
getting assorted errors with all variations I try.
Googling says use pexpect, but I'd prefer a stdlib solution.
Any help appreciated.
Thanks,
Kent
--
http://mail.python.org/mailman/listinfo/python-list
Re: Trying to run a sudo command from script
On Fri, Jan 1, 2010 at 5:08 PM, Diez B. Roggisch wrote:
> Kent Tenney schrieb:
>>
>> Howdy,
>>
>> A script running as a regular user sometimes wants
>> to run sudo commands.
>>
>> It gets the password with getpass.
>> pw = getpass.getpass()
>>
>> I've fiddled a bunch with stuff like
>> proc = subprocess.Popen('sudo touch /etc/foo'.split(),
>> stdin=subprocess.PIPE)
>> proc.communicate(input=pw)
>>
>> getting assorted errors with all variations I try.
>>
>> Googling says use pexpect, but I'd prefer a stdlib solution.
>
> pexpect is pure python, and it's needed. There is no easy way around the
> issue, so if you insist on not using pexpect, you re-invent the wheel and
> write the exact same code - just more error-prone, because of
> wheel-reinvention
Indeed, the requirements of this are way more complex than I guessed.
The following seems to work well, took some fiddling with EOF.
def sudo(command, password=None, prompt="Enter password "):
import pexpect
if not password:
import getpass
password = getpass.getpass(prompt)
command = "sudo " + command
child = pexpect.spawn(command)
child.expect(['ssword', pexpect.EOF])
child.sendline(password)
child.expect(pexpect.EOF)
# is this necessary?
child.close()
Thanks,
Kent
>
> Diez
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
Problem building Python from source
Trying to do a vanilla cmmi: ~/Python-2.6.3rc1$ ./configure ~/Python-2.6.3rc1$ make ... Traceback (most recent call last): ... ImportError: No module named cStringIO make: *** [sharedmods] Error 1 The fix is to uncomment the line in Modules/Setup #cStringIO cStringIO.c Question: Is there an argument to ./configure or make, or an environment setting which will make cStringIO available without editing Modules/Setup ? Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
Sqlalchemy access to Firefox's places.sqlite
Howdy,
Lazy, wanting to access Firefox's places.sqlite via Sqlalchemy.
How about this:
Sqlite Manager -> places.sqlite -> Export Wizard -> table name sqlite_manager
this produces file sqlite_manager.sql which looks like:
BEGIN TRANSACTION;
INSERT INTO "sqlite_master" VALUES('table','moz_bookmarks','moz_bookmarks',
2,'CREATE TABLE moz_bookmarks (id INTEGER PRIMARY KEY,type INTEGER,
fk INTEGER DEFAULT NULL, parent INTEGER, position INTEGER, title LONGVARCHAR,
keyword_id INTEGER, folder_type TEXT, dateAdded INTEGER,
lastModified INTEGER)');
INSERT INTO "sqlite_master" VALUES('index','moz_bookmarks_itemindex',
'moz_bookmarks',3,'CREATE INDEX moz_bookmarks_itemindex ON
moz_bookmarks (fk, type)');
...
Is there an easy way to go from this sql to Sqlalchemy code?
Thanks,
Kent
--
http://mail.python.org/mailman/listinfo/python-list
question
In a docutils svn checkout. [docutils/trunk/docutils]$ python setup.py install --root /tmp OK [docutils/trunk/docutils]$ python setup.py install_data --root /tmp distutils.errors.DistutilsFileError: could not delete '/usr/local/lib/python2.6/dist-packages/docutils/parsers/rst/include/README.txt': Permission denied Am I missing something? If it works for you, I suppose it's somewhere in my versioning. I have bull in a china shop tendencies when it comes to installing stuff. Thanks, Kent -- http://mail.python.org/mailman/listinfo/python-list
