nltk in 3.7.2 for win 10 64 bit

2019-03-20 Thread Türkcan Kurt
is there a way to install nltk in win 10 64 bit in python 3.7.2 ? -- Teşekkürler, iyi çalışmalar. ODTU - BİDB Lisanslı Yazılım Sorumlusu swb...@metu.edu.tr Tel: 210 3311 -- https://mail.python.org/mailman/listinfo/python-list

Re: Panda data read_csv returns 'TextFileReader' object

2015-04-29 Thread Kurt
Python for Data Analysis. Kurt On Friday, April 24, 2015 at 6:53:05 PM UTC-4, Dave Angel wrote: > On 04/24/2015 04:04 PM, Kurt wrote: > > Isn't the call pd.read_csv(filepath,...) suppose to return a dataframe, not > > this other object? I keep getting the following err

Panda data read_csv returns 'TextFileReader' object

2015-04-24 Thread Kurt
Isn't the call pd.read_csv(filepath,...) suppose to return a dataframe, not this other object? I keep getting the following error when I try to view the attribute head. AttributeError: 'TextFileReader' object has no attribute 'head' I reference pandas as pd and df is suppose to define itself. I

Re: How to turn a string into a list of integers?

2014-09-06 Thread Kurt Mueller
Am 06.09.2014 um 20:19 schrieb Steven D'Aprano : > Kurt Mueller wrote: > [...] >> Now the part of the two Python builds is still somewhat unclear to me. > [...] >> In Python 2.7: >> As I learned from the ord() manual: >> If a unicode argument is given

Re: How to turn a string into a list of integers?

2014-09-06 Thread Kurt Mueller
Am 06.09.2014 um 07:47 schrieb Steven D'Aprano : > Kurt Mueller wrote: >> Could someone please explain the following behavior to me: >> Python 2.7.7, MacOS 10.9 Mavericks [snip] Thanks for the detailed explanation. I think I understand a bit better now. Now the part of the

Re: How to turn a string into a list of integers?

2014-09-05 Thread Kurt Mueller
Am 05.09.2014 um 21:16 schrieb Kurt Mueller : > Am 05.09.2014 um 20:25 schrieb Chris “Kwpolska” Warrick : >> On Sep 5, 2014 7:57 PM, "Kurt Mueller" wrote: >>> Could someone please explain the following behavior to me: >>> Python 2.7.7, MacOS

Re: How to turn a string into a list of integers?

2014-09-05 Thread Kurt Mueller
Am 05.09.2014 um 20:25 schrieb Chris “Kwpolska” Warrick : > On Sep 5, 2014 7:57 PM, "Kurt Mueller" wrote: > > Could someone please explain the following behavior to me: > > Python 2.7.7, MacOS 10.9 Mavericks > > > > >>> import sys > > >>

Re: How to turn a string into a list of integers?

2014-09-05 Thread Kurt Mueller
196] My obviously wrong understanding: ‚AÄ‘ in ‚ascii‘ are two characters one with ord A=65 and one with ord Ä=196 ISO8859-1 —-> why [65, 195, 132] u’AÄ’ is an Unicode string —-> why [65, 196] It is just the other way round as I would expect. Thank you -- Kurt Mueller, kurt.alfred.muel...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Functions on list items

2014-08-19 Thread Kurt
> > Maybe http://pandas.pydata.org/ ??? > > Thanks. This reply is like that butterfly wing flap causing hurricanes a world away; big steerage away from proprietary stuff used in my org. Detox will take some time though. K -- https://mail.python.org/mailman/listinfo/python-list

Functions on list items

2014-08-19 Thread Kurt
module (if it exists)? Kurt -- https://mail.python.org/mailman/listinfo/python-list

Re: split lines from stdin into a list of unicode strings

2013-09-05 Thread Kurt Mueller
Am 05.09.2013 10:33, schrieb Peter Otten: > Kurt Mueller wrote: >> Am 29.08.2013 11:12, schrieb Peter Otten: >>> kurt.alfred.muel...@gmail.com wrote: >>>> On Wednesday, August 28, 2013 1:13:36 PM UTC+2, Dave Angel wrote: >>>>> On 28/8/2013 04

Re: split lines from stdin into a list of unicode strings

2013-09-05 Thread Kurt Mueller
Am 29.08.2013 11:12, schrieb Peter Otten: > kurt.alfred.muel...@gmail.com wrote: >> On Wednesday, August 28, 2013 1:13:36 PM UTC+2, Dave Angel wrote: >>> On 28/8/2013 04:32, Kurt Mueller wrote: >>>> For some text manipulation tasks I need a template to split lines

Re: split lines from stdin into a list of unicode strings

2013-08-29 Thread Kurt Mueller
Am 29.08.2013 11:12, schrieb Peter Otten: > kurt.alfred.muel...@gmail.com wrote: >> On Wednesday, August 28, 2013 1:13:36 PM UTC+2, Dave Angel wrote: >>> On 28/8/2013 04:32, Kurt Mueller wrote: >>>> For some text manipulation tasks I need a template to split lines

Re: split lines from stdin into a list of unicode strings

2013-08-28 Thread kurt . alfred . mueller
On Wednesday, August 28, 2013 1:13:36 PM UTC+2, Dave Angel wrote: > On 28/8/2013 04:32, Kurt Mueller wrote: > > For some text manipulation tasks I need a template to split lines > > from stdin into a list of strings the way shlex.split() does it. > > The encoding of the in

Re: right adjusted strings containing umlauts

2013-08-28 Thread kurt . alfred . mueller
On Wednesday, August 28, 2013 12:23:12 PM UTC+2, Dave Angel wrote: > On 28/8/2013 04:01, Kurt Mueller wrote: > > Because I cannot switch to Python 3 for now my life is not so easy:-) > > For some text manipulation tasks I need a template to split lines > > from stdin into a li

split lines from stdin into a list of unicode strings

2013-08-28 Thread Kurt Mueller
## $ cat | template.py Comments are welcome. TIA -- Kurt Mueller -- http://mail.python.org/mailman/listinfo/python-list

Re: right adjusted strings containing umlauts

2013-08-28 Thread Kurt Mueller
Am 08.08.2013 18:37, schrieb Chris Angelico: > On Thu, Aug 8, 2013 at 5:16 PM, Kurt Mueller > wrote: >> Am 08.08.2013 17:44, schrieb Peter Otten: >>> Kurt Mueller wrote: >>>> What do I do, when input_strings/output_list has other codings like >>>>

Re: right adjusted strings containing umlauts

2013-08-23 Thread Kurt Mueller
Am 08.08.2013 18:37, schrieb Chris Angelico: > On Thu, Aug 8, 2013 at 5:16 PM, Kurt Mueller > wrote: >> Am 08.08.2013 17:44, schrieb Peter Otten: >>> Kurt Mueller wrote: >>>> What do I do, when input_strings/output_list has other codings like >>>>

Re: right adjusted strings containing umlauts

2013-08-08 Thread Kurt Mueller
encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 0: invalid start byte muk@mcp20:/sw/prog/scripts/text_manip> How do I handle this two inputs? TIA -- Kurt Mueller -- http://mail.python.org/mailman/listinfo/python-list

Re: right adjusted strings containing umlauts

2013-08-08 Thread Kurt Mueller
Am 08.08.2013 17:44, schrieb Peter Otten: > Kurt Mueller wrote: >> What do I do, when input_strings/output_list has other codings like >> iso-8859-1? > > You have to know the actual encoding. With that information it's easy: >>>> output_list > ['\xc3\

Re: right adjusted strings containing umlauts

2013-08-08 Thread Kurt Mueller
Am 08.08.2013 16:43, schrieb jfhar...@gmail.com: > On Thursday, 8 August 2013 15:23:46 UTC+1, Kurt Mueller wrote: >> I'd like to print strings right adjusted. >> print( '>{0:>3}<'.format( 'ä' ) ) > > Make both strings unicode > prin

right adjusted strings containing umlauts

2013-08-08 Thread Kurt Mueller
#x27; ) ) > ä< Same with % notation: print( '>%3s<' % ( 'a' ) ) > a< print( '>%3s<' % ( 'ä' ) ) > ä< For a string with no Umlaut it uses 3 characters, but for an Umlaut it uses only 2 characters. I guess it has to to with unicode. How do I get it right? TIA -- Kurt Mueller -- http://mail.python.org/mailman/listinfo/python-list

Re: How to modify this script?

2013-01-10 Thread Kurt Hansen
Kurt wrote: > > Spooky behavior. Yes, the green-apple-example also works for me with > your new script, BUT ...! > > Try to copy the table content on this page: > http://www.danacord.dk/frmsets/records/732-r.html > which is a realistic scenario. That's whar I am doing

Re: How to modify this script?

2013-01-09 Thread Kurt Hansen
table online (see link above). You may ommit the rows after track 14. Not that it makes any differerence, but that block is surposed to be formatted differerent. I do that manually afterwards ... if not ... ;-) -- Regards Kurt Hansen -- http://mail.python.org/mailman/listinfo/python-list

Re: How to modify this script?

2013-01-09 Thread Kurt Hansen
Den 06/01/13 15.20, Chris Angelico wrote: That version should work. Am 06.01.2013 15:30 schrieb Kurt Hansen: It certainly does. I'll keep it and use it until at better solution is found. On 08/01/13 15.18, Thomas Rachel wrote: > That would be simple: Replace output += &

Re: How to modify this script?

2013-01-09 Thread Kurt Hansen
; the snippet upon the text, either using my self-defined hotkey or by pushing ctrl+space and select my snippet from a list. The copied text is inserted as clean text without any HTML. The Python-snippet we are discussing recognizes tabs to separate the columns and adds the apprpriate HTM

Re: How to modify this script?

2013-01-07 Thread Kurt Hansen
Thank you for trying to help. ---- *From:* Kurt Hansen *To:* python-list@python.org *Sent:* Sunday, January 6, 2013 3:21 PM *Subject:* Re: How to modify this script? Den 06/01/13 15.01, chaouche yacine wrote: > Well, I'm not answering your question since I

Re: How to modify this script?

2013-01-06 Thread Kurt Hansen
Den 06/01/13 15.52, Chris Angelico skrev: On Mon, Jan 7, 2013 at 1:40 AM, Kurt Hansen wrote: failed: cannot concatenate 'str' and 'tuple' objects The problem is this line: output += '', line, '' Change it to: output += '' + line + '&#

Re: How to modify this script?

2013-01-06 Thread Kurt Hansen
Den 06/01/13 15.22, Subimal Deb wrote: Kurt, Try this: [cut] I've tested it on my original example: Price table 1 Green apple $1 5 Green apples$4 10 Green apples$7 With all four lines selected it makes an error. With only three (without the first line) it

Re: How to modify this script?

2013-01-06 Thread Kurt Hansen
Den 06/01/13 15.20, Chris Angelico wrote: On Mon, Jan 7, 2013 at 1:03 AM, Kurt Hansen wrote: I'm sorry to bother you, Chris, but applying the snippet with your code in Gedit still just deletes the marked, tab-separated text in the editor. Ah, whoops. That would be because I had a bug i

Re: How to modify this script?

2013-01-06 Thread Kurt Hansen
t;%s" % (3 - nb_columns + 1, item) return "%s" % item output = "\n" for line in file("data.txt"): items = line.strip().split("\t") columns = "" for item in items : columns += addcolumn(item,len(items)) output += addli

Re: How to modify this script?

2013-01-06 Thread Kurt Hansen
Den 06/01/13 14.44, Chris Angelico wrote: On Mon, Jan 7, 2013 at 12:34 AM, Kurt Hansen wrote: "innermost"? I have replaced this with yours, but all the marked text are deleted: Here's the full code, with my change: $< lines = $GEDIT_SELECTED_TEXT.split("\n"); o

Re: How to modify this script?

2013-01-06 Thread Kurt Hansen
that I'm not experienced, so please tell me exactly where it's surposed to be inserted. Could you eventually show the complete modified script? ---- *From:* Kurt Hansen *To:* python-list@python.org *Sent:* Sunda

Re: How to modify this script?

2013-01-06 Thread Kurt Hansen
Den 06/01/13 13.52, Chris Angelico skrev: On Sun, Jan 6, 2013 at 11:42 PM, Kurt Hansen wrote: Since there's only one "field" in the first line, I want this output: Price table - insted of Price table How to? Thank you i advance. It's actually quite simple, as long a

How to modify this script?

2013-01-06 Thread Kurt Hansen
s: Price table 1 Green apple $1 5 Green apples $4 10 Green apples $7 Since there's only one "field" in the first line, I want this output: Price table - insted of Price table How to? Thank you i advance. -- Venlig hilsen Kurt Hansen -- http://mail.python.org/mailman/listinfo/python-list

Re: how to detect the character encoding in a web page ?

