Re: print(....,file=sys.stderr) buffered?

2012-08-13 Thread Grant Edwards
writes to stderr and stdout and assume order is preserved unless you take specific steps (such as forcing them both to be unbuffered or flushing them at certain points). > Is this guarantee no more valid in Python 3.2 ? If you write to stderr all three times, it should work the way you want it to. -

Re: [OT] Posting under ones full name

2012-08-15 Thread Grant Edwards
x27;s the convention for Usenet and mailing lists. > Perhaps you said "Please use `m4-style quotes rather than matching > ASCII quotes' or `something else' to indicate omission instead". -- Grant Edwards grant.b.edwards

Re: [OT] Posting under ones full name

2012-08-16 Thread Grant Edwards
On 2012-08-16, Dan Sommers wrote: > On 2012-08-15 at 13:59:53 +, > Grant Edwards wrote: > >> On 2012-08-15, Chris Angelico wrote: > >> > Perhaps you said "Please use `m4-style quotes rather than matching >> > ASCII quotes' or `something else

Re: Top-posting &c. (was Re: [ANNC] pybotwar-0.8)

2012-08-17 Thread Grant Edwards
gt; And FWIW, I add my voice to those who prefer to read replies > underneath the original text. Same here. I often skip reading top-posted articles entirely, since I don't really care to take the time to start reading at the bottom, working my up, trying to figure out exactly what the

Re: Top-posting &c. (was Re: [ANNC] pybotwar-0.8)

2012-08-18 Thread Grant Edwards
o top posting. I got one comment something like "That's cool how you interleaved your reponses -- it's like having a real conversation." -- Grant Edwards grant.b.edwardsYow! Somewhere in Tenafly, at New Jersey, a

Re: Why doesn't Python remember the initial directory?

