Re: strange subprocess behavior when calling ps

2010-11-16 Thread Roger Davis
Thanks, Ned! That really helps to explain what is going on. Now, just a couple more questions and I think I will know all I need to know. First, I *still* don't quite understand why this happens with my 2.6.6 interpreter but not my 2.6.1, and why another of the respondents to this thread (Chris) c

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Roger Davis
> Completely off topic but I think the try clause could be rewritten that way: > ... > Don't use bare except clause, you're masking syntax errors for instance, > which will be flagged as 'unexpected error in generation ...". > In a more general manner, if something unexpected happens it's better t

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Roger Davis
On Nov 16, 11:19 pm, Ned Deily wrote: > Interesting.  It appears that OS X 10.6 takes into account the ... Thanks very much for your thorough explanation, Ned! I think I've got what I need now. Roger -- http://mail.python.org/mailman/listinfo/python-list

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Roger Davis
Thanks for the clarification on exceptions, Chris! Roger -- http://mail.python.org/mailman/listinfo/python-list

Re: strange subprocess behavior when calling ps

2010-11-18 Thread Roger Davis
Hi JM, Thank you very much for your followup explanation! Roger -- http://mail.python.org/mailman/listinfo/python-list

Re: python wia and RegisterEvent

2010-04-18 Thread Roger Upole
t; What am I missing? You need to be processing messages to receive COM events. Try replacing your sleep loop with pythoncom.PumpMessages(). Roger -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.X vs. 3.X - level of acceptance?

2010-04-27 Thread Roger Binns
It is disturbing just many 2.3 users there still are though. Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkvXFTUACgkQmOOfHg372QR7YwCgpZdsgkV9iBy/1/8eIBwxy3S4 Sy8AoI8vsivExNADG9Bmx+WbWTQN74V

Re: Loading C extension from memory

2010-05-19 Thread Roger Binns
inux, Windows, 32 and 64 bit. If the local machine doesn't have a compiler you can even use libtcc or something newer. For example see this 3 year old page, as well as links at the bottom: http://www.cs.tut.fi/~ask/cinpy/ Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU

Re: Python preprosessor

2009-06-07 Thread Roger Binns
buffers in py2), long ints (needing L suffix in some py2 versions), the next() builtin from py3, exec syntax differences etc. You can see more details in the first 120 lines of http://code.google.com/p/apsw/source/browse/apsw/trunk/tests.py Roger -BEGIN PGP SIGNATURE- Version: GnuP

Re: Opening a SQLite database in readonly mode

2009-07-06 Thread Roger Binns
tables (you provide the underlying data for the SQL queries to work on) and VFS (you provide the file access). See this link for more details: http://apsw.googlecode.com/svn/publish/pysqlite.html Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFA

Re: hoe to build a patched socketmodule.c

2009-07-09 Thread Roger Binns
You'll also be able to control how read and write are done (eg read vs recvfrom vs recvmsg vs readv). You can use os.fdopen to convert your raw file descriptor into a Python file object if appropriate. If you do use ctypes then you'll only need to distribute pure Python source code. Roge

Re: Test for Pythonwin?

2009-07-31 Thread Roger Miller
On Jul 31, 2:09 am, "steve" wrote: > Is there a good way to check if a script is running inside Pythonwin? > Perhaps a property or method that is exposed by that environment? I've used if sys.stdin.fileno() < 0: This is not precisely a test for pythonwin, but indicates whether standard streams

Re: Do anyone here use Python *embedded* in a database?

2009-08-05 Thread Roger Binns
ich database servers are more tuned for. Roger -- http://mail.python.org/mailman/listinfo/python-list

Re: where is ctrl+newline handled in pywin editor?

2009-09-22 Thread Roger Upole
(same as a normal enter). ProcessEnterEvent in \pythonwin\pywin\framework\interact.py checks whether the shift or ctrl keys were used. Roger -- http://mail.python.org/mailman/listinfo/python-list

Re: Querying for ownership of file shared by Samba fails with "MemoryError: allocating SECURITY_DESCRIPTOR"

2009-09-23 Thread Roger Upole
AT32 filesystem. This has absolutely no ACL or >>permission capabilities on it. Win NT, 2K, XP use NTFS by default, >>which allows ACLS. > > Any insights would be greatly appreciated. > > Steve Walker > middleforkgis aht gmail.com > If I remember correctly, GetFileSecurity can work unpredictably with file systems that don't support ACL's. Try using win32security.GetNamedSecurityInfo instead. Roger -- http://mail.python.org/mailman/listinfo/python-list

