Embedding python and multiple separate scripts

2006-04-14 Thread Stefan D
Hi, I'm trying to embed python into an chat bot I've made in c++. After googling around and reading docs for almost a day I have a few questions. First of all it seems like the best way to be able to run separate scripts in different, isolated environments is to create a sub-interpreter (by us

Mechanize/ClientForm - How to select IgnoreControl button and submit form

2009-12-23 Thread Brian D
All, I'm hoping to implement a project that will be historically transformational by mapping inequalities in property assessments. I'm stuck at step one: Scrape data from http://www.opboa.org. The site uses a bunch of hidden controls. I can't find a way to get past the initial disclaimer page be

ORM's are evil. Was: Mechanize/ClientForm - How to select IgnoreControl button and submit form

2009-12-24 Thread Brian D
Just kidding. That was a fascinating discussion. Now I'd like to see if anyone would rather procrastinate than finish last-minute shopping. This problem remains untouched. Anyone want to give it a try? Please? I'm hoping to implement a project that will be historically transformational by mappin

Re: ORM's are evil. Was: Mechanize/ClientForm - How to select IgnoreControl button and submit form

2009-12-24 Thread Brian D
On Dec 24, 8:20 am, Brian D wrote: > Just kidding. That was a fascinating discussion. > > Now I'd like to see if anyone would rather procrastinate than finish > last-minute shopping. > > This problem remains untouched. Anyone want to give it a try? Please? > > I&#x

Re: Mechanize/ClientForm - How to select IgnoreControl button and submit form

2009-12-24 Thread Brian D
On Dec 23, 8:33 am, Brian D wrote: > All, > > I'm hoping to implement a project that will be historically > transformational by mapping inequalities in property assessments. > > I'm stuck at step one: Scrape data fromhttp://www.opboa.org. > > The site uses a bunc

Mechanize - Click a table row to navigate to detail page

2009-12-24 Thread Brian D
A search form returns a list of records embedded in a table. The user has to click on a table row to call a Javascript call that opens up the detail page. It's the detail page, of course, that really contains the useful information. How can I use Mechanize to click a row? Any ideas? -- http:/

Re: Mechanize - Click a table row to navigate to detail page

2009-12-26 Thread Brian D
On Dec 25, 4:36 am, "Diez B. Roggisch" wrote: > Brian D schrieb: > > > A search form returns a list of records embedded in a table. > > > The user has to click on a table row to call a Javascript call that > > opens up the detail page. > > > It'

How to test a URL request in a "while True" loop

2009-12-30 Thread Brian D
I'm actually using mechanize, but that's too complicated for testing purposes. Instead, I've simulated in a urllib2 sample below an attempt to test for a valid URL request. I'm attempting to craft a loop that will trap failed attempts to request a URL (in cases where the connection intermittently

Re: How to test a URL request in a "while True" loop

2009-12-30 Thread Brian D
On Dec 30, 11:06 am, samwyse wrote: > On Dec 30, 10:00 am, Brian D wrote: > > > What I don't understand is how to test for a valid URL request, and > > then jump out of the "while True" loop to proceed to another line of > > code below the loop. There'

Re: How to test a URL request in a "while True" loop

2009-12-30 Thread Brian D
On Dec 30, 12:31 pm, Philip Semanchuk wrote: > On Dec 30, 2009, at 11:00 AM, Brian D wrote: > > > > > I'm actually using mechanize, but that's too complicated for testing > > purposes. Instead, I've simulated in a urllib2 sample below an attempt > &g

Re: How to test a URL request in a "while True" loop

2009-12-30 Thread Brian D
Thanks MRAB as well. I've printed all of the replies to retain with my pile of essential documentation. To follow up with a complete response, I'm ripping out of my mechanize module the essential components of the solution I got to work. The main body of the code passes a URL to the scrape_record

Re: How to test a URL request in a "while True" loop

2009-12-30 Thread Brian D
On Dec 30, 7:08 pm, MRAB wrote: > Brian D wrote: > > Thanks MRAB as well. I've printed all of the replies to retain with my > > pile of essential documentation. > > > To follow up with a complete response, I'm ripping out of my mechanize > > module the es

fsync() doesn't work as advertised?

2010-01-04 Thread Brian D
If I'm running a process in a loop that runs for a long time, I occasionally would like to look at a log to see how it's going. I know about the logging module, and may yet decide to use that. Still, I'm troubled by how fsync() doesn't seem to work as advertised: http://docs.python.org/library/o

Re: fsync() doesn't work as advertised?

2010-01-04 Thread Brian D
On Jan 4, 10:29 am, Antoine Pitrou wrote: > Le Mon, 04 Jan 2010 08:09:56 -0800, Brian D a écrit : > > > > > What I've seen is that flush() alone produces a complete log when the > > loop finishes. When I used fsync(), I lost all of the write entries > > except t

Re: fsync() doesn't work as advertised?

2010-01-06 Thread Brian D
On Jan 5, 1:08 pm, Nobody wrote: > On Mon, 04 Jan 2010 08:09:56 -0800, Brian D wrote: > > If I'm running a process in a loop that runs for a long time, I > > occasionally would like to look at a log to see how it's going. > > > I know about the logging modu

Iterate over group names in a regex match?

2010-01-19 Thread Brian D
Here's a simple named group matching pattern: >>> s = "1,2,3" >>> p = re.compile(r"(?P\d),(?P\d),(?P\d)") >>> m = re.match(p, s) >>> m <_sre.SRE_Match object at 0x011BE610> >>> print m.groups() ('1', '2&#

Re: Iterate over group names in a regex match?

2010-01-19 Thread Brian D
On Jan 19, 11:28 am, Peter Otten <__pete...@web.de> wrote: > Brian D wrote: > > Here's a simple named group matching pattern: > > >>>> s = "1,2,3" > >>>> p = re.compile(r"(?P\d),(?P\d),(?P\d)") > >>>> m =

Re: Iterate over group names in a regex match?

2010-01-19 Thread Brian D
On Jan 19, 11:51 am, Brian D wrote: > On Jan 19, 11:28 am, Peter Otten <__pete...@web.de> wrote: > > > > > Brian D wrote: > > > Here's a simple named group matching pattern: > > > >>>> s = "1,2,3" > > >>

Generic proxy (that proxies methods like __iter__)

2010-01-27 Thread D HANNEY
>>> def show(opened): ... with opened as file: ... for line in file: ... print line.strip() ... >>> show(open("test.txt")) blah1 blah2 blah3 # # Good! I wonder if I can do that with StringIO ... # >>> import StringIO >>> show(StringIO.StringIO("

Stuck on a three word street name regex

2010-01-27 Thread Brian D
frazzled brain? The pattern I'm using doesn't keep the "CHASE" with the "JOHN CHURCHILL": >>> p = >>> re.compile(r'(?P\d+)\s(?P[A-Z\s]*)\s(?P\w*)\s(?P\w{2})$') >>> s = '1405 RAMPART S ST' >>> m = re.search(p, s)

Re: Stuck on a three word street name regex

2010-01-27 Thread Brian D
On Jan 27, 6:35 pm, Paul Rubin wrote: > Brian D writes: > > I've tackled this kind of problem before by looping through a patterns > > dictionary, but there must be a smarter approach.> > > Two addresses. Note that the first has incorrectly transposed the

Re: Stuck on a three word street name regex

2010-01-27 Thread Brian D
On Jan 27, 7:27 pm, MRAB wrote: > Brian D wrote: > > I've tackled this kind of problem before by looping through a patterns > > dictionary, but there must be a smarter approach. > > > Two addresses. Note that the first has incorrectly transposed the > > direct

Re: Generic proxy (that proxies methods like __iter__)

2010-01-28 Thread D HANNEY
On Jan 27, 3:07 pm, Arnaud Delobelle wrote: > On 27 Jan, 14:41, D HANNEY wrote: > [...] > > See [1] for an explanation.  Here is an idea: you could get round that > by generating a class on the fly, if you don't mind changing the class > of the object (untested): &

Re: Stuck on a three word street name regex

2010-01-28 Thread Brian D
> > [snip] > > Regex doesn't gain you much. I'd split the string and then fix the parts > > as necessary: > > >  >>> def parse_address(address): > > ...     parts = address.split() > > ...     if parts[-2] == "S": > > ...         parts[1 : -1] = [parts[-2]] + parts[1 : -2] > > ...     parts[1 : -1]

Re: Stuck on a three word street name regex

2010-01-28 Thread Brian D
On Jan 28, 7:40 am, Brian D wrote: > > > [snip] > > > Regex doesn't gain you much. I'd split the string and then fix the parts > > > as necessary: > > > >  >>> def parse_address(address): > > > ...     parts = address.split(

Re: Generic proxy (that proxies methods like __iter__)

2010-01-28 Thread D HANNEY
On Jan 28, 1:31 pm, D HANNEY wrote: > > Your solution works if I change "type(obj)" to say "obj.__class__". > If I don't make this change Python complains "TypeError: Error when > calling the metaclass bases type 'instance' is not an acceptab

Re: Stuck on a three word street name regex

2010-01-28 Thread Brian D
> Correction: > > [snip] the expression "parts[1 : -1]" means gather list items from the > second element in the list (index value 1) to one index position > before the end of the list. [snip] MRAB's solution was deserving of a more complete solution: >>> def parse_address(address): # Ha

Re: Stuck on a three word street name regex

2010-01-28 Thread Brian D
On Jan 28, 8:27 am, Lie Ryan wrote: > On 01/28/10 11:28, Brian D wrote: > > > > > I've tackled this kind of problem before by looping through a patterns > > dictionary, but there must be a smarter approach. > > > Two addresses. Note that the first has incorr

Re: Regular expression to structure HTML

2009-10-02 Thread Brian D
expressions. > > > Note that the output is referenced using named groups. > > > My challenge is successfully matching the HTML tags in between the > > first table row, and the second table row. > > > I'd appreciate any suggestions to improve the approach. > &g

Re: Regular expression to structure HTML

2009-10-02 Thread Brian D
hallenge is successfully matching the HTML tags in between the > > first table row, and the second table row. > > > I'd appreciate any suggestions to improve the approach. > > > rText = "8583 > href=lic_details.asp?lic_number=8583>New Horizon Technical Academy

Command parsing... best module to use?

2009-11-02 Thread Collin D
Hey everyone. I am writing a game in python, and it includes a text console somewhat like the one in WoW and Runescape. I want to be able to include "/" commands, like IRC, and was wondering what the best module would be to parse these. Thanks a lot, Collin D -- http://mail.python.o

Re: Command parsing... best module to use?

2009-11-03 Thread Collin D
Thanks for the replies. Pyparsing looks just like what I need. -- http://mail.python.org/mailman/listinfo/python-list

HI ALL, COUPLE R INVITING U FOR HOT DATING FOR FREE.... PLZ WELCOME(ABOVE 18YEARS ONLY)

2010-11-19 Thread d...@couples
HI ALL, COUPLE R INVITING U FOR HOT DATING FOR FREE PLZ WELCOME(ABOVE 18YEARS ONLY) http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 -- http://mail.python.org/mailman/listinfo/python-list

R U READY TO DATE WITH HOT COMMITED COUPLES....

2010-11-20 Thread d...@couples
R U READY TO DATE WITH HOT COMMITED COUPLES JUST FOLLOW THE LINK... WE R WAITING http://adultfriendfinder.com/go/g1271112-ppc http://adultfriendfinder.com/go/g1271112-ppc http://adultfriendfinder.com/go/g1271112-ppc http://adultfriendfinder.com/go/g1271112-ppc -- http://mail.python.

wxPython: How to get letter colour from TextCtrl

2010-05-17 Thread D. Schramm
Hello, I've got a problem getting the colour of a single letter within the TextCtrl widget: letterstyle = wx.TextAttr() self.p1.GetStyle(self.p1.XYToPosition(0,0),letterstyle) color = letterstyle.GetTextColour() print color This should display the colour value of the very first letter in the

Re: Python vs. Fedora and CentOS

2010-05-31 Thread Jason D
The major Red Hat based Linux distros are still shipping with Python 2.4. As a result, almost all hosting providers are running obsolete versions of Python. The big problem seems to be that "cPanel" and "yum" still use older versions of Python, and those programs are more

Basic Information about Python

2010-07-30 Thread Durga D
Hi All, I am new to python based application developement. I am using Windows XP. 1. Can I create desktop application (just hello world program) with Python language like exe in VC++? 2. If First statement is Yes, Can I include this application with my existing setup(assume 10 MB) for wind

Re: Basic Information about Python

2010-07-30 Thread Durga D
Hi JM, Thanks alot for your prompt response. If I include into windows setup, what will be setup size (assume before include 10 MB)? i mean, python supporting dlls/libs size for python exe. Regards, Durga. On Jul 30, 6:04 pm, Jean-Michel Pichavant wrote: > Durga D wrote: > &g

Re: How to insert string in each match using RegEx iterator

2009-06-10 Thread Brian D
> expression.  Hmm, maybe the code example is easier to follow than the > explanation... > > from pyparsing import Word, nums, Regex > > # an integer is a 'word' composed of numeric characters > integer = Word(nums) > > # or use this if you prefer > inte

Re: How to escape # hash character in regex match strings

2009-06-11 Thread Brian D
On Jun 11, 2:01 am, Lie Ryan wrote: > 504cr...@gmail.com wrote: > > I've encountered a problem with my RegEx learning curve -- how to > > escape hash characters # in strings being matched, e.g.: > > >>>> string = re.escape('123#abc456') > >

Re: How to escape # hash character in regex match strings

2009-06-11 Thread Brian D
On Jun 11, 9:22 am, Brian D wrote: > On Jun 11, 2:01 am, Lie Ryan wrote: > > > > > 504cr...@gmail.com wrote: > > > I've encountered a problem with my RegEx learning curve -- how to > > > escape hash characters # in strings being matched, e.g.:

What the \xc2\xa0 ?!!

2010-09-07 Thread Brian D
In an HTML page that I'm scraping using urllib2, a \xc2\xa0 bytestring appears. The page's charset = utf-8, and the Chrome browser I'm using displays the characters as a space. The page requires authentication: https://www.nolaready.info/myalertlog.php When I try to concatenate strings containi

Working with dictionaries and keys help please!

2017-05-31 Thread David D
I have a dictionary with a 10 people, the key being a number (0-10) and the value being the people's name. I am in the processing of Insert, Adding and deleting from the dictionary. All seems well until I delete a person and add a new one. The numbers (keys) do not change and so I am getting

Re: Working with dictionaries and keys help please!

2017-05-31 Thread David D
Learning about dictionaries for a database possibly in the future. On Wednesday, May 31, 2017 at 8:58:39 PM UTC-4, MRAB wrote: > On 2017-06-01 01:29, David D wrote: > > I have a dictionary with a 10 people, the key being a number (0-10) and the > > value being the people'

Is there a Programming FAQ for Python 3.x?

2011-07-15 Thread Richard D. Moores
Is there a Programming FAQ for Python 3.x? There is , but it's for 2.7 Thanks, Dick Moores -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a Programming FAQ for Python 3.x?

2011-07-15 Thread Richard D. Moores
On Fri, Jul 15, 2011 at 16:39, Thomas Jollans wrote: > On 07/16/2011 01:24 AM, Richard D. Moores wrote: >> Is there a Programming FAQ for Python 3.x? There is >> <http://docs.python.org/faq/programming.html>, but it's for 2.7 >> >> Thanks, >> >&g

python glibc issue

2011-08-04 Thread Garrett, Benjamin D
Hi, I am running into a problem with Python 2.6 and SuSe 11 SP1. The error message looks just like this one: https://bugzilla.redhat.com/show_bug.cgi?id=556584 That link implies the fix is to upgrade to > glibc-2.11.90. But for this particular hardware, it would be difficult to upgrade the cor

Puzzled about the output of my demo of a proof of The Euler Series

2011-08-10 Thread Richard D. Moores
I saw an interesting proof of the limit of The Euler Series on math.stackexchange.com at . Scroll down to Hans Lundmark's post. I thought I'd try to see this "pinching down" on the limit of pi**2/6. Se

Puzzled about the output of my demo of a proof of The Euler Series

2011-08-12 Thread Richard D. Moores
For the first time in my 7 years of using Gmail, I accidentally deleted my original post and it's one reply by casevh. I found both in the list archive, and with this post both quote casevh's reply and answer it. Sorry about my screw up. On Aug 10, 4:57 pm, "Richard D. Moores"

Re: relative speed of incremention syntaxes (or "i=i+1" VS "i+=1")

2011-08-22 Thread Richard D. Moores
On Sun, Aug 21, 2011 at 18:12, Steven D'Aprano wrote: > But really, we're talking about tiny differences in speed. Such trivial > differences are at, or beyond, the limit of what can realistically be > measured on a noisy PC running multiple processes (pretty much all PCs > these days). Here are

share info between methods in a Class

2011-02-24 Thread Garcia, Paul D
What is the best way to access/change list or dictionary information between methods in the same class? Note : I would normally have the input_list originally populate by reading in a file. Currently I have: class Action: def __init__(self): self.input_List = list()

Tracing in a Flask application

2021-08-04 Thread Javi D R
Hi I would like to do some tracing in a flask. I have been able to trace request in plain python requests using sys.settrace(), but this doesnt work with Flask. Moreover, what i want to trace is in a flask application, when an endpoint is called, what was the request, which parts of the code was

Re: need some kind of "coherence index" for a group of strings

2016-11-03 Thread Neil D. Cerutti
On 11/3/2016 1:49 PM, jlada...@itu.edu wrote: The Levenshtein distance is a very precise definition of dissimilarity between sequences. It specifies the minimum number of single-element edits you would need to change one sequence into another. You are right that it is fairly expensive to com

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Glen D souza
fld = [ ] data = shlex.split(ln) for item in data: fld.append(item) fld = fld + [0] * (5 - len(data)) On Sat, 29 Sep 2018 at 11:03, Glen D souza wrote: > i have a approach, it may not be best > > fld = [ ] > for data in shlex.split(ln): >fld.append(data) > &g

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Glen D souza
i have a approach, it may not be best fld = [ ] for data in shlex.split(ln): fld.append(data) On Sat, 29 Sep 2018 at 07:52, wrote: > On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote: > > I have a list created by:- > > > > fld = shlex.split(ln) > > > > It may co

Using Python to add thumbnails to Explorer

2005-10-26 Thread c d saunter
Greetings All, In Widows Explorer there is a thumbnail view, where you see images as thumbnails. Applications such as MS Office and OpenOffice, when installed, cause their respective filetypes to be previewed as thumbnails as well. Thumbnails are stored in the Thumbs.db hidden file.

Re: Jpg

2005-10-26 Thread c d saunter
Tuvas ([EMAIL PROTECTED]) wrote: : I am building a GUI interface at the moment, and would like to have : support for displaying a jpg file, and a FITS file if possible. Is : there any way to do this? My interface has been written in Tkinter at : the moment, especially because of it's great portabil

Re: Using Python to add thumbnails to Explorer

2005-10-26 Thread c d saunter
Hi Roger, Thanks for the info - I was actually interested in custom per file thumbnails rather than icons, but your message sentt me pouring through seemingly relevent parts of the registry - however what I need isn't there. Turns out I need to use a .dll shell

Re: Using Python to add thumbnails to Explorer

2005-11-02 Thread c d saunter
John J. Lee ([EMAIL PROTECTED]) wrote: : "Roger Upole" <[EMAIL PROTECTED]> writes: : Or, if not, then you can do it with module ctypes. : http://starship.python.net/crew/theller/ctypes/ : There's an O'Reilly book called something like "win32 shell : programming" that covers this stuff. : John

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-28 Thread c d saunter
Michael Hoffman ([EMAIL PROTECTED]) wrote: : muldoon wrote: : > Americans consider having a "British accent" a sign of sophistication : > and high intelligence. Many companies hire salespersons from Britain to : > represent their products,etc. Question: When the British hear an : > "American accent

Re: Parallel port programming on windows XP/2000?

2005-08-03 Thread c d saunter
Novice Experl ([EMAIL PROTECTED]) wrote: : I'd like to write a simple application that interfaces with the parallel port, and changes the data on it according to keyboard input. I hope I can get it to run under windows xp and / or windows 2000. : How can I do this? What do I need to know? It doe

Re: Parallel port programming on windows XP/2000?

2005-08-03 Thread c d saunter
em in Basic. These days it's almost impossible without special kit and lots of know how. Heck, the old BBC Mirco had raw IO capabilites as fast as an IBM parallel port, and more flexible to boot. Progress. A real pain for r&d types. --- cds c d saunter ([EMAIL PROTECTED]) wrote: :

Re: Decline and fall of scripting languages ?

2005-08-07 Thread c d saunter
Kay Schluehr ([EMAIL PROTECTED]) wrote: : No good news for scripting-language fans: : http://www.phpmag.net/itr/news/psecom,id,23284,nodeid,113.html Just as well I ditched a scripting language for Python then... cds -- http://mail.python.org/mailman/listinfo/python-list

Python C module questions

2005-09-01 Thread jeremy . d . brewer
Hi, I'm rather new to Python, and I've just written my first Python C module. I was wondering if some more experience Pythonista would look over what I've written and given me some pointers (or find some bugs). I had a few questions while writing this as well. Also, I know that there are much be

Re: What's the difference between VAR and _VAR_?

2005-09-09 Thread S. D. Rose
I can't get the value of the variable (out of the class function) if it has two leading underscores. -Dave >>> class encrypt: def encrypt(self, userValue): self.initialNumber = userValue self.__secretSeed = 7 return self.initialNumber * self.__secretSeed >>> enc = encrypt() >>> enc.encryp

Re: Python 2.4 removes None data type?

2005-03-04 Thread Gary D. Duzan
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >I just read in the 'What's New in Python 2.4' document that the None >data type was converted to a constant: >http://python.org/doc/2.4/whatsnew/node15.html > >""" ># None is now a constant; code that binds a new valu

Re: Jython Phone Interview Advice

2005-03-15 Thread c d saunter
George Jempty ([EMAIL PROTECTED]) wrote: : I'm undergoing a phone interview for a Jython job today. Anybody have : practical advice for me? I haven't worked with Python in years, but I : have been working with Java in the meantime (resume at : http://scriptify.com/george_jempty_resume.pdf). I've

Re: Lisp-likeness

2005-03-15 Thread Matthew D Swank
On Tue, 15 Mar 2005 14:16:09 -0800, Thomas A. Russ wrote: > The lisp snippet creates new functions each time the addn function is > called, so one can interleave calls to the individual functions. Yes, I believe them to be equivalent. Each call to addn creates an activation record which is closed

Re: Proposal for adding Shallow Threads and a Main Loop to Python

2005-03-17 Thread Gary D. Duzan
In article <[EMAIL PROTECTED]>, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > >import mainloop, urllib > >def get_and_save(path): >infile = waitfor urllib.urlopen(path, async=True) >outfile = waitfor open(path.split('/')[-1], async=True) >waitfor outfile.write(waitfor infile.read(async=Tru

access to generator state

2004-12-02 Thread Neal D. Becker
I am converting optimization code from legacy C to python. Generators are a HUGE convenience, because the original code structures have the optimizer as the main code calling your function, while I want to invert these roles. I want to call the optimizer to perform just one step at a time. So, t

float point properties access

2004-12-03 Thread Neal D. Becker
Is there a way in python to access properties of floats? I need something equiv to C DBL_EPSILON defined in . -- http://mail.python.org/mailman/listinfo/python-list

Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
I have a function that recognizes PTR records for dynamic IPs. There is no hard and fast rule for this - every ISP does it differently, and may change their policy at any time, and use different conventions in different places. Nevertheless, it is useful to apply stricter authentication standards

Re: Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 18:00:06 -0500, Mitja wrote: > On Wed, 08 Dec 2004 16:09:43 -0500, Stuart D. Gathman <[EMAIL PROTECTED]> > wrote: > >> I have a function that recognizes PTR records for dynamic IPs Here >> is the very ugly code so far. >> ... >

Re: Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 18:39:15 -0500, Lonnie Princehouse wrote: > Regular expressions. > > It takes a while to craft the expressions, but this will be more > elegant, more extensible, and considerably faster to compute (matching > compiled re's is fast). I'm already doing that with the rehmac rege

Re: Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 19:52:53 -0500, Lonnie Princehouse wrote: > I don't think a Bayesian classifier is going to be very helpful here, > unless you have tens of thousands of examples to feed it, or unless it We do have tens of thousands of examples to feed it. > The series of if host.find(...) li

Re: Creating Fixed Length Records

2004-12-08 Thread Stuart D. Gathman
x27;8s6s2s' >>> v = ('foo','bar','AA') >>> struct.pack(fmt,*v) 'foo\x00\x00\x00\x00\x00bar\x00\x00\x00AA' -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-

Re: Help beautify ugly heuristic code

2004-12-10 Thread Stuart D. Gathman
That gives me a few things to try. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis" - background song for a Microsoft sponsored "Where do you want t

Re: Help beautify ugly heuristic code

2004-12-10 Thread Stuart D. Gathman
On Fri, 10 Dec 2004 22:03:20 +, JanC wrote: > Stuart D. Gathman schreef: > >> I have a function that recognizes PTR records for dynamic IPs. There > Did you also think about ISPs that use such a PTR record for both dynamic > and fixed IPs? There seems to be a lot o

Re: Optional Static Typing - Haskell?

2004-12-24 Thread Neal D. Becker
I've just started learning about Haskell. I suggest looking at this for an example. A good intro: http://www.haskell.org/tutorial -- http://mail.python.org/mailman/listinfo/python-list

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-29 Thread c d saunter
Alex Martelli ([EMAIL PROTECTED]) wrote: : I'm considering proposing to O'Reilly a 2nd edition of "Python in a : Nutshell", that I'd write in 2005, essentially to cover Python 2.3 and : 2.4 (the current 1st edition only covers Python up to 2.2). : So, if there's any advice or request about a 2nd e

Installation error, compiling from source on Oracle Linux

2016-02-16 Thread John D. Gwinner
I'm installing an app that requires Carbon and some other Python 2.7 features. The version of Oracle Linux we're using comes with 2.6. I've read that it is not a good idea to directly update the O/S as it "may break things" so I'm doing make altinstall. I've downloaded Python-2.7.11 Downloaded

Re: Understanding "help" command description syntax - explanation needed

2014-11-05 Thread Neil D. Cerutti
On 11/5/2014 7:41 AM, Chris Angelico wrote: On Wed, Nov 5, 2014 at 11:31 PM, Ivan Evstegneev wrote: That's what I'm talking about (asking actually), where do you know it from? I know it because I've been a programmer for 39 years. I didn't intend to offence anyone here. Just asked a questi

Not Able to Log in on XNAT server through PyXNAT

2014-12-04 Thread suyash . d . b
Hello All, I have installed pyxnat on my mac. With pyxnat i am trying to access XNAT server in our university. As mentioned on the tutorial i tried both ways, neither is working. Following error is displayed: >>> central=Interface(server='http://hd-hni-xnat.cac.cornell.edu:8443/xnat') User: sdb

Re: Not Able to Log in on XNAT server through PyXNAT

2014-12-05 Thread suyash . d . b
On Friday, December 5, 2014 2:41:54 AM UTC-5, dieter wrote: > suyash@gmail.com writes: > > > Hello All, > > > > I have installed pyxnat on my mac. With pyxnat i am trying to access XNAT > > server in our university. As mentioned on the tutorial i tried both ways, > > neither is working. Foll

Re: threading

2014-04-09 Thread Neil D. Cerutti
On 4/8/2014 9:09 PM, Rick Johnson wrote: I warn you that not only will "it" impede the interpretation of your ideas, "it" will also degrade your ability to think clearly when expressing yourself and slow (or completely halt) your linguistic evolution. HAVE YOU NOTICED THAT YOUR INNER MONOLO

Re: The “does Python have variables?” debate

2014-05-08 Thread Neil D. Cerutti
On 5/8/2014 8:41 AM, Roy Smith wrote: In article , Jerry Hill wrote: thinking of python variables as having two parts -- names and values -- really can help people who are struggling to learn the language. There's many levels of learning, and we see them all on this list. For people who a

Procedure for downloading and Installing Python 2.7 Modules

2015-07-20 Thread W. D. Allen
Would like to locate and install numpy, scipy and matplotlib with Wing 101 for Python 2.7 Just beginning to use Python 2.7 for engineering work. Any guidance would be appreciated. Thanks, WDA balle...@gmail.com end -- https://mail.python.org/mailman/listinfo/python-list

Re: open() and EOFError

2014-07-08 Thread Neil D. Cerutti
On 7/7/2014 7:10 PM, Mark Lawrence wrote: On 07/07/2014 23:09, Gregory Ewing wrote: Marko Rauhamaa wrote: with open(path) as f: ... If the open() call is guarded against exceptions (as it usually should), one must revert to the classic syntax: Hmmm, maybe we could do with a with-

Re: Standard library Help

2014-07-11 Thread Neil D. Cerutti
On 7/11/2014 4:53 AM, Wolfgang Maier wrote: On 07/11/2014 10:32 AM, Nicholas Cannon wrote: Hey i would like to know alot more about the standard library and all of its functions and so on and i know it is huge and i would basically like to learn only the useful stuff that i could use and all of

Re: Python 3 is killing Python

2014-07-16 Thread Neil D. Cerutti
On 7/16/2014 10:27 AM, Frank Millman wrote: Would this have been so easy using Python2 - I don't think so. What follows is blatant speculation, but it is quite possible that there are many non-English speakers out there that have had their lives made much easier by the changes to Python3 - a 'si

Re: OT: usenet reader software

2014-07-22 Thread Neil D. Cerutti
On 7/22/2014 11:14 AM, Anssi Saari wrote: I don't really know about about html and slrn since I don't see much of it but links in a terminal application is usually something for the terminal to handle. I run Gnus on a remote machine and use a local terminal for display, Konsole in Linux and mintt

Re: one to many (passing variables)

2014-07-28 Thread Neil D. Cerutti
On 7/25/2014 9:47 PM, C.D. Reimer wrote: Thank you for the link. I'm curious about one item mentioned in the article: "Avoid return values that Demand Exceptional Processing: return zero-length array or empty collection, not null" Isn't a zero-length array, empty collection and null all the same

Re: Python Classes

2014-08-05 Thread Neil D. Cerutti
On 8/4/2014 6:44 PM, John Gordon wrote: In Shubham Tomar writes: classes. I understand that you define classes to have re-usable methods and procedures, but, don't functions serve the same purpose. Can someone please explain the idea of classes If a function simply accepts some data, does

Re: Specifying `blocking` and `timeout` when acquiring lock as a context manager

2014-08-08 Thread Neil D. Cerutti
On 8/8/2014 9:25 AM, Ethan Furman wrote: On 08/08/2014 04:51 AM, cool-RR wrote: If I want to acquire a `threading.Lock` using the context manager protocol, is it possible to specify the `blocking` and `timeout` arguments that `acquire` would usually take? Not that I know of, but why would y

Re: Specifying `blocking` and `timeout` when acquiring lock as a context manager

2014-08-08 Thread Neil D. Cerutti
On 8/8/2014 12:16 PM, Chris Angelico wrote: On Sat, Aug 9, 2014 at 2:05 AM, Neil D. Cerutti wrote: Perhaps defer release, a la a common Go pattern: with contextlib.ExitStack() as stack: acquired = lock.acquire(blocking=False) if acquired: stack.callback(lock.release

Re: Specifying `blocking` and `timeout` when acquiring lock as a context manager

2014-08-08 Thread Neil D. Cerutti
On 8/8/2014 2:35 PM, Neil D. Cerutti wrote: Here's another attempt at context managing: @contextlib.contextmanager def release_if_acquired(lock, blocking=True, timeout=-1): acquired = lock.acquire(blocking, timeout) if acquired: yield acquired lock.re

Re: how to get the ordinal number in list

2014-08-12 Thread Neil D. Cerutti
On 8/10/2014 2:14 PM, Roy Smith wrote: In article <154cc342-7f85-4d16-b636-a1a953913...@googlegroups.com>, Rustom Mody wrote: l= [6,2,9,12,1,4] sorted(l,reverse=True)[:5] [12, 9, 6, 4, 2] No need to know how sorted works nor [:5] Now you (or Steven) can call it abstract. And yet its 1. A

Re: how to get the ordinal number in list

2014-08-12 Thread Neil D. Cerutti
On 8/12/2014 2:20 PM, Rustom Mody wrote: On Tuesday, August 12, 2014 11:10:48 PM UTC+5:30, Neil D. Cerutti wrote: Beginners are particularly poor, in relation to experts, at noticing the applicability of idea, and at combining ideas together. Breaking things into component parts has multiple

Re: Python vs C++

2014-08-21 Thread Neil D. Cerutti
On 8/21/2014 8:54 AM, David Palao wrote: Hello, I consider myself a python programmer, although C++ was one of the first languages I learned (not really deeply and long time ago). Hey, that sounds just like me. Now I decided to retake C++, to broaden my view of the business. However, as I pro

Re: Python vs C++

2014-08-22 Thread Neil D. Cerutti
On 8/22/2014 5:29 AM, Marko Rauhamaa wrote: C is readily supported by all extension APIs. Its calling conventions are stable and well-understood. Its runtime requirements are trivial. Plus, you don't have to be a Medieval Scholar to program in it. C itself is very simple (albeit not simple to u

<    1   2   3   4   5   6   >