2012-08-20 Thread Grant Edwards
have to do with the startup directory? If you want to know where __main__ is, you can probably figure it out from /proc/self/ -- Grant Edwards grant.b.edwardsYow! Am I having fun yet? at gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-23 Thread Grant Edwards
ot;,"--interface",dest="interface",metavar="",type='str',default="eth0") options,args = p.parse_args() if len(args) != 0: sys.stderr.write("no arguments accepted\n") sys.exit(1) def toHex(s): return " ".join([(

Re: Objects in Python

2012-08-24 Thread Grant Edwards
ss. Ah, but as we are always fond of saying in this group "that's an implementation detail, and not part of the language definition". The model where a compiler is "keeping notes about it in Narnia" is also perfectly valid. However, RAM is easier to find than magic ward

Re: interfacing with x86_64 assembler

2012-08-31 Thread Grant Edwards
ssembler? :) Nothing -- it's called "C". -- Grant Edwards grant.b.edwardsYow! Not SENSUOUS ... only at "FROLICSOME" ... and in

Re: sockets,threads and interupts

2012-09-04 Thread Grant Edwards
TERM and SIGINT and clean up before exiting. You can't catch SIGKILL, but sending a SIGKILL isn't considered polite unless you've already tried SIGTERM/SIGINT and it didn't work. -- Grant Edwards grant.b.edwardsYow! Are we on STRIKE yet?

Re: python docs search for 'print'

2012-09-04 Thread Grant Edwards
quot;site:python.org " also works nicely if you know what you want is on the python.org site. I never bother with the site's search function -- the results are always far better using google. [This isn't a particular fault of the python.org site, I find the same is true for p

Re: python docs search for 'print'

2012-09-05 Thread Grant Edwards
probably the simplest solution. I'm not enough of a web guy to know how to do that, but I do know that some sites do handle site search that way. -- Grant Edwards grant.b.edwardsYow! I like the way ONLY at their

Re: python docs search for 'print'

2012-09-05 Thread Grant Edwards
On 2012-09-05, Dave Angel wrote: > On 09/05/2012 01:47 PM, Grant Edwards wrote: > >> Making the site's "search" box use Google or somesuch is probably the >> simplest solution. I'm not enough of a web guy to know how to do >> that, but I do know th

Re: Bitshifts and "And" vs Floor-division and Modular

2012-09-07 Thread Grant Edwards
instruction? If that _were_ the case, the difference would be more noticable, but would still probably not worth worrying about unless a truely huge number of operations were being done in a very tight loop with no intervening I/O operations. -- Grant Edwards grant

How to timeout a recv() on an ssl connection?

2012-09-10 Thread Grant Edwards
ith an SSLSocket, it works the first time it's called with timeout set to something other than None (it times out properly). Subsequence reads with timeout set to None work, but then the second time it's called with a non-None timeout, it hangs for several minutes, and then the recv() returns

Re: How to timeout a recv() on an ssl connection?

2012-09-10 Thread Grant Edwards
On 2012-09-10, Grant Edwards wrote: > I can't figure out how to timeout a recv() on an SSLSocket -- I'm using > Python 2.6 nad 2.7. Here's what I've got so far (it needs to work on > either a plain or SSL socket): > > s.settimeout(timeout) >

Re: Obnoxious postings from Google Groups (was: datetime issue)

2012-09-21 Thread Grant Edwards
w I'm not alone. If one wants the best chance of getting a question answered, using something other than Google Groups is indeed a good idea. -- Grant Edwards grant.b.edwardsYow! The PILLSBURY DOUGHBOY at is CRYING for

Re: Blue Screen Python

2012-09-21 Thread Grant Edwards
bug in hardware, OS kernel, or device driver. The solution is usually to fix the hardware, OS, or device driver. -- Grant Edwards grant.b.edwardsYow! I'm having an at emotional outburst!!

Re: Obnoxious postings from Google Groups (was: datetime issue)

2012-09-23 Thread Grant Edwards
On 2012-09-22, Hank Gay wrote: > On 2012-09-21 15:07:09 +0000, Grant Edwards said: >> >> I told my news client years ago to filter out anything posted from >> Google Groups -- and I know I'm not alone. If one wants the best >> chance of getting a question answ

Re: Pass numeric arrays from C extensions to Python

2012-09-24 Thread Grant Edwards
struct module and the ctypes module. -- Grant Edwards grant.b.edwardsYow! Life is a POPULARITY at CONTEST! I'm REFRESHINGLY gmail.comCANDID!! -- http://mail.python.org/mailman/listinfo/python-list

Re: python file API

2012-09-25 Thread Grant Edwards
o >> > end-of-file? That's currently done with an optional second >> > parameter to seek() method. >> >> Negative indices. >> > > Which still doesn't handle the third seek mode -- relative to > current position. fileobj.pos

Re: Article on the future of Python

2012-09-25 Thread Grant Edwards
on falls below a certain critical mass -- will the "Python Community" start to stagnate because it isn't attacting new developers in the quantity or diversity that it used to... -- Grant Edwards grant.b.edwardsYow! Alright, you!!

Re: Article on the future of Python

2012-09-27 Thread Grant Edwards
s/syntax/semantics at random from the various different piles. Those bits where then stuck together with duct tape and bubble gum and called PHP... As one of the contractors who wrote some of the PHP said: "PHP is like the worst parts of shell, Perl, and Java all combi

Re: get google scholar using python

2012-10-01 Thread Grant Edwards
ogle often provides an API that's intended for use by non-browser programs. Those interfaces are usually both easier to use for the programmer and impose less load on the servers. -- Grant Edwards grant.b.edwardsYow! I am deeply CONCERNED

Re: write binary with struct.pack_into

2012-10-06 Thread Grant Edwards
On 2012-10-06, Dennis Lee Bieber wrote: > On Fri, 5 Oct 2012 20:27:36 -0700 (PDT), palmeira > declaimed the following in gmane.comp.python.general: > >> >> #WRITE >> fb=open('testOUT.bin') > > Unless you specify otherwise, open() defaults to read-only It also defaults to 'text' mode which

Re: Unpaking Tuple

2012-10-09 Thread Grant Edwards
_= >>tuple[:4]=0D=0A> > a,b,c,d =3D my_tuple if len(my_tuple) =3D=3D 4 else (my_= > > How does one unpack this post? ;-) Yea, my newsreader doesn't like those posts either -- though they're not as bad as what yours displays. Mine just shows "^M" strings all at th

Re: surprising behaviour of global dictionaries

2012-10-09 Thread Grant Edwards
rom within that same file. I don't think I've ever even heard of that before... -- Grant Edwards grant.b.edwardsYow! The Korean War must at have been fun. gmail.com --

Re: Generating C++ code

2012-10-10 Thread Grant Edwards
nux/Unix, non-Windows), or it may actually have no OS at all. It almost certainly doesn't have a hard drive. Many years ago, there was a "deeply embedded Python" project that was attempting to get Python running on such platforms, but it's been abandoned for ages. IIRC, it wa

Re: Private methods

2012-10-10 Thread Grant Edwards
equip yourself with a semi-decent mail reader? > Like Thunderbird, hint, hint :) You're tilting at windmills. Just give up and filter out all postings with a messageid ending in '@googlegroups.com'. I find that solves all sorts of problems... -- Grant Edwards grant.b.ed