2012-12-24 Thread Kurt Mueller
Am 24.12.2012 um 04:03 schrieb iMath: > but how to let python do it for you ? > such as these 2 pages > http://python.org/ > http://msdn.microsoft.com/en-us/library/bb802962(v=office.12).aspx > how to detect the character encoding in these 2 pages by python ? If you have the html code, let

Re: Donald E. Knuth in Python, cont'd

2012-04-11 Thread Kurt Mueller
f April 2012? Grüessli -- Kurt Müller, m...@problemlos.ch -- http://mail.python.org/mailman/listinfo/python-list

Re: Question About Command line arguments

2011-06-10 Thread Kurt Smith
On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips wrote: > How do I write my script so it picks up argument from the output of commands > that pipe input into my script? def main(): import sys print sys.stdin.read() if __name__ == '__main__': main() $ echo "fred" | python script.py fr

Re: How to use Python well?

2011-02-16 Thread Kurt Smith
On Wed, Feb 16, 2011 at 12:35 PM, snorble wrote: > I use Python a lot, but not well. I usually start by writing a small > script, no classes or modules. Then I add more content to the loops, > and repeat. It's a bit of a trial and error learning phase, making > sure I'm using the third party modul

Re: Trying to decide between PHP and Python

2011-01-06 Thread Kurt Smith
On Thu, Jan 6, 2011 at 3:32 PM, Alan Meyer wrote: > On 1/5/2011 11:40 AM, Tomasz Rola wrote: >> >> On Tue, 4 Jan 2011, Roy Smith wrote: >> >>> There.  Now that I've tossed some gasoline on the language wars fire, >>> I'll duck and run in the other direction :-) >> >> May I suggest a better strateg

Re: while True or while 1

2010-12-14 Thread Kurt Mueller
is true? Having said this he went out again to the Jews and said to them, I see no wrong in him." Today: We are so thankful that today we are free to define "True" ourselves using Python 2.x. Future: Be warned, the future gets darker! ;-) Grüessli -- Kurt Mueller -- http://mail.python.org/mailman/listinfo/python-list

Re: Glob in python which supports the ** wildcard

2010-11-22 Thread Kurt Mueller
Hi, Am 22.11.2010 um 23:05 schrieb Stefan Sonnenberg-Carstens: > Am 22.11.2010 22:43, schrieb Martin Lundberg: >> I want to be able to let the user enter paths like this: >> apps/name/**/*.js >> and then find all the matching files in apps/name and all its >> subdirectories. However I found out t

Re: Glob in python which supports the ** wildcard

2010-11-22 Thread Kurt Mueller
HI, Am 22.11.2010 um 23:05 schrieb Stefan Sonnenberg-Carstens: > Am 22.11.2010 22:43, schrieb Martin Lundberg; >> >> I want to be able to let the user enter paths like this: >> apps/name/**/*.js >> and then find all the matching files in apps/name and all its >> subdirectories. However I found o

Re: Need advice on starting a Python group

2010-03-12 Thread Kurt Smith
the time it would take to learn it when they already have something else working. Until something with value comes along (like your meeting with specific topics) to change their minds, an open-ended meeting won't appeal much to them. Just some thoughts, and an example of what's worked here. Personally I tend to make it to the meetings with a specific topic, and end up skipping the ones that are more open-ended. Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-18 Thread Kurt Smith
On Thu, Feb 18, 2010 at 10:46 PM, Steve Howell wrote: > On Feb 18, 2:49 pm, Jonathan Gardner > wrote: >> On Feb 18, 8:15 am, Steve Howell wrote: >> >> >> >> >     def print_numbers() >> >         [1, 2, 3, 4, 5, 6].map { |n| >> >             [n * n, n * n * n] >> >         }.reject { |square, cu

Re: Over(joy)riding

2010-02-17 Thread Kurt Smith
the straits module to remedy it -- you might be interested. He goes into detail here: http://www.artima.com/weblogs/viewpost.jsp?thread=246488 Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Using jython to call python procedures/methods

2010-01-20 Thread Kurt Smith
C (see the docs for the xmlrpclib module in the standard library) or SOAP (Google it). These would be better than rolling your own. Perhaps there's a more Pythonic solution though? Kurt > > I had toyed with the idea of having jython/java write the data to a > file/database and then

Re: An assessment of the Unicode standard

2009-09-01 Thread Kurt Mueller
Am 01.09.2009 um 09:39 schrieb Terry Reedy: But this same problem also extends into monies, nation states, units of measure, etc. There is, of course, an international system of measure. The US is the only major holdout. (I recall Burma, or somesuch, is another.) An interesting proposition

Re: Python/Fortran interoperability

2009-08-24 Thread Kurt Smith
#x27;s my blog summarizing the status of 'fwrap,' a Fortran wrapper utility for the C, Cython & Python languages. http://fortrancython.wordpress.com/ Linked there are my talk slides & presentation at last week's SciPy 2009 conference, which gives a good overview. Kurt -- http://mail.python.org/mailman/listinfo/python-list

Pulling arrays from database for plotting

2009-08-12 Thread Kurt Schwehr
Hi all, What's the best way to pull arrays from a database for plotting? Right now, this is what I do, but can it be done simpler / more efficiently? ipython -pylab import sqlite3 cx = sqlite3.connect('20080407.decimated.db3') a = array( [tuple(row) for row in cx.execute('SELECT cg_offset, delta_

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-22 Thread Kurt Smith
On Wed, Jul 22, 2009 at 2:48 AM, Bearophile wrote: > greg: >> Posting benchmark times for Pyrex or Cython is pretty >> meaningless without showing the exact code that was >> used, since times can vary enormously depending on >> how much you C-ify things. > > Was this link, shown by William, not eno

Re: Why not enforce four space indentations in version 3.x?

2009-07-10 Thread Kurt Smith
On Fri, Jul 10, 2009 at 2:22 PM, walterbyrd wrote: > I believe Guido himself has said that all indentions should be four > spaces - no tabs. > > Since backward compatibility is being thrown away anyway, why not > enforce the four space rule? > > At least that way, when I get python code from somebo

Re: A superclass using a child classes' methods

2009-06-24 Thread Kurt Schwehr
Jean-Michel, Thanks for the excellent response setting me straight. Now to figure out what dumb thing I did to make my code not work... -kurt On Jun 24, 12:23 pm, Jean-Michel Pichavant wrote: > Kurt Schwehr wrote: > > I'm trying to build an OO system for encoding and decoding &

A superclass using a child classes' methods

2009-06-24 Thread Kurt Schwehr
ll the data from the attribute? Thanks, -kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting Python code to C/C++

2009-06-23 Thread Kurt Smith
on... 2) Write the core functionality in C yourself, and then wrap those C functions in Cython. You'll want to take a look at the documentation: http://docs.cython.org/ and, more specifically on wrapping C code: http://docs.cython.org/docs/external_C_code.html I don't think you'll be able to avoid learning C, though. Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Tool for browsing python code

2009-06-17 Thread Kurt Smith
it works fine. Better than ctags/etags for python. Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: How to catch str exception?

2009-05-15 Thread Kurt Symanzik
ised which though deprecated but still a 3rd party library I use uses it. So how can I catch such exception without relying on catch all, which could be bad. system: Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Try this, i.e. catch the exact string:

Re: Why there is a parameter named "self" for classmethod function?

2009-05-06 Thread Kurt Symanzik
s such as: @classmethod def print_hello(cls): print "hello" But you might consider decorating the method as a static method instead since in your example you are not using the parameter at all. A static method would not require a parameter. @staticmethod def print_h

Re: string processing question

2009-05-01 Thread Kurt Mueller
Sion Arrowsmith wrote: > Kurt Mueller wrote: >> :> python -c 'print unicode("ä", "utf8")' >> ä >> :> python -c 'print unicode("ä", "utf8")' | cat >> Traceback (most recent call last): >> File "

Re: string processing question

2009-05-01 Thread Kurt Mueller
"ignore"): print a, len(a), type(a)' ä 2 ä 1 :> python -c 'for a in "ä", unicode("ä", "utf8", "ignore"): print a, len(a), type(a)' | cat Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 0: ordinal not in range(128) ä 2 :> How can I achieve that my python programs are unicode enabled: - Input strings can have different encodings (mostly ascii, latin_1 or utf8) - My python programs should always output "utf8". Is that a good idea?? TIA -- Kurt Müller, m...@problemlos.ch -- http://mail.python.org/mailman/listinfo/python-list

Re: string processing question

2009-05-01 Thread Kurt Mueller
program or to a file. Maybe we leave the other issue with the different centering for the moment. My goal is to have my python programs unicode enabled. TIA -- Kurt Mueller -- Kurt Müller, m...@problemlos.ch -- http://mail.python.org/mailman/listinfo/python-list

string processing question

2009-04-30 Thread Kurt Mueller
;ascii' codec can't encode character u'\xe4' in position 9: ordinal not in range(128) ä --ä-- > The behaviour changes if I pipe the output to another prog or to a file. and centering with the string a is not correct, but with string b. Could somebody please explain this to me? Thanks in advance -- Kurt Müller, m...@problemlos.ch -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory efficient tuple storage

2009-03-13 Thread Kurt Smith
ill pack the data into an array of C structs with the fields as indicated by the dtype parameter. Perhaps a database solution as mentioned in other posts would suit you better; if the temporary spike in memory usage is unacceptable you could try to roll your own loadtxt function that would be leaner and meaner. I suggest the numpy solution for its ease and efficient use of memory. Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory efficient tuple storage

2009-03-13 Thread Kurt Smith
On Fri, Mar 13, 2009 at 11:33 AM, Kurt Smith wrote: [snip OP] > > Assuming your data is in a plaintext file something like > 'genomedata.txt' below, the following will load it into a numpy array > with a customized dtype.  You can access the different fields by name > (

Re: Memory efficient tuple storage

2009-03-13 Thread Kurt Smith
x27;, 'position', 'dpoint'], 'formats': ['S100', np.int, np.float]}) return np.loadtxt(fname, delimiter=' ', dtype=dt) if __name__ == '__main__': arr = g2arr('genomedata.txt') print arr print arr['chromo'

Re: Indentations and future evolution of languages

2009-03-10 Thread Kurt Smith
..@work:~/tmp [366]$ python2.5 -tt mixed.py File "mixed.py", line 6 print a ^ TabError: inconsistent use of tabs and spaces in indentation Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Data Coding suggestions

2009-02-28 Thread Kurt Smith
ight take a look at the source code for the Gourmet Recipe Manager http://grecipe-manager.sourceforge.net/ It's written in python, has a persistent database (not sure if using sqlite3) and you might be able to adapt it to your needs. We use it for our shopping lists here and it's great. Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: can multi-core improve single funciton?

2009-02-20 Thread Kurt Smith
ng > original enough that nobody has written a library to handle > large chunks of it. > > And on the grasping hand, I find that most of us vastly > overestimate the originality of what we're doing. +1 The Mote in God's Eye / The Gripping Hand reference! Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression bug?

2009-02-19 Thread Kurt Smith
es not say that zero-length matches won't work. I can work around the problem thusly: re.sub(r'(?<=[a-z])(?=[A-Z])', '_', 'fooBarBaz').split('_') Which is ugly. I reckon you can use re.findall with a pattern that matches the components and not the boundaries, but you have to take care of the beginning and end as special cases. Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: number theory libraries / project euler

2009-02-18 Thread Kurt Smith
17119/ You can find some combinatorics in numpy, I believe. Often the solutions are one-to-five liners, if you've thought the problem through. Too much dependence on external libraries robs the project euler problems of their fun, IMO. Best, Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Fortran array in python (f2py?)...

2009-02-14 Thread Kurt Smith
u like I'd be happy to send you the code. Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb and MySQL stored functions

2009-02-03 Thread kurt . forrester . fec
On Feb 3, 8:28 am, Dennis Lee Bieber wrote: > On Mon, 2 Feb 2009 23:28:05 -0800 (PST), > kurt.forrester@googlemail.com declaimed the following in > comp.lang.python: > > > However, when I try to use the MySQLdb module it returns an incorrect > > value (it returns 1). > > > I wish to use the DB

MySQLdb and MySQL stored functions

2009-02-02 Thread kurt . forrester . fec
ver, when I try to use the MySQLdb module it returns an incorrect value (it returns 1). I wish to use the DB API 2.0 compliant module for flexibility. Therefore I am trying to work out why the MySQLdb does not return the value as expected (that is as it is returned by the Query Browser). Any

MySQLdb and MySQL stored functions

2009-02-02 Thread Kurt Forrester
xibility. Therefore I am trying to work out why the MySQLdb does not return the value as expected (that is as it is returned by the Query Browser). Any help would be greatly appreciated. Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Minor Typo in doc

2008-12-19 Thread Kurt Mueller
Steve Holden schrieb: > Kurt Mueller wrote: >> Hi >> There is a minor typo in the new doc in: >> http://www.python.org/doc/2.6/library/signal.html >> -- >> signal.SIG_DFL¶ >> This is one of two

Minor Typo in doc

2008-12-18 Thread Kurt Mueller
://bugs.python.org? Grüessli -- Kurt Müller, m...@problemlos.ch -- http://mail.python.org/mailman/listinfo/python-list

Re: getting object instead of string from dir()

2008-12-17 Thread Kurt Smith
In [7]: import numpy as np In [8]: aa = np.zeros(100) In [9]: whos Variable Type Data/Info --- a strfoo aa ndarray100: 100 elems, type `float64`, 800 bytes b strbar c float 5.234 d module np module ages/numpy/__init__.pyc'> os module And I trust you've heard of numpy, scipy and matplotlib? http://www.scipy.org/ http://matplotlib.sourceforge.net/ http://numpy.scipy.org/ Cheers, Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: "xxx.has_key(a)" vs "a in xxx"

2008-10-30 Thread Kurt Smith
On Thu, Oct 30, 2008 at 9:37 AM, Łukasz Ligowski <[EMAIL PROTECTED]>wrote: > Hi, > > There is small inconsistency (or I don't understand it right) between > python > 2.5 docs and python 2.6 docs. > > 2.5 docs say that: > "a.has_key(k) Equivalent to k in a, use that form in new code" Meaning: do

Re: unicode .replace not working - why?

2008-10-18 Thread Kurt Peters
Thanks, The "distraction" was my problem. I replaced the textu.replace as you suggested and it works fine. Kurt On Sun, 12 Oct 2008 19:53:09 -0700, Mark Tolonen wrote: > In your original code: > >textu.replace(unichr(167),'\n') > > as Dennis suggeste

Re: 'Hidden Features of Python'

2008-10-17 Thread Kurt Smith
s you miss the point -- read the Zen, and apply its principles to the "this" module. I think they managed to break pretty much all of them, probably to illustrate a point, all in good fun. Tim Peters rocks! For more fun with the Zen, see this thread: http://mail.python.org/pipermail/python-bugs-list/2008-July/055857.html Best, Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode .replace not working - why?

2008-10-12 Thread Kurt Peters
t posts attempting to shed some light on the subject. Regards, Kurt "John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Oct 12, 7:05 am, Kurt Peters <[EMAIL PROTECTED]> wrote: > I'm using the code below to read a pdf document, and it has no

Re: unicode .replace not working - why?

2008-10-12 Thread Kurt Peters
Thanks... On a side note, do you really think the function call wouldn't interpret the unichr before the function call? Kurt "Peter Otten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Kurt Peters wrote: > >> I had done that about 21 revi

Re: unicode .replace not working - why?

2008-10-11 Thread Kurt Peters
I had done that about 21 revisions ago. Nevertheless, why would you think that would work, when the code as shown doesn't? kurt "Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, 11 Oct 2008 15:05:43 -0500, Kurt Peters > <[E

unicode .replace not working - why?

2008-10-11 Thread Kurt Peters
Unfortunately, the replace isn't working, does anyone know what I'm doing wrong? I tried a number of things so I left comments in place as a subset of the bunch of things I tried to no avail. Any help? Kurt #!/usr/bin/python # -*- coding: utf-8 -+- from pyPdf import PdfFi

Re: HARD REAL TIME PYTHON

2008-10-07 Thread Kurt Mueller
point out, that the terms SPEED and REAL-TIME and HARD-REAL-TIME should not be misused or misunderstood. Read: http://en.wikipedia.org/wiki/Real-time Grüessli -- Kurt Müller, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: HARD REAL TIME PYTHON

2008-10-07 Thread Kurt Mueller
Am 07.10.2008 um 11:44 schrieb Diez B. Roggisch: Kurt Mueller wrote: David, As others mentioned before, python is not the right tool for "HARD REAL TIME". But: Maybe you can isolate the part of your application that needs "HARD REAL TIME". Then implement this p

Re: HARD REAL TIME PYTHON

2008-10-07 Thread Kurt Mueller
("SPEED") - If one fails, this is catastrophic for the application ("HARD") - Deliver an response to an interrupt within 5-10[ms]("REAL TIME") see http://en.wikipedia.org/wiki/Real-time Grüessli -- Kurt Müller, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Read and write binary data

2008-09-08 Thread Kurt Smith
eading and writing binary data, even fortran records. And last but not least, you can always take a look at the scipy and numpy mailing lists. Good luck, Kurt > how to control read and write binary data, like > 'formatted','stream','big-endian','little

Re: Getting pid of a remote process

2008-08-19 Thread Kurt Mueller
#x27; | grep PID PID=30596 :~> see: man bash -> Special Parameters Grüessli -- Kurt Müller, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Histogram of floating point values.

2008-07-25 Thread Kurt Smith
8,0.97,0.93,0.92,0.92,0.83,0.66,0.50,0.50] input_hist=array(data) pylab.hist(input_hist) pylab.show() The last line will display the actual histogram. See the difference pylab.show and pylab.ion functions. In the future, it is advisable to post these questions to the matplotlib or the numpy/scipy us

Re: String split with " and/or ' and/or \

2008-06-24 Thread Kurt Mueller
Peter Otten schrieb: Kurt Mueller wrote: How to (super)split a string (literal) containing " and/or ' and/or \. example: ' a " b b " c\ c '.supersplit(' ') -> ['a', ' b b ', 'c c'] import shlex shlex.split(

String split with " and/or ' and/or \

2008-06-24 Thread Kurt Mueller
How to (super)split a string (literal) containing " and/or ' and/or \. example: ' a " b b " c\ c '.supersplit(' ') -> ['a', ' b b ', 'c c'] Thanks and Grüessli -- Kurt Müller: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Books for learning how to write "big" programs

2008-05-22 Thread Kurt Smith
Better yet, find out what pitfalls they found and avoided (or fell into). Compare their approach & organization with another competing project. This is the wonder of open source software -- you have access to everything, and can learn from all the expertise the developers put into their opus.

Re: subprocess.popen function with quotes

2008-03-25 Thread Kurt Smith
second example, not a triple single quote. Incidentally, a triple quoted string will work as well. Moral from this example: when passing arguments that would normally be quoted to be safe from the shell's expansion, etc, don't. Just pass it using Popen(['cmd', 'arg-that-would-normally-be-quoted']) and it will be passed directly to the function without the shell's intervention. Since the argument is passed directly to the command (rename in your case, grep in this one) quoting to preserve special characters isn't needed, and the quotes will be passed as part of the argument, giving the null results you got above. Kurt -- http://mail.python.org/mailman/listinfo/python-list

New subclass vs option in __init__

2007-12-06 Thread Kurt Smith
ings, should one usually err on the side of a new subclass? Is option b) just being lazy? Is a) too verbose in many situations? Kurt -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-15 Thread Kurt Smith
On 10/15/07, Gary Herron <[EMAIL PROTECTED]> wrote: > Dmitri O.Kondratiev wrote: > > Gary, thanks for lots of info! > > Python strings are not lists! I got it now. That's a pity, I need two > > different functions: one to reverse a list and one to reverse a string: > True, they are not both lists,

Re: What does the syntax [::-1] really mean?

2007-10-04 Thread Kurt Smith
:-1] == obj[slice(None,None,-1)] >>> 'abc'[::-1] 'cba' >>> 'abc'[None:None:-1] 'cba' >>> 'abc'[slice(None,None,-1)] 'cba' Taking a look at the slice class: | indices(...) | S.indices(len) ->

Re: How to assign a function to another function

2007-09-17 Thread Kurt Smith
ot; ...: ...: In [3]: def assigner(): ...: global foo ...: foo = bar ...: ...: In [4]: assigner() In [5]: foo() called bar Kurt -- http://mail.python.org/mailman/listinfo/python-list

Final SF Python Patch/Bug Summary

2007-08-23 Thread Kurt B. Kaiser
New / Reopened Patches __ minidom pretty xml output improvement (2007-08-19) http://python.org/sf/1777134 opened by Teajay removeTest() method patch for unittest.TestSuite (2007-08-21) http://python.org/sf/1778410 opened by Mark Edgington robotparser.py fi

Weekly Python Patch/Bug Summary

2007-08-18 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 417 open (+13) / 3855 closed ( +0) / 4272 total (+13) Bugs: 1069 open ( +4) / 6800 closed (+10) / 7869 total (+14) RFE : 262 open ( -1) / 296 closed ( +1) / 558 total ( +0) New / Reopened Patches __ Replacing

  1   2   3   >