Re: Python + Some sort of Propel + Creole

2008-08-12 Thread Josh Bloom
http://sqlobject.org/
http://www.sqlalchemy.org/

Django's built in ORM is also quite good for web development tasks.

-josh


On Tue, Aug 12, 2008 at 3:18 PM, Samuel Morhaim [EMAIL PROTECTED]wrote:

 Hi, I come from an extensive background developing webapps with Symfony...
 Symfony uses Propel/Creole a lot.

 Is there something similar to Propel/Creole for Python?

 I found a few DB abstraction layers (Creole) but I am not sure which one is
 the best..  can somebody point me to a good one? Also can somebody point me
 to a good
 object relational mapper? (Like Doctrine or Propel for php.. ?  )

 I am really just interested in:
 -Being able to talk to  sqlite, mysql and mssql.
 -Being able to easily create DB schemas (Like done with propel in which you
 use a YAML or XML file to specify a schema)


 Thanks.







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

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

Re: How to create a file on users XP desktop

2007-10-06 Thread Josh Bloom
I believe you can use something like '%USERPROFILE%\DESKTOP' as the path on
a windows machine to get to the current users desktop directory. I'm not
sure if the python open() command will expand that correctly, but give it a
shot.

-Josh


On 10/6/07, goldtech [EMAIL PROTECTED] wrote:

 Can anyone link me or explain the following:

 I open a file in a python script. I want the new file's location to be
 on the user's desktop in a Windows XP environment.  fileHandle = open
 (., 'w' )  what I guess I'm looking for is an environmental
 variable that will usually be correct on most XP desktops and will
 work in the open statement. Or is there another way?

 Thanks

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

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

Re: Python memory handling

2007-05-31 Thread Josh Bloom
If the memory usage is that important to you, you could break this out
into 2 programs, one that starts the jobs when needed, the other that
does the processing and then quits.
As long as the python startup time isn't an issue for you.


On 31 May 2007 04:40:04 -0700, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Greets,

 I've some troubles getting my memory freed by python, how can I force
 it to release the memory ?
 I've tried del and gc.collect() with no success.
 Here is a code sample, parsing an XML file under linux python 2.4
 (same problem with windows 2.5, tried with the first example) :
 #Python interpreter memory usage : 1.1 Mb private, 1.4 Mb shared
 #Using http://www.pixelbeat.org/scripts/ps_mem.py to get memory
 information
 import cElementTree as ElementTree #meminfo: 2.3 Mb private, 1.6 Mb
 shared
 import gc #no memory change

 et=ElementTree.parse('primary.xml') #meminfo: 34.6 Mb private, 1.6 Mb
 shared
 del et #no memory change
 gc.collect() #no memory change

 So how can I free the 32.3 Mb taken by ElementTree ??

 The same problem here with a simple file.readlines()
 #Python interpreter memory usage : 1.1 Mb private, 1.4 Mb shared
 import gc #no memory change
 f=open('primary.xml') #no memory change
 data=f.readlines() #meminfo: 12 Mb private, 1.4 Mb shared
 del data #meminfo: 11.5 Mb private, 1.4 Mb shared
 gc.collect() # no memory change

 But works great with file.read() :
 #Python interpreter memory usage : 1.1 Mb private, 1.4 Mb shared
 import gc #no memory change
 f=open('primary.xml') #no memory change
 data=f.read() #meminfo: 7.3Mb private, 1.4 Mb shared
 del data #meminfo: 1.1 Mb private, 1.4 Mb shared
 gc.collect() # no memory change

 So as I can see, python maintain a memory pool for lists.
 In my first example, if I reparse the xml file, the memory doesn't
 grow very much (0.1 Mb precisely)
 So I think I'm right with the memory pool.

 But is there a way to force python to release this memory ?!

 Regards,
 FP

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

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


Re: progress indicator in a mod_python script

2007-05-17 Thread Josh Bloom

Hi Rajarshi,

What you probably want to do is break this into multiple parts.

When a request comes in to perform a query consider this a new job, give it
an ID and set it off and running.
Then return an HTML page that knows to keep checking a status URL (based on
the ID) every few seconds to see if the job is done, if the job is done,
return the results, if its not return keeps checking until its.

Here's some info about making an HTML Page refresh itself automatically.
http://en.wikipedia.org/wiki/Meta_refresh

-Josh

On 17 May 2007 07:46:28 -0700, Rajarshi [EMAIL PROTECTED] wrote:


Hi, I have a web application built using mod_python.Currently it
behaves like a standard CGI - gets data from a form, performs a query
on a backend database and presents a HTML page.

However the query can sometimes take a bit of time and I'd like to
show the user some form of indeterminate progress indicator (spinning
dashes etc). My searching seems to indicate that this is based on some
form of asynchronous calls (AJAX) and I'm not sure how I can achieve
this effect in my mod_python app.

Any pointers to achieve this would be very appreciated.

Thanks,

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

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

Re: how to find a lable quickly?

2007-05-04 Thread Josh Bloom

I haven't used it myself, but I'm pretty sure you're going to get a lot of
pointers to
http://pyparsing.wikispaces.com/

Also you may want to start naming your variables something more descriptive.
IE
testResultsFile = open('test.txt','r')
testLines=testResultsFile.readlines()

for line in testLines:
  label = line.split( )
etc..

Another option is to use a Regular Expression which may speed this up for
you.
http://docs.python.org/lib/module-re.html

-Josh

On 5/4/07, wang frank [EMAIL PROTECTED] wrote:


Hi,

I am a new user on Python and I really love it.

I have a big text file with each line like:

label 3
teststart   5
endtest  100
newrun 2345

I opened the file by uu=open('test.txt','r') and then read the data as
xx=uu.readlines()

In xx, it contains the list of each line. I want to find a spcefic labels
and read the data. Currently, I
do this by
for ss in xx:
   zz=ss.split( )
  if zz[0] = endtest:
index=zz[1]

Since the file is big and I need find more lables, this code runs slowly.
Are there anyway to speed up the process? I thought to convert the data xx
from list to a dictionay, so I can get the index quickly based on the
label. Can I do that effeciently?

Thanks

Frank

_
メッセンジャーお友達紹介プレゼント第2弾開始!ラスベガス旅行プレゼント
http://campaign.live.jp/dizon/

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

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

Re: grabbing Pictures from the web

2007-04-10 Thread Josh Bloom

I don't have any experience with TK so I can't comment on that but for
getting pics from the web, you will need to do the following:
1) Work with the flickr API or flickr feeds to get the url for each picture
that you want to work with.
2) Either download the image to disk or read it into memory to work with.

Here's some sample code to open a url and save it to disk. (This is
expecting that the url points to a .jpg)

import urllib
picture = urllib.urlopen(pathToTheImageThatYouWant).readlines()
newPic = open('YourNewFile.jpg', 'wb') #Use wb as you're writing a binary
file.
newPic.writelines(picture)
newPic.close()

-Josh


On 4/10/07, Juan Vazquez  [EMAIL PROTECTED] wrote:


I am new to python (2 weeks old)  and I would like to write a script that
grabs pictures from the web (specifically flickr) and put them on a Tk
Canvas for a slide show/editing program. my 2 questions are
1) How do I grab a picture from the web
2) is the use of the Tk canvas for working with the picture the best
approach?

Any help or references to resources that point me in the right direction
would be greatly appreciated. Thanks in Advance.
-Juan

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

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

Re: writing dictionaries to a file

2007-03-21 Thread Josh Bloom

Where have you defined the relationship between the 2 dictionaries?

If you know that all the someys are related to the somex you can do
something like this:

somex = {'unit':'00', 'type':'processing'}

somey1 = {'comment':'fair', 'code':'aaa'}
somey2 = {'comment':'fair', 'code':'bbb'}
somey3 = {'comment':'fair', 'code':'ccc'}

# Put all the dicts in a List
dictList = []
dictList.append(somey1)
dictList.append(somey2)
dictList.append(somey3)

for dict in dictList: #Iterate over the lists
   print (%s, %s) % (somex['unit'], dict['code']) #Print just the info
that you want

I'll leave writing it to a file as an exercise in Googling.
-Josh


On 3/21/07, kavitha thankaian [EMAIL PROTECTED] wrote:


Hi All,

I have two dictionaries:

somex:{'unit':00, type:'processing'}

somey:{'comment':'fair', 'code':'aaa'}
somey:{'comment':'good', 'code':bbb'}
somey:{'comment':'excellent', 'code':'ccc'}


now i would like to write this to a file in the following format(unit,
code),,,the output should be as follows written to a file,,,

  00, aaa
  00, bbb
  00, ccc

can someone help me?

Regards
Kavitha


--
Here's a new way to find what you're looking for - Yahoo! 
Answershttp://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/


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

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

Re: Printing __doc__

2007-03-21 Thread Josh Bloom

This will work, but I'm getting out of my depth as to whether its a good
idea to do or not.

import sys

def testFunc():
   ''' Here is my doc string'''
   n = sys._getframe().f_code.co_name
   print eval(n).__doc__

testFunc()

The issue being that n is a simply a string containing the name of the
function. You'll need the actual function itself to get its docstring.

-Josh


On 21 Mar 2007 12:47:06 -0700, gtb [EMAIL PROTECTED] wrote:


Greetings,

Don't know the daily limit for dumb questions so I will ask one or
more.

In a function I can use the statement n =
sys._getframe().f_code.co_name to get the name of the current
function. Given that I can get the name how can I print the __doc__
string? I cant use the following, it will tell me to bugger off as the
string has no such attribute.

def spam(self):
n = sys._getframe().f_code.co_name
print n.__doc__  #Wrong
print __doc__ #No good either
#


thanx,

gtb

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

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

Re: List to string

2007-03-20 Thread Josh Bloom

That's pretty funny :)

On 3/20/07, Steven D'Aprano [EMAIL PROTECTED] wrote:


On Tue, 20 Mar 2007 13:01:36 +0100, Bruno Desthuilliers wrote:

 Steven D'Aprano a écrit :
 On Mon, 19 Mar 2007 13:11:09 +0100, Bruno Desthuilliers wrote:

 There's no cast in Python. It would make no sens in a dynamically
 typed language, where type informations belong to the LHS of a
binding,
 not the RHS.

 Surely you have left and right mixed up?

 (rereading)
 (ashamed)
 Obviously, yes.
 Thanks for the correction.

That's okay, I have a big L and R written on the bottom of my shoes.
Of course, they didn't do me any good until I got a L and R tattooed
on my feet.



--
Steven.

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

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

Re: Python Oracle

2007-03-14 Thread Josh Bloom

I would suggest using cx_Oracle as I have had good experience with it.
http://www.cxtools.net/default.aspx?nav=cxorlb

-Josh

On 3/14/07, Facundo Batista [EMAIL PROTECTED] wrote:


Hi! I need to connect to Oracle.

I found this binding,

  http://www.zope.org/Members/matt/dco2

that is the recommended in the Python page.

But that page seems a bit confuse to me. In the upper right corner says
that the last release is PreRelease 1, from 2001-11-15.

At the bottom, however, it says that 1.3 beta was released 2003-02-10,
and is a development version (the last stable is 1.2, from 2002-10-02),
four and a half years ago.

The question is: is this connector the recommended one? it's aged
because it's stable and no more changes are necessary, or it just dead?
Works Ok?

Thank you!! Regards,

--
.   Facundo
.
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/


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

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

Re: Server-side script takes way too long to launch

2007-03-13 Thread Josh Bloom

Teresa, when you call a python script this way, the server needs to load the
python interpreter for each call.

If you need faster execution you should look into having a server process
running already. Something like mod_python for apache or CherryPy will help
you speed this up.

-Josh


On 3/13/07, Teresa Hardy [EMAIL PROTECTED] wrote:


I have a webpage calling a python script, using Apache
serverhttp://localhost/cgi-bin/mycode.py?dmn
I am using Firefox, WindowsXP Python 2.4

I can count to 13 from the time I click to the time the browser finds the
path.

The python runs okay when I finally get to it. In the first step it just
launches a Flash file. I benchmarked the time thru the python code and it
isn't the slow part. It's the launch. Forgive me if I am not explaining this
well. I am pretty much teaching myself...fumbling thru the process.

Any suggestions on how to speed up the first step?

Thanks,
Teresa







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

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

Re: IronPython with Apache

2007-03-08 Thread Josh Bloom

Hi Ed,

Some more info about your environment will be helpful here.
What OS version, apache version, etc.

-Josh


On 7 Mar 2007 15:05:54 -0800, edfialk [EMAIL PROTECTED] wrote:


Hi all, I'm completely new to Python, but fairly experienced in PHP
and few other languages.

Long story short: The IronPython executable doesn't work for .cgi
scripts in my browser.


I've been assigned to write a service that pulls in parameters from
the URL, accesses a file and serves some data through a CSV.  The only
problem I foresee myself is accessing and reading this file, which is
a 'hyper-cube' in that it has many dimensions of data.

Anyway, the code for reading and writing this cube was already written
by a coworker in IronPython and .NET.  Again, I'm totally new to
Python but as I'm stepping through trying to pick out pieces that I
need, I can't even import clr.

So, I'm told I need IronPython, which I get, and I replace the #!c:
\Python25\python.exe with the IronPython executable (#!c:
\IronPython-1.0.1\ipy.exe), but I get a 500 Internal Server error and:

[Wed Mar 07 17:02:21 2007] [error] [client 127.0.0.1] malformed
header from script. Bad header=  File , line 0, in __import__:
testing.cgi in the Error log.

Does anyone know how to set up this 'IronPython' through Apache so I
can use it to read/write data?

Any help would be greatly appreciated.
Thanks!
-Ed

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

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

Re: Python design project

2007-02-05 Thread Josh Bloom

Hi Solrick,

This sounds like some interesting stuff. I'd love to discuss it some more
with you and maybe work with you on it.

Some things to think about:

  1. Rules for Font interactions. What happens when fonts 'hit' each
  other, or 'live' long enough to reproduce andmutate maybe?
  2. What parts of the fonts can change. height, width, scale, kerning,
  serifs, color, transparency, etc
  3. Python may not be the best environment for this application. Flash
  might be alot faster to get something going in as its designed for animating
  vectors and has a solid programming language behind it to write in your
  rules logic.

Best,
Josh

On 5 Feb 2007 03:09:33 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:


I think I need to explain the things better I think, so I do;

First answering the questions above; I think i have to explain the
project more.

With type I mean; typography/fonts/characters.. For my final exam I
created the idea to treath fonts as a living organisms.
There for I want to create with the help of somebody, a little program
were i can import vector based fonts, and when they are imported they
turn alive
By turn alive I mean; they move random over the work area, opacity
changing, changing of size/color, merge together ans some more things,
little fonts changing.

Because my python skills are zero, I'm looking for a partner which can
help me. I'm working On mac, but windows is not a problem.

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

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

Re: Recursive zipping of Directories in Windows

2007-02-04 Thread Josh Bloom

Hi Jandre,

Your code is treating the directory as a file and trying to open it and read
its bytes to zip them. You'll need to differentiate between files and
directories.

You'll need to check out the Zip module to see how it expects files that
should be nested within folders. I believe you'll need to set the archive
name for the nested files to something like \\temp\\file.ext etc.

-Josh


On 4 Feb 2007 11:42:23 -0800, Jandre [EMAIL PROTECTED] wrote:


On Feb 1, 9:39 pm, Larry Bates [EMAIL PROTECTED] wrote:
 Jandre wrote:
  Hi

  I am a python novice and I am trying to write a python script (most of
  the code is borrowed) to Zip a directory containing some other
  directories and files. The script zips all the files fine but when it
  tries to zip one of the directories it fails with the following
  error:
  IOError: [Errno 13] Permission denied: 'c:\\aaa\\temp'

  The script I am using is:

  import zipfile, os

  def toZip( directory, zipFile ):
  Sample for storing directory to a ZipFile
  z = zipfile.ZipFile(
  zipFile, 'w', compression=zipfile.ZIP_DEFLATED
  )
  def walker( zip, directory, files, root=directory ):
  for file in files:
  file = os.path.join( directory, file )
  # yes, the +1 is hacky...
  archiveName = file[len(os.path.commonprefix( (root,
  file) ))+1:]
  zip.write( file, archiveName, zipfile.ZIP_DEFLATED )
  print file
  os.path.walk( directory, walker, z  )
  z.close()
  return zipFile

  if __name__ == __main__:
  toZip( 'c:\\aaa', 'c:\\aaa\\test.zip' )

  I have tried to set the permissions on the folder, but when I check
  the directory permissions it is set back to Read Only

  Any suggestions?

  Thanks
  Johan Balt

 Couple of quick suggestions that may help:

 1) don't use 'file' as a variable name. It will mask
 the builtin file function.  If it hasn't bitten you before
 it will if you keep doing that.

 2) If you put the target .zip file in the directory you are
 backing what do you expect the program to do when it comes
 to the file you are creating as you walk the directory?  You
 haven't done anything to 'skip' it.

 3) Your commonprefix and +1 appears to result in same
 information that the easier to use os.path.basename()
 would give you.  Double check me on that.

 I don't see anything that references C:\\aaa\temp in your
 code.  Does it exist on your hard drive?  If so does it
 maybe contain temp files that are open?  zipfile module
 can't handle open files.  You must use try/except to
 catch these errors.

 Hope info helps.

 -Larry

Thank you Larry.
I've changed the code as epr your advice. The code is now:

import zipfile, os

def toZip( directory, zipFile ):
Sample for storing directory to a ZipFile
z = zipfile.ZipFile(
zipFile, 'w', compression=zipfile.ZIP_DEFLATED
)
def walker( zip, directory, files, root=directory ):
for f in files:
f = os.path.join( directory, f )
archiveName = os.path.basename(f)
zip.write( f, archiveName, zipfile.ZIP_DEFLATED )
print f
os.path.walk( directory, walker, z  )
z.close()
return zipFile


if __name__ == __main__:
toZip( 'c:\\aaa\\', 'c:\\bbb\\test.zip' )

I still get the same error:
Traceback (most recent call last):
  File C:\Python24\Lib\site-packages\pythonwin\pywin\framework
\scriptutils.py, line 310, in RunScript
exec codeObject in __main__.__dict__
  File C:\Python24\Scripts\dirZip.py, line 20, in ?
toZip( 'c:\\aaa\\', 'c:\\bbb\\test.zip' )
  File C:\Python24\Scripts\dirZip.py, line 14, in toZip
os.path.walk( directory, walker, z  )
  File C:\Python24\lib\ntpath.py, line 329, in walk
func(arg, top, names)
  File C:\Python24\Scripts\dirZip.py, line 12, in walker
zip.write( f, archiveName, zipfile.ZIP_DEFLATED )
  File C:\Python24\lib\zipfile.py, line 405, in write
fp = open(filename, rb)
IOError: [Errno 13] Permission denied: 'c:\\aaa\\temp'

c:\\aaa\\temp is a directory in the directory I an trying to zip. I
want to use this script to back up my work once a day and would like
to
keep the directory structure as is. I can zip the files in c:\aaa\tem
fine so I guess that there aren't any open files in the directory.
Any more ideas?

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

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

Re: client/server design and advice

2006-12-01 Thread Josh Bloom

You may also want to take a look at Erlang http://www.erlang.org/ for some
ideas of how to do distributed programming.
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: detecting that a SQL db is running

2006-12-01 Thread Josh Bloom

I think the main point is that your Python code should be written in such a
way that when you attempt to connect to your local MSDE it will timeout
correctly instead of hanging.

Do you have a loop somewhere that just keeps retrying the connection instead
of giving up at some point?

Here are a couple of links to bits o code, that you can use to see whats
running on your local machine.
http://blog.dowski.com/2003/12/20/getting-at-processes-with-python-and-wmi/
http://mail.python.org/pipermail/python-win32/2001-November/000155.html
Search the resulting lists for whatever name MSDE is supposed to run as.

-Josh

On 12/1/06, bill ramsay [EMAIL PROTECTED] wrote:


Dennis

none of this matters,  all i am trying to find out is whether or not
the local MSDE is actually running.

I put all the other bits in there to try and put some background to
it.

kind regards

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

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

Looking for a way to stop execution of script, in the script

2006-11-14 Thread Josh Bloom
Hi everyone, I'm looking for a way to stop execution of a script from within the script. I'm familiar with this idiom:While 1: doFirstThing() doSecondThing() if something: break doThirdThing()
 breakBut that seems a little kludgy to me with extra breaks involved. Is there a way to do something like this?doFirstThing()doSecondThing()if something:
 diedoThirdThing()Thanks for the help, Josh
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a way to stop execution of script, in the script

2006-11-14 Thread Josh Bloom
Thanks Fredrik, yeah the while loop for single run is pretty stupid. sys.exit() thats the call I was looking for. -JoshOn 11/14/06, Fredrik Lundh
 [EMAIL PROTECTED] wrote:
Josh Bloom wrote: Hi everyone, I'm looking for a way to stop execution of a script from within the script. I'm familiar with this idiom: While 1: doFirstThing()
 doSecondThing() if something: break doThirdThing() breakI'm not.why are you using a while statement to execute the code once? doFirstThing() doSecondThing()
 if something: die doThirdThing()sys.exit() ?(or if you prefer, raise SystemExit)/F--
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: What's the best IDE?

2006-10-25 Thread Josh Bloom
I'm not going to call it the 'best' ide as thats just silly. But if your developing on Windows pyscripter http://mmm-experts.com/Products.aspx?ProductId=4
 is a great IDE. -JoshOn 10/25/06, Bruno Desthuilliers [EMAIL PROTECTED]
 wrote:[EMAIL PROTECTED] a écrit : Recently I've had some problems with PythonWin when I switched to
 Py2.5, tooka long hiatus, and came back. So now I'm without my god sent helper, and I'm looking for a cool replacement, or some advocation to reinstall/setup PyWin. But the Python website's list is irrefutably
 long. It would take a month or two to test all of those products. So I'm looking for experienced advocates.  What's your favorite IDE?emacs What do you like about it?1. It's so complicated and ugly that just using it is enough to makes
you look like a seasonned pro.2. It gives me a reason to engage in holy wars with vim users. It would be fine for a begginer, right?Certainly not.But you may want to look for other advices:
http://groups.google.com/groups?as_q=best+IDEas_ugroup=comp.lang.python--
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: MP3 files and Python...

2006-10-11 Thread Josh Bloom
Dive Into Python also has a little tutorial/code for reading and editing mp3 tags. http://www.diveintopython.org/object_oriented_framework/index.html
-JBOn 10/10/06, Max Erickson [EMAIL PROTECTED] wrote:
Karlo Lozovina [EMAIL PROTECTED] wrote: I'm looking for a Python lib which can read and _write_ ID3v1 and ID3v2 tags, and as well read as much as possible data from MP3 file (size, bitrate, samplerate, etc...).
 MP3 reproduction is of no importance...Try mutagen:http://www.sacredchao.net/quodlibet/--
http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list

Debugging question: Print out program state (Variables)

2006-10-06 Thread Josh Bloom
Hello PyListers, I have a python script that runs nightly and fetches info from various webservers and does some processing on the data. Occasionally my script has a problem and is unable to finish its work. I have try blocks and logging for most of the errors that can happen. 
What I would like to do is write out the state of my script when an error is encountered. I've been looking at the traceback module and think Im on the right track, but I haven't figured out a way to write out all of the programs current variables. Is there a handy module that can do something like that?
Thanks,Josh
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: help on pickle tool

2006-10-06 Thread Josh Bloom
If you must build your web ui in Java, then Jython is probably the best way for you to go. Inside of your java code you need to create a Jython instance. Then you can use the Jython pickle module to deserialize the data you are receiving. Last I remember Jython was equivalent to about CPython 
2.2 so you might have an incompatibility between the 2 versions of pickle (just guessing on that, you'll have to try it)-JoshOn 6 Oct 2006 04:10:54 -0700, 
virg [EMAIL PROTECTED] wrote:Hi,
Yes, using python client we are able deserialize data usingr = pickle.loads(result).where result is a response from the server and r is a dictionary afterdeserialization.For serialisation at the server written in python using
pickle.dumps(result, 2)Now we are developing web based Client using java. So we are writingclient in java. If server and client are in python we dont see anyproblems since we are using same serialisation tool pickle. Now we
have seen problems because we are writing client in java. we did notfind equivalent function on java for this tool pickle. If i usestandard java desrialisation functions i am getting error as invalidheader becasue of incompatibility between python and java. Please help
me if you have any clueregards,- Virghanumizzle wrote: On 6 Oct 2006 02:29:59 -0700, virg [EMAIL PROTECTED] wrote:  Yes your are right. I will send a dictionary object from the server to
  the client.  I already have client which is written in python. But we are migrating  the python client which is a command line toolto Web UI client  (java). Please explain 'Web UI'. Can Python perform an equivalent function?
 -- Theerasak--http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: python html rendering

2006-10-03 Thread Josh Bloom
Hey Pierre,I'm using this plug-in for wordpress to display Python code. http://blog.igeek.info/wp-plugins/igsyntax-hiliter/It works pretty well and can display a lot of other languages as well. 
-JoshOn 10/3/06, Pierre Imbaud [EMAIL PROTECTED] wrote:
Hi, Im looking for a way to display some python codein html: with correct indentation, possibly syntax hiliting, dealingcorrectly with multi-line comment, and... generating valid html code ifthe python code itself deals with html (hence manipulates tag litterals.
Thanks for your help!--http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: XSLT speed comparisons

2006-09-28 Thread Josh Bloom
Hey Damian, I suggest you take a look at http://mmm-experts.com/Products.aspx?ProductId=4 which is a nice open source Python IDE for windows. After you've installed the version from that page, you should go to 
http://groups.google.com/group/PyScripter?lnk=oa and get the more recent unofficial release, for a few features and fixes. Its got good intellisense type code completion and is pretty sweet overall, debugging, unit testing, a file based Code Explorer, 
Give it a shot. -JoshOn 28 Sep 2006 12:18:28 -0700, Damian [EMAIL PROTECTED] wrote:
Sorry about the multiple posts folks. I suspect it was the FasterFoxFireFox extension I installed yesterday tricking me.
I had a brief look at libxml(?) on my Ubuntu machine but haven't run iton the server.I'll look into pyrxp Larry.I have to say I'm struggling a little with the discoverability anddocumentation side of things with Python. I realise that
discoverability is purported to be one of its strong sides but comingfrom the Visual Studio IDE where Intellisense looks after everything asyou are typing and you can see exactly what methods are available to
what class and what variables are required and why what I've seen sofar is not that flash.I've installed Eclipse with Pydev (very impressive) on my Linux box andam using IDLE on Windows and it could just be my lack of familiarity
that is letting me down. Any other IDE recommendations?I'd be keen to test pyrxp and libxslt but may need help with the code -I spent literally hours yesterday trying to make a 20-line bit of codework. To make things worse I started with 4suite in Ubuntu and it
refused to work with an error about not being able to find default.cator something. Googled for hours with no luck.That said, I really want to make the switch and so far Python looks tobe the best choice.
CheersDamian--http://mail.python.org/mailman/listinfo/python-list
-- 
http://mail.python.org/mailman/listinfo/python-list