Saving an image to file from windows clipboard

2005-10-07 Thread stephen
'convert "' + myfile + '" "' + myfile.replace('bmp','png') + '"' popen(command).read() myfile.remove() Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Saving an image to file from windows clipboard

2005-10-07 Thread stephen
Thanks -- works as advertised. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Photo layout

2005-06-27 Thread stephen
http://www.reportlab.org > > Note: I'm assuming the photos are in .JPG, .TIF or some format that > PIL can recognize. If they are in some proprietary RAW format you > will need to convert them first. > > -Larry Bates > > Stephen Boulet wrote: > > Is there a python sol

Passing a variable number of arguments to a wrapped function.

2005-08-05 Thread stephen
idth: plot(xvalues, yvalues, linecolor, linewidth=linewidth) elif linecolor: plot(xvalues, yvalues, linecolor) elif linewidth: plot(xvalues, yvalues, linewidth=linewidth) else: plot(xvalues, yvalues) Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing a variable number of arguments to a wrapped function.

2005-08-05 Thread stephen
Using 'plot(*args, **kwargs)' does seem to work just fine. Thanks to all for their suggestions. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: "Best" way to SIGHUP spamd from web page?

2005-02-18 Thread stephen
Webmin (webmin.com) has a command shell module (cgi over https?). Isn't this an example of a secure way to run commands via the internet? Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: PHP vs. Python

2004-12-23 Thread Stephen
I like the idea of being able to port specific sections to C ... Python seems more flexible than PHP ... scalable. We're mainly using it to drive dynamic web apps ... online store ... etc. Thanks Again! Stephen -- http://mail.python.org/mailman/listinfo/python-list

Help with python_fold.vim

2005-12-20 Thread stephen
I see that the python_fold plugin for vim lets you fold classes/functions, etc. Can someone tell me how to fold/unfold sections? Thanks. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with python_fold.vim

2005-12-20 Thread stephen
opens them all recursively, zm closes them all one level, and zM closes them all recursively.""" Stephen -- http://mail.python.org/mailman/listinfo/python-list

Printing a percent sign

2006-09-25 Thread stephen
Hi all. How do I escape the "%" sign in a print statement so that it prints? Thanks. Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing a percent sign

2006-09-25 Thread stephen
Thanks -- a percent escapes itself when using %-formatting. Stephen [EMAIL PROTECTED] wrote: > Hi all. How do I escape the "%" sign in a print statement so that it > prints? Thanks. > > Stephen -- http://mail.python.org/mailman/listinfo/python-list

Looping over a list question

2006-10-03 Thread stephen
here ever been a proposal for this? Just wondering ... Stephen Boulet -- http://mail.python.org/mailman/listinfo/python-list

Re: Looping over a list question

2006-10-03 Thread stephen
mming 'phrasings' resonate with different people. For me, for example, lambda causes my eyes to glaze over. I do love list comprehensions though. I'd also love to see string constants implemented some day too (like str.whitespace and str.ascii_letters). Stephen -- http://mail.python.org/mailman/listinfo/python-list

Newbie Help!

2006-02-05 Thread Stephen
Hi All, im new to python i just have a few questions and was wondering if you could help me?? 1. what programming langaugue does python use? or which is most popular? 2. Does anyone know where i could get hold of practice code 3. Any good ebooks or links to start with. (according to the

Re: ~!~ Britneys New BOOBS

2007-05-17 Thread STEPHEN
netto 24 bottles 33l 9.99 grolch <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > http://scargo.in - Download pics and videos of Britneys new Boob job > see her new tits naked! > -- http://mail.python.org/mailman/listinfo/python-list

Re: List append

2007-09-14 Thread Stephen
In your code, "array" is a class attribute, so it is shared among all instances. You need to use the __init__ method to define instance (data) attributes instead: def __init__(self): self.array = [] On Sep 14, 11:25 pm, mouseit <[EMAIL PROTECTED]> wrote: > I'm trying to add an element to a li

Tkinter Status on OSX

2007-10-21 Thread stephen
Hey guys, What is that status of Tkinter on OSX (10.4.10)? I have tried several installations (Python 2.4.4, 2.5 and 2.5.1) all from the official distro sites and others each version has the same major issue.Theproblem is simple to recreate, use any of the simple sample code available here: http:

Reading a tab delimited text file.

2009-02-23 Thread Stephen
Hi, I would like to read a text file of numbers produced by a data acquisition system into three vectors of doubles. The contents of the file are: +0.000e+0 +2.7645134e+1 +2.7745625e+1 +0.4100041e-1 +2.7637787e+1 +2.7731047e+1 +0.0820008e+0 +2.7645134e+1 +2.7750483e+1 ... or +

Re: Reading a tab delimited text file.

2009-02-23 Thread Stephen
On Feb 23, 4:06 pm, Tim Chase wrote: > > I would like to read a text file of numbers produced by a data > > acquisition system into three vectors of doubles. The contents of the > > file are: > > > +0.000e+0      +2.7645134e+1   +2.7745625e+1 > > +0.4100041e-1      +2.7637787e+1   +2.7731047e+

git_revision issues with scipy/numpy/matplotlib

2012-07-06 Thread Stephen Webb
I installed py27-numpy / scipy / matplotlib using macports, and it ran without failing. When I run Python I get the following error: $>> which python /Library/Frameworks/Python.framework/Versions/2.7/bin/python $>> python Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (

Re: git_revision issues with scipy/numpy/matplotlib

2012-07-07 Thread Stephen Webb
I think the easiest thing to do would be to remove the python.org Python entirely, kill it from the path (which I've already done), and install directly a MacPorts version of Python. Any caveats or warnings about getting rid of the /Library/Frameworks/Python directory? On Jul 7, 2012, at J

multiprocessing help

2012-11-06 Thread Stephen Bunn
t want to say all processes that spawned from here $@%@$% DIE. Thanks in advance for anybody that has some spare time to point me in the right direction. I am grateful. Thanks. Very Respectfully, Stephen Bunn scb...@sbunn.org sqlimport.py Description: Binary data daemon.py Description: Binary

Embedding Python27 in C++ on Windows: CRT compatibility issues with VS2010?

2012-05-24 Thread Stephen Lin
but should use VS2008 instead, or are there other workarounds? Thanks for the help, Stephen -- http://mail.python.org/mailman/listinfo/python-list

running multiple scripts -- which way is more elegant?

2011-06-19 Thread Stephen Bunn
List, First I'm very new to Python. I usually do this kind of thing with shell scripts, however, I'm trying to move to using python primarily so I can learn the language. I'm attempting to write a script that will check a server for various configuration settings and report and/or change based

Re: running multiple scripts -- which way is more elegant?

2011-06-19 Thread Stephen Bunn
On Mon, Jun 20, 2011 at 1:26 PM, Chris Angelico wrote: > > I'd be inclined toward the second solution if I'm writing all the code > > myself > On Mon, Jun 20, 2011 at 3:21 PM, Florencio Cano wrote: > I'm with Chris, if the config_scripts are going to be implemented in > Python always, the second

Re: running multiple scripts -- which way is more elegant?

2011-06-20 Thread Stephen Bunn
On Mon, Jun 20, 2011 at 11:19 PM, Florencio Cano wrote: > > import config_script obviously doesn't work and __import__(config_script) > > works from the python interpreter but fails in the script (ImportError: > > Import by filename is not supported.) > > You can use this: > > exec("import " + mod

Re: Windows service in production?

2011-08-18 Thread Stephen Hansen
ce" application we use in our company instead. It runs as a service, and executes any random series of programs beneath it, creating JOB's for each so any subprocesses of they launch all get killed together cleanly, and handling dependencies via between them through various means, and stuff

Re: try... except with unknown error types

2011-08-19 Thread Stephen Hansen
lar bit of code must not, under any circumstances, not ultimately work. Even going so far as to start having hour long waits between retries until the other side is finally up :P) -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http

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

2011-08-21 Thread Stephen Hansen
and generally thought of as merely syntactical sugar for: n = n + x ... lets one easily think that this should be entirely safe, even with mutable objects, because if += were merely syntactical sugar, it would be. But its not! Because += is wiggly. It can do more then one entirely differe

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

2011-08-21 Thread Stephen Hansen
ecause my criticism isn't about one choosing to do crazy stuff with the object model. I've never advocated Python be strict about rules. But for Python, all by itself, with nothing but built-in and basic types, to have a situation where: a = a + b a += b ... does two very dis

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

2011-08-21 Thread Stephen Hansen
On 8/21/11 9:37 PM, Stephen Hansen wrote: > But, += is Python itself adding an unpredictable behavior into the core > language, with its own base types behaving ... very differently to fundamental, basic appearing operators. Editing fail on my part. Similarly: > But for Python, all

Re: questions (& answers) about object, type, builtin types, class, metaclass and __getattribute__

2011-08-22 Thread Stephen Hansen
ject (but NOT in the case of __*__ methods, usually, which are obtained internally by a direct struct access, i.e., mytype->tp_new gets mytype.__new__). If no such attribute exists, it goes along to do its default attribute-resolution process, including the descriptor protocol and dict checkin

Re: Error when deleting and reimporting subpackages

2011-08-22 Thread Stephen Hansen
you'll be able to re-import apkg.subpkg. I.e: Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>>

Re: Error when deleting and reimporting subpackages

2011-08-22 Thread Stephen Hansen
On Mon, Aug 22, 2011 at 12:14 PM, Matthew Brett wrote: > Yes, sorry, I should have mentioned that I explored these kind of > variations. > > I think I see that there isn't an obvious way for del sys.modules['apkg'] > to know to delete or modify 'apkg.subpkg', because sys.modules is just a > dict.

Re: Windows No-Install Distribution?

2011-08-23 Thread Stephen Hansen
nience of customers who want to auto-install via Group Policy). In most situations, Python's good at "finding itself", i.e. where the python.exe is actually located -- and it boostraps the location of everything else based on that. -- Stephen Hansen ... Also: Ixokai

Re: Run time default arguments

2011-08-27 Thread Stephen Hansen
t;? That's a kind of odd thing to do, I think. In Python at least. Why not just: debug = defaults.get("debug", None) (Strictly speaking, providing None to get is not needed, but I always feel odd leaving it off.) That's generally how I spell it when I need to do run tim

Re: is there any principle when writing python function

2011-08-27 Thread Stephen Hansen
t. The entire idea that its hard, time-consuming, effort-draining or difficult to make code clean and "pretty" from the get-go is just wrong. You don't need to do a major "prettying up" stage after the fact. Sure, sometimes refactoring would greatly help a body of code as

Re: Arrange files according to a text file

2011-08-27 Thread Stephen Hansen
= max(ratios) > owner = usernames[ratios.index(best)] > print filename,":",owner It amazes me that I can still find a surprising new tool in the stdlib after all these years. Neat. /pinboards -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (

Re: Understanding .pth in site-packages

2011-08-27 Thread Stephen Hansen
event people from seeing the code*, they're just regular zip files and can be unzipped fine. I almost always install unzip my eggs on a developer machine, because I inevitably want to go poke inside and see what's actually going on. -- Stephen Hansen ... Also: Ixokai ... M

Re: Interact with SQL Database using Python 2.4 or lower

2011-08-28 Thread Stephen Hansen
and are fairly competitive. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Interact with SQL Database using Python 2.4 or lower

2011-08-28 Thread Stephen Hansen
On 8/28/11 10:23 PM, Chris Angelico wrote: > On Mon, Aug 29, 2011 at 3:09 PM, Stephen Hansen > wrote: >> Get a new webhost. ... >> >> But I don't know if they have a warehouse in Australia, if their latency >> with any of their various data centers is suitable

Re: Web hosting when you need to install your own modules (was Re: Interact with SQL Database using Python 2.4 or lower)

2011-08-28 Thread Stephen Hansen
around that a long time ago, and now always keep the jobs of managing my DNS record and hosting my sites /totally/ separate. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital

Re: Threads in Python

2011-09-01 Thread Stephen Hansen
arty module; Twisted's asynch dispatching isn't really exactly concurrency, but it does a better job then concurrency does for some operations; someone's always working on coroutines in some fashion or another, which is another kind of concurrency.) Lots of different ways to go concurren

Re: Detecting Ctrl-Alt-Del in Windows

2011-09-02 Thread Stephen Hansen
ole point of that secure sequence is that the OS and only the OS responds. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] allow line break at operators

2011-09-03 Thread Stephen Hansen
ke it worth the complication. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ * Obvious exaggeration :P signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with simple OOP Python question

2011-09-05 Thread Stephen Hansen
is single "sub" dictionary with all instances of your A class. If you want to define instance-specific attributes, define them in the __init__ method, like so: class A: def __init__(self): self.sub = dict() def sub_add(self, cls): obj = cls() self.sub[o

builtin max() and weak ordering

2011-03-03 Thread Stephen Evans
, Alexander and Paul McJones. 2009. Elements of Programming. Addison Wesley. Pages 52-53 The code below demonstrates the issue. Using the total key gives the correct result. Using the weak key returns the "incorrect" result. Tested with Python 2.7.1 and 3.1.2 (applies to 3.2) Ste

Python programming language vulnerabilities

2017-09-09 Thread Stephen Michell
in Python (for technical level, persons that provide technical supervision to implementers, or that write and maintain organizational Python coding standards. If you are interested in helping, please reply to this posting. Thank you Stephen Michell Convenor, ISO/IEC/JTC 1/SC 22/WG 23

Re: Python programming language vulnerabilities

2017-09-10 Thread Stephen Michell
My apologies. I maintain that website. There should have been no broken links. I will fix that. The previous version of TR 24772 had annexes for language-specific material. We have split those out, so the main document (Tr 24772-1) only has language independent material. The last Python documen

Re: Python programming language vulnerabilities

2017-09-11 Thread Stephen Michell
CORRECTION. My sincere apologies to anyone that tried the link that I posted. The actual link is www.open-std.org/jtc1/sc22/wg23 follow the link to documents, or go directly there via www.open-std.org/jtc1/sc22/wg23/docs/documents.html I was informed that there are some broken links to documen

Re: integer copy

2017-10-20 Thread Stephen Tucker
ast, For what it's worth, After a = 5 b = 5 afloat = float(a) bfloat = float(b) afloat is bfloat returns False. Stephen Tucker. On Fri, Oct 20, 2017 at 9:58 AM, ast wrote: > > "ast" a écrit dans le message de > news:59e9b419$0$3602$426a7...@news.free.fr... >

Printing Unicode strings in a list

2022-04-28 Thread Stephen Tucker
ythonic way of doing it than concatenating them into a single string and printing that? 4. Does Python 3.x exhibit the same behaviour as Python 2.x in this respect? Thanks in anticipation. Stephen Tucker. -- https://mail.python.org/mailman/listinfo/python-list

Re: Printing Unicode strings in a list

2022-04-28 Thread Stephen Tucker
uses Python 2.x. The team are moving to an updated version of the system whose Python interface is Python 3.x. However, I am expecting to retire over the next 8 months or so, so I do not need to be concerned with Python 3.x - my successor will be doing that. Stephen. On Thu, Apr 28, 2022 at 2:

Discerning "Run Environment"

2022-05-18 Thread Stephen Tucker
oal (b). Can anyone please tell me if there is, and, if there is, what it is? Thanks. Stephen Tucker. -- https://mail.python.org/mailman/listinfo/python-list

Re: on GNU EMACS's python-mode, loading entire buffer

2022-09-29 Thread Stephen Berman
On Sun, 04 Sep 2022 16:47:07 -0300 Meredith Montgomery wrote: > Meredith Montgomery writes: > >> Meredith Montgomery writes: >> >> [...] >> >>> I would also be interested in a command that restarts the REPL afresh >>> and reloads my buffer --- sort of like keyboard's [F5] of the IDLE. >> >> A

Are these good ideas?

2022-11-14 Thread Stephen Tucker
ng had the idea described above, I am considering using it again to save all the parameter-and-results passing. I see nothing wrong with doing that, but I may well be missing something! Comments, please! Stephen Tucker. -- https://mail.python.org/mailman/listinfo/python-list

file.read Method Documentation (Python 2.7.10)

2023-01-09 Thread Stephen Tucker
in the Python 3.x documentation? Stephen Tucker. -- https://mail.python.org/mailman/listinfo/python-list

Re: file.read Method Documentation (Python 2.7.10)

2023-01-11 Thread Stephen Tucker
underlying fread() C function, and will behave the same in corner cases, such as whether the EOF value is cached. Stephen. On Mon, Jan 9, 2023 at 6:25 PM Chris Angelico wrote: > On Tue, 10 Jan 2023 at 01:36, Stephen Tucker > wrote: > > > > Dear Python-list, > > > > Yes

Re: file.read Method Documentation (Python 2.7.10)

2023-01-11 Thread Stephen Tucker
Chris, Thanks for your reply. I hope the evidence below (taken from IDLE) clarifies my issue: Stephen. == 1. Create BOM.txt - >>> myfil = open ("BOM.txt", "wb") >>> myfil.write ("\xef" + "\xbb"

Re: file.read Method Documentation (Python 2.7.10)

2023-01-12 Thread Stephen Tucker
sider this enquiry closed. Stephen. On Wed, Jan 11, 2023 at 5:36 PM Chris Angelico wrote: > On Thu, 12 Jan 2023 at 04:31, Stephen Tucker > wrote: > > 1. Create BOM.txt > > 2. Input three bytes at once from BOM.txt and print them > > 3. Input three bytes one at a time from

IDLE "Codepage" Switching?

2023-01-17 Thread Stephen Tucker
quot; >>> for thisCP in range (158, 169): mylongstr += chr (thisCP) + " " >>> print mylongstr ž Ÿ ¡ ¢ £ ¤ ¥ ¦ § ¨ >>> mylongstr = "" >>> for thisCP in range (157, 169): mylongstr += chr (thisCP) + " " >>>

Re: IDLE "Codepage" Switching?

2023-01-18 Thread Stephen Tucker
ce the strange glyphs); Bytes 192 to 255 (C0 to FF) inclusive were output as UTF-8-encoded characters - without any offset being added to their codepoints in the meantime! I thought you might just be interested in this - there does seem to be some method in IDLE's mind, at least. Stephen Tucker.

Precision Tail-off?

2023-02-13 Thread Stephen Tucker
. Is the same behaviour exhibited in Python 3.x? For your information, the first 20 significant figures of the cube root in question are: 49793385921817447440 Stephen Tucker. -- >>> 123.456789 ** (1.0 / 3.0) 4.979338592181744 >>> 123456

Re: Precision Tail-off?

2023-02-17 Thread Stephen Tucker
otN. I rest my case. Perhaps this observation should be brought to the attention of the IEEE. I would like to know their response to it. Stephen Tucker. On Thu, Feb 16, 2023 at 6:49 PM Peter Pearson wrote: > On Tue, 14 Feb 2023 11:17:20 +, Oscar Benjamin wrote: > > On Tue, 14 Feb

Re: Precision Tail-off?

2023-02-17 Thread Stephen Tucker
10 ** (math.log10 (12345678900) / 3) 4.979338592181736e+16 >>> 12345678900 ** (1.0 / 3.0) 4.979338592181734e+16 >>> 123456789e42 ** (1.0 / 3.0) 4.979338592181734e+16 ------ Stephen Tucker. On Fri, Feb

Python 2.7 range Function provokes a Memory Error

2023-03-02 Thread Stephen Tucker
behave the same way? 2. Is there any equivalent way that behaves more like a for loop (that is, without producing a list)? To get round the problem I have written my own software that is used in a for loop. Stephen Tucker. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7 range Function provokes a Memory Error

2023-03-06 Thread Stephen Tucker
n it won't handle Python integers either. AND (b) IF xrange in Py3 is intended to be equivalent to range (which, even in Py2, does handle Python integers) THEN It could be argued that xrange in Py3 needs some attention from the developer(s). Stephen Tucker. On Thu, Mar 2, 2023 at 6:24 PM

Are there Python modules that allow a program to write to the screen?

2021-04-25 Thread Stephen Tucker
Hi, I have old software written in GWBASIC that I use to plot diagrams on the screen. In Windows 10, I have to resort to using the DOSBox emulator to run it. I would dearly like to re-write it in Python - ideally Python 2.7. What, if anything, is available? Stephen Tucker. -- https

Re: Trying to read from a text file to generate a graph

2021-07-28 Thread Stephen Berman
[Resending to the list only, since I couldn't post it without subscribing.] On Wed, 28 Jul 2021 11:58:21 -0400 "Steve" wrote: > I forgot about the no-file rule... > >> On 28Jul2021 02:55, Steve wrote: >> I am going though a struggle with this and just don't see where it >> fails. I am using th

Is there a better way to create a list of None objects?

2021-08-12 Thread Stephen Tucker
) * 8) TypeError: unsupported operand type(s) for *: ... # diclll_BLim [thisISO_] = list ((None,) * 8) --- Thanks in anticipation. Stephen Tucker. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a better way to create a list of None objects?

2021-08-12 Thread Stephen Tucker
Thanks for this feedback, Chris, Matthieu. Both are spot on - and thanks for the timing comparison, Matthieu. I suppose I didn't think to try the solution you suggest because I didn't think that I would end up with a single list, but 8 of them. OK, I'll stop wriggling. Stephen.

Re: degrees and radians.

2016-08-24 Thread Stephen Tucker
For what it's worth, mathematicians naturally work with angles in radians. The mathematics of the trignonmetric functions works naturally when the angle is expressed in radians. For the older among us, logarithms also have a "natural" base, and that is the number e. Back in those days, however, e

Re: Doubled backslashes in Windows paths

2016-10-07 Thread Stephen Tucker
nted to the Windows Command interpreter, the spaces are accepted as part of it without the need then of enclosing quotes. Hope this helps. Yours, Stephen Tucker. On Fri, Oct 7, 2016 at 6:30 AM, Oz-in-DFW wrote: > I'm using Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC >

Re: Quick way to calculate lines of code/comments in a collection of Python scripts?

2016-10-24 Thread Stephen Tucker
mn of line counts; Import these lines into an Excel Spreadsheet and calculate whatever you like with them. Stephen. On Sun, Oct 23, 2016 at 9:51 PM, Tomasz Rola wrote: > On Wed, Oct 05, 2016 at 01:56:59PM -0400, Malcolm Greene wrote: > > Looking for a quick way to calculate lines of c

Re: calling a program from Python batch file

2016-12-07 Thread Stephen Tucker
This might be totally irrelevant, but, if (a) the data to be read by the program during a given run is known when the program is run/launched, (b) that data is purely textual and (c) that data can be read by the program from the stdin channel, then my idea is (1) before the launch, put that data in

Re: Ruby parens-free function calls [was Re: Accessing parent objects]

2018-03-27 Thread Stephen Hansen
t encourage the petulant little meat-heads to follow > some sensible styling rules. My god, I've been away from this list for quite awhile, but we're still entertaining this fool? -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2018-06-05 Thread Stephen Tucker
I have found Learning Python by Mark Lutz helpful. I have the 4th edition (2009). Its ISBN is 978-0-596-15806-4. A lot will depend on your learning style. This book reads more like a set of course notes than a reference book, but it does contain tables and summaries, too. On Tue, Jun 5, 2018 at 5

Re: Question about floating point

2018-08-28 Thread Stephen Tucker
are want the computer to behave more like you would want it to behave. Regards, Stephen Tucker. On Tue, Aug 28, 2018 at 3:11 PM, Frank Millman wrote: > Hi all > > I know about this gotcha - > > x = 1.1 + 2.2 >>>> x >>>> >>> 3.30

Re: Python Array

2016-03-30 Thread Stephen Hansen
On Wed, Mar 30, 2016, at 10:34 PM, tdspe...@gmail.com wrote: > as you can see the option element was added third but is the first one > displayed. > > Is this just standard - I am using Python 3.5 The order of items in dictionaries is based on the hash value -- which while stable, should be consi

Re: Strange range

2016-04-02 Thread Stephen Hansen
decisions against. Most code exists outside the stdlib. --- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Stephen Hansen
On Sat, Apr 9, 2016, at 12:25 PM, Mark Lawrence via Python-list wrote: > Again, where is the relevance to Python in this discussion, as we're on > the main Python mailing list? Please can the moderators take this stuff > out, it is getting beyond the pale. You need to come to grip with the fact

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
x27;re asking is why this returns a tuple, where in the first eval you got a string. The answer is because commas create tuples (not parens), so: "String1", "String2" is a tuple expression. Whereas: "String1" is a string expression. > the ques

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Stephen Hansen
x27;t. Your mistake is again -- parens don't make tuples, commas do. A one element tuple is: >>> b = ("hello,) The parens are optional, I always put them in because: >>> b = "hello", The parens group an expression, they don't make a type. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:18 PM, Stephen Hansen wrote: > The parens are optional, I always put them in because: > >>> b = "hello", Ahem, "because its easy to miss the trailing comma" is what I meant to say here. -- https://mail.python.org/mailman/listinfo/python-list

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:22 PM, Fillmore wrote: > Hold on a sec! it turns up that there is such thing as single-element > tuples in python: > > >>> c = ('hello',) > >>> c > ('hello',) > >>> c[0] > 'hello' > >>> c[1] > Traceback (most recent call last): >File "", line 1, in > IndexError

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:17 PM, Fillmore wrote: > On 04/10/2016 07:30 PM, Stephen Hansen wrote: > > > There's nothing inconsistent or surprising going on besides you doing > > something vaguely weird and not really expressing what you find > > surprising.

Re: Parens do create a tuple (was: one-element tuples [Was: Most probably a stupid question, but I still want to ask])

2016-04-10 Thread Stephen Hansen
at I should have mentioned the empty tuple exception that proves the rule. The only time you need parens is to resolve ambiguity. To suggest that parens do make tuples confuses the issue, given things like this: >>> a = 1,2,3 >>> b = (1, 2, 3) -- Stephen Hansen m e @ i x o k a

Re: one-element tuples

2016-04-10 Thread Stephen Hansen
en: >>> a = '"string1",' Note the trailing comma. > I can tell you that it exists because it bit me in the butt today... > > and mind you, I am not saying that this is wrong. I'm just saying that it > surprised me. If the above doesn't explain it, then I still don't understand what you're finding surprising and what you'd expect otherwise. ---Stephen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
ile multiples will return a tuple, but how you're doing that (checking the type of the result) is fine. --Stephen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: one-element tuples

2016-04-10 Thread Stephen Hansen
th your words: code is good, show code, don't get me wrong, but you need to express your expectations and how the difference between what happened and what you expected surprised you. Both parts, the code and the expression of your thoughts, are really important to getting help around here :)

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 10:18 PM, Rustom Mody wrote: > On Monday, April 11, 2016 at 10:17:13 AM UTC+5:30, Stephen Hansen wrote: > > On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > > > and the (almost always to be avoided) use of eval() > > > > FWIW, there&#x

Re: The reason I uninstalled Python 3.5.1 (32-bit) for Windows

2016-04-12 Thread Stephen Hansen
folder. If you can't use pip while in the same directory as pip.exe, I don't even know what is wrong. That said, you can access pip via 'python -m pip args' instead of using the pip executable. -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: hourly weather forecast data

2016-04-12 Thread Stephen Hansen
etch a RSS feed from Wunderground. But that was awhile ago and I don't see the obvious RSS links banymore. Did you see: https://www.wunderground.com/weather/api/d/docs -- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: How to XOR a byte output?

2016-04-13 Thread Stephen Hansen
at which point its no longer bytes (and before you did something to it besides displaying it, you'd want to decode it back to bytes again, probably). --Stephen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: sys.exit(1) vs raise SystemExit vs raise

2016-04-15 Thread Stephen Hansen
> * You can use named constants from ‘os’ for the purpose of specifying > exit status numbers. Only on *nix. Even then it varies from platform to platform which constants you can use. I'd prefer to document the return status and use numbers/my own constants directly, that way supporting any p

Re: Guido sees the light: PEP 8 updated

2016-04-16 Thread Stephen Hansen
the core devs taste and particular needs, and it goes out of its way to say that it is only a suggestion and other concerns (especially local consistency) override its advice. --- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7

2016-04-16 Thread Stephen Hansen
bian, it should come pre-installed. --- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: How much sanity checking is required for function inputs?

2016-04-19 Thread Stephen Hansen
n user error messages, not exceptions. Note, 1) doesn't mean I always raise a nicer message, it means if "KeyError" is ambiguious or odd, I raise a better and more informative one. But you're getting nothing swapping out KeyError for Exception(lotsofwords). I use 1) more to be less 'nicer' and more, er, 'more specific'. Since I don't like exceptions to rise to the user level where niceness is needed. --Stephen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

Re: How much sanity checking is required for function inputs?

2016-04-19 Thread Stephen Hansen
On Tue, Apr 19, 2016, at 11:09 PM, Ethan Furman wrote: > On 04/19/2016 10:51 PM, Stephen Hansen wrote: > > I use 1) more to be less 'nicer' and more, er, 'more specific'. Since I > > don't like exceptions to rise to the user level where niceness is > &g

Re: Running lpr on windows from python

2016-04-20 Thread Stephen Hansen
mmandline = r"C:\windows\system32\lpr.exe -S 172.28.84.38 -P RAW C:\john\myfile" The r in front of the string makes it a raw string so you don't have to double up the slashes. --- Stephen Hansen m e @ i x o k a i . i o -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >