Re: Framework for a beginner

2012-04-19 Thread Grzegorz Staniak
just don't work well with your neurons. And you may still call the former "my languages". GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Gotcha's?

2012-04-06 Thread Grzegorz Staniak
gt;> >> Yes, that's what you said already. My reasoning was in the part you stripped >> from my quote. *shrug* > > Multiple symmetric quote characters breaks one of python's own zen > rules: > > There should be one-- and preferably only one --obvious way t

Re: Python Gotcha's?

2012-04-06 Thread Grzegorz Staniak
s, but 'that' is 'that' like 'this'> ... with 'qq' providing the version with inerpolation. I could always find an arbitrary character for quoting that was _not_ present in the string, and so, most of the time, avoid quoting altogether. It was perhaps a bit too magical, but pruced very readable strings. GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Gotcha's?

2012-04-05 Thread Grzegorz Staniak
ocol specs and follow them. Sure, sure. But it still may raise a few eyebrows as people start to play along while still reading the spces. It's just not something that I'd expect (yes, I learnt Perl before I discovered Python). GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Gotcha's?

2012-04-05 Thread Grzegorz Staniak
kes is to start playing with generating JSON without the use of specialized JSON libraries/functions. For testing, for fun, out of curiosity... GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: random number

2012-03-26 Thread Grzegorz Staniak
t the OP requested, i.e. "6 digit random number *from a given number*"? That is, a random permutation of the set of its digits? GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: Data mining/pattern recogniton software in Python?

2012-03-23 Thread Grzegorz Staniak
g/ > [2] http://statsmodels.sourceforge.net/ > [3] http://docs.python.org/library/queue.html > [4] > http://www.laurentluce.com/posts/python-threads-synchronization-locks-rlocks-semaphores-conditions-events-and-queues/ Thanks for the suggestions. GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Data mining/pattern recogniton software in Python?

2012-03-23 Thread Grzegorz Staniak
of 15 readings and ring a bell when the data in buffer form a specific pattern (a spike, a trough, whatever)? I'll be grateful for a push in the right direction. Thanks, GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to locate existing standard encodings in python

2008-11-11 Thread Grzegorz Staniak
f editing, e.g. pasting part of an "Alias" at the end of the line for "AddDefaultCharset" or sth like this. GS -- Grzegorz Staniak Nocturnal Infiltration and Accurate Killing -- http://mail.python.org/mailman/listinfo/python-list

Re: wildcard match with list.index()

2008-11-10 Thread Grzegorz Staniak
s thinking about something like: > > mylist.index('no*') > > Of course this doesn't work. I guess there's a way to use the glob module in this situation, but for the specific case I think you can use: start_with_no = (i for i in mylist if i.startswith("no")) GS

Re: Workflow engine?

2008-11-09 Thread Grzegorz Staniak
or _any_ suggestions or comments. Most of them happened to be along the lines of "phew, that's too easy, go bother yourself with the rest of the stuff". > The common denonimator of a workflow (state engine) is so simple, the > only complexity comes from the environment it

Re: Workflow engine?

2008-11-09 Thread Grzegorz Staniak
ied any such code? What would you recommend? > > There are some packages for zope on pypi: > Products.DCWorkflow - zope2, cmf > hurry.workflow and some extensions - zope3 > zope.wfmc - zope3 (not many dependencies on zope3) Thanks, I'll have a look at them. GS -- Grzegorz Sta

Re: Workflow engine?

2008-11-08 Thread Grzegorz Staniak
tion was pretty specific: could you comment on/recommend an open source python workflow engine/module (implied: to go with a web app). Sharepoint doesn't match the description. I think one could assume that if I'm asking about wheels, I need a pointer to a wheel shop, and I'm not

Re: Workflow engine?

2008-11-08 Thread Grzegorz Staniak
framework. > > http://www.google.de/search?q=python+state+machine To be exact, I used the words "engine/library", not "a whole framework". Thanks for the link, I've googled for articles and recipes myself and as I said, I more or less know what to do - I just thought it might be a good idea to ask whether perhaps the wheel has already been invented. Apparently I was wrong. GS -- Grzegorz Staniak Nocturnal Infiltration and Accurate Killing -- http://mail.python.org/mailman/listinfo/python-list

Re: Workflow engine?

2008-11-08 Thread Grzegorz Staniak
dea to start writing another one? I'd much prefer an existing workflow project that I could use, test, and contribute to, just as I decided on TG for the web thing. GS -- Grzegorz Staniak Nocturnal Infiltration and Accurate Killing -- http://mail.python.org/mailman/listinfo/python-list

Workflow engine?

2008-11-08 Thread Grzegorz Staniak
tell), itools.workflow, spiff (AFAIK tied to a CMS), but not much else. I don't think I'll have enough time to get acquinted with Plone and its offer of products. Has anyone here tried any such code? What would you recommend? TIA, GS -- Grzegorz Staniak Nocturnal Infiltration and Accurate

Re: A bit weird dictionary behavior

2008-09-22 Thread Grzegorz Staniak
; And some would argue that it was wrong to have such a wide definition > for the truth value of an expression in the first place... Just out of idle curiosity, what could be the alternatives? Not to evaluate e.g. strings to "true"? Aren't such conventions as "whatever is

Re: PHP's str_replace ?

2008-09-10 Thread Grzegorz Staniak
ink this here is an example where even str_replace > in Python wouldn't have worked well. What about mystring.translate(transtable)? GS -- Grzegorz Staniak Nocturnal Infiltration and Accurate Killing -- http://mail.python.org/mailman/listinfo/python-list

Re: PHP's str_replace ?

2008-09-10 Thread Grzegorz Staniak
Is there some equivalent in Python ? The .translate() method of strings? >>> import string >>> mystr = "This is just a test" >>> transtable = string.maketrans("aeiouy","--") >>> mystr.translate(transtable) 'Th-s -s j-st - t-st' GS -- Grzegorz Staniak Nocturnal Infiltration and Accurate Killing -- http://mail.python.org/mailman/listinfo/python-list

Re: PHP's str_replace ?

2008-09-10 Thread Grzegorz Staniak
re some equivalent in Python ? The .translate() method of strings? >>> import string >>> mystr = "This is just a test" >>> transtable = string.maketrans("aeiouy","--") >>> mystr.translate(transtable) 'Th-s -s j-st - t-st' GS -- Grzegorz Staniak Nocturnal Infiltration and Accurate Killing -- http://mail.python.org/mailman/listinfo/python-list

Re: Equivalents of Ruby's "!" methods?

2008-08-25 Thread Grzegorz Staniak
an iterator? GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: Total No. of "Records" in a File?

2008-08-23 Thread Grzegorz Staniak
ase the length of "os.listdir()" could suffice, but then you might need to filter out sub-directories, or maybe count files in them too using "os.walk()". GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: simple Question about using BeautifulSoup

2008-08-20 Thread Grzegorz Staniak
') > > but the file extension doesn't work. So how do I open one? Have you tried the local file URL, like "file:///home/user/file.html"? GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: ??????: How to use win32com to convert a MS WORD doc to HTML ?

2008-08-20 Thread Grzegorz Staniak
.. Very sorry, but I just couldn't resist. GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: like a "for loop" for a string

2008-08-17 Thread Grzegorz Staniak
t;no" and I want > all of "text5+more Text" because it is after "yes". It is like the yeses are > bullet points and I want all the info after them. However, all in one > string. I guess this can be done with regular expressions: http://www.python.org/doc/current/lib/module-re.html Read about groups, then write an appropriate regex. GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list

Re: like a "for loop" for a string

2008-08-17 Thread Grzegorz Staniak
ething like "count and return all occurences of the substring 'abc' in foo"? Looks like you should use the re module. GS -- Grzegorz Staniak -- http://mail.python.org/mailman/listinfo/python-list