Processing Game Help

2017-12-10 Thread Lauren Porter
Hello all! I've been trying to create a game in Python Processing where a spaceship moves horizontally in order to miss a collision with an asteroid. I'm having difficulty making it so that the game quits when an asteroid hits the spaceship, could anybody help? Here is my code. As you can see,

[issue17569] urllib2 urlopen truncates https pages after 32768 characters

2013-03-29 Thread J Porter
J Porter added the comment: Here is the code (security info removed) and the output. I noticed that the problem is a bit different between 2.6.5 and 2.7.3 (on one the use of authentication is different) so I've included the output for both: import urllib2 userData=Basic KEY GOES HERE

[issue17569] urllib2 urlopen truncates https pages after 32768 characters

2013-03-28 Thread J Porter
New submission from J Porter: When using urllib2 to fetch page data from an https server, I found that only the first 32768 characters of the download were retrieved. Other browsers returned the full documents, so it does not appear to be a server issue. If http, rather than https is used

[issue17262] OrderedDict not ordering properly when int and float keys are used

2013-02-20 Thread Matthew Porter
New submission from Matthew Porter: I've got two lists: state_cns_list = [0.001, 1, 2, 5] state_names_list = [L, S, D, H] When I try to create an OrderedDict linking each state_cns_list entry with its corresponding state_names_list entry, like so: states = OrderedDict( {float(state_cns_list

[issue17262] OrderedDict not ordering properly when int and float keys are used

2013-02-20 Thread Matthew Porter
Matthew Porter added the comment: Ahh nevermind, just realized my error :P Sorry for the waste of internet space -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17262

[issue15843] aifc.open expects only str or file pointer

2012-09-01 Thread Alastair Porter
New submission from Alastair Porter: Passing a unicode filename to aifc.open() results in the argument being treated like a filepointer instead of opening the file. The argument check, http://hg.python.org/cpython/file/default/Lib/aifc.py#l332 only checks if the argument is a str. Should

sometype.__new__ and C subclasses

2010-05-02 Thread James Porter
I've been trying to write a Python C extension module that uses NumPy and has a subtype of numpy.ndarray written in C. However, I've run into a snag: calling numpy.ndarray.__new__(mysubtype, ...) triggers an exception in the bowels of Python (this is necessary for a handful of NumPy features).

Re: sometype.__new__ and C subclasses

2010-05-02 Thread James Porter
On 5/2/2010 4:34 AM, Carl Banks wrote: Why don't you use mysubtype.__new__(mysubtype,...)? If you wrote mysubtype in C, and defined a different tp_new than ndarray, then this exception will trigger. And it ought to; you don't want to use ndarray's tp_new to create an object of your subclass,

Re: sometype.__new__ and C subclasses

2010-05-02 Thread James Porter
On 5/2/2010 1:43 PM, Robert Kern wrote: Perhaps things would be clearer if you could post the C code that you've written that fails. So far, you've only alluded at what you are doing using Python-syntax examples. I'm not sure how much this will help, but here you go. The actual C code

Re: sometype.__new__ and C subclasses

2010-05-02 Thread James Porter
On 5/2/2010 3:58 PM, Robert Kern wrote: Well, I think we can change zeros_like() and the rest to work around this issue. Can you bring it up on the numpy mailing list? def zeros_like(a): if isinstance(a, ndarray): res = numpy.empty(a.shape, a.dtype, order=a.flags.fnc) res.fill(0) res =

Dynamic Loading Modules

2009-01-17 Thread Riley Porter
I make myself clear? Please let me know if I need to explain that better. Thanks ! -- Riley Porter Network Security Engineer Offensive Security - OSCP SANS GIAC - GCIH CCNA, Security+ ACSA - Arcsight Security Analyst -- http://mail.python.org/mailman/listinfo/python-list

Re: Reasoning behind 'self' parameter in classes?

2008-07-30 Thread Brett g Porter
Robert Dailey wrote: This is an example of a response I'm looking for: The self parameter is required because the parser is a bit old and needs to know the exact object you're referencing This is _not_ an example of what I'm looking for: Specifying self is a great mysterious thing that we

Re: Python program as daemon?

2008-07-25 Thread Brett g Porter
Johny wrote: Is it possible to run a Python program as daemon? Sure -- see http://code.activestate.com/recipes/66012/ for an example (and some useful stuff in the comments.) -- http://mail.python.org/mailman/listinfo/python-list

Compress a string

2008-05-18 Thread Matt Porter
Hi guys, I'm trying to compress a string. E.g: BBBC - ABC The code I have so far feels like it could be made clearer and more succinct, but a solution is currently escaping me. def compress_str(str): new_str = for i, c in enumerate(str): try: if c !=

Re: [EMAIL PROTECTED]: Re: Compress a string]

2008-05-18 Thread Matt Porter
On Sun, 18 May 2008 19:13:57 +0100, J. Clifford Dyer [EMAIL PROTECTED] wrote: On Sun, May 18, 2008 at 07:06:10PM +0100, Matt Porter wrote regarding Compress a string: Hi guys, I'm trying to compress a string. E.g: BBBC - ABC The code I have so far feels like it could be made clearer

Re: Compress a string

2008-05-18 Thread Matt Porter
On Sun, 18 May 2008 20:30:57 +0100, Peter Otten [EMAIL PROTECTED] wrote: Matt Porter wrote: I'm trying to compress a string. E.g: BBBC - ABC Two more: from itertools import groupby .join(k for k, g in groupby(aabbcc)) 'abc' import re re.compile(r(.)\1*).sub(r\1

Re: Python MIDI in 2008

2008-05-06 Thread Brett g Porter
Maciej Bliziński wrote: For the last couple of days, I've been looking for a Python midi library. I'm generally interested in sending MIDI events via ALSA. It seems like everything out there is pretty old; packages are from 2003 or 2005. Some packages don't seem to be really used, for instance

Re: License selection for free software

2008-05-06 Thread Matt Porter
On Tue, 06 May 2008 20:02:21 +0100, Paul Rubin http://phr.cx@nospam.invalid wrote: [EMAIL PROTECTED] (Ville M. Vainio) writes: [EMAIL PROTECTED] (Ville M. Vainio) writes: I don't think BSD/MIT like license really annoys anyone. Think python here ;-) Python's non-GPL license certainly is

Getting started with JPype

2007-08-13 Thread porter
Hi, For nefarious javaesque reasons I've been trying to get started with jpype (http://jpype.sourceforge.net). This looks like a potentially useful tool for integrating java classes into C-python, but frustratingly I've run into immediate problems. The documentation on the project really doesn't

Re: Getting started with JPype

2007-08-13 Thread porter
Gah - I hate it when that happens: Just after posting I figured out my silly mistake: my package is called myclasses and I was referencing 'myclass' apologies for wasting your time Hi, For nefarious javaesque reasons I've been trying to get started with jpype

Re: Iteration over strings

2007-07-31 Thread Brett g Porter
Robert Dailey wrote: Hi, I have the following code: str = C:/somepath/folder/file.txt for char in str: if char == \\: char = / The above doesn't modify the variable 'str' directly. I'm still pretty new to Python so if someone could explain to me why this isn't working

Re: Eureka moments in Python

2007-03-13 Thread Brett g Porter
Steven D'Aprano wrote: I'd be interested in hearing people's stories of Eureka moments in Python, moments where you suddenly realise that some task which seemed like it would be hard work was easy with Python. Mine was definitely when I was first working with the xmlrpc module, and I was

Re: Eureka moments in Python

2007-03-13 Thread Brett g Porter
Dustan wrote: On Mar 13, 10:05 am, Brett g Porter [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: I'd be interested in hearing people's stories of Eureka moments in Python, moments where you suddenly realise that some task which seemed like it would be hard work was easy with Python. Mine

Re: do people really complain about significant whitespace?

2006-08-09 Thread Brett g Porter
is not as good a solution as eliminating the scutwork, especially when it shouldn't be necessary at all... -- // Brett g Porter * [EMAIL PROTECTED] // http://www.bgporter.net/blog -- http://mail.python.org/mailman/listinfo/python-list

Re: xmlrpclib and methods declared at runtime

2006-07-26 Thread Brett g Porter
in a way that lets the users of your code forget that there's anything magic going on at all. It just looks like code. -- // Brett g Porter * [EMAIL PROTECTED] // http://www.bgporter.net/blog -- http://mail.python.org/mailman/listinfo/python-list

Re: String handling and the percent operator

2006-07-13 Thread Brett g Porter
Justin Azoff wrote: Tom Plunket wrote: boilerplate = \ [big string] return boilerplate % ((module,) * 3) [deletia...] Of course.. stuff = {'lang': 'python', 'page': 'typesseq-strings.html'} print I should read the %(lang)s documentation at ...

Re: Non-web-based templating system

2006-04-28 Thread Brett g Porter
Diez B. Roggisch wrote: [EMAIL PROTECTED] wrote: Maybe the built-in string interpolation is sufficient? print Hello %(name)s % dict(name=Peter Pan) Or in recent pythons, the built-in string templating system (see http://docs.python.org/lib/node109.html) from string import Template

Re: How to *Search* with google from inside my programme and get the search result?

2006-02-15 Thread Brett g Porter
I V wrote: Frank Potter wrote: Does google supply some webservice to programmers? I did see Googling for google api gets you to: http://www.google.com/apis/ It appears to be a SOAP API, which you can access with python, but I think you'll need a third-party library. Googling for python

Re: URL 'special character' replacements

2006-01-09 Thread Brett g Porter
Oblique Strategy (© Brian Eno/Peter Schmidt): // Accretion // Brett g Porter * [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern matching with string and list

2005-12-13 Thread Brett g Porter
BartlebyScrivener wrote: Even without the marker, can't you do: sentence = the fabric is red colors = [red, white, blue] for color in colors: if (sentence.find(color) 0): print color, sentence.find(color) That depends on whether you're only looking for whole words:

Re: Mutability of function arguments?

2005-12-07 Thread Brett g Porter
(© Brian Eno/Peter Schmidt): // Repetition is a form of change // Brett g Porter * [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: [Fwd: Re: hex string to hex value]

2005-11-22 Thread Brett g Porter
Schmidt): // Repetition is a form of change // Brett g Porter * [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: First Script Problem

2005-09-16 Thread Brett g Porter
to either use string formatting or the idiom of using the join method of list objects to create a string in a single pop once a list of substrings is all populated. -- // Today's Oblique Strategy (© Brian Eno/Peter Schmidt): // Destroy -nothing -the most important thing // Brett g Porter

Re: Defending Python

2005-07-13 Thread Brett g Porter
-- // Today's Oblique Strategy (© Brian Eno/Peter Schmidt): // Change instrument roles // Brett g Porter * [EMAIL PROTECTED] // http://bgporter.inknoise.com/JerseyPorkStore -- http://mail.python.org/mailman/listinfo/python-list

Re: How to compare files

2005-07-01 Thread Brett g Porter
without '\n' are the same) Thanks for help. LAd. Have you looked at the difflib module that comes with Python? http://docs.python.org/lib/module-difflib.html -- // Today's Oblique Strategy (© Brian Eno/Peter Schmidt): // Change instrument roles // Brett g Porter * [EMAIL PROTECTED

Re: Python forum

2005-05-17 Thread Brett g Porter
Thanks Don't forget that there's also the Tutor list (see http://www.python.org/mailman/listinfo/tutor ), targeted to people looking to learn the language... -- // Today's Oblique Strategy (© Brian Eno/Peter Schmidt): // Change instrument roles // Brett g Porter * [EMAIL PROTECTED] -- http