Re: OT Questions

2012-10-17 Thread Grant Edwards
aking something out of context" is something done by a somebody who is reading or quoting somebody else. -- Grant Edwards grant.b.edwardsYow! I own seven-eighths of at all the artists in downtown

Re: Aggressive language on python-list

2012-10-17 Thread Grant Edwards
d stick to it, and discuss nothing but Python coding problems. I disagree! I think occasional off-topic meta-arguments can be interesting and entertaining. Yow! Am I having a meta-meta-discussion yet? -- Grant Edwards grant.b.edwardsYow! -- I love KATRINKA

Re: Aggressive language on python-list

2012-10-17 Thread Grant Edwards
guage.python from a Usenet server). Newsreaders often have more sophisticated mechanisms to allow you to filter out certain people/topics/whaterver that don't interest you. -- Grant Edwards grant.b.edwardsYow! ... this must be what

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Grant Edwards
, sometimes that means breaking up the line. -- Grant Edwards grant.b.edwardsYow! Am I in GRADUATE at SCHOOL yet? gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: locking files on Linux

2012-10-18 Thread Grant Edwards
p://www.thegeekstuff.com/2012/04/linux-file-locking-types/ http://www.hackinglinuxexposed.com/articles/20030623.html -- Grant Edwards grant.b.edwardsYow! Your CHEEKS sit like at t

Re: locking files on Linux

2012-10-18 Thread Grant Edwards
On 2012-10-18, andrea crotti wrote: > 2012/10/18 Grant Edwards : >> On 2012-10-18, andrea crotti wrote: >> >> File locks under Unix have historically been "advisory". That means >> that programs have to _choose_ to pay attention to them. Most >>

Re: A desperate lunge for on-topic-ness

2012-10-18 Thread Grant Edwards
0 > characters goes back to teletype machines, and IBM cards, and > character based terminals > > Should that really be the basis for a suggested style now? You don't expect me to through my Heathkit H19 terminal in the trash, do you? :) -- Grant Edwards grant.b

Re: A desperate lunge for on-topic-ness

2012-10-20 Thread Grant Edwards
On 2012-10-20, Dennis Lee Bieber wrote: > Strangely, we've gone from 80-character fixed width displays to > who-knows-what (if I drop my font size I can probably get nearly 200 > characters across in full-screen mode)... > > But at the same time we've gone from 132-character line-prin

Re: Preventing crap email from google?

2012-10-20 Thread Grant Edwards
On 2012-10-20, Michael Torrie wrote: > On 10/19/2012 06:43 PM, Mark Lawrence wrote: >> Good morning/afternoon/evening all, >> >> Is there any possibility that we could find a way to prevent the double >> spaced rubbish that comes from G$ infiltrating this ng/ml? For example, >> does Python hav

Re: A desperate lunge for on-topic-ness

2012-10-21 Thread Grant Edwards
On 2012-10-21, Steven D'Aprano wrote: > On Sun, 21 Oct 2012 22:43:07 +1100, Chris Angelico wrote: > >> On Sun, Oct 21, 2012 at 9:00 PM, Steven D'Aprano >> wrote: >>> Er, no. Note spelling of "source code" vs "souce code". Hence the grin. >> >> Ahh. I totally didn't see that, I'm way too used to

Re: program loaded in memory

2012-10-22 Thread Grant Edwards
k is in py2exe. I'm curious how there can be a memory leak in py2exe. I thought all it did was bundle up the python interpreter and the required libraries into a "private" python installation that's then invoked by the wrapper. Does py2exe actually do something after the appl

Re: Preventing crap email from google?

2012-10-22 Thread Grant Edwards
. Same here. Here's the rule I have in slrn's .score file: Score:: =- Message-ID: .*googlegroups.com -- Grant Edwards grant.b.edwardsYow! Where does it go when at you flush? gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast forward-backward (write-read)

2012-10-24 Thread Grant Edwards
ware (I think it was DX: http://www.research.ibm.com/dx/). My plugin would subsample "on the fly" a selected section of a huge 2D array of data in a file. IBM and SGI had all sorts of widgets you could use to sample, transform and visualize data, but they all assumed that the input data would fit

Re: while expression feature proposal

2012-10-25 Thread Grant Edwards
programs you write. In my experience, EXPR is usually a read from a file/socket/pipe that returns '' on EOF. If VAR is not '', then you process, then you process it inside the loop. -- Grant Edwards grant.b.edwardsYow! We're going to

Re: while expression feature proposal

2012-10-25 Thread Grant Edwards
e a substantial improvement in > some sense or make something new possible. There was no new syntax in > 3.2 and very little in 3.3. I think the new syntax should be introduced in 2.00. There were a number of other big changes between 1.52 and 2.00, so that seems like a good spot to put th

Re: How to set 250000 baud rate in pyserial ?

2012-10-25 Thread Grant Edwards
return 4; } if (ioctl(fd, TCGETS2, &t)) { perror("TCGETS2"); return 5; } printf("actual speed reported %d\n", t.c_ospeed); return 0; } -- Grant Edwards grant.b.edwards at gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Nice solution wanted: Hide internal interfaces

2012-10-29 Thread Grant Edwards
icer (prettier) solution out there, > but I can't currently think of it. Do you have any hints? IMO, the "right" thing to do in Python is to use single underscore names for methods that you intend to be called by "friend" modules (is that correct C++ lingo?) but don'

Re: Nice solution wanted: Hide internal interfaces

2012-10-29 Thread Grant Edwards
e it clear to the user what she is > supposed to use and what not. The single underscore indicates that the user is not to use the method. -- Grant Edwards grant.b.edwardsYow! I am covered with at pure vegetable oil and I

Re: datetime issue

2012-10-31 Thread Grant Edwards
lang.python (which is where I read/post from): http://en.wikipedia.org/wiki/Usenet > Can i get responses to my mail instead of constantly check the google > groups site? Yes. You can subscribe directly to the list (which means you'll receive a _lot_ of e-mail every da

Re: datetime issue

2012-11-01 Thread Grant Edwards
On 2012-10-31, ru...@yahoo.com wrote: > On 10/31/2012 09:11 AM, Grant Edwards wrote:> On 2012-09-16, ?? > wrote: >> >>> Iam positng via google groups using chrome, thats all i know. >> >> Learn something else. Google Groups is seriously and

Re: Obnoxious postings from Google Groups

2012-11-02 Thread Grant Edwards
; Huh. If you're messing about with ancient[1] languages like Java, C# and > especially C, you're not a real programmer. Real programmers use modern, > advanced languages like D, Erlang, Go or Haskell. Don't forget Smalltalk! Old, but always modern and advanced... --

