Re: Best practice for caching hash

2022-03-16 Thread Greg Ewing
f)) '0xfff' >>> hex(hash(0x1fff)) '0x0' And up to that limit they're as widely distributed as you can get -- each integer hashes to a unique value! But keep in mind that the hash value itself is not directly used to locate a dict slot --

Re: Reducing "yield from" overhead in recursive generators

2022-03-18 Thread Greg Ewing
ng the chain of frames into the call stack and then resuming the last one. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: convenience

2022-03-22 Thread Greg Ewing
attribute of an object. Theoretically it's possible for these to have side effects and for bad things to happen if you skip them. But that would be very unusual and surprising, and we generally assume such things don't happen. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Reducing "yield from" overhead in recursive generators

2022-03-22 Thread Greg Ewing
On 23/03/22 11:44 am, Rathmann wrote: So that sounds like the original CPython implementation had an O(depth) component, but with a lower constant factor than the current version? Yes, but so much lower that I would expect it to be unmeasurable. -- Greg -- https://mail.python.org/mailman

Re: What to do to correct the error written below:

2022-04-12 Thread Greg Ewing
t of books with a given isbn (presumably all copies of the same book). It would make more sense for there only to be a list of books, and just one reference to the student, at that point in the code. Generally this whole piece of code seems hopelessly confused and needs to be re-thought. --

Re: Python app on a Mac

2022-04-15 Thread Greg Ewing
Script action, and save it as type Application. The command should be something like /path/to/desired/python /path/to/my/python_file.py Note that the current directory will probably be the user's home directory, so it's best to use full pathnames for everything. -- Greg -- https://mail.

Re: FULLSCREEN and DOUBLEBUF

2018-06-12 Thread Greg Ewing
nd video memory. Experimentation is the only way to be sure. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: low-level csv

2019-11-17 Thread Greg Ewing
ally it's easier and safer to use the csv module for csv. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Resources related with web security

2019-11-27 Thread Greg Ewing
others and doing it themselves, so nobody writes anything down about it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Aw: Re: stuck on time

2019-12-08 Thread Greg Ewing
know everything about it. We can offer advice, but ultimately you're the one who has to work it out. If you don't think the project is worth that much effort, that's up to you. But you asked for help, and we're doing our best to give it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: stuck on time

2019-12-08 Thread Greg Ewing
monospaced, but it is designed for very low resolution, so it's probably a reasonable choice for use on a small display. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2 to 3 converter

2019-12-08 Thread Greg Ewing
x using an automated process. It sounds like an interesting project, but be aware that it's probably an AI-complete problem. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-08 Thread Greg Ewing
code that does something noticeable. You'll find that *any* form of import executes all the top-level code. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-09 Thread Greg Ewing
table statement that creates a class object and binds it to a name. There's nothing stopping you from subsequently rebinding that name to some other object, or deleting it altogether. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-10 Thread Greg Ewing
hting. Python differs from VBScript and other VB-family languages in that names are case-sensitive. So it's common to use case to distinguish between things such as a class and an instance. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-11 Thread Greg Ewing
with a code example, it would have to be run on a different implementation of Python that didn't use reference counting, such as Jython. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-11 Thread Greg Ewing
thon ? You deal with it by not relying on __del__ for anything that needs to be done promptly. There are always alternatives: e.g. file objects have a close() method, and the "with" statement was invented to make it easy to do these kinds of things properly. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-11 Thread Greg Ewing
know, all the details are unique to Python. Some other languages have a "with" statement, but it does something completely different. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 - How do I import a class from another file

2019-12-13 Thread Greg Ewing
On 14/12/19 5:13 pm, boB Stepp wrote: is it true that CPython itself is free to implement these behaviors differently in its own future versions? Yes. That's why it's not a good idea to rely on them even if you only intend to run your code on CPython. -- Greg -- https://mail.

Re: Cython, producing different modules from the same .pyx

2019-12-19 Thread Greg Ewing
PyInit_XXX(), where XXX is computed from the .pyx name, You could try creating a set of top-level .pyx stubs, each of which just 'include' the real code. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: How to extend an object?

2019-12-20 Thread Greg Ewing
ase: for s in 'abc'.like( '(.)' ): I would recommend making it a stand-alone function instead, so that you would write for s in like('abc', '(.)'): -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday Finking: Source code organisation

2019-12-28 Thread Greg Ewing
ten in the file in either order, -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday Finking: Source code organisation

2019-12-28 Thread Greg Ewing
ou have to go out of your way to get things in a different order. But strangely, I tend to do the opposite for methods of a class. I don't really know why. My instinctive idea of the "right" ordering just seems to flip over somehow between modules and classes. -- Greg -- https://mail

Re: Friday Finking: Source code organisation

2019-12-30 Thread Greg Ewing
own to the bottom of the file and work backwards. But it's not so easy for classes if you have more than one class in a file. That might be part of the reason I do things the opposite way in classes. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python, Be Bold!

2020-01-02 Thread Greg Ewing
It looks like what the OP is after already exists: https://docs.python.org/3/library/zipapp.html "This module provides tools to manage the creation of zip files containing Python code, which can be executed directly by the Python interpreter." -- Greg -- https://mail.python.o

Re: A small quiz

2020-01-03 Thread Greg Ewing
ewhat advanced topics, to be tackled after your students are familiar with the basics. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python, Be Bold!

2020-01-03 Thread Greg Ewing
Perhaps getting zipextimporter into the standard library, and developing versions of it for Linux and MacOS, would be a useful improvement? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Extension type inherit from Python int

2020-01-16 Thread Greg Ewing
whether it just needs to be something with a sufficiently int-like interface. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: IDLE, TCP/IP problem.

2020-01-16 Thread Greg Ewing
port from being opened. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Sandboxing eval()

2020-01-21 Thread Greg Ewing
_']['__imp'+'ort__']", {"__builtins__":{}}) You can probably find a way to block that particular loophole. But then there will be another one, and another, and another... You'll never be sure that you've found all of them. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Nested Loop Code Help

2020-01-26 Thread Greg Ewing
ree assignment statements. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: How to read the original data line by line from stdin in python 3 just like python 2?

2020-01-28 Thread Greg Ewing
On 29/01/20 6:27 pm, Peng Yu wrote: Suppose that I use this to read from stdin. But `line` contains decoded data in python 3. In python 2, it contains the original data. What is the best way to get the original data in python 3? Read from stdin.buffer, which is a stream of bytes. -- Greg

Re: JavaScript's void operator in Python?

2020-02-02 Thread Greg Ewing
On 3/02/20 3:38 am, Stefan Ram wrote: void( ( print( 2 ), print( 3 ))) If the functions you're calling all return None, you can do this: >>> print(2); print(3) 2 3 -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Asyncio question

2020-02-21 Thread Greg Ewing
e point of asyncio is to make tasks very lightweight, so you can use as many of them as is convenient without worries. One task per client sounds like the right thing to do here. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: encapsulating a global variable

2020-02-25 Thread Greg Ewing
blems need to be addressed by appropriate use of locks, etc. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: encapsulating a global variable

2020-02-25 Thread Greg Ewing
ion, while ensuring that there really is only one instance, and making this fact clear to anyone reading the code. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: `async def` breaks encapsulation?

2020-03-17 Thread Greg Ewing
call a coroutine, so switching a function between coroutine and non-coroutine would still have just as much of a ripple effect on the rest of your code. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: How does the super type present itself and do lookups?

2020-03-19 Thread Greg Ewing
the tp_getattro type slot, which corresponds to __getattribute__. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Python 3.8.2 on MacOSX Sierra?

2020-03-21 Thread Greg Ewing
bort trap: 6 Am I out of luck? Is Python 3.8 only intended work on very recent versions of MacOSX? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.8.2 on MacOSX Sierra?

2020-03-22 Thread Greg Ewing
version) but I think I'm being bitten by the same underlying issue. I'm going to try again with XCode 8, which purportedly comes with a 10.12 SDK, and see if that fixes it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.8.2 on MacOSX Sierra?

2020-03-22 Thread Greg Ewing
On 22/03/20 10:20 pm, Greg Ewing wrote: I'm going to try again with XCode 8, which purportedly comes with a 10.12 SDK, and see if that fixes it. It does. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: `async def` breaks encapsulation?

2020-03-23 Thread Greg Ewing
*should* be eliminated, before thinking about how to achieve it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: How does the super type present itself and do lookups?

2020-03-24 Thread Greg Ewing
7;, '__init__', '__new__', '__thisclass__', '__self__', '__self_class__', '__doc__'] from which it's clear that the super object overrides __getattribute__ but not __getattr__. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: python read line by line and keep indent

2020-04-17 Thread Greg Ewing
so that you keep whatever indentation the line had before. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: print() ignores context ?

2020-05-05 Thread Greg Ewing
nding mode for floats. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-08-26 Thread Greg Ewing
On 23/07/20 12:23 pm, dn wrote: You be sure to have a nice day, now! How do you feel about you be sure to have a nice day, now? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Symlinks already present

2020-09-03 Thread Greg Ewing
ue >>> os.lstat('test2/spam/..').st_ino == os.lstat('test2').st_ino True What happens if you go one level deeper? I.e. is os.lstat('test1/spam/eggs/../..').st_ino == os.lstat('test1').st_ino and os.lstat('test2/spam/eggs/../..').st_ino == os.lstat('test2').st_ino ? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Puzzling difference between lists and tuples

2020-09-18 Thread Greg Ewing
normal brackets, but there are a few interesting ones, such as LEFT/RIGHT WHITE/BLACK LENTICULAR BRACKET and LEFT/RIGHT TORTOISE SHELL BRACKET. 〖 〗【 】〔 〕 -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: importlib changes from py3.7 to py3.8

2020-09-19 Thread Greg Ewing
empty __init__.py in Python 3.8 and there was no problem: % ls -l empty total 0 -rw-r--r-- 1 greg staff 0 20 Sep 12:00 __init__.py % python3 Python 3.8.2 (default, Mar 23 2020, 11:36:18) [Clang 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits"

Re: Puzzling difference between lists and tuples

2020-09-20 Thread Greg Ewing
chine it seems to be about 17 times slower than using a trailing comma: >>> timeit.repeat("tuple(['first'])") [0.1774688908953, 0.1768788059062, 0.1768771102082, 0.176763284033, 0.17684489200001963] >>> timeit.repeat("('first',)") [0.0117392889055, 0.01156933400708, 0.01158800017473, 0.01156976132486, 0.01157938358281] -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: List Partition Comprehension (Feature Suggestion)

2020-09-22 Thread Greg Ewing
so rarely needed. Although it probably wouldn't be as fast as an LC could potentially be, due to the need to call a user-supplied function for every item. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Use of a variable in parent loop

2020-09-27 Thread Greg Ewing
had this way of using "pass" in mind. More likely they're just trying to be helpful and save you from having to manually unindent in a few rare situations. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Subprocess Connection Error

2020-10-17 Thread Greg Ewing
ve you tried using a different name, such as "my_types.py"? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Question on ABC classes

2020-10-22 Thread Greg Ewing
actually do any harm if someone instantiated your base class? If not, then it's probably not worth going out of your way to prevent it. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Covariance matrix syntax

2020-10-24 Thread Greg Ewing
ed=True does *not* make your result biased -- quite the contrary!) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: GUI: I am also looking for a nudge into the best (GUI) direction.

2020-10-31 Thread Greg Ewing
en changes occur. On the other hand, if the toolkit wraps the platform's native widgets, it gets all the correct appearance and behaviour, and automatically tracks changes. For these reasons I regard "uses native widgets" as a mark of quality for a toolkit. -- Greg -- https://mail.py

Re: GUI: I am also looking for a nudge into the best (GUI) direction.

2020-11-01 Thread Greg Ewing
of the standard offerings from Microsoft such as WinForms rather than rolling your own. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Environment vars

2020-11-25 Thread Greg Ewing
ery different things... -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Why can't numpy array be restored to saved value?

2020-11-25 Thread Greg Ewing
gives you another view of the underlying data. This is a trap you need to watch out for, since it's different from the way sequences normally behave in Python. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: list[type, type, ...] ?!

2020-12-03 Thread Greg Ewing
ntics with respect to particular types -- that's left to the type checkers. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: list[type, type, ...] ?!

2020-12-03 Thread Greg Ewing
nterpreter? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Returning from a multiple stacked call at once

2020-12-12 Thread Greg Ewing
the limit is about 1000. So if you have a large graph with a path more than 1000 steps long, you can hit the recursion limit. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: dict.get(key, default) evaluates default even if key exists

2020-12-17 Thread Greg Ewing
macros effectively let you do something similar. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Lambda in parameters

2020-12-19 Thread Greg Ewing
g but functions. This is mainly of theoretical interest; it's not usually a practical way to go about things. But it's a good exercise in thinking about functions as objects to be manipulated. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Control stript which is runing in background.

2021-01-02 Thread Greg Ewing
On 3/01/21 12:30 am, Alan Bawden wrote: So as long as the OP's commands are no longer than 512 bytes, and as long as they are careful to send commands in a single call to write(), Also note that's one write() system call, which may or may not correspond to one Python write() call

Re: primitive password cracker

2021-01-07 Thread Greg Ewing
x27;b', 'c'], 3, [], words) print(words) For this particular problem it's less efficient than the technique used by itertools.product, because it generates sub-combinations multiple times. However, it's a useful technique to keep in mind whenever you have a "variable number o

Re: dayofyear is not great when going into a new year

2021-01-08 Thread Greg Ewing
On 9/01/21 11:17 am, Martin Schöön wrote: "regardless of what you have been told, recreational use of mathematics is harmless" I hope that is true for recreational programming as well :-) Mostly harmless, but it can be addictive! -- Greg -- https://mail.python.org/mailman/listi

Re: learning python building 2nd app, need advices

2021-01-08 Thread Greg Ewing
On 9/01/21 12:10 pm, pascal z wrote: any way to attach a file because I loose indentation? Indentation usually makes it through here if you indent with spaces rather than tabs. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: binascii.b2a vs ord()

2021-01-10 Thread Greg Ewing
"credits" or "license" for more information. >>> s = 'Hello World' >>> s 'Hello World' >>> b = s.encode('ascii') >>> b b'Hello World' >>> s2 = b.decode('ascii') >>> s2 'Hello World' -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-11 Thread Greg Ewing
look right to you, it may be the fault of whatever you're using to read the group. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-11 Thread Greg Ewing
ard python distribution, gives low-level access to C library functions). -- Greg -- https://mail.python.org/mailman/listinfo/python-list

sqlite utf8 encoding error

2005-11-17 Thread Greg Miller
deDecodeError: 'utf8' codec can't decode bytes in position 13-18: unsupported Unicode code range does anyone have any idea on what could be going wrong? The string that I store in the database table is: 'Keinen Text für Übereinstimmungsfehler gefunden' I thought that all st

Re: sqlite utf8 encoding error

2005-11-18 Thread Greg Miller
Thank you for all your suggestions. I ended up casting the string to unicode prior to inserting into the database. Greg Miller -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite utf8 encoding error

2005-11-21 Thread Greg Miller
Thanks again, I'll look into this method. Greg Miller -- http://mail.python.org/mailman/listinfo/python-list

Re: ncurses' Dark Devilry

2005-11-29 Thread Greg Ewing
ass ttys, on most of which it is physically impossible to write characters without the cursor moving. The best you can do is move it back to where you want it afterwards. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac

ODBC Connection on Windows XP

2005-01-03 Thread Greg Lindstrom
this before, and having used the odbc module for about a year now, I'm at a quandary; what does this mean and what do I do to fix it? Thanks! --greg -- Greg Lindstrom 501 975.4859 Computer Programmer [EMAIL PROTECTED] NovaSys Health Little Rock, Arkansas "We are

Looking for Form Feeds

2005-01-24 Thread Greg Lindstrom
(re does not like the control characters, I guess). Is it possible for me to pull out the formfeeds in a straightforward manner? Thanks! --greg -- Greg Lindstrom 501 975.4859 Computer Programmer [EMAIL PROTECTED] NovaSys Health Little Rock, Arkansas "We are the

Accessing Postgress from Windows

2005-01-28 Thread Greg Lindstrom
n, if possible. What can you recommend for the task? Thanks...and see you all at PyCon! --greg -- Greg Lindstrom 501 975.4859 Computer Programmer [EMAIL PROTECTED] NovaSys Health Little Rock, Arkansas "We are the music makers, and we are the dreamers of dreams." W.W.

EDI x12 --> XML

2005-02-04 Thread Greg Lindstrom
ore I either write one or use one that I have written in Perl? Thanks! --greg-- Greg Lindstrom 501 975.4859 Computer Programmer [EMAIL PROTECTED] NovaSys Health Little Rock, Arkansas "We are the music makers, and we are the dreamers of dreams." W.W. -- http://

Re: Loop until condition is true

2005-06-22 Thread Greg Lindstrom
A bit off topic, but what does the expression "Don't try to teach your grandfather how to suck eggs." mean? I've never heard it before and am curious to the story behind it. Thanks, --greg -- http://mail.python.org/mailman/listinfo/python-list

COM problem .py versus .exe

2005-06-27 Thread Greg Miller
I have a .DLL that I am extracting the file version from using wmi.py. The specific code is: c = wmi.WMI() for f in c.CIM_DataFile(Name="c:\\glossersdmsservices\\bin\\glosscmanager.dll"): sdmsver = f.Version this works fine when running the application as a python file, when I

Re: COM problem .py versus .exe

2005-06-27 Thread Greg Miller
that since it cleared the problem here, it will also clear the problem on that machine, ( the error message was slightly different ), so once again thanks again. Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: COM problem .py versus .exe

2005-06-28 Thread Greg Miller
Hello again, I put the executable on the "virgin" PC today. I am using the wmi(b) that you gave me. The error that I am receiving now is: File "autoStart.pyc", line 241, in test File "wmib.pyc", line 157, in ? File "win32com\client\__init__.pyc", line 73, in GetObject File "win32com\client\__ini

Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
The two machines are both running Windows XP, the desktop is running XP Pro, the "virgin" PC is running XP embedded. I would say the biggest difference is that the embedded machine has only the py2exe executable running/installed, while the desktop has the full python24 installation. I get no bui

Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
I put you code snippet into my code, running it from the desktop PC gave me the following output ( I added a print statement ): . . . winmgmts: T i.Caption is \\rocps00101\ROCPR001 T i.Caption is \\ROCPS00101\ROCPR024 T i.Caption is \\ROCPS00101\R

Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
line 157 is in fact where the traceback says the failure is: File "autoStart.py", line 241, in test File "wmib.pyc", line 157, in ? File "win32com\client\__init__.pyc", line 73, in GetObject File "win32com\client\__init__.pyc", line 88, in Moniker com_error: (-2147221020, 'Invalid syntax', None, N

Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
Unfortunately I have a "fire" to put out with a patch to the existing machine code, I'll get back to looking into the problem a little later. Thanks very much for you assistance with this! I really didn't look into the GetFileVersionInfo, can I assume that is a cytypes function? -- http://mail.

Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
I didn't see the earlier post, thanks for the resend. The firefighting is just about over, I have to find the machine owner to get permission to try the code. Then back to the dll version battle. If I can keep away from dealing with the ctypes code I will. I'll see how this works for me. Thank

Re: COM problem .py versus .exe

2005-06-29 Thread Greg Miller
I tried the code snippet using win32api.GetFileVersionInfo(), what I get now is the following when running on the executable machine: . . . FileFlagsMask => 63 FileType => 2 FileVersionMS => 65536 FileVersionLS => 1 Signature => -17890115 FileSubtype => 0 FileFlags => 0 ProductVersionLS => 1 FileD

Re: COM problem .py versus .exe

2005-06-30 Thread Greg Miller
time. It's been a good learning experience for me. Now on with the project....Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: COM problem .py versus .exe

2005-06-30 Thread Greg Miller
That code works great, and is a tad bit cleaner than what I came up with, thanks again. -- http://mail.python.org/mailman/listinfo/python-list

Re: f*cking re module

2005-07-05 Thread Greg Lindstrom
stand/use. Regular expressions are not either, though I use them all the time (I learned them when I was a system admin on a Sun network and tend to fall back on them when I need a "quick fix"). I hear that Perl 6 is going to have a rewrite of regular expressions; it will be interesting t

Re: class attribute to instance attribute

2005-07-05 Thread Greg Ewing
t is to be done, instead of writing code to do it. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Lots of pdf files

2005-07-20 Thread Greg Lindstrom
do not see a way. Any suggestions? As it stands now, I'm printing sending 200 files, waiting until the queue is clear, then another 200, and so forth. Eventually we will be paperless (if for no other reason this seems insane to me), but what can I do in the meantime? Thanks for you

Knowing when a file completes.

2005-07-26 Thread Greg Lindstrom
r whatever it's called on windows) to detect when a new file is created in a directory and, more importantly, when it is "complete" (if that makes sense)? Thanks for your help. --greg -- Greg Lindstrom 501 975.4859 (office) Senior Programmer

Re: pain

2005-08-04 Thread Greg Lindstrom
ct. When you show them that Python "works" and that they will be able to understand the code, I'm guessing they will let you do more. Before you know it, you're coding everything in Python. Best of luck, --greg -- http://mail.python.org/mailman/listinfo/python-list

Resetting modification time

2005-08-15 Thread Greg Peretti
ficulty with is the resetting the modification time. According to the O'Reilly book I have, using utime in this way - os.utime(testfile, (1124137226, 1124137227)) (those are just sample numbers) - would do so, but I'm generating an OSError. Any Ideas? Greg Peretti web developer www.

while c = f.read(1)

2005-08-18 Thread Greg McIntyre
I have a Python snippet: f = open("blah.txt", "r") while True: c = f.read(1) if c == '': break # EOF # ... work on c Is some way to make this code more compact and simple? It's a bit spaghetti. This is what I would ideally like: f = open("blah.txt", "r") while c = f.re

Re: while c = f.read(1)

2005-08-22 Thread Greg McIntyre
Okay, the 1st option seems more complicated and the 2nd option, while simpler to my eye makes me worry about file descriptors, resource management and memory running out. My files are large, hence 1 character at a time, not f.read(). This is code from another employee and I'm just in the stages o

Re: while c = f.read(1)

2005-08-22 Thread Greg McIntyre
The 2nd option has real potential for me. Although the total amount of code is greater, it factors out some complexity away from the actual job, so that code is not obscured by unnecessary compexity. IMHO that's great practice. I like it! Thank you! The assurance that the code was clear was good t

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