what happens to Popen()'s parent-side file descriptors?

2010-10-13 Thread Roger Davis
Hi, I am new to this group, please forgive me if this is a repeat question. I am a new Python programmer but experienced in C/Unix. I am converting a shell script to Python which essentially loops infinitely, each pass through the loop running commands like set output = `cat this | grep that

Re: what happens to Popen()'s parent-side file descriptors?

2010-10-14 Thread Roger Davis
Many thanks to all who responded to my question! It's nice to know, as someone new to Python, that there are lots of well-informed people out there willing to help with such issues. Thanks, Mike, for your pipes suggestion, I will keep that in mind for future projects. Seebs, you are of course cor

IDLE debugger questions

2010-10-22 Thread Roger Davis
), it only adds a line-break into the source code. Any suggestions? Thanks! Roger Davis -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE debugger questions

2010-10-23 Thread Roger Davis
Thanks for that info, Ned, I can now get the sys.argv[] list I need, that's a big help! However, is there any other way to set a breakpoint in idle that will work on Mac OS X, maybe entering a manual command somewhere with a specified line number? Inability to set a breakpoint is an absolute showst

Re: A question on modification of a list via a function invocation

2017-09-04 Thread ROGER GRAYDON CHRISTMAN
>Does a poor job AFAIAC of explaining the difference between foo and bar in foll def foo(x): x += 2 def bar(x): x.append(2) a=10 b=[10] foo(a) a >10 bar(b) b >[10, 2] Or with just one function: >>> def baz(x,y): x += y >>> a = 10 >>> b = [10] >>> baz(a

Re: A question on modification of a list via a function invocation

2017-09-06 Thread ROGER GRAYDON CHRISTMAN
asing, of course, since most assignment operationscreate aliases. But at least it's nice to know that aliasing immutable valuesis harmless. Hence my unit on building recursive data structures entirelyout of tuples. Roger ChristmanPennsylvania Sate University -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple game board GUI framework

2017-09-11 Thread ROGER GRAYDON CHRISTMAN
object whose inventory included several rooms, so as the ship moved, so did everything on board. And there was no GUI required for it -- so no issues there. It's been a couple decades or so, but that interpreted object-oriented language LPC might still be out there somewhere.

Re: [Tutor] beginning to code

2017-09-13 Thread ROGER GRAYDON CHRISTMAN
tenating strings and formatting data. Roger Christman -- https://mail.python.org/mailman/listinfo/python-list

Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread ROGER GRAYDON CHRISTMAN
n the student would write he was unable to actually compute that without a calculator. And yes, I deliberately designed the questions to have such easy numbers to work with. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] beginning to code

2017-09-23 Thread ROGER GRAYDON CHRISTMAN
On Fri, Sep 22, 2017 12:03 PM, Dennis Lee Bier wrote:> On Fri, 22 Sep 2017 23:30:34 +1000, Steve D'Aprano > declaimed the following: > >The exercise is to demonstrate pass by reference semantics. That requires > >demonstrating the same semantics as the Pascal swap procedure: > > > >procedure swa

Re: python console menu level looping

2017-09-25 Thread ROGER GRAYDON CHRISTMAN
ty data base would happen only once at program startup, after which it behaves just like an 'existing collection' with less data? As someone else pointed out, your tests along the lines of if how_to_insert == 'new collection': are error prone, just from typing errors.

Re: Call by binding [was re: [Tutor] beginning to code]

2017-09-25 Thread ROGER GRAYDON CHRISTMAN
d_to_self(x) # x is still 5 is 'arg' a value parameter or a reference parameter? Can you replicate this behavior in Pascal without any if statement, since, as you say, the semantics are wholly contained by those of Pascal (aside from the += operator itself not appearing in the Pascal la

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-26 Thread ROGER GRAYDON CHRISTMAN
s to (assuming c has been assigned). But in C++, that statement would be completely invalid -- once you associate a reference to a reference variable, you cannot change the binding.This further emphasizes that the statement "int &b = a" is not an assignment statement, which means it is rather irrelevant to the semantics of assignment statements. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread ROGER GRAYDON CHRISTMAN
bout what happens when we do "b = c" in the non-Python languages and in Python. >From the ordering of the notes in this forum, I will just assume you did not get a chance to read it before this post I am responding to. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Beginners and experts

2017-09-30 Thread ROGER GRAYDON CHRISTMAN
randomly perturb the code instead. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: when is the filter test applied?

2017-10-03 Thread ROGER GRAYDON CHRISTMAN
, I would expect the filter to be a lazy application to the iterable you are filtering, so anything that removes from your iterable is going to cause you filter so skip something. That can also be fixed by copying the iterable first. Or alternatively, you can go more functional and instead create a new iterable set of data from the old, instead of mutating what you have. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 169, Issue 5

2017-10-04 Thread ROGER GRAYDON CHRISTMAN
you're joking. So for the humour-impaired: THIS POST WAS A >JOKE. Okay? Good.) > > Gotta watch out for all those Islamic extremists. Somewhere along the line when I wasn't paying attention, they got us all using Arabic numerals. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-04 Thread ROGER GRAYDON CHRISTMAN
7;d rather keep my course content small and simple. Roger Christman Pennsylvania State University > > -- https://mail.python.org/mailman/listinfo/python-list

Re: newb question about @property

2017-10-04 Thread ROGER GRAYDON CHRISTMAN
st): File "", line 1, in p.__slots__ = ['x','y','z'] AttributeError: 'any' object attribute '__slots__' is read-only Oh, and here's a little thing from the Python 3.6.2 Glossary: __slots__ A declaration inside a class that saves memory by pre-declaring space for instance attributes and eliminating instance dictionaries. Though popular, the technique is somewhat tricky to get right and is best reserved for rare cases where there are large numbers of instances in a memory-critical application. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 169, Issue 7

2017-10-05 Thread ROGER GRAYDON CHRISTMAN
e is a better way to access the elements of a list than counting down the subscripts. I still see a lot of instructors and programmers who newly migrate to Python that use counting a range() as their first choice in traversing a list. Teaching the for loop without using range, I believe, is t

Re: Introducing the "for" loop

2017-10-06 Thread ROGER GRAYDON CHRISTMAN
ve an exercise to do a string translation, using an ugly 12-way if-else construct nested within a loop where a dictionary would very easily trim the if-else and str.translate() would eliminate the loop. (This is fresh in my mind because I plan to illustrate both their solution and mine in

Re: Pedagogical style [was Re: The "loop and a half"]

2017-10-06 Thread ROGER GRAYDON CHRISTMAN
addition, and the rug gets pulled out from under them.There is no visible quantity of 1, 2, or 3 in those circles and diamonds; and probably no 1, 2, or 3 in the children's game either. How is it any surprise that they did not figure out the children's game as quickly? Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread ROGER GRAYDON CHRISTMAN
a language like that somewhere around this forum. But I like it anyway Roger Christman Pennsylvania State University On Wed, Oct 11, 2017 12:07 PM, Dennis Lee Bieber wrote: > On Wed, 11 Oct 2017 00:21:46 -0400, Bill >declaimed the following: > >>PL-I has already been taken. That

Re: how to replace multiple char from string and substitute new char

2017-10-12 Thread ROGER GRAYDON CHRISTMAN
t mind having wo function calls in that one line of code. If you want only one function call and you want to do even more substitutions than just those below, there is another handy functionin the string object that can do so very nicely. What did you try? Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 169, Issue 23

2017-10-12 Thread ROGER GRAYDON CHRISTMAN
itself has one entry (the exception) and one exit. And, unlike goto's and set_jmp() is easiliy incorporated into other control structures depending on where you want to go after any recovery steps. The code that generated the exception, of course, seemingly has more than one exit, but exceptions are just that -- exceptions. I hope you don't start using counting loops up to 2**64 to visit a 100 element array and rely on IndexError to exit such a loop. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 169, Issue 23

2017-10-12 Thread ROGER GRAYDON CHRISTMAN
set a breakpoint at the very bottom of a function when debugging. Roger Christman Pennsylvania State University On Thu, Oct 12, 2017 12:26 AM, Steve D'Aprano wrote: > > >Message: 3 >Date: Thu, 12 Oct 2017 12:26:07 +1100 >From: Steve D'Aprano >To: python-list@python.org >

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread ROGER GRAYDON CHRISTMAN
r way. We don't need any annotations or attributes or whatnot if we have the perfectly normal function documentation. Or is that kind of habit no longer practiced in 'the real world'? Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Save non-pickleable variable?

2017-10-21 Thread ROGER GRAYDON CHRISTMAN
a Python data structure, it should also be pickleable. The "Json.org" web site should give you a place to download the modules you would need for each of the two languages. Hope this helps. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Just a quick question about main()

2017-10-27 Thread ROGER GRAYDON CHRISTMAN
ot;main"? I guess I'm not stuck on that habit, since my programming experiences go way back to the old Fortran days Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Coding style in CPython implementation

2017-10-29 Thread ROGER GRAYDON CHRISTMAN
an Implicit" in the example cited. Roger Christman Pennsylvania State University On Sun, Oct 29, 2017, Setfan Ram wrote: > =?UTF-8?B?zqPPhM6tz4bOsc69zr/PgiDOo8+Jz4bPgc6/zr3Or86/z4U=?= writes: >>I guess the following parts from "Zen of Python" apply to this case: > >

Re: why it append one more letter after decode?

2017-10-30 Thread ROGER GRAYDON CHRISTMAN
ample with "\\" in one case, and r"\\" in the other case. These are not equal to each other, and naturally would not give equal results from your function. So that leads to the second possibility that you are not calling the function in the same way. In either case, you cannot blame the function for giving you different results if you give it different data. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Reading a remove csv file

2017-11-02 Thread ROGER GRAYDON CHRISTMAN
ut the utf-8 encoding, but although I find that as an option for a local file (with open()) I did not see that on my first glance at the two functions above. Is there an easy way to read a remove CSV file with utf-8 encoding without copying the whole file locally first? Roger Christman Pennsylv

FW: Reading a remove csv file

2017-11-02 Thread ROGER GRAYDON CHRISTMAN
now a variable in my program's memory (all of the data), instead of streamlike. I suppose I did read somewhere about setting a stream option. Roger Christman Pennsylvania State University Forwarded Message Just a quick question on how best to read a

Re: replacing 'else' with 'then' in 'for' and 'try'

2017-11-06 Thread ROGER GRAYDON CHRISTMAN
ters in itertools) And I see that simply removing 'break' from my vocabulary, this whole 'else on a loop' issue completely dissolves. So thank you for, even unintentionally, helping me to feel good about living inside my ivory tower! Roger Christman Pennsylvania State Unive

Re: Ideas about how software should behave

2017-11-09 Thread ROGER GRAYDON CHRISTMAN
any of the posters here appear commonly enough to place the spirit of a particular post in the context of their general presentation style. Roger Christman Pennsylvania State University On Thu, Nov 9, 2017, Gregory Ewing wrote:But ideas are not software -- they don't actively *do* anything,

Re: Shoulid constants be introduced to Python?

2017-11-16 Thread ROGER GRAYDON CHRISTMAN
1]. Python allows these loopholes in with the expectation that the programmer should know better. I think the same thing would be true with constants. If you need this crutch to protect yourself from accidentally clobbering constants, then do better. If you only need it to for documentation purposes, just tweak the documentation. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem in defining multidimensional array matrix and regression

2017-11-19 Thread ROGER GRAYDON CHRISTMAN
S your V's. I'm thinking that is the first place you should look. You could either modify your data file (with a nice global replace/change) or you could give a different value to one of the default parameters to the functions you use to open the file. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 170, Issue 34

2017-11-27 Thread ROGER GRAYDON CHRISTMAN
indented statements that follow them. Roger Christman Pennsylvania State University On Mon, Nov 27, 2017 Cai Gengyang wrote: > >Message: 38 >Date: Mon, 27 Nov 2017 04:54:21 -0800 (PST) >From: Cai Gengyang >Subject: While, If, Count Statements >Message-ID: >Content-Type: text/pl

Re: Python-list Digest, Vol 170, Issue 34

2017-11-27 Thread ROGER GRAYDON CHRISTMAN
ed statements that follow them. Roger Christman Pennsylvania State University On Mon, Nov 27, 2017 Cai Gengyang wrote: > >Message: 38 >Date: Mon, 27 Nov 2017 04:54:21 -0800 (PST) >From: Cai Gengyang >Subject: While, If, Count Statements >Message-ID: >Content-Type: text/pl

Re: Python-list Digest, Vol 171, Issue 7

2017-12-06 Thread ROGER GRAYDON CHRISTMAN
I think I also came up with 4 as "the most frequent number". It is unclear ot me how you came up with 3.36 as the most common number, because I tried rolling a six-sided die myself several times, and somehow 3.36 didn't come up even once! On Wed, Dec 6, 2017, D'Arcy Cain wrote: > On 12/05/2017 0

Re: Python-list Digest, Vol 171, Issue 7

2017-12-06 Thread ROGER GRAYDON CHRISTMAN
choosing implementations that require 5, 10, or 20 times as much code as necessary. The increase in program size would have a multiplicative effect on writing time and debugging time and would have an adverse affect on a course grade, product delivery date, customer satisfaction, and job security. So learn how to find the efficient solutions now while you still have instructors around to help you. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Python homework

2017-12-13 Thread ROGER GRAYDON CHRISTMAN
t of the responses I see did attempt to work within the perceived constraints regarding what language tools the student was expected to use. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Learning

2017-12-16 Thread ROGER GRAYDON CHRISTMAN
#include? >From my experience, both as instructor and student, with introductory programming courses with half a dozen different first languages to use for those courses, I think C++ is one of the worst choices! (In my humble opinion, of course) Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Learning

2017-12-16 Thread ROGER GRAYDON CHRISTMAN
On Sat, Dec 16, 2017, Marko Rauhamaa wrote: > Chris Angelico : > >> On Sat, Dec 16, 2017 at 11:41 PM, Marko Rauhamaa wrote: >> r...@zedat.fu-berlin.de (Stefan Ram): >> As a start, one should learn: >> >> 1.) how to install Python >> (if not already installed) >> >> 2.) how to st

Re: RFC: Proposal: Deterministic Object Destruction

2018-02-28 Thread ROGER GRAYDON CHRISTMAN
ting at all. So if you have a program that can get by leaving unused memory allocated, and can still terminate the program before all the memory is claimed, your reference count system is far less efficient than relying on a garbage collector that happens to not get activated before your program ends. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: memoization (original Subject lost because mailer lost the whole thread)

2022-09-19 Thread Christman, Roger Graydon
time to linear time). And the process is straightforward enough that you could even define a decorator that could be applied to any function you choose. I don't have an example handy just because I never took the time to write one. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 232, Issue 1

2023-01-01 Thread Christman, Roger Graydon
lem will never arise. So, I am very happy with this Python language decision -- it allows for the most efficient means to modify a list in place and also very much reduce the danger of aliasing bugs. Roger Christman Pennsylvania State University From: Pytho

Re: New assignmens ...

2021-10-25 Thread Christman, Roger Graydon
se as described in its PEP just as it is, and I see no compelling reason to expand its use. It is there to reduce code size by eliminating a duplication of code, If the code you write using the walrus operator is longer or more complicated than the code would be without it, you are misusing it. R

Re: New assignmens ...

2021-10-27 Thread Christman, Roger Graydon
just compelled to create tuple and lists in all of your use-cases, even when they serve no purpose. Roger Christman -- https://mail.python.org/mailman/listinfo/python-list

Re: New assignmens ...

2021-10-27 Thread Christman, Roger Graydon
inside of a test condition, if its usage makes the code less clear. I interpret the PEP has using the walrus to define a name for a particular value that would be both tested and reused, and not that it would be used to assign to a value that was not being tested (such as the a part of (a,b)). Or in short, I do not find your choice of use-case really lines up with the rationale given for walrus operator. You are free to disagree with me, but fortunately, we have one of those PEP authors participating in this list regularly if you want his opinion. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Is duck-typing misnamed?

2016-08-27 Thread ROGER GRAYDON CHRISTMAN
etc. I do grant that ultimately, the duck does come into play, since the witch weighs the same as a duck. Roger Christman Electrical Engineering and Computer Science Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Is duck-typing misnamed?

2016-08-27 Thread ROGER GRAYDON CHRISTMAN
ss. I think this is very much like me defining methods __iter__ and __next__ and voila, I've turned something into an iterator by witch -- er.. duck-typing! Perhaps she inherited her weight from her latent duckness. Thoughts? Roger Christman On Sat, Aug 27, 2016 06:27 PM, python-list@pyt

Linear Time Tree Traversal Generator

2016-09-20 Thread ROGER GRAYDON CHRISTMAN
squeeze the 'yield node._value' in between them. Is there hope for a linear-time tree-traversal generator, or will I have just have to settle for an n-log-n generator or a linear time behavior with linear extra space? Roger Christman instructor Pennsylvania State University -- https:/

Re: Linear Time Tree Traversal Generator

2016-09-20 Thread ROGER GRAYDON CHRISTMAN
On Tue, Sep 20, 2016 at 9:46 AM, ROGER GRAYDON CHRISTMAN <https://webmail.psu.edu/webmail/retrieve.cgi?mailbox=inbox&mid=CAO1D73Eho37guUZkM6Kk9Nu5WB43oN721G33XGNis0LhSu7xVQ%40mail%2egmail%2ecom&cmd=view&start_num=10800&limit=50&sort=0&display=4&headers=default&

Re: Linear Time Tree Traversal Generator

2016-09-21 Thread ROGER GRAYDON CHRISTMAN
port iteration, but then is no better than a dict in any way, except for maybe some rare operation like "identify the minimal value" Roger Christman instructor Pennsylvania State Universtiy -- https://mail.python.org/mailman/listinfo/python-list

Namespace for timeit

2016-10-14 Thread ROGER GRAYDON CHRISTMAN
size )', number=1, globals='test') That tells me the namespace isn't supposed to be a string test.__dict__ is just an empty dictionary so where do I find 'sorter', 'array', and 'size'? Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Stock quote AP

2018-03-12 Thread ROGER GRAYDON CHRISTMAN
dictionary. You would just need to get a dictionary Reader from the csv module, import urllib.request import io, csv file = urllib.request.urlopen(site + filename) data = io.TextIOWrapper(file, newline="", encoding="utf-8") reader = csv.DictReader(data) for row in reade

Re: What is not working with my "map" usage?

2018-09-22 Thread ROGER GRAYDON CHRISTMAN
t to. The * and ** prefixes really should be avoided as much as possible,unless you know exactly what you are getting out of them. Roger ChristmanPennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

IDLE Default Working Directory

2018-11-12 Thread Christman, Roger Graydon
't see anything there -- and I fear that I might have to fight some Windows settings somewhere else instead. I think this is Windows 10. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: IDLE Default Working Directory

2018-11-12 Thread Christman, Roger Graydon
eryk sun responded: On 11/12/18, Christman, Roger Graydon wrote: > > I looked in IDLE's own configuration menu, and didn't see anything there -- > and I fear that I might have to fight some Windows settings somewhere else > instead. I th

Re: IDLE Default Working Directory

2018-11-13 Thread Christman, Roger Graydon
half the students away in the very first class, just trying to configure their development environment. If that's impossible, then I guess I'll have to fire a note off to the university tech support requesting them to play with that "Start In" option through %AppData%, or whatever it was. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Loop with Else Clause

2019-02-05 Thread Christman, Roger Graydon
tle tangent of mine doesn't seem to apply to your situation at all, and I don't there is a 'single' language element in any programming language I can think of that does what you ask -- so stick with the cleaner: if (__): # loop; else: #don't loop Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: encapsulating a global variable (BlindAnagram)

2020-02-25 Thread Christman, Roger Graydon
e dictionary in the first place. Is it practical to have the entire dictionary statically defined? Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday Finking: Poly more thick

2020-02-29 Thread Christman, Roger Graydon
x27;: 2} >>> any_as_dict([('a',1), ('b',2)]) {('a', 1): ('b', 2)} >>> any_as_dict({('a',1), ('b',2)}) {('b', 2): ('a', 1)} This seems to address your apparent definition of "key-value pairs&

Re: Friday Finking: Poly more thick

2020-02-29 Thread Christman, Roger Graydon
Emending my own note from moments ago: def any_as_dict(*args, **kwargs): if len(args) == 0: my_dict = kwargs elif type(args[0]) == type(dict()): my_dict = args[0] else: my_dict = dict(args[0]) print(type(my_dict),my_dict) >>> any_as_dict(a=1,b=2) {'a': 1, 'b': 2} >>> any_as_dict({'a':1, 'b':2}

Re: Friday Finking: Limiting parameters

2020-07-11 Thread Christman, Roger Graydon
or object. If you still end up with a large number of independent parameters, I would question the simplicity of your function's intent. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Re: new feature in Python

2020-09-30 Thread Christman, Roger Graydon
e was this ".=" token somewhere earlier in the program statement. Besides, I could foresee a lot of programming errors when people would start to generalize this operation to do things like: list .= append(item) list .= sort() which would most certainly be incorrect. Roger Christman Pennsylvania State University -- https://mail.python.org/mailman/listinfo/python-list

Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
the first, sequence of the letter 'a', and only if the length of the sequence is exactly 3. Does such a regular expression exist? If so, any ideas as to what it could be? -- Roger L. Cauvin [EMAIL PROTECTED] (omit the "nospam_" part) Cauvin, Inc. Product Management

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Christoph Conrad" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello Roger, > >> I'm looking for a regular expression that matches the first, and only >> the first, sequence of the letter 'a', and only if the length of the >&g

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
27; instead of the lookbehind (and maybe > parentheses around the 'aaa' to somehow 'match' is specially?). > > It's definitely not very clear what exactly the intent is, no... Sorry for the confusion. The correct pattern should reject all strings except those in

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Sybren Stuvel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Roger L. Cauvin enlightened us with: >> I'm looking for a regular expression that matches the first, and >> only the first, sequence of the letter 'a', and only if the le

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
7;b' has a length of >> exactly three. > > Ah...a little more clear. > > r = re.compile("[^a]*a{3}b+(a+b*)*") > matches = [s for s in listOfStringsToTest if r.match(s)] Wow, I like it, but it allows some strings it shouldn't. For example: "xyz123aabba

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 26 Jan 2006 14:09:54 GMT, rumours say that "Roger L. Cauvin" > <[EMAIL PROTECTED]> might have written: > >>Say I have some string that begins with an arbitrary

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
is ensures that no "a"s come before the first 3x"a" and nothing but "b" > and "a" follows it. Anchoring may be the key here, but this pattern rejects "xayz123aaabab" which it should accept, since the 'a' between the '

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Roger L. Cauvin wrote: >> Sorry for the confusion. The correct pattern should reject all strings >> except those in which the first sequence of the letter 'a' that is >

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
files so that the code doesn't have to change to add or change patterns. Before throwing up my hands and re-architecting, I wanted to see if regexps would handle the job (they have in every case but one). -- Roger L. Cauvin [EMAIL PROTECTED] (omit the "nospam_" part) Cauvin, Inc. Product Management / Market Research http://www.cauvin-inc.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Roger L. Cauvin wrote: > >> Good suggestion. Here are some "test cases": >> >> "xyz123aaabbab" accept >> "xyz123aabbaab" reject >> "

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 26 Jan 2006 16:41:08 GMT, rumours say that "Roger L. Cauvin" > <[EMAIL PROTECTED]> might have written: > >>Good suggestion. Here are some "test cases&qu

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 26 Jan 2006 16:26:57 GMT, rumours say that "Roger L. Cauvin" > <[EMAIL PROTECTED]> might have written: > >>"Christos Georgiou" <[EMAIL PROTECTED]

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 26 Jan 2006 18:01:07 +0100, rumours say that "Fredrik Lundh" > <[EMAIL PROTECTED]> might have written: > >>Roger L. Cauvin wrote: >> >>> Good s

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Christos Georgiou" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 26 Jan 2006 17:09:18 GMT, rumours say that "Roger L. Cauvin" > <[EMAIL PROTECTED]> might have written: > >>Thanks, but the second test case I listed con

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Roger L. Cauvin wrote: > >> > $ python test.py >> > gotexpected >> > --- >> > accept accept >> > reject reject >> > accept ac

Re: Match First Sequence in Regular Expression?

2006-01-26 Thread Roger L. Cauvin
"Tim Chase" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The below seems to pass all the tests you threw at it (taking the modified > 2nd test into consideration) > > One other test that occurs to me would be > > "xyz123aaabbaaabab" > > where you have "aaab" in there twice. Good

'File name' is not recognized as an internal or external command, operable program

2007-02-12 Thread Roger A. Wehage
Here it is-nearly four and a half years since Mike Henley posted 'File name' is not recognized as an internal or external command, operable program-and the problem still persists. Some weeks ago I installed ActiveState 8.3.5.0 on Windows XP and many things stopped working. Like Mike, I struggled to

Re: Tkinter: The good, the bad, and the ugly!

2010-12-30 Thread Arndt Roger Schneider
GUI and pyjamas existing side by side in mutual harmony for many years. pyjamas: Perhaps without javascript. -roger -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   >