Re: Obnoxious postings from Google Groups

2012-11-05 Thread Grant Edwards
egular" space or a "no-break space", and names would be visually ambiguous. Visually ambiguous names are horrible. > But, yeah, in the world we live in today, I try to avoid spaces in > filenames. But, instead of turning "My File Name" into MyFileName, I'll

Re: accepting file path or file object?

2012-11-05 Thread Grant Edwards
ad() method, I check for presence of a read() method. If that fails, then I assume it's a filename and pass it to open(). If that fails, then it fails. -- Grant Edwards grant.b.edwardsYow! Oh my GOD -- the at SUN just

Re: Obnoxious postings from Google Groups

2012-11-05 Thread Grant Edwards
listing the directory contents Don't most OSes allow non-printing characters in filenames? VMS and Unix always have. AFAIK, there are only two characters that can't appear in a Unix filename: '\x00' and '/'. -- Grant Edwards grant.b.edwardsYow!

Re: Obnoxious postings from Google Groups

2012-11-07 Thread Grant Edwards
ould have to agree. However when the task involves mainly manipulating files and running other programs, the clumsy control structures are a small enough price to pay for the ease with which bash deals with manipulating files/paths/programs. OTOH, you can use C shell or PHP and ge

Re: accuracy problem in calculation

2012-11-08 Thread Grant Edwards
or Fraction types, but be aware > that your script will probably run a lot slower. Or admit to yourself that the measurements that produce your input data just aren't that accurate anyway and forget about it. :) -- Grant Edwards grant.b.edwardsYow! Bo

Re: Simple Question regarding running .py program

2012-11-15 Thread Grant Edwards
On 2012-11-15, Mark Lawrence wrote: > On 15/11/2012 21:29, ru...@yahoo.com wrote: > > All I'll say is that when I read something on gmane via Thunderbird on > Windows Vista on any of the 25 Python mailing lists that I subscribe to, > I don't want to read the double spaced crap that comes from G$

Re: Constructing JSON data structures from non-string key python dictionaries

2012-11-21 Thread Grant Edwards
27;color': colors[0] }} ] > > Incidentally, dictionary keys in Python don't have to be strings, but > merely 'hashable', which includes integers, floats and tuples amongst > others. I think he meant that in his use case, the Python dictionary keys mus

Re: mini browser with python

2012-12-05 Thread Grant Edwards
, there was an "HTML" widget that allowed you to do that. Does Tkinter have something like that? -- Grant Edwards grant.b.edwardsYow! This ASEXUAL PIG at really BOILS my BLOOD gmail.com

Re: Keeping a Tkinter GUI alive during a long running process

2012-12-29 Thread Grant Edwards
after > the external process has terminated. Isn't there a way in Tkinter to have a file descriptor produce an event whenever it becomes readble? http://stackoverflow.com/questions/3348757/how-to-make-tkinter-repond-events-while-waiting-socket-data -- Grant Edwards

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Grant Edwards
nd line. I do use the "meld" visual diff program quite a bit... -- Grant Edwards grant.b.edwardsYow! As President I have at to go vacuum my coin gmail.comcollection! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is awesome (Project Euler)

2012-12-31 Thread Grant Edwards
ing their own out of chunks of flint. -- Grant Edwards grant.b.edwardsYow! Being a BALD HERO at is almost as FESTIVE as a gmail.comTATTOOED KNOCKWURST. -- http://mail.python.org/mailman/listinfo/python-list

Yet another attempt at a safe eval() call

2013-01-03 Thread Grant Edwards
r("operand expressions are not allowed to contain the string 'import'") globals = {'__builtins__': None} locals = symbolTable return eval(expr, globals, locals) I can guarantee that symbolTable is a dict that maps a set of string symbol names to inte

Re: Yet another attempt at a safe eval() call

2013-01-03 Thread Grant Edwards
On 2013-01-04, Tim Chase wrote: > On 01/03/13 17:25, Grant Edwards wrote: >> def lessDangerousEval(expr): >> global symbolTable >> if 'import' in expr: >> raise ParseError("operand expressions are not allowed to contain >> the st

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Steven D'Aprano wrote: > On Thu, 03 Jan 2013 23:25:51 +0000, Grant Edwards wrote: > >> I've written a small assembler in Python 2.[67], and it needs to >> evaluate integer-valued arithmetic expressions in the context of a >> symbol table that d

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Steven D'Aprano wrote: > On Fri, 04 Jan 2013 07:24:04 -0500, Terry Reedy wrote: > >> On 1/3/2013 6:25 PM, Grant Edwards wrote: >>> >>> I've written a small assembler in Python 2.[67], and it needs to >>> evaluate integer-valued arit

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Michael Torrie wrote: > On 01/04/2013 08:53 AM, Grant Edwards wrote: >> That's obviously the "right" thing to do. I suppose I should figure >> out how to use the ast module. > > Or PyParsing. > > As for your program being "sec

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Steven D'Aprano wrote: > On Thu, 03 Jan 2013 23:25:51 +0000, Grant Edwards wrote: > >> I've written a small assembler in Python 2.[67], and it needs to >> evaluate integer-valued arithmetic expressions in the context of a >> symbol table that d

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Chris Angelico wrote: > On Sat, Jan 5, 2013 at 3:38 AM, Grant Edwards wrote: >> I've added equals, backslash, commas, square/curly brackets, colons >> and semicolons to the prohibited character list. I also reduced the >> maximum length to 60 characte

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Chris Angelico wrote: > On Sat, Jan 5, 2013 at 4:14 AM, Grant Edwards wrote: >> On 2013-01-04, Chris Angelico wrote: >>> On Sat, Jan 5, 2013 at 3:38 AM, Grant Edwards >>> wrote: >> >>>> I've added equals, backslash, commas, sq

Re: Yet another attempt at a safe eval() call

2013-01-04 Thread Grant Edwards
On 2013-01-04, Chris Angelico wrote: > On Sat, Jan 5, 2013 at 5:09 AM, Grant Edwards wrote: >> The error messages are still pretty cryptic, so improving >> that will add a few more lines. One nice thing about the ast code is >> that it's simple to add code to allow

Re: Yet another attempt at a safe eval() call

2013-01-06 Thread Grant Edwards
On 2013-01-05, Oscar Benjamin wrote: > On 4 January 2013 15:53, Grant Edwards wrote: >> On 2013-01-04, Steven D'Aprano wrote: >>> On Thu, 03 Jan 2013 23:25:51 +, Grant Edwards wrote: >>> >>> * But frankly, you should avoid eval, and write your ow

Re: Thought of the day

2013-01-14 Thread Grant Edwards
On 2013-01-14, Steven D'Aprano wrote: > A programmer had a problem, and thought Now he has "I know, I'll solve > two it with threads!" problems. :) That took a few seconds -- must be the cold. -- Grant Edwards grant.b.edwards

Re: Python modules

2013-01-14 Thread Grant Edwards
ng and then after they've learned that add "by the way, don't actually do it that way". -- Grant Edwards grant.b.edwardsYow! Your CHEEKS sit like at twin NECTARINES above

Re: Parse a Wireshark pcap file

2013-01-23 Thread Grant Edwards
n script and just output some interesting key value pairs To what does "key value pairs" refer? -- Grant Edwards grant.b.edwardsYow! I am a traffic light, at and Alan Ginzberg kidnapped

Re: Looking under Python's hood: Will we find a high performance or clunky engine?

2012-01-23 Thread Grant Edwards
On 2012-01-22, Rick Johnson wrote: > What does Python do when presented with this code? It does what you tell it to. What else would you expect? -- Grant Edwards grant.b.edwardsYow! Are we wet yet?

Re: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-24 Thread Grant Edwards
On 2012-01-24, Chris Angelico wrote: > On Tue, Jan 24, 2012 at 4:57 PM, Rick Johnson > wrote: >> >> >> [RR's usual schtick] > All in favour, say "Aye" in Latin. All against, say "Plonk". I plonked RR ages ago. Now I only get to see his p

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread Grant Edwards
s are then converted into .dex files to run on Davlik. I don't know much at all about Jython, but if it generates JVM byte code, mightn't the same conversion to .dex be applicable? -- Grant Edwards grant.b.edwardsYow! What I want to find

Re: [semi OT]: Smartphones and Python?

2012-02-16 Thread Grant Edwards
On 2012-02-16, Grant Edwards wrote: > On 2012-02-16, Michael Torrie wrote: > >> You claimed Jython is or will be available on Android. It's not and >> Jython isn't being ported to Dalvik and it has nothing to do with >> patents. Android might use java a languag

Re: Python code file prototype

2012-02-17 Thread Grant Edwards
On 2012-02-17, John Gordon wrote: > In <66ea0353-02ee-4152-947a-97b44ff3e...@p7g2000yqk.googlegroups.com> Bruce > Eckel writes: > >> There's an option when you do this to insert default file contents, so >> I began searching the web for some kind of prototype Python file that >> would be appropr

Re: Python code file prototype

2012-02-18 Thread Grant Edwards
On 2012-02-17, Dennis Lee Bieber wrote: > On Fri, 17 Feb 2012 09:55:46 -0700, Ian Kelly > wrote: > >> >>The shebang has to be the first thing in the file to be useful. As it >>is above, it might as well not be there. I would suggest also >>including a doc string in the skeleton. >> > Of c

Re: Python as a default shell, replacement of bash, sh, cmd ?

2012-02-22 Thread Grant Edwards
data.log | sort ;) Any decent modern shell (e.g. Bash) is a stunningly powerful environment aimed at solving a certain sort of problems in a certain way. Python is aimed at solving a more general set of problems in an entirely different way. Yes, you can drive a nail with a screwdriver if you t

Re: Python math is off by .000000000000045

2012-02-22 Thread Grant Edwards
you want something else, then perhaps you should use rationals or decimals: http://docs.python.org/library/fractions.html http://docs.python.org/library/decimal.html -- Grant Edwards grant.b.edwardsYow! What I want to find at

Re: Python math is off by .000000000000045

2012-02-27 Thread Grant Edwards
for the solutions to their problems than do > comp.lang.python posters. > > http://compgroups.net/comp.lang.java.programmer/Floating-point-roundoff-error One might wonder if the frequency of such questions decreases as the programming language becomes "lower level" (e.g.

Re: The original command python line

2012-03-04 Thread Grant Edwards
On 2012-03-04, Chris Rebert wrote: > On Sat, Mar 3, 2012 at 9:38 PM, Damjan Georgievski wrote: >> How can I get the *really* original command line that started my python >> interpreter? > On Linux, you can read from: > /proc//cmdline > to get the null-delimited "command line". And if what y

Re: converting from tcl/tkl to python

2012-03-09 Thread Grant Edwards
tart since you know how Tk works (assuming the API for the newer themed widgets isn't too much different than the old widgets). -- Grant Edwards grant.b.edwardsYow! Give them RADAR-GUIDED at SKEE-BALL LANES and

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-14 Thread Grant Edwards
ou can kill them by name instead of having to look up the PID. It seems like an excellent thing to add to the "os" module. > Look for 'prctl' and 'PR_SET_NAME', which are the C-level function > and constant that do the job; a cursory examination of PyPI shows

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-15 Thread Grant Edwards
>>> >> >> I did google, I've played with Exemaker (it works perfect, but not py3) and >> i've seen questions on Stackoverflow. >> The thing I mean is a build feature of python to give such a name. Not 3rd >> part or etc. like Grant Edwards said. I

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-16 Thread Grant Edwards
On 2012-03-16, Chris Angelico wrote: > On Fri, Mar 16, 2012 at 5:39 AM, Grant Edwards > wrote: >> Seems like an awfully obtuse way of doing things -- I don't really >> want to have 15 different copies of Python (or even links), and it >> requires root privleges

Re: Is it technically possible to give Python option of naming process of running script?

2012-03-16 Thread Grant Edwards
ill ends up as python2.6 (or whatever the real binary is called). > > Try a hardlink instead of symlink? It seems to work for me. Not across different filesystems -- which was what I was talking about. -- Grant Edwards grant.b.edwardsYow! As President I have

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Grant Edwards
On 2012-03-28, Chris Angelico wrote: > for all you know, it might actually be stored as a sequence of > apples in a refrigerator [...] > There's no logical Python way to turn that into a series of bytes. There's got to be a joke there somewhere about how to eat an apple...

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Grant Edwards
. It's easy as long as you deal with nothing but ASCII and Latin-1. ;) -- Grant Edwards grant.b.edwardsYow! Somewhere in Tenafly, at New Jersey, a chiropractor gmail.comis viewing "Lea

Re: "convert" string to bytes without changing data (encoding)

2012-03-28 Thread Grant Edwards
: 33 are non-printing control characters (now mostly obsolete) that affect how text and space is processed and 95 printable characters, including the space (which is considered an invisible graphic). -- Grant Edwards grant.b.edwardsYow

Re: I look for a package to make some simple console "form"

2012-04-02 Thread Grant Edwards
their console-mode-installer (which was written in Python). But, the docs are pretty sparse, and it's not very active these days. > I would like very low level feature, form like sphinx quick start or > modern-package-template? Sorry, no clue what those are... -- Grant Edwards

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-04-03 Thread Grant Edwards
the new code an hooking it into the indicated spot with jump instructions. The mind wobbled. -- Grant Edwards grant.b.edwardsYow! I'm a fuschia bowling at ball somewhere in Brittany gmail.com -- http://mail.python.org/mailman/listinfo/python-list

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

2012-04-11 Thread Grant Edwards
On 2012-04-11, Antti J Ylikoski wrote: > I wrote about a straightforward way to program D. E. Knuth in Python, Yikes. I think if you're going to try to write AI in Pyton, you might want to start out programming something a bit simpler... ;) -- Grant Edwards grant.b

Re: Suggest design to accomodate non-unix platforms ?

2012-04-18 Thread Grant Edwards
tmp_file) >> result = os.system(cmd) >> >> ... on a Windows box it will fail because 'ssh' isn't part of Windows. > > ssh isn't guaranteed to be part of Unix/Linux systems surely. It's not absolutely, 100%, iron-clad guaranteed, but

Re: hex to bin 16 bit word

2012-04-27 Thread Grant Edwards
7;t exceed 0x1. This is probably better: n = int('0xc0a8'16) & 0x -- Grant Edwards grant.b.edwardsYow! What PROGRAM are they at watching? gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: hex to bin 16 bit word

2012-04-27 Thread Grant Edwards
On 2012-04-27, Grant Edwards wrote: > On 2012-04-27, Paul Rubin wrote: >> python writes: >>> What to decode hex '0xC0A8' and return signed short int. >> >> Is this right? >> >> n = int('0xC0A8', 16) >> if n >= 0xf

Re: hex to bin 16 bit word

2012-04-27 Thread Grant Edwards
On 2012-04-27, Grant Edwards wrote: > On 2012-04-27, Grant Edwards wrote: >> On 2012-04-27, Paul Rubin wrote: >>> python writes: >>>> What to decode hex '0xC0A8' and return signed short int. >>> >>> Is this right? >>>

Re: serial module

2012-05-22 Thread Grant Edwards
the normal ISA/PCI-attached drivers. The main things you'll notice are differences in buffer/fifo sizes and the timing of things like commands to set/clear modem control lines. -- Grant Edwards grant.b.edwardsYow! I didn't order any

<    1   2   3   4   5   6   7   8   9   10   >