Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Hughlander
May 11, 2005

nbv4 posted:

Does anybody know of a RSS feed or something one can subscribe to thats comprehensive on all the goings on of the python community? Apparently there was a loving pycon 20 minutes from where I live a few days ago but I missed it because I had no idea it was going on.

http://planet.python.org/rss20.xml ?

Adbot
ADBOT LOVES YOU

ATLbeer
Sep 26, 2004
Über nerd
So... this may be getting into coding horror territory but, I'm fiddling around with the idea of streaming MP3's over HTTP. Not hard but, I need the ability to seek to portions of MP3 via a query parameter.

I'm doing some basic experiments with a very simple WSGI application and am having problems with getting more than 5 or so concurrent streams.

Here's the basic WSGI HTTP server
code:
from gevent import wsgi
from wapp import application
wsgi.WSGIServer(('', 8088), application, spawn=None).serve_forever()
And here's where the possible coding horror starts
code:
def application(environ, start_response):
    status = '200 OK'
    chunk_size = 512
    response_headers = [
                        ('Content-type', 'audio/mpeg'),
                        ]
    start_response(status, response_headers)
    fh = open('/dev/shm/big.mp3')
    fh.seek(1000000)
    while True:
        data = fh.read(chunk_size)
        if not data:
            break
        else:
            yield data
This seems like the simplest way to do this but, it's just flailing after 5 or so connections.

ATLbeer fucked around with this message at 13:05 on Aug 3, 2010

Lurchington
Jan 2, 2003

Forums Dragoon

that's the one I used, and you just need to remember it's an aggregator of a lot of personally-run blogs so there's a fair amount of whitenoise.

b0lt posted:

It might be helpful to brush up on itertools/functools, they're pretty handy and will make your whiteboard examples more impressive.

An excellent idea. I've used itertools in the past, but not functools.

edit:
multiprocessing on windows experts, is printing a string not atomic?

I copy+pasted the second example from PyMOTW and was surprised at this kind of output:

code:
Creating 4 consumers
CConsumer-1: 0 * 0onsumer-3: 2 * 2

Consumer-4: 1 * 1
Consumer-2: 3 * 3
Consumer-1: 4 * 4C
onsumer-3: 5 * 5
Result: 0 * 0 = 0
Result: 2C * 2 = 4onsumer-4: 6 * 6

Result: 1 * 1 = 1
CRonsumer-2: 7 * 7esult:
 3 * 3 = 9
CCRonsumer-3: 8 * 8onsumer-1: 9 * 9esult:

 4 * 4 = 16
Result: 5 * 5 = 25C
onsumer-4: ExitingResult: 6 * 6 = 36

CRonsumer-2: Exiting
esult: 7 * 7 = 49
Consumer-1: ExitingResult:C
 8onsumer-3: Exiting * 8 = 64

Result: 9 * 9 = 81
re-running this on Windows Vista (2 processors) will result in slightly different but still garbled output each time. My home Macbook Pro will not get garbled output and I'm wondering if this is a side effect of the magic necessary to get multiprocessing on windows?

Lurchington fucked around with this message at 15:20 on Aug 3, 2010

Sneftel
Jan 28, 2009

Lurchington posted:

I'm wondering if this is a side effect of the magic necessary to get multiprocessing on windows?
Yes. The manner in which multiprocessing funnels all output to the same place is OS-dependent; the short answer is, if you're going to do output from multiple processes, grab a lock first.

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

Sneftel posted:

Yes. The manner in which multiprocessing funnels all output to the same place is OS-dependent; the short answer is, if you're going to do output from multiple processes, grab a lock first.

Or use the built in logging module support

nbv4
Aug 21, 2002

by Duchess Gummybuns
code:
In [1]: from tsclient.AsciiDammit import asciiDammit

In [2]: asciiDammit(u"Ænima")
tsclient/AsciiDammit.py:173: UnicodeWarning: Unicode equal comparison failed to convert both
arguments to Unicode - interpreting them as being unequal
  a = CHARS.get(g,g)
Out[2]: u'\xc3\x86nima'

In [3]: asciiDammit("Ænima")
Out[3]: 'A+nima'

In [4]: "Ænima"
Out[4]: '\xc3\x86nima'

