Python added to PATH, cannot be directly accessed, cannot install pip

2021-09-27 Thread Will
7;t find Python directly through the Command Prompt, and I cannot install get-pip.py to Python. For reference, I have Python version 3.9.6 and I installed Python directly from the site (I did not use Anaconda). Can you guys help me with this? Or do I need to delete Python and

IDLE

2021-02-16 Thread Will Anderson
Hi, I hope you are having a good day. I have a small IDLE problem and can’t seem to fix it. I have a .py file that I want to open using IDLE but there is no option I have even tried totally wiping python and reinstalling it nothing seems to work. Please help.     Will

Re: proposal for slice hashing

2020-05-16 Thread Will Bradshaw
as I made the post. I've also done a bit of work on the proposal to make the key function changeable in functools.lru_cache though that is a bit more complex and will take a bit of refactoring to do right. -- https://mail.python.org/mailman/listinfo/python-list

Re: proposal for slice hashing

2020-05-11 Thread Will Bradshaw
On Monday, May 11, 2020 at 4:45:55 PM UTC-4, Chris Angelico wrote: > On Tue, May 12, 2020 at 6:31 AM Will Bradshaw wrote: > > > > On Monday, May 11, 2020 at 4:10:56 PM UTC-4, Chris Angelico wrote: > > > On Tue, May 12, 2020 at 6:01 AM Will Bradshaw > > > wrot

Re: proposal for slice hashing

2020-05-11 Thread Will Bradshaw
On Monday, May 11, 2020 at 4:10:56 PM UTC-4, Chris Angelico wrote: > On Tue, May 12, 2020 at 6:01 AM Will Bradshaw wrote: > > The only options as of now are: > > 1. use 3 layers of wrappers to pack the slices into a custom type that > > supports hashing pass this m

proposal for slice hashing

2020-05-11 Thread Will Bradshaw
the numpy style but is computes it's values on __getitem__ calls as it represents an infinite field of numbers. However this operation is expensive. In many cases the same slice of the field will be needed repeatedly. This lends itself to using an lru cache on __getitem__() however this doe

Why the CLI hang using pyjwt ?

2017-10-12 Thread will
Not sure why the CLI command "pyjwt decode --no-verify ..." will hang at sys.stdin.read() even though I provided all the input. Any ideas on how to work around the problem? $ pyjwt -v pyjwt 1.5.3 $ pyjwt decode --no-verify eyJhbGciOiJIUzI1NiIsInR5cC

Re: Python modules

2014-11-11 Thread Will Acheson
On Sunday, November 9, 2014 11:51:41 PM UTC-5, Steve Hayes wrote: > I have a book on Python that advocates dividing programs into modules, and > importing them when needed. > > I have a question about this. > > I can understand doing that in a compiled language, where different modules > can be

Re: What is rstrip() in python?

2014-11-11 Thread Will Acheson
On Sunday, November 9, 2014 6:12:24 AM UTC-5, satish...@gmail.com wrote: > What is rstrip() in python? > > What does it do in the following piece of code? > > import sqlite3 > conn = sqlite3.connect('dbase1') > curs = conn.cursor() > > file = open('data.txt') > rows = [line.rstrip().split(',') f

How can I wrap a binary file-like object with an IO stream?

2013-03-21 Thread Will McGugan
opriate IO stream that handles the encoding/decoding. I'm sure I could implement the logic myself by looking at the mode/ encoding and return the appropriate IO interface, but I was hoping there was something in the stdlib to do this, or some pre-existing code I can lift? Thanks in advance

Re: Fastest technique for string concatenation

2010-10-05 Thread Will Hall
On Oct 5, 2:39 pm, Will Hall wrote: > On Oct 3, 8:19 am, Roy Smith wrote: > > > > > My local news feed seems to have lost the early part of this thread, so > > I'm afraid I don't know who I'm quoting here: > > > > My understanding is that append

Re: Fastest technique for string concatenation

2010-10-05 Thread Will Hall
gnificant improvement over doing the join(). Okay. I've never responded to one of these before, so please correct me if I'm making any large blunders. I'd just recently read Guido's Python Patterns -- An Optimization Anecdote, and I was wondering why a similar method to the on

Re: What would YOU like to see in a txt to html converter?

2009-05-07 Thread Will Wang
> "Florian" == Florian Wollenschein > writes: Florian> As you might have mentioned I'm just working on a txt to html converter called Florian> "thc". This project is intended for me to learn Python and now pyQT4 to which I Florian> changed a few days ago (started with Tkint

Re: How to round a floating point to nearest 10?

2008-08-09 Thread Will Rocisky
On Aug 9, 5:46 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Will Rocisky wrote: > > I want my 76.1 to be rounded to decimal 80 and 74.9 to decimal 70. > > How can I achieve that? > >>> help(round) > > Help on built-in function round in module __built

How to round a floating point to nearest 10?

2008-08-09 Thread Will Rocisky
I want my 76.1 to be rounded to decimal 80 and 74.9 to decimal 70. How can I achieve that? -- http://mail.python.org/mailman/listinfo/python-list

How to concatenate datetime.date object and datetime.time object

2008-08-05 Thread Will Rocisky
Actually I am trying to save both date and time in one cell but they are given separately by user. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple HTML template engine?

2007-10-15 Thread Will McGugan
allen.fowler wrote: > Hello, > > Can anyone recommend a simple python template engine for generating > HTML that relies only on the Pyhon Core modules? > Mako (http://www.makotemplates.org/) sounds like what you want.. Will McGugan http://www.willmcgugan.com -- http://mail.pyt

Re: Simple HTML template engine?

2007-10-15 Thread Will McGugan
allen.fowler wrote: > Hello, > > Can anyone recommend a simple python template engine for generating > HTML that relies only on the Pyhon Core modules? > Mako (http://www.makotemplates.org/) sounds like what you want.. Will McGugan http://www.willmcgugan.com -- http://mail.pyt

Order of tuples in dict.items()

2007-10-14 Thread Will McGugan
Hi, If I have two dictionaries containing identical values, can I be sure that the items() method will return tuples in the same order? I tried an experiment with CPython and it does appear to be the case. >>> a=dict(a=1, b=1, c=2) >>> b=dict(c=2, a=1, b=1) >>>

Re: Generating a unique identifier

2007-09-07 Thread Will Maier
. 2.5 includes the uuid module for RFC 4122 universally-unique IDs: http://docs.python.org/lib/module-uuid.html -- [Will [EMAIL PROTECTED]|http://www.lfod.us/] -- http://mail.python.org/mailman/listinfo/python-list

Re: My 'time' module is broken, unsure of cause

2007-08-23 Thread Will Maier
le that's shadowing the stdlib's time. To check: Python 2.4.4 (#1, Jul 26 2007, 14:42:10) [GCC 3.3.5 (propolice)] on openbsd4 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> print time.__file__ /usr/local/lib/python2.4/lib-dynload/time.so -- [Will [EMAIL PROTECTED]|http://www.lfod.us/] -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple python iteration question

2007-08-14 Thread Will Maier
e the enumerate() builtin. >>> l = ['a', 'b', 'c'] >>> for i, v in enumerate(l): ... print i, v ... 0 a 1 b 2 c -- [Will [EMAIL PROTECTED]|http://www.lfod.us/] -- http://mail.python.org/mailman/listinfo/python-list

Re: passing vars to py scipts in cron jobs

2007-08-07 Thread Will Maier
at need arguments. This is commonly done with either sys.argv (a list of arguments passed when invoking the script) or os.environ (a dictionary of environment variables and values). Use either to instantiate your classes or run functions. -- [Will [EMAIL PROTECTED]|http://www.lfod.us/] -- http:

Cross platform Python app deployment

2007-07-30 Thread Will McGugan
Hi, Is there some reference regarding how to package a Python application for the various platforms? I'm familiar with Windows deployment - I use Py2Exe & InnoSetup - but I would like more information on deploying on Mac and Linux. TIA, Will McGugan -- http://www.willmcgugan.com

Re: Sorting dict keys

2007-07-20 Thread Will Maier
, 1 That means that doesn't return a sorted version of the list you're working with. Instead, it sorts the list itself. If you want to return a sorted list, use (duh) sorted: >>> sorted(l) ['eggs', 'spam', 'spam'] -- [Will [EMAIL PROTECTED]|http://www.lfod.us/] -- http://mail.python.org/mailman/listinfo/python-list

Re: How to check if an item exist in a nested list

2007-07-19 Thread Will Maier
gt;>> 'spam' in dinner True 'in' uses the __contains__() method implemented by lists. -- [Will [EMAIL PROTECTED]|http://www.lfod.us/] -- http://mail.python.org/mailman/listinfo/python-list

Re: Pure Python equivalent of unix "file" command?

2007-07-19 Thread Will Maier
On Thu, Jul 19, 2007 at 03:29:35PM -0400, W3 wrote: > Just a quick one... Is there such a thing? Debian et al ship Python bindings[0] for file(1)[1]. file works by using a file (/etc/magic) with 'magic' numbers in it to figure out the type of a file. Googling 'python magic&#

Re: Log Memory Usage

2007-07-19 Thread Will Maier
On Thu, Jul 19, 2007 at 04:35:56AM -0500, Will Maier wrote: > On Thu, Jul 19, 2007 at 09:52:36AM +0100, Robert Rawlins - Think Blue wrote: > > I have a scheduled event which occurs every minute, i just need a > > code solution to give me the systems current memory consumptions

Re: Log Memory Usage

2007-07-19 Thread Will Maier
of anything in the standard library that does this sort of thing. Instead, you'll probably need to rely on your system's tools. sysstat is available on Linux and provides the sar(1) command for examining logs of various system attributes. The tool to use depends on the system you'r

Re: Interpreting os.lstat()

2007-07-18 Thread Will Maier
os.lstat()." http://www.python.org/doc/current/lib/module-stat.html -- [Will [EMAIL PROTECTED]|http://www.lfod.us/] -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: freebsd admin scripting

2007-07-18 Thread Will Maier
ugh. > > I think you're referring to ConfigParser. This is the standard way > to do config files in Python, and it is very simple to use and > work with, so I would recommend using it. rc.conf is a shell script on BSD systems. The OP will need to write his own parser to read it. Ta

Re: getting text inside the HTML tag

2007-07-14 Thread Will Maier
n reading through SGMLParser documentation, but just can't > figure that out... You need to define handle_data. You may also want to look at HTMLParser in addition to the alternatives previously mentioned. http://docs.python.org/lib/module-sgmllib.html -- [Will [EMAIL PROTECTED]|http

Re: condor_compiled python interpreter

2007-07-11 Thread Will Maier
e you building for the standard universe? It shouldn't be too hard. See this thread[0] for some more bits, including a step-by-step. [0] https://lists.cs.wisc.edu/archive/condor-users/2007-March/msg00216.shtml https://lists.cs.wisc.edu/archive/condor-users/2007-March/msg00217.shtml

Per thread data

2007-07-09 Thread Will McGugan
Hi, Is there a canonical way of storing per-thread data in Python? Will McGugan -- http://mail.python.org/mailman/listinfo/python-list

Re: error return without exception set

2007-07-03 Thread Will McGugan
ns when I'm debugging a wxWidgets application with Komodo, but I can't trap it. I'm guessing it must be a Komodo issue, because I dont get it if I run it without the debugger. Will -- http://mail.python.org/mailman/listinfo/python-list

error return without exception set

2007-07-03 Thread Will McGugan
Hi, Can anyone suggest a likely cause for the following exception... Exception exceptions.SystemError: 'error return without exception set' in ignored Thanks Will McGugan -- http://mail.python.org/mailman/listinfo/python-list

Re: process stdin grab

2007-06-28 Thread Will Maier
hon? i need only to write to its > stdin, not read any information from it, and i don't really need > to know if my command worked for now, so error handling isn't > really an issue. I don't know of any magic to write to a running program's stdin. -- [Will [EMAIL PROTE

Re: Reversing a string

2007-06-27 Thread Will Maier
backward.reverse() ... return ''.join(backward) >>> rev("spam") 'maps' list.reverse() changes the list in-place. Instead of iterating over the items in the string sequence, you can just convert the input string outright. -- [Will [EMAIL P

Re: finding an element in a string

2007-06-25 Thread Will Maier
print "Good." > > But that, obviously, will only respond "good" when one writes > "fine". I was looking for a way for the program to respond "good" > to any sentence that would contain the word "fine" in it. Since strings are

Re: Matrix Multiplication

2007-06-18 Thread Will McGugan
google.com/p/gameobjects/ Will McGugan -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on Vista installation issues

2007-05-22 Thread will
Vista is a 64 bit OS and there is no port of pywin32 for either Vista or 64-bit XP -- http://mail.python.org/mailman/listinfo/python-list

Re: Vector classes

2007-04-22 Thread Will McGugan
Mizipzor wrote: > During my coding Ive found two vector classes on the internet. Ive > modified them both a little but the do both have advantages and > disadvantages. > I'm working on a vector class at the moment, in my 'gameobjects' library. It's not really ready for public consumption, but fee

Re: 16bit RGB with Image module

2007-03-27 Thread Will McGugan
m = Image.fromstring("RGB", (326, 325), pixel_data, "raw", "BGR;16") > im.show() > > Although I have no idea *why* it works, other than the fact that I'm now > using the correct number of bits per pixel. :) > > Anyone have thoughts on this? Well

Re: execution speed increase after compile py code into exe?

2007-03-24 Thread Will McGugan
om running normally (not that I've actually tested it, > mind you). Actualy startup is faster for the apps that I have py2exe'd. I think this may be because all the modules are in one place and Python doesn't have to go searching for them. Will -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Announcing BBCode parsing module

2007-03-10 Thread Will McGugan
Hi, I have written a BBCode parsing module that may be of use to some people. It turns BBCode in to XHTML snippets. See the following page if you are interested... http://www.willmcgugan.com/2007/03/10/bbcode-python-module/ Will McGugan -- blog: http://www.willmcgugan.com -- http

Re: generate tuples from sequence

2007-01-17 Thread Will McGugan
Will McGugan wrote: > Hi, > > I'd like a generator that takes a sequence and yields tuples containing > n items of the sqeuence, but ignoring the 'odd' items. For example Forgot to add, for my purposes I will always have a sequence with a multiple of n items. Will

generate tuples from sequence

2007-01-17 Thread Will McGugan
while True: yield tuple([i.next() for _ in xrange(count)]) Is this the most efficient solution? Regards, Will McGugan -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.exit versus raise SystemExit

2007-01-08 Thread Will McGugan
ption manually. In the same way that 'open' is prefered over 'file', even though they appear to do the same thing. Will -- blog: http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

sys.exit versus raise SystemExit

2007-01-08 Thread Will McGugan
Hi, Is there any difference between calling sys.exit() and raise SystemExit? Should I prefer one over the other? Regards, Will McGugan -- blog: http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble getting google through urllib

2006-12-19 Thread Will McGugan
Duncan Booth wrote: > > > > Google doesnt like Python scripts. You will need to pretend to be a > > browser by setting the user-agent string in the HTTP header. > > > and possibly also run the risk of having your system blocked by Google if > they figure out

Re: trouble getting google through urllib

2006-12-19 Thread Will McGugan
"&" and "%7C", so I'm > thinking thats the problem, does anyone know how I would make it keep > the url as I intended it to be? > Google doesnt like Python scripts. You will need to pretend to be a browser by setting the user-agent string in the HTTP header.

Re: I'm looking for an intelligent date conversion module

2006-12-16 Thread Will McGugan
mthorley wrote: > Greetings, I'm looking for a python module that will take a datetime > obj and convert it into relative time in english. > For example: 10 minutes ago, 1 Hour ago, Yesterday, A few day ago, Last > Week, etc > I feel for you. I'm always on the lookou

Re: Restrictive APIs for Python

2006-12-15 Thread Will Ware
Gabriel Genellina wrote: > In Python, the usual way of saying "don't play with me" is prepending > an underscore: _private Thanks, I am familiar with that. > BTW, have you *ever* tested your code? Yes, we have a QA process. The problem is not that the code doesn't work, it does. It was developed

Restrictive APIs for Python

2006-12-15 Thread Will Ware
_FRIENDS list is optional. Having defined _PUBLIC and optionally _FRIENDS, use something like the following to protect your class. Restricting the API will incur a performance overhead, so it's best to do it under the control of some sort of debug flag. if debug_flag: from restrictive imp

Re: YouTube written in Python

2006-12-13 Thread Will McGugan
ers now... :-) > Nice quote re youtube on Python.org http://www.python.org/about/quotes/ Will McGugan -- blog: http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: write an update manager in python/wxPython

2006-12-07 Thread Will McGugan
en there is a new version. It would require a little more effort if you want to have some kind of automatic update... Will McGugan -- blog: http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Ensure a variable is divisible by 4

2006-12-04 Thread Will McGugan
it divisable'. Do you want to check it is divisible or do you want to make it divisible? And if you want to make it divisible do you want to go to the next multiple of 4, or the previous? Will McGugan -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: extremely slow array indexing?

2006-11-30 Thread Will McGugan
e processing a lot of data? With numbers those big I would expect to have enough time to go make a coffee, then drink it. If you think it is slower than it could be, post more code for optimization advice... Will McGugan -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Will McGugan
Beliavsky wrote: > > The number 1 is not generally considered to be a prime number -- see > http://mathworld.wolfram.com/PrimeNumber.html . > I stand corrected. -- blog: http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Will McGugan
Steve Bergman wrote: > Just wanted to report a delightful little surprise while experimenting > with psyco. > The program below performs astonoshingly well with psyco. > > It finds all the prime numbers < 10,000,000 Actualy, it doesn't. You forgot 1 and 2. Will

Re: Remarkable results with psyco and sieve of Eratosthenes

2006-11-29 Thread Will McGugan
> #!/usr/bin/python -OO > import math > import sys > import psyco > > psyco.full() > > def primes(): > primes=[3] > for x in xrange(5,1000,2): > maxfact = int(math.sqrt(x)) > flag=True > for y in primes: > if y > maxfact: > break >

Re: Python 2.5 idle and print command How do I suppress a line feed?

2006-11-23 Thread Will McGugan
notejam wrote: > Hi, > I am having a problem with print statements always cause a line feed. > I need to print a line of text, then the next print statement will > start printing where the last one stopped rather than drop down a line. > > In basic we can do this with print &quo

Re: Python 2.5 idle and print command How do I suppress a line feed?

2006-11-23 Thread Will McGugan
notejam wrote: > Hi, > I am having a problem with print statements always cause a line feed. > I need to print a line of text, then the next print statement will > start printing where the last one stopped rather than drop down a line. > > In basic we can do this with print &quo

Python work in UK

2006-11-23 Thread Will McGugan
omething in web development, applications, graphics or other interesting field. Here is a copy of my CV. http://www.willmcgugan.com/cvwillmcgugan.pdf Regards, Will McGugan -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: 3d programming without opengl

2006-11-01 Thread Will McGugan
nelson - wrote: > hi! >i want to build up a simple 3d interactive geometry application in > python. Since i want to run it without 3D acceleration (a scene will > be quite simple) I was wondering if there was a library in python that > allow me to build 3D graphic without

Re: Alternative constructors naming convention

2006-10-12 Thread Will McGugan
Steven Bethard wrote: > Are you really using staticmethod and calling __new__? It's often much > easier to use classmethod, e.g.:: > > class Color(object): > ... > @classmethod > def from_html(cls, r, g, b): > ... > # convert r, g, b to normal

Alternative constructors naming convention

2006-10-11 Thread Will McGugan
= Color.FromHtml(r, g, b) c = Color.from_html(r, g, b) Will McGugan -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython problems using GLCanvas

2006-10-09 Thread Will McGugan
and i can't interact > with my machine. I hava only to press power button.. what will > cause it? the code i use is exactly the code of the demo > > If using openGL is so difficult to do together with wxpython, what > toolkit can i use do do 3d graphics? Simple graphic

Re: __init__ style questions

2006-10-02 Thread Will McGugan
Duncan Booth wrote: > > Yes, it would, although since the implication is that your class expected > numbers and the file iterator returns strings I'm not sure how much it > matters: you are still going to have to write more code than in your > example above. e.g. > >v1 = Vector3D(float(n) for

Re: __init__ style questions

2006-10-02 Thread Will McGugan
Duncan Booth wrote: > No it isn't Pythonic. Why not just require 3 values and move the > responsibility onto the caller to pass them correctly? They can still use > an iterator if they want: > > Vector3D(a, b, c) > Vector3D(*some_iter) I kind of liked the ability to partially use iterato

__init__ style questions

2006-10-02 Thread Will McGugan
rors? 4) This does seem like a good candidate for __slots__, since there will could be large-ish lists of Vector3Ds. But is it a premature optimization? If it was just for myself or other experienced programmers I wouldn't be bothered about having the ability to do stupid things, because I si

SSL certificate meta data

2006-09-25 Thread Bernd Will
Hello everybody,   please help me with this topic:   Working at a big company (+100.000 employees worldwide), we have an amount of data centers and shared services where our webservers, backend server etc. are located. Now it happens from time to time, that certificates are expired and

Re: Interfacing my chess client with GNU chess using python

2006-09-18 Thread Will McGugan
r better ways of doing it. Any help would be appreciated. > The subprocess module may help you... http://docs.python.org/dev/lib/module-subprocess.html Will McGugan -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & chess

2006-08-24 Thread Will McGugan
brary for these things > (http://www.alcyone.com/software/chess/). Does anyone konw about more > chess related modules? I have written a chess module that may be of use to you. http://www.willmcgugan.com/2006/06/18/chesspy/ Will McGugan -- work: http://www.kelpiesoft.com blog: http://www.wil

Python-like C++ library

2006-08-23 Thread Will McGugan
ace C++ with Python in any way, just to emulate the strings / containers / slicing etc. I did google for it but my search terms were too vague... Thanks in advance, Will McGugan -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

iter(callable, sentinel)

2006-07-27 Thread Will McGugan
Hi, I've been using Python for years, but I recently encountered something in the docs I wasnt familar with. That is, using two arguements for iter(). Could someone elaborate on the docs and maybe show a typical use case for it? Thanks, Will McGugan -- work: http://www.kelpiesoft.com

Re: wxPython: wxStaticBitmap and large images

2006-07-20 Thread Will McGugan
map. An alternative may be to place your bitmap in html and use a wxHtmlWindow to display it. Will McGugan -- http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple file writing techiques ...

2006-07-19 Thread Will McGugan
his... with open('somefile','w') as fout: fout.writelines( line+"\n" for line in convertedData ) > ... or maybe some hybrid of the two which writes chunks of the > convertedData list out in one shot ... The OS should buffer it for you. Will McGugan -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython Grid XY Coordinates question

2006-07-14 Thread Will McGugan
ent) coordinates. If you have the mouse position in screen coordinates, you will need to convert them with the ScreenToClient for your grid. Will McGugan -- work: http://www.kelpiesoft.com blog: http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Persistant dictionary with lockable elements

2006-07-12 Thread Will McGugan
ashes. The Shelve module seems ideal for this, but because the server will be multithreaded I would like to be able to lock individual elements of the shelve while they are being processed (not just the entire Shelve object). Is there some way of using Shelve like this, or should I just move to a

Chess module blog

2006-06-18 Thread Will McGugan
://www.willmcgugan.com/2006/06/18/chesspy/ Regards, Will McGugan -- work: http://www.kelpiesoft.com blog: http://www.willmcgugan.com -- http://mail.python.org/mailman/listinfo/python-list

Freezing a static executable

2006-06-04 Thread Will Ware
libdl.so.2 => /lib/libdl.so.2 (0xb7f56000) libutil.so.1 => /lib/libutil.so.1 (0xb7f52000) libm.so.6 => /lib/tls/libm.so.6 (0xb7f2d000) libc.so.6 => /lib/tls/libc.so.6 (0xb7dff000) /lib/ld-linux.so.2 (0xb7f86000) What stupid thing am I doing wrong? TIA for any adv

Python netstring module

2006-06-04 Thread Will McGugan
Hi folks, I have just posted a python 'netstring' module on my blog. Comments welcome! http://www.willmcgugan.com/2006/06/04/python-netstring-module/ Regards, Will McGugan -- http://mail.python.org/mailman/listinfo/python-list

midi input

2006-04-29 Thread Will Hurt
on how to do this. thanks in advance will -- http://mail.python.org/mailman/listinfo/python-list

midipy.py on linux

2006-04-27 Thread Will Hurt
same thing available for linux[ie i can get raw midi data in as a list] and thats why no-ones bothered to compile midipy under linux? Thanks Will -- http://mail.python.org/mailman/listinfo/python-list

Interpreting python profiler results

2006-03-07 Thread Will Ware
anybody know if I am correct in my conclusion that most of the program's time is being spent in some getattr function in PyOpenGL? Thanks Will Ware -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about idioms for clearing a list

2006-02-06 Thread Will McGugan
e and: > > (3) mylist = [] > > Why are (1) and (2) preferred? I think the first two are changing the > list in-place, but why is that better? Isn't the end result the same? I'm wondering why there is no 'clear' for lists. It feels like a common operation for mut

Re: Testing for the presence of input from stdin.

2006-01-24 Thread Will McDonald
On 24/01/06, Roland Heiber <[EMAIL PROTECTED]> wrote: > Will McDonald wrote: > > Hi all. > > > > I'm writing a little script that operates on either stdin or a file > > specified on the command line when run. I'm trying to handle the > > s

Re: Testing for the presence of input from stdin.

2006-01-23 Thread Will McDonald
there waiting for input much like cat would. I think that's preferable, and simpler :), than implementing timeouts. Thanks. Will. -- http://mail.python.org/mailman/listinfo/python-list

Testing for the presence of input from stdin.

2006-01-23 Thread Will McDonald
e useage again. Is there a simple way to achieve this? Thanks, Will. Here's what I've got so far... #!/usr/bin/python # # hail - heads and tails import sys, os, getopt def hail(file,headlines=10,taillines=10): lines = file.readlines() sys.stdout.writelines(lines[:headlines])

Re: OpenGL

2006-01-22 Thread Will McGugan
functional? > Thanks > Something _like_ a PyOpenGL implementation? What about PyOpenGL itself? http://pyopengl.sourceforge.net/ Will McGugan -- http://www.willmcgugan.com "".join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c in "jvyy*jvyyzpthtna^pbz") -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex on Darwin, gcc 3.3 optimization trouble

2006-01-01 Thread Will Ware
In case anybody else has this problem, the solution is to add "-O" in extra_compile_args, which will override the "-O3" normally used. This is done in the setup.py file. -- http://mail.python.org/mailman/listinfo/python-list

Pyrex on Darwin, gcc 3.3 optimization trouble

2005-12-30 Thread Will Ware
st an approach to debugging this? I'm comfortable on Linux but I can't find my way out of a paper bag on a Mac. Also, is there a Pyrex or distutils option for limiting the compiler optimization level, ideally on a per-platform basis? Thanks much Will Ware -- http://mail.python.org/m

Re: Simple question on Parameters...

2005-12-28 Thread Will McGugan
or or Color(1.0, 1.0, 1.0, 1.0) fillColor = fillColor or Color(0.0, 0.0, 0.0, 0.25) Will McGugan -- http://www.willmcgugan.com "".join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c in "jvyy*jvyyzpthtna^pbz") -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple question on Parameters...

2005-12-28 Thread Will McGugan
ath(self, path, closePath=True, outlineColor=(1.0, 1.0, 1.0, 1.0), fillColor=(0.0, 0.0, 0.0, 0.25)): It all depends on what you find the most elegant solution. Im guessing you will use color values a lot, so I would recommend writing a simple class. Its also more natural to refer to the comp

Re: Interesting little "gotcha" with generators

2005-12-22 Thread Will McGugan
control flow > command. For example, you can't have "return" with an argument inside a > generator. > > Too bad "return" wasn't entirely forbidden within generators, and > "yield" without an argument mandated instead. Oh well, too let

Re: Invoking Unix commands from a Python app

2005-12-17 Thread Will McDonald
On 16 Dec 2005 08:45:01 -0800, Rob Cowie <[EMAIL PROTECTED]> wrote: > Excellent... just the thing I was looking for. Thanks. > > Does anyone know of a unix app that could be used to monitor the > duration of processes etc.? If you have control over starting the program then &

Re: Worthwhile to reverse a dictionary

2005-12-14 Thread Will McGugan
gt; There may be a better solution to your original problem (if you post more details Im sure there will be plenty of suggestions), but the following should reverse a dictionary.. >>> testdict = dict(a=1, b=2) >>> reversedict = dict( (value, key) for key, value in

Piecewise-cubic lookup table generator

2005-11-21 Thread Will Ware
I needed to generate some C code for a fast lookup table using piecewise-cubic interpolation. If anybody else needs this, the Python code for it is at http://tinyurl.com/92zcs (alt.source, Google Groups). Will Ware -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a List into a String

2005-11-05 Thread Will McGugan
a, > > the output is > > f e d c b a > > How can i remove the spaces b/w each letter? print "".join(list) BTW list isnt a good name for a list, it hides the built in type. Will McGugan -- http://www.willmcgugan.com "".join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c in "jvyy*jvyyzpthtna^pbz") -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >