Localized strftime()

2005-10-23 Thread Sebastjan Trepca
Hi! I'm trying to get a localized date format from strftime() but it seems that is doesn't have any parameters for that or any information about this issue in Python docs. For example I want to turn this: 19 Oct, 2005 to this(slovene language): 19 Okt, 2005 Thanks for help, Sebastjan -- http://

Re: Localized strftime()

2005-10-23 Thread Sebastjan Trepca
Great, it works, thanks :) On 23/10/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Sebastjan Trepca wrote: > > > I'm trying to get a localized date format from strftime() but it seems > > that is doesn't have any parameters for that or any information a

Dictionary string parser

2005-11-22 Thread Sebastjan Trepca
Hi, is there any library or some way to parse dictionary string with list, string and int objects into a real Python dictionary? For example: >>> my_dict = dict_parser("{'test':'123','hehe':['hooray',1]}") I could use eval() but it's not very fast nor secure. Thanks, Sebastjan -- http://mail.

Re: Dictionary string parser

2005-11-22 Thread Sebastjan Trepca
Wow, this helps a LOT! It's just what I needed, thank you very much! :) Sebastjan On 22/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Sebastjan Trepca wrote: > > > is there any library or some way to parse dictionary string with list, > > string and int objects

Re: Python is incredible!

2005-12-12 Thread Sebastjan Trepca
Welcome to Python world :) On 12 Dec 2005 03:44:13 -0800, Tolga <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I am using Common Lisp for a while and nowadays I've heard so much > about Python that finally I've decided to give it a try becuase Python > is not very far away from Lisp family. > > I

PIL and ImageMagick scalability

2005-12-26 Thread Sebastjan Trepca
Hi everyone! I have a question about image processing. We have a website which will process a lot of images a day.It will be running Apache(worker) with mod_python. My question is what should we use for processing. If we use PIL the processing will be done with the same process that handles other

Dominant color & PIL

2006-01-22 Thread Sebastjan Trepca
Hi!I was wondering is it possible to find out which colour is dominant in an image using PIL? It would be very easy to create interesting mozaic images with that :)Thanks, Sebastjan -- http://mail.python.org/mailman/listinfo/python-list

Re: Dominant color & PIL

2006-01-23 Thread Sebastjan Trepca
o get the values for themaster image.> Terry Hancock wrote:> > On Sun, 22 Jan 2006 21:07:45 +0100> > Sebastjan Trepca < [EMAIL PROTECTED]> wrote:> > > I was wondering is it possible to find out which> > > colour is dominant in an image using PIL?>

How to create a unix shell account with Python?

2006-02-05 Thread Sebastjan Trepca
Hi! I couldn't find anything on creating a new linux user account in Python documentation. Anyone has any experience with this? You just run useradd command in shell or is there a more pythonic way? Thanks, Sebastjan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a unix shell account with Python?

2006-02-06 Thread Sebastjan Trepca
Ok, thanks :) On 5 Feb 2006 13:01:23 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > os.system("useradd ...") > > Its not pretty, but it gets it done. > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Shared memory

2006-03-02 Thread Sebastjan Trepca
Hey! Are there any "live" modules for working with shared memory in Python? I found some but they are all dead(posh,shm)... Thanks, Sebastjan -- http://mail.python.org/mailman/listinfo/python-list

Re: encoding problem

2006-03-03 Thread Sebastjan Trepca
I think you are trying to concatenate a unicode string with regular one so when it tries to convert the regular string to unicode with ASCII(default one) encoding it fails. First find out which of these strings is regular and how it was encoded, then you can decode it like this(if regular string is

Re: object's list index

2006-03-03 Thread Sebastjan Trepca
Um, what about: for oindex in xrange(len(list)): object = list[oindex] print oindex You can't create a generic function for this. Sebastjan On 3/3/06, William Meyer <[EMAIL PROTECTED]> wrote: > hi, > > I need to get the index of an object in a list. I know that no two objects > in the

Egg with option to install extra packages

2006-04-19 Thread Sebastjan Trepca
Hi, I'm trying to distribute my application which also support some extra libraries but does not require them to run. I set the "extra" option but I don't know how could I specify that I want to install my application with any of that extra packages. So now I have in my setup.py like this:

Slovenian Python User Group

2006-05-13 Thread Sebastjan Trepca
Hi! just wanted to send a notice about a new portal/group for Slovenian Python fans here :) http://soup.zen.si (btw, it's in slovene lang) Sebastjan -- http://mail.python.org/mailman/listinfo/python-list

Weird local variables behaviors

2008-06-20 Thread Sebastjan Trepca
Hey, can someone please explain this behavior: The code: def test1(value=1): def inner(): print value inner() def test2(value=2): def inner(): value = value inner() test1() test2() [EMAIL PROTECTED] ~/dev/tests]$ python locals.py 1 Traceback (most recent call

Re: Weird local variables behaviors

2008-06-21 Thread Sebastjan Trepca
PROTECTED]> wrote: >> Sebastjan Trepca wrote: >> > Hey, >> >> > can someone please explain this behavior: >> >> > The code: >> >> > def test1(value=1): >> > def inner(): >> > print value >> > inner()

Re: File Permissions

2006-03-10 Thread Sebastjan Trepca
Those constants are in stat module so add "import stat" before the program. On 10 Mar 2006 06:20:18 -0800, VJ <[EMAIL PROTECTED]> wrote: > Hi All > > I need to get the user permission of a file using python. I was trying > the following code which i found on google grups > > st = os.stat(myfile)

Re: Server applications - avoiding sleep

2006-03-15 Thread Sebastjan Trepca
You can create a Windows Service which will run as long as Windows are up, well, except if you stop it. You can find more info here: http://www.python.org/windows/win32/ Sebastjan On 15 Mar 2006 05:26:45 -0800, rodmc <[EMAIL PROTECTED]> wrote: > I have written a small server application (for Win

Re: imap folder scanner

2006-03-24 Thread Sebastjan Trepca
A very simple example... import imaplib m = imap.IMAP4() m.login(username,password) m.select('myfolder') status, data = m.search(None,'(SUBJECT "BIKES")') assert status=='OK', "Error. Message: %s"%data data = data[0] #you get your results in a list and search returns only one result assert data,"N

Re: What's The Best Editor for python

2006-03-24 Thread Sebastjan Trepca
http://www.pspad.com/en/It supports Python plugins! :)Sebastjanhttp://www.trepca.si/blog On 24 Mar 2006 08:50:15 -0800, Fuzzyman <[EMAIL PROTECTED]> wrote:> > PythonStudent wrote:> > Hi,> > Can one of you say to me what's the best editor for editing the python > > programs ( for linux or windows ),

Re: imap folder scanner

2006-03-25 Thread Sebastjan Trepca
.append(sender[sender.find('From:')+5:].strip())  sender = ""   else:  sender+=itemprint parsed_sendersSebastjan On 3/25/06, Kun <[EMAIL PROTECTED]> wrote: Marco Carvalho wrote:> On 3/24/06, Sebastjan Trepca <[EMAIL PROTECTED]> wrote:>>> m.select(

Re: Very stupid question.

2006-03-30 Thread Sebastjan Trepca
Check os.stat() function here http://docs.python.org/lib/os-file-dir.html-- Sebastjanhttp://www.trepca.si/blog On 30 Mar 2006 09:34:32 -0800, Sullivan WxPyQtKinter <[EMAIL PROTECTED]> wrote: In addition, f=file('filename','r');len(f.read()) is quite expensive inmy point of view, If the file is serv

Re: Very stupid question.

2006-03-30 Thread Sebastjan Trepca
On 3/30/06, Sullivan Zheng <[EMAIL PROTECTED]> wrote: Wow, seems I am not that supid. Why python does not include this function in the file object. It is almost a tradition in other languages...   import os   os.stat(path).st_size   really not elegant or OO.True.-- Sebastjanhttp://www.trepca.si/blo

Distribution of Python apps

2006-04-05 Thread Sebastjan Trepca
Hi,I was wondering if there is anything similar to py2exe for OS X and Linux distributions so that I wouldn't have to pre-install Python and required modules for my application.Thanks.-- Sebastjanhttp://www.trepca.si/blog -- http://mail.python.org/mailman/listinfo/python-list