In [5]: asciiDammit('\xc3\x86nima')
Out[5]: 'A+nima'

In [6]: asciiDammit(u'\xc3\x86nima')
Out[6]: u'\xc3\x86nima'

In [7]: "Ænima".decode('utf-8')
Out[7]: u'\xc6nima'

In [8]: asciiDammit(u'\xc6nima')
Out[8]: u'\xc6nima'

In [9]: asciiDammit('\xc6nima')
Out[9]: 'AEnima'

asciiDammit is a function that turns funky characters such as the 'Æ' character into the two character ascii equivalent "AE". This asciiDammit function only works when it gets a plain string such as '\xc6nima'. How do I go from "Ænima" to '\xc6nima'? I've tried all sorts of combinations of unicode(), str(), .decode('utf-8'), .encode('utf-8'), .decode('ascii'), .encode('ascii'), but nothing works.

edit: the value I'm starting with looks like this:

code:
>>> print value, repr(value)
Ænima u'\xc6nima'

nbv4 fucked around with this message at 21:16 on Aug 3, 2010

tef
May 30, 2004

-> some l-system crap ->
Welp; I can't remember off hand but it had something to do with the unicodedata encoding. But what I was thinking only worked for accents. Whoops

tef fucked around with this message at 23:24 on Aug 3, 2010

deimos
Nov 30, 2006

Forget it man this bat is whack, it's got poobrain!

nbv4 posted:

asciiDammit is a function that turns funky characters such as the 'Æ' character into the two character ascii equivalent "AE". This asciiDammit function only works when it gets a plain string such as '\xc6nima'. How do I go from "Ænima" to '\xc6nima'? I've tried all sorts of combinations of unicode(), str(), .decode('utf-8'), .encode('utf-8'), .decode('ascii'), .encode('ascii'), but nothing works.

edit: the value I'm starting with looks like this:

code:
>>> print value, repr(value)
Ænima u'\xc6nima'

'\xc6' for Æ is a latin-1 encoding, not utf-8 (utf-8 is u'\xc6' or '\xc3\x86').

code:
>>> print value.encode('utf-8'), repr(value)
Ænima u'\xc6nima'
>>> value.encode('latin-1')
'\xc6nima'
It's part of the stupid stupid extended Ascii, your method is expecting the single character on a single byte, when unicode dictates c386 for the character. Your method is expecting latin-1 input, the correct UTF-8 is '\xc3\x86nima'.

For future reference: http://www.fileformat.info/info/unicode/char/00c6/index.htm this site has prevented many an encoding migraine (of special note is the "More..." link below encodings.

deimos fucked around with this message at 00:24 on Aug 4, 2010

Hughmoris
Apr 21, 2007
Let's go to the abyss!
Disclaimer: I'm teaching myself Python as a hobby, not in a class.

I'm trying to write a very simple program to track my expenses. Right now I have it setup where it will ask for how much money was spent, and the type of expense. It will then write that information to a text file. There is a TAB separating the amount and the type. The format is as follows:

code:
$10     food
$20     auto
$5      misc
That part is working fine. Now I want to add a function that will add up the expenses in the text file and give me a total. My problem is that I don't know how to get the money spent from each line then jump to the next line, ignoring the formatting and type of expense. My book is a bit sparse on the subject. Could someone point me in the right direction?

Hughmoris fucked around with this message at 23:29 on Aug 4, 2010

wins32767
Mar 16, 2007

Try reading in the whole file then operating on the information contained in it.

You can do it your way by doing a combination of read() and seek() on your open file handle, but why bother for a small file?

deimos
Nov 30, 2006

Forget it man this bat is whack, it's got poobrain!

Hughmoris posted:

Disclaimer: I'm teaching myself Python as a hobby, not in a class.

I'm trying to write a very simple program to track my expenses. Right now I have it setup where it will ask for how much money was spent, and the type of expense. It will then write that information to a text file. There is a TAB separating the amount and the type. The format is as follows:

code:
$10     food
$20     auto
$5      misc
That part is working fine. Now I want to add a function that will add up the expenses in the text file and give me a total. My problem is that I don't know how to get the money spent from each line then jump to the next line, ignoring the formatting and type of expense. My book is a bit sparse on the subject. Could someone point me in the right direction?

Read up on readline() and split()

Hughlander
May 11, 2005

So I'm working with IronPython and Windows Forms, and trying to get the simplest possible form to work:

code:
from clr import AddReference, accepts, returns, Self
AddReference("System.Windows.Forms")
AddReference("System.Drawing")

import System
from System.Windows.Forms import *
from System.ComponentModel import *
from System.Drawing import *

class DCCForms: # namespace
    
    class Form1(System.Windows.Forms.Form):
        def __init__(self):
            self.InitializeComponent()
            
        @returns(None)
        def InitializeComponent(self):           
            self.Name = 'Form1'
            self.Text = 'DCC'
            self.Load += self._Form1_Load
            self._groupBox1.ResumeLayout(False)
            self._groupBox1.PerformLayout()
            self.ResumeLayout(False)
            self.PerformLayout()
        
        @accepts(Self(), System.Object, System.EventArgs)
        @returns(None)
        def _Form1_Load(self, sender, e):
            pass
        
class WindowsApplication10: # namespace   
    @staticmethod
    def RealEntryPoint():
        Application.EnableVisualStyles()
        Application.Run(DCCForms.Form1())

WindowsApplication10.RealEntryPoint();
It errors out on the self.Load 'TypeError: Object is not callable.'

I'm running IronPython 2.6.1, but the form code was originally generated for 1.1.2(?) with some slight fixups, the same error occurs if I set a 'TextChanged' handler for a text widget. Without the += the form displays but obviously the load/textchanged functions aren't invoked.

Any one know what I'm doing wrong? Further, anyone know what the best resource for IronPython questions are? My google-fu feels really weak to me.

Hughmoris
Apr 21, 2007
Let's go to the abyss!

deimos posted:

Read up on readline() and split()

Thank you, after reading up on those I was able to fumble something together. It ain't pretty but it works.

Lurchington
Jan 2, 2003

Forums Dragoon

Sneftel posted:

Yes. The manner in which multiprocessing funnels all output to the same place is OS-dependent; the short answer is, if you're going to do output from multiple processes, grab a lock first.

m0nk3yz posted:

Or use the built in logging module support

Thanks both of you*. This will be good for actual implementations I end up doing. I was mostly surprised that the lack of a "gotcha" on PyMOTW and the lack of a specific answer on google searches.

*m0nk3yz: I finally got around to seeing your PyCon 09 intro to multiprocessing talk, and I thought it was great :)

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

Lurchington posted:

Thanks both of you*. This will be good for actual implementations I end up doing. I was mostly surprised that the lack of a "gotcha" on PyMOTW and the lack of a specific answer on google searches.

*m0nk3yz: I finally got around to seeing your PyCon 09 intro to multiprocessing talk, and I thought it was great :)

Thanks! I should do a follow up talk next pycon - sadly though, my own usage of multiprocessing in the past year is really low, as I'm working on single-core, lower memory boxes. I do use a lot of threads though.

Captain Capacitor
Jan 21, 2008

The code you say?
Why must you hate me, pyparsing? You look so shiny and wonderful, but refuse to do as you're told.

k-selectride
May 24, 2004
belgian waffle
I wanted to ask for some advice on a function I have in my program.

code:
def deltaU(k, l):
	if k == 9:
		if l == 9:
			Ediff =  (-1)*( s[k, l]*(s[0, l] + s[k, 0] + s[k - 1, l] + s[k, l - 1]) ) 
                                                - ( s[k, l]*(s[0, l] + s[k, 0] + s[k - 1, l] + s[k, l - 1]) )
		else:
			Ediff =  (-1)*( s[k, l]*(s[0, l] + s[k, l + 1] + s[k - 1, l] + s[k, l - 1]) ) 
                                               - ( s[k, l]*(s[0, l] + s[k, l + 1] + s[k - 1, l] + s[k, l - 1]) )	
	elif l == 9:
		Ediff =  (-1)*( s[k, l]*(s[k + 1, l] + s[k, 0] + s[k - 1, l] + s[k, l - 1]) ) 
                                       - ( s[k, l]*(s[k + 1, l] + s[k, 0] + s[k - 1, l] + s[k, l - 1]) )
	else:
		Ediff =  (-1)*( s[k, l]*(s[k + 1, l] + s[k, l + 1] + s[k - 1, l] + s[k, l - 1]) ) 
                                       - ( s[k, l]*(s[k + 1, l] + s[k, l + 1] + s[k - 1, l] + s[k, l - 1]) ) 
	return Ediff

The idea of the function is to take two integers as input. I have a two dimensional n*n Numpy array that is randomly populated with ones and negative ones. The two integers are read in as coordinates in the array and the values of the cells directly top, left, right, bottom of inputted coordinate are summed, then multiplied with the inputted coordinate. I take that value, i'll call it sum, and compute Ediff = -sum - sum, basically. Now, this works just fine for any value of n up until n-1, so if n=10 and one of my coordinates is 9 I want to be able to wrap around the other end of the array. I was able to do that, but my solution feels clunky, so I'm wondering if there's a more python way to do that.

editted for table breaking

k-selectride fucked around with this message at 22:55 on Aug 6, 2010

tripwire
Nov 19, 2004

        ghost flow
Cool, you figured out how to write C in python

tripwire
Nov 19, 2004

        ghost flow
Use slices, theyre one of the nicest features of numpy.

code:
>>> import numpy
>>> grid = numpy.arange( (10*10),dtype=numpy.int)
>>> grid = grid.reshape(10,10)
>>> grid
array([[ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9],
       [10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
       [20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
       [30, 31, 32, 33, 34, 35, 36, 37, 38, 39],
       [40, 41, 42, 43, 44, 45, 46, 47, 48, 49],
       [50, 51, 52, 53, 54, 55, 56, 57, 58, 59],
       [60, 61, 62, 63, 64, 65, 66, 67, 68, 69],
       [70, 71, 72, 73, 74, 75, 76, 77, 78, 79],
       [80, 81, 82, 83, 84, 85, 86, 87, 88, 89],
       [90, 91, 92, 93, 94, 95, 96, 97, 98, 99]])

>>> x,y = 6,3
>>> grid[y,x]
36
>>> grid[ max(y-1,0) : y+2,
...       max(x-1,0) : x+2 ]
array([[25, 26, 27],
       [35, 36, 37],
       [45, 46, 47]])

>>> sum( grid[ max(y-1,0) : y+2,
...            max(x-1,0) : x+2 ].flatten()            )
324
Edit: Whoops, forgot that slicing from negative to positive will give you nothing. Best to clamp the value of x and y to zero at the lowest if youre using slices.

tripwire fucked around with this message at 23:19 on Aug 6, 2010

k-selectride
May 24, 2004
belgian waffle

tripwire posted:

Use slices, theyre one of the nicest features of numpy.

code:
>>> import numpy
>>> grid = numpy.arange( (10*10),dtype=numpy.int)
>>> grid = grid.reshape(10,10)
>>> grid
array([[ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9],
       [10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
       [20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
       [30, 31, 32, 33, 34, 35, 36, 37, 38, 39],
       [40, 41, 42, 43, 44, 45, 46, 47, 48, 49],
       [50, 51, 52, 53, 54, 55, 56, 57, 58, 59],
       [60, 61, 62, 63, 64, 65, 66, 67, 68, 69],
       [70, 71, 72, 73, 74, 75, 76, 77, 78, 79],
       [80, 81, 82, 83, 84, 85, 86, 87, 88, 89],
       [90, 91, 92, 93, 94, 95, 96, 97, 98, 99]])

>>> x,y = 6,3
>>> grid[y,x]
36
>>> grid[ max(y-1,0) : y+2,
...       max(x-1,0) : x+2 ]
array([[25, 26, 27],
       [35, 36, 37],
       [45, 46, 47]])

>>> sum( grid[ max(y-1,0) : y+2,
...            max(x-1,0) : x+2 ].flatten()            )
324
Edit: Whoops, forgot that slicing from negative to positive will give you nothing. Best to clamp the value of x and y to zero at the lowest if youre using slices.

This is very nice, thanks :)

nbv4
Aug 21, 2002

by Duchess Gummybuns
I'm writing a desktop gui program in python and I need to make an installer for windows users. Asking windows users to install python and then setuptools, and then extract a zip file, navigate there on the commandline and then type in "python setup.py install" is asking too much. I need to make it a one single exe that will install python (if not already installed), wxpython (and a few others), etc. all in one process. Is this possible, if so, where should I start?

The Journey Fraternity
Nov 25, 2003



I found this on the ground!

nbv4 posted:

I'm writing a desktop gui program in python and I need to make an installer for windows users. Asking windows users to install python and then setuptools, and then extract a zip file, navigate there on the commandline and then type in "python setup.py install" is asking too much. I need to make it a one single exe that will install python (if not already installed), wxpython (and a few others), etc. all in one process. Is this possible, if so, where should I start?

Might py2exe fit the bill?

nbv4
Aug 21, 2002

by Duchess Gummybuns

The Journey Fraternity posted:

Might py2exe fit the bill?

I looked into that, but it seems to be just for simple one-file scripts. I'm looking for a big installer that will install a bunch of dependencies.

BeefofAges
Jun 5, 2004

Cry 'Havoc!', and let slip the cows of war.

nbv4 posted:

I looked into that, but it seems to be just for simple one-file scripts. I'm looking for a big installer that will install a bunch of dependencies.

I've had some success with py2exe for programs that use several third party modules. You should give it a try, at least. When it does work, there's no installation necessary - your users just launch the exe. It won't work if you're doing any tricky stuff like importing modules in exec statements, though.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

nbv4 posted:

I looked into that, but it seems to be just for simple one-file scripts. I'm looking for a big installer that will install a bunch of dependencies.

I've used py2exe for a script with something like 10 dependencies or something.

inveratulo
May 14, 2002
wat
We have an automated job that is creating hot backups of a couple dozen SVN repositories and storing them with revision numbers as a tar.gz. The files end up looking something like one of these: reponame-qa-567-608.tar.gz, testrepo-670.tar.gz, or somerepo-34-434.tar.gz

I wrote the following section of code as part of a recovery operation, that will take the filenames, strip the revisions, and move the directories so that the above repos would end up like: reponame-qa, testrepo, and somerepo

code:
#!/usr/bin/python
import os,sys,re
for line in os.popen('ls').readlines():
  tmpArray = []
  for word in line.split('-'):
    if re.compile('\D').match(word) != None: tmpArray.append(word)
  os.popen("mv -f "+line.strip()+" "+'-'.join(tmpArray))
At this point the labor is done, so I'm happy with it; but I would be interested to know if there is a more efficient solution, as sort of a thought exercise. I figured it was possible to iterate over the filenames and quit when the first number was hit, but the above solution was the quickest way I knew how to do it. Can anyone do it better?

spankweasel
Jan 4, 2006

From my experience, regex is pretty slow. Also, you're compiling the regex every time through the loop.

# precompile the regex
entry_re = re.compile("\D")

<...>
if entry_re.match(word) is not None: tmpArray.append(word)
<...>

You could also move to using the built-in calls in the os module to get around using popen (which has to go through the overhead of making fork() system calls):

i.e.

os.popen("ls") becomes os.listdir(".")
os.popen("mv -f") becomes os.rename(src, dst)

Moving away from popen and compiling the regex should increase the speed by a considerable margin (if you're operating on a large number of files). If this is just a dozen files or so, it won't matter too much, however.

Lurchington
Jan 2, 2003

Forums Dragoon
os.walk is the go-to for this kind of thing. That and shutil.move are both preferred to popping open your own terminal processes. The glob module is good if you don't need multiple levels and will always be looking for *.tar.gz

edit: well, looks like I'm second, and with some different resources. Spankweasel's suggestions are fine, but when you said "more efficient" I didn't necessarily take that as in minimizing runtime speed. I assumed you meant quickest in terms of writing something readable and that did the job.

edit2, here's what I'd do:

code:
import os
import re
import shutil

regex = re.compile(r"([\w\-]+)-\d+.*\.tar\.gz")

for root, dirs, files in os.walk(your_svn_directory):
    for file in files:
        match = regex.match(file)
        if match is not None:
            shutil.move(file, os.path.join(your_new_destination, match.group(1))

Lurchington fucked around with this message at 15:40 on Aug 9, 2010

Threep
Apr 1, 2006

It's kind of a long story.

inveratulo posted:

Can anyone do it better?
Here's a horrible list comprehension:

code:
import os
import re
import shutil

[shutil.move(src, m.group(1)) for src, m in [(src, re.match('(\D+)-', src)) for src in os.listdir('.')] if m]
or more readable:
code:
for src, m in [(src, re.match('(\D+)-', src)) for src in os.listdir('.')]:
    if m:
        shutil.move(src, m.group(1))
You don't really need to compile regexes for efficiency as they're automatically cached.

Threep fucked around with this message at 15:45 on Aug 9, 2010

inveratulo
May 14, 2002
wat
Goddamn guys thanks a ton! My attempt was truly infantile.

king_kilr
May 25, 2007
The glob module may be of use.

ATLbeer
Sep 26, 2004
Über nerd

king_kilr posted:

The glob module may be of use.

FUUUUUUU.. I just wrote a script that had to go slosh a 700,000 file directory system that was about 10 layers deep at some points and do some patch work and clean up some bugs.

The standard library is too drat good. I have so many square wheels that I have reinvented and then learned there was a stdlib that did just that.

KuruMonkey
Jul 23, 2004
I'm learning python (day 4!) and mostly its going well. I'm coming from PHP, and my transition project is to recreate my gallery web site I run on my HTPC in Python. (cherrypy)

Looking like about 3 days to re-implement something I originally wrote in an evening :)

Anyway:
Any thoughts on which image manipulation library is the one to go for if you, say, wanted to get to grips with just one rather than spend time learning 3 or 4 and then picking? Is there a best library? Any dogs to definitely avoid?

m0nk3yz
Mar 13, 2002

Behold the power of cheese!

KuruMonkey posted:

I'm learning python (day 4!) and mostly its going well. I'm coming from PHP, and my transition project is to recreate my gallery web site I run on my HTPC in Python. (cherrypy)

Looking like about 3 days to re-implement something I originally wrote in an evening :)

Anyway:
Any thoughts on which image manipulation library is the one to go for if you, say, wanted to get to grips with just one rather than spend time learning 3 or 4 and then picking? Is there a best library? Any dogs to definitely avoid?

PIL

tripwire
Nov 19, 2004

        ghost flow
A word of caution: if you are at all interested in manipulating/encoding animated gifs, PIL is going to be a pain in the rear end.

KuruMonkey
Jul 23, 2004

m0nk3yz posted:

PIL

Thanks; I would have probably started with one of the GD wrappers (what I use in PHP) and PIL looks pretty similar to the wrapper I ended up making for GD2 in PHP.

Got my thumbnailer re-done in a little under an hour - including installing PIL and having to read the docs for every step of the process, that's pretty sweet :)

tripwire posted:

A word of caution: if you are at all interested in manipulating/encoding animated gifs, PIL is going to be a pain in the rear end.

Also thanks; that's the kind of info I was hoping for. I'm not going to immediately look at gifs - if I were, is there a library that's particularly better for that?

crip drinkn milk
Jan 31, 2001

IS DOG VEGABLE?
I have a need to validate quickly if an input field actually contains english text rather than "DErrrrrrrp" for users overriding a setting that usually shouldn't be messed with. Anyone have experience?

I'm running on hundreds of machines win32/win64/linux/macosx so something contained would be fantastic.

Lurchington
Jan 2, 2003

Forums Dragoon
I'm reading this as checking that a field contains a valid English word.

and if so, I found (googling for python validate input as english language):

MacOSX: http://www.mail-archive.com/python-list@python.org/msg287570.html
Linux (and also mac apparently): leveraging the words file
Windows came up dry so far, but maybe you could confirm what exactly you wanted

here's another link that looked promising on a cursory glance: http://code.activestate.com/recipes/117221-spell-checking/#c4

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Any english word at all? Not some list of specifc words like ['yes', 'no'] or I dunno ['development', 'staging', 'production']?

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

crip drinkn milk posted:

I have a need to validate quickly if an input field actually contains english text rather than "DErrrrrrrp" for users overriding a setting that usually shouldn't be messed with. Anyone have experience?

I'm running on hundreds of machines win32/win64/linux/macosx so something contained would be fantastic.


get them to type the change in twice :3:

  • Locked thread