Re: Membership of multiple items to a list

2009-02-02 Thread Stephen Hansen
On Sun, Feb 1, 2009 at 7:47 PM, Ben Finney wrote: > rdmur...@bitdance.com writes: > >> I don't even see Stephen Hansen's posts. My newsreader just shows >> the header and says "[HTML part not displayed]". > > Likewise. Yeah, I know HTML is bad

Re: is python Object oriented??

2009-02-02 Thread Stephen Hansen
>> >> You, sir, should be programming in some language other than Python. > > Why? - Python is object oriented, but I can write whole systems > without defining a single class. > By analogy, if data hiding is added to language, I could write a > whole system without hiding a single item. > Convers

Re: What is wrong in my list comprehension?

2009-02-02 Thread Stephen Hansen
>> str.find() returns -1 on failure (i.e. if the substring is not in the >> given string). >> -1 is considered boolean true by Python. > > That's an odd little quirk... never noticed that before. > > I just use regular expressions myself. > > Wouldn't this be something worth cleaning up? It's a lit

Re: is python Object oriented??

2009-02-02 Thread Stephen Hansen
> > > > that an underscore convention is > > > "just as good", (It isn't), > > > > Why isn't it? > > Because it needs human intervention. > Not necessarily at all: that's something that could be checked very readily with static analysis. Why isn't that a good enough tool if policy isn't sufficien

Re: What is wrong in my list comprehension?

2009-02-02 Thread Stephen Hansen
> > I'm only curious if it's worth cleaning up because the OP's case is one > where there is more than one way to do it. I just think at this point ".find" is just not the right method to use; "substring" in "string" is the way to determine what he wants is all. ".find" is useful for when you wan

Re: Membership of multiple items to a list

2009-02-02 Thread Stephen Hansen
On Mon, Feb 2, 2009 at 10:21 AM, Duncan Booth wrote: > Stephen Hansen wrote: > > > I'm re-sending this same message as the OpenPGP S/MIME attachment > > format -- just so test if its actually readable by news clients in > > general. I have absolutely no idea. Not t

Re: Reading text file with wierd file extension?

2009-02-02 Thread Stephen Hansen
> > The above works well. I am able to open the file and read it's > contents. I assume to read a file in text file "mode" the parameter is > scanned for a ".txt" extension, otherwise the Python runtime doesn't > know what version of "open(...)" to invoke. How do I pass the original > filename (MyT

Re: Reading text file with wierd file extension?

2009-02-02 Thread Stephen Hansen
> class MyUtilityClass: >def __init__(self, DataFilepath): >Resourcepath = DataFilepath + ".rsc" >DataFileH = open(DataFilepath) >ResourceFileH = open(Resourcepath) There's nothing wrong with this code. You have to look elsewhere in your program-- perhaps what cal

Re: function scope

2009-02-02 Thread Stephen Hansen
On Mon, Feb 2, 2009 at 3:40 PM, Baris Demir wrote: > Hi everybody, > > I am quite new to python and using it for my thesis. Luckily I found out > some kind of behavior surprising to me and so unwanted in my code. I could > not find any explanation, so solution for the code. > It is simply like t

Re: function scope

2009-02-02 Thread Stephen Hansen
> If you want a copy when you have > to do so explicitly with "temp=d.copy()". Or that! I forgot about that method. :) Curiously, in 160k lines of code, I haven't explicitly copied a dictionary once. I find that odd. --S -- http://mail.python.org/mailman/listinfo/python-list

Re: Varibles -- copies and references

2009-02-02 Thread Stephen Hansen
> > Guess the simple types show the expected behaviour (even though they are > technically instances of existing classes). The user defined classes seem to > be references/shallow copies. I prefer to avoid the term "reference" when talking about Python semantics, because it tends to make a lot of

Re: rfi : bestpractises for implementing secure policies in python

2009-02-02 Thread Stephen Hansen
s just "harder". I'm only interested in the casual protection. But we have a solid relationship with our customers and they all have maintenance contracts: we keep them loyal and not interested in doing anything like that primarily by providing continued updates and enhancements overtime. So we're only really worried about casual tweaking bypassing the security. HTH, --Stephen -- http://mail.python.org/mailman/listinfo/python-list

Problem using compileall

2009-02-02 Thread Stephen Hansen
I'm having a slight problem with pre-compiling some files for distribution that I'm not sure where to even look for. An excerpt from an output: C:\mother\Python24\core\application\sysconfig>python -m compileall . Listing . ... Compiling .\BulkListClass.py ... Sorry: TypeError: ('c

Re: Problem using compileall

2009-02-03 Thread Stephen Hansen
> Try this to discover whether the file actually contains a NUL byte or not: > > f = open("BulkListClass.py","rb") > src = f.read() > i = src.index('\0') > print "found NUL at index", i > print repr(src[i-20:i+20]) Doh. It did. How the heck did that get there! I hadn't thought to actually look --

Re: Import without executing module

2009-02-03 Thread Stephen Hansen
On Tue, Feb 3, 2009 > So, is inserting the above if statement common practice for python > programmers? As a C programmer, it seems that people put a "#ifndef > XXX...#define XXX...[all of the code]...#endif" almost as a habit. I > wonder if its the same thing? That statement is very common in P

Re: Good or bad use of __repr__?

2009-02-03 Thread Stephen Hansen
> > As written, if a program references a Dimension instance without an > attribute, it gets the size attrbute "by default". If it wants the other > attributes, they have to be spec'd. In the context of the code being > developed, the "size" attribute is the "logical" representation of the > dimens

Re: Ordered dict by default

2009-02-05 Thread Stephen Hansen
But: this seems like a complete lose-lose for an idea from my perspective. Sure you say an unordered dictionary could then be added for my needs, but... I like my syntactic sugar, thank you :) Ordered dictionaries can be useful, its good to see a standard implementation going into the core, bu

Re: Ordered dict by default

2009-02-05 Thread Stephen Hansen
> Now, I also do recognize the utility of ordered dictionaries in some cases, > but > exactly what you mean by ordered varies. I have two cases where "ordered" > has the keys are in a specific custom order. I have four cases where "ordered" > means maintaining insertion order. For the former I do

Re: Flattening lists

2009-02-05 Thread Stephen Hansen
> Either list creation is somewhat > costly, or "if var is None" is really cheap. "if x is y" is extremely cheap, I believe. Unlike most comparisons which are (relatively) expensive, that one is just comparing simple object address. You can't override "is" so there's a whole series of checks that

Re: Returning a variable number of things...

2009-02-06 Thread Stephen Hansen
On Fri, Feb 6, 2009 at 10:50 AM, r0g wrote: > Hi There, > > I have a function that uses *args to accept a variable number of > parameters and I would like it to return a variable number of objects. > > I could return a list but I would like to take advantage of tuple > unpacking with the return

Re: Trouble sorting a list of objects by attributes

2009-02-06 Thread Stephen Hansen
> I think there may have been a misunderstanding. I was already using > attrgetter, my problem is that it doesn't appear to be sorting by the > argument i give it. How does sort work with strings? How about with > datetime.time or datetime.date? You were using the attrgetter, but it looks like

Re: Why doesn't this RE match?

2009-02-06 Thread Stephen Hansen
>In my experience with regular expressions, regex should have found a > match. However, in this case regex.match() returns None. Why is that? > What am I missing? You want regex.search(). match specifically looks for the pattern from the start of the screen, search anywhere. --S -- http://m

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-06 Thread Stephen Hansen
On Fri, Feb 6, 2009 at 7:32 PM, er wrote: > Thanks Chris. Lua tables are one of my favorite linguistic traits, which > was actually part of the discussion that brought up this nugget. > Nevertheless, any details you care to provide about the details. I'm going > to dive into the source code in m

Re: Process crash with no reason

2009-02-08 Thread Stephen Hansen
> Thanks a lot and sorry for the late response. My main suspect is the > CherryPy. > I'm still investigating it. You're asking for advice but not listening to what people are saying here -- why is CherryPy on the top of your list? What version of CherryPy is it? 1 or 2? If its 2, then its pure p

Re: easy_install

2009-02-08 Thread Stephen Hansen
> I updated my easy_install, used the scripts directory, dropped the "c:\" and > it gave the response below for me: That's kinda apples to oranges to what the OP's problem is. The OP appears to be trying to install an egg he downloaded previously. You're instructing easy_install (by dropping the

Re: Spam

2009-02-12 Thread Stephen Hansen
> There seems to be lot of spam coming in this newsgroup. > Is it possible to have some mechanism similar to say - slashdot - > wherein mails can be moderated by any of the usual users? > This is required only for people who is posting for the first time > (or people who has been rated spam b

Re: Spam

2009-02-12 Thread Stephen Hansen
> C.P.L C.L.P even. Ahem. --S -- http://mail.python.org/mailman/listinfo/python-list

Re: hpw to convert a linux python script ?

2009-02-12 Thread Stephen Hansen
> # Absolute path to the directory that holds media. > # Example: "/home/media/media.lawrence.com/" > MEDIA_ROOT = fsroot+'/Projects/PytDj/images/' > > Note that most Windows APIs allow you to use the forward slash as a > delimiter. It's mostly the command line and Windows Explorer that are > snott

Re: Python change a value of a variable by itself.

2009-02-17 Thread Stephen Hansen
hat list in r_new[1], you can use the copy module, or something like: r_new[1] = r[1][:] which uses list slices to return a copy of the specified list. HTH, --Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: v 3.0 mpkg

2009-02-18 Thread Stephen Hansen
> Follow up: Python 3.0.1 has been released and, with it, an installer > image for OS X: > > > How doe the 3.0 installer on the mac interact with existing installs? I have the system install but more importantly the python.org one which I can't hav

Re: urllib2 login help

2009-02-21 Thread Stephen Hansen
> > *ANY* hints/suggestions/directions would be very appreciated since > I've run out of ideas of things to try at this point. > The last time I heard something like this, I suggested that the problem might be cookies -- and it ended up working for the person I believe. http://groups.google.com/g

Re: how to convert '\xf0' to 0xf0 ?

2008-12-11 Thread Stephen Thorne
uct.unpack('!hi', '\xf0\xf0\xf0\xf0\xff\xfe') (-3856, -252641282) help(struct) for more information -- Regards, Stephen Thorne Development Engineer NetBox Blue - 1300 737 060 Scanned by the NetBox from NetBox Blue (http://netboxblue.com/) -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing None objects from a sequence

2008-12-14 Thread Stephen Thorne
way? There's a little hack that will remove all elements from a list that are 'False' when considered as a boolean. So None, [], '', False, etc. filter(None, myseq) an example: >>> l = ['1', 2, 0, None, '5'] >>> filter(None, l

Re: How do I manually uninstall setuptools (installed by egg)?

2008-12-14 Thread Stephen Thorne
dist_deb.py here: http://bazaar.launchpad.net/~jerub/packaging/trunk/annotate/11?file_id=bdist_deb.py-20080507003948-5c5mn3f68meq60hs-1 -- Regards, Stephen Thorne Development Engineer NetBox Blue - 1300 737 060 Scanned by the NetBox from NetBox Blue (http://netboxblue.com/) Can you afford to b

Re: no sign() function ?

2008-12-22 Thread Stephen Thorne
u don't want a float response:: def sign(x): return cmp(x, 0) -- Regards, Stephen Thorne Development Engineer NetBox Blue - 1300 737 060 -- http://mail.python.org/mailman/listinfo/python-list

ZSI - ServiceContainer

2008-12-28 Thread Stephen Chapman
Does Anyone know how to Make the ServiceContainer work under SSL Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python: delay in files changing after alteration

2009-01-05 Thread Stephen Chapman
I have never noticed any such delay. After making a change I just hit F5 on my browser and its fine. Maybe its a browser issue On 1/5/09, psaff...@googlemail.com wrote: > Maybe this is an apache question, in which case apologies. > > I am running mod_python 3.3.1-3 on apache 2.2.9-7. It works

Re: formatted 'time' data in calculations

2009-01-07 Thread Stephen Chapman
Here is how I have done adjustments to time in the past. This is mostly Date related but it may help today = datetime.date.today() wkdiff = datetime.timedelta(weeks=1) daydiff = datetime.timedelta(days=1) startdate=(today-wkdiff)-daydiff this will subtract 1 week and 1 day from today. Stephen

Re: Authorize.net integration problem

2009-03-31 Thread Stephen Chapman
Are they expecting the results in a specific order... because as you probably know a dictionary is never in the order that you add the items. Lakshman Prasad wrote: Yup. Unusual, it is. But thats how their string specification syntax is. It includes a ^ at the end. On Tue, Mar 31, 2009 at

Re: The Python standard library and PEP8

2009-04-19 Thread Stephen Hansen
> > Also, my code sample was itself a trick question. Python has *dynamic* > > object orientation (just as the blurb says), and square() will work > > on any object with a __mul__() method (through the ``*`` syntax), just as > > len() works on any object with a __len__() method. So my code > > d

Re: What is a real name, round 668

2009-04-20 Thread Stephen Hansen
why does the substance of my message need to have a certain name attached to it? This is the internet. I am what I present to you: my thoughts and ideas that I articulate to you. My name is meaningless. If you google "Stephen Hansen", you'll get countless results that aren't me

Re: Web based application development using python

2009-04-27 Thread Stephen Hansen
> i am getting more specific, is there any web development framework > better than mod python which is > easy to maintain. > I'd have a hard time categorizing mod_python as a "web development framework"; it seems to me to be primarily a Python accelerator for Apache, with lightweight tools which c

Re: Why bool( object )?

2009-04-27 Thread Stephen Hansen
On Mon, Apr 27, 2009 at 11:11 PM, Aaron Brady wrote: > What is the rationale for considering all instances true of a user- > defined type? Is it strictly a practical stipulation, or is there > something conceptually true about objects? > > ''' > object.__bool__(self) > If a class defines neither

Re: Please explain this strange Python behaviour

2009-04-30 Thread Stephen Hansen
ython handles name binding consistently throughout the entire language. In this corner case that just seems weird at first to people. --Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: web access through vpn client

2009-05-01 Thread Stephen Hansen
> > I am trying to retrieve financial data off website for stock market > analysis. Just hobby not for pay. I actually am impressed that > urllib2 and BeautifulSoup work pretty well to do what I want, and the > first little routine actually gets the data from the web page... > except if my VPN cl

Re: Convert variable directly into a string (no ASCII)

2009-05-02 Thread Stephen Hansen
> I need to print variables out over serial, however I need them to not be > in ASCII, ie if the variable is 5 then print 5 not "5". > > The function that writes to the serial port requires a string and I can > send non-variables out with the string "/x05" for 5. > > Is this even possible? > Check

Re: Most Basic Question Ever - please help

2009-05-02 Thread Stephen Hansen
> > IDLE 2.6.2 > >>> python module1.py > SyntaxError: invalid syntax > The ">>>" prompt is Python's interactive interpreter. Once you are here, you already are in python-- so typing "python" again is redundant and invalid. >From this prompt you type in python code. I have never used IDLE so can't

Multiprocessing + Frozen bug?

2009-05-02 Thread Stephen Hansen
In the multiprocessing.forking module, there's: def get_command_line(): ... if getattr(sys, 'frozen', False): return [sys.executable, '--multiprocessing-fork'] else: prog = 'from multiprocessing.forking import main; main()' return [_p

Re: Simple way of handling errors

2009-05-07 Thread Stephen Hansen
> If it fails, you get both a straight-forward error message and a useful > traceback: > > Traceback (most recent call last): > File "", line 1, in > IOError: [Errno 2] No such file or directory: 'foomanchu' > > > The only reason you would bother going to the time and effort of catching > the err

Re: Logging exceptions to a file

2009-05-07 Thread Stephen Hansen
> > > > > So far so good, but I'd like to record (possibly unhandled) exceptions > > > in the logfile. > > > * Do I need to explicitly trap every single exception ? > > > * In that case, won't I get 2 log messages on the console (as > > > illustrated in the code below: > Check out sys.excepthook,

Re: Creating temperory files for a web application

2009-05-08 Thread Stephen Hansen
> > > Thank you Diez. > I would like to go ahead with the cleanest solution indeed. > I am creating the image on the fly. But I could not understand what > you meant by render to memory as a string. > How do we send the image to the browser? > > Were you mentioning about having the image as a strin

Re: import overwrites __name__

2009-05-08 Thread Stephen Hansen
> > So what leads to the behavior that the .pyc is not created? > PYC's are only generated on import, they're never made for the main script. I personally like to keep my 'main script' very small. Largely just something which imports other modules and sends them along on their business. --S --

Re: import overwrites __name__

2009-05-08 Thread Stephen Hansen
> > > Still I appreciate if someone could explain me why. > We can't without seeing the code. There shouldn't be any difference, so if there is then its because your code is doing something to cause it-- break it down to a runnable example and we may be able to tell you why, giving us real code an

Re: I'm intrigued that Python has some functional constructions in the language.

2009-05-09 Thread Stephen Hansen
> Python also has higher-order functions like that, but their use is > disfavored in certain circles. With Python 3, there has actually been > movement towards removing them from the language. ... Buh? Reduce was moved to functools, map and filter weren't touched; there was some discussion befor

Re: mod_python and xml.dom.minidom

2009-05-09 Thread Stephen Hansen
> > My only advice is, don't use mod_python. The project is dead, you > should use mod_wsgi instead: http://code.google.com/p/modwsgi/ > To echo what Daniel said, mod_wsgi is really the way to go. It might still not work in "embedded" mode where like mod_python the Python interpreter is in the Ap

Re: Pythonic way to normalize vertical whitespace

2009-05-10 Thread Stephen Hansen
On Fri, May 8, 2009 at 8:53 AM, wrote: > I'm looking for suggestions on technique (not necessarily code) about the > most pythonic way to normalize vertical whitespace in blocks of text so that > there is never more than 1 blank line between paragraphs. Our source text > has newlines normalized

Re: Help with a HTTP GET request

2009-05-12 Thread Stephen Hansen
> I am trying to build a HTTP request that looks like: > http://localhost/common/foxisapi.dll/tmsmail.x2.isapi > ? > Works in a browser. > > and now I am attempting to use HTTPConnection > >>> conn = httplib.HTTPConnection("localhost") > >>> print x > %3CPROCESS%20sync%3D%27%27%20schema%3D%27%27%20

C API: how to replace python number object in place?

2009-05-14 Thread Stephen Vavasis
If x is a C variable of type PyObject*, and I happen to know already that the object is of a numeric type, say int, is there a way to change the value of x in place to a different number? In the C/API documentation I found routines to increment or decrement it in place, but I didn't find a rou

Re: C API: how to replace python number object in place?

2009-05-14 Thread Stephen Vavasis
In my previous posting, I inquired how to change a python numeric object in place. Several people responded that this is not possible. Perhaps I should explain the larger problem that I am trying to solve, and then the solution will become apparent. I have a C routine R that invokes a Python

Re: python3 module for dbus ?

2009-05-21 Thread Stephen Hansen
> > > Do you know if I can get dbus bindings for python3 and glib bindings for >>> python3 ? Or could I use them otherwise (like without the modules) ? >>> >> >> Sorry, no answers to your questions off-hand, but what's wrong with >> using 2.x? >> > > It is now old and will be replaced by 3.0 > And

Re: When does the escape character work within raw strings?

2009-05-23 Thread Stephen Hansen
> > > How do you know how a string object is going to be treated by any > > given function? Read the Fine Manual for that function. > > So am I to understand that there is no consistency in string handling > throughout the standard modules/objects/methods? > > Seems to make python a lot more compl

Re: Printing list/tuple elements on separate lines

2009-06-04 Thread Stephen Hansen
On Thu, Jun 4, 2009 at 5:37 PM, Johnny Chang wrote: > I have a large list of strings that I am unpacking and splitting, and > I want each one to be on a new line. Someone showed me how to do it > and I got it working, except it is not printing each on its own > separate line as his did, making i

array of 64-bit ints?

2008-05-23 Thread Stephen Vavasis
Is it possible to have an array of 64-bit-ints using the standard Python array module? On my 64-bit architecture (AMD64, MSVC), both "int" and "long int" are 32 bit integers. To declare 64-bit ints, one needs either "long long int" or "size_t". However, according to the Python array document

creating yaml without tags using pyyaml

2008-06-06 Thread Stephen Moore
f the errors. So I'm wondering if there is an option to YAML.decode that will create a yaml document without the tags? Thankyou Regards Stephen -- http://mail.python.org/mailman/listinfo/python-list

Re: creating yaml without tags using pyyaml

2008-06-06 Thread Stephen Moore
On Fri, Jun 6, 2008 at 8:20 PM, Kirill Simonov <[EMAIL PROTECTED]> wrote: > Stephen Moore wrote: >> >> I have come to the conclusion that this is the fault of the tags (for >> example, !!python/tuple) as getting rid of them gets rid of the >> errors. >> >&

Re: Python embedding question.

2008-07-15 Thread Stephen Johnson
The Pyglet library has all the functionality of pygame, but is smaller and much more self-contained. Pygame requires SDL, pyglet only OpenGL. On Jul 15, 2008, at 6:26 AM, Uwe Schmitt wrote: On 15 Jul., 12:14, Thomas Troeger <[EMAIL PROTECTED]> wrote: Kay Schluehr wrote: On 15 Jul., 11:51, T

Re: Distributing Python App

2008-07-18 Thread Stephen Johnson
Look up py2app and py2exe, for OS X and Windows, respectively. They are extensively documented and easy to use. On Jul 18, 2008, at 3:35 PM, KDawg44 wrote: Hi, I am very new to Python but find it very interesting (from what I know of it) and am considering writing an application. However, I

Re: Any Game Developers here?

2008-07-18 Thread Stephen Johnson
I use the Pyglet library to make games. You want to look at the pyglet and pygame mailing lists, not this one. Use Google. In my opinion, PyGame is clunky and Pyglet is elegant, simple, and comprehensive. PyGame has more examples available, but Pyglet has great documentation and enough exam

Re: Any Game Developers here?

2008-07-18 Thread Stephen Johnson
l, not just one library. (though of course I know that's not too likely) Aren't you one of the Escort Wing developers? :) Thanks Michael On Fri, Jul 18, 2008 at 5:13 PM, Stephen Johnson <[EMAIL PROTECTED]> wrote: I use the Pyglet library to make games. You want to look at t

Re: Any Game Developers here?

2008-07-18 Thread Stephen Johnson
08 at 7:52 PM, Stephen Johnson <[EMAIL PROTECTED]> wrote: Yes, I wrote the music, the GUI, and bits of code here and there.. Will Hogben is working on EW 2 for Freeverse right now. But that was in BlitzMax, and I'm in greener pastures now, working on my demo for PyOhio. -Steve Jo

Re: Python Written in C?

2008-07-20 Thread Stephen Johnson
Carry bits? Who worries about carry bits when you have unlimited precision arithmetic? You want cool? THIS is cool: j = ((invert(xyz[1]-xyz[0],xyz[1]**(k-1))*(xyz[1]**(k-1)-prev_gen[2])) % xyz[1]**(k-1))/xyz[1]**(k-2) You call that "cool." I call it "unreadable." -Steve Johnson -- http://mail.

Re: convert list of lists to list

2008-07-22 Thread Stephen Johnson
list_A = [['klas*', '*', '*'], ['mooi*', '*', '*', '*'], ['koe'], ['arm*', '*', '*(haar)'], ['groei*', '*', '*', '*', '*']] list_B = [] for inner_list in list_A: #join elements of list into a string with separator ' ' list_B.append(' '.join(inner_list)) print list_B Output: ['kl

Re: Doubt

2008-07-23 Thread Stephen Johnson
You don't need a mailing list, you need to read the tutorial. Those are completely trivial questions. http://docs.python.org/tut/tut.html -Steve Johnson On Jul 23, 2008, at 10:51 AM, ജഗന്നാഥ് wrote: Friends I am a Perl programmer new to Python. I have a small doubt. How to convert the perl

Re: readln() until EOF

2008-07-24 Thread Stephen Johnson
the_file = open(path, 'r') for this_line in the_file: #do stuff with this_line -Steve Johnson On Jul 24, 2008, at 3:09 PM, korean_dave wrote: a = open("Thefile.txt","r") while ?: result = a.readln() what do i put in if i want to keep reading line by line until i reach the e

Re: python lists and newline character

2008-07-28 Thread Stephen Johnson
domain.strip() Assuming domain is the string with the newline. -Steve Johnson On Jul 28, 2008, at 1:32 PM, Support Desk wrote: Hello all, I am using os.popen to get a list returned of vpopmail users, something like this x = os.popen('/home/vpopmail/bin/vuserinfo -n -D mydomai

xcompile patch for python 2.5.2?

2008-08-12 Thread Stephen Cattaneo
Hi all, Personally I know nothing of cross compiling so please excuse my ignorance, if this question is silly. A friend of mine is attempting to cross compile python 2.5.2 onto a MIPS64 box. He is asking if there is a cross compile patch for 2.5.2. Do any of you know where He might find such a

manipulating hex values

2008-04-01 Thread Stephen Cattaneo
Hi all, I am relatively new to socket programming. I am attempting to use raw sockets to spoof my IP address. From what I can tell I will have to build from the Ethernet layer on up. This is fine, but I am having some trouble with manipulating my hex values. Seems to me that there are tw

Re: Re: manipulating hex values

2008-04-01 Thread Stephen Cattaneo
Gabriel Genellina wrote: > En Tue, > 01 Apr 2008 14:11:31 -0300, Stephen Cattaneo > <[EMAIL PROTECTED]> escribió: > >> I am relatively new to socket programming. I am attempting to use raw >> sockets to spoof my IP address. > > Don't bother to try... >

RE: manipulating hex values

2008-04-03 Thread Stephen Cattaneo
Thanks to everyone ( Grant, Cliff, and Gabriel) for responding and helping me. Cheers, Steve -Original Message- From: Grant Edwards [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2008 7:46 PM To: python-list@python.org Subject: Re: manipulating hex values On 2008-04-01, Stephen

RE: Running a python code periodically

2008-04-08 Thread Stephen Cattaneo
If your on a *NIX just use cron. Execute 'crontab -e' edit the file as desired and save see man crontab for formatting. Cheers, Steve From: Maryam Saeedi [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 08, 2008 10:54 AM To: python-list@python.

RE: Best way to check if string is an integer?

2008-04-08 Thread Stephen Cattaneo
1E+1 is short hand for a floating point number, not an interger. >>> float("1E+1") 10.0 You could convert the float to an integer if you wanted (i.e. ceiling, floor, rounding, truncating, etc.). Cheers, Steve -Original Message- From: Martin Marcher [mailto:[EMAIL PROTECTED] Sent: Tuesd

Python does not get environment variable when using cron.

2008-08-17 Thread Stephen Cattaneo
Hello all, I am attempting to execute an automated test (written in Python) via cron. I have to check the HOSTNAME variable as part of the test, oddly under cron the HOSTNAME environment variable is not in the os.environ dictionary. I know that cron runs in a subshell that does not have all of t

RE: Python does not get environment variable when using cron.

2008-08-18 Thread Stephen Cattaneo
PM - To: python-list@python.org - Subject: Re: Python does not get environment variable when using cron. - - On Aug 18, 11:15 am, "Stephen Cattaneo" - <[EMAIL PROTECTED]> wrote: - > Hello all, - > - > I am attempting to execute an automated test (written in Python) via - > cron

Logix - gone?

2008-09-10 Thread Stephen Johnson
I found Logix (http://livelogix.net/logix/) while looking for something else and thought it looked like a very interesting project. Unfortunately, the blog, mailing list, and Trac links are broken, and the contact email address bounces. I am interested in playing with it and working on it i

Re: Logix - gone?

2008-09-10 Thread Stephen Johnson
U try the download link; it worked for me. Oops. You just found my daily stupid. However, I still wish the Trac link worked, and I would prefer the participation of the original dev to forking it. -Steve Johnson -- http://mail.python.org/mailman/listinfo/python-list

Re: Abstract class

2008-09-14 Thread Stephen Horne
On Sun, 14 Sep 2008 18:03:23 +0200, Mr.SpOOn <[EMAIL PROTECTED]> wrote: >I have to manage many elements of music such as notes, intervals, >scales, chords and so on. All these elements share properties and >behavior, so what I want to do is an abstract class "Note" and other >subclasses, for examp

Re: explain slice assignment to newb

2008-09-20 Thread Stephen Horne
On Sat, 20 Sep 2008 14:20:20 -0700 (PDT), Andrew <[EMAIL PROTECTED]> wrote: >please explain this behavior to a newb: > a = [1,2,3,4] b = ["a","b","c","d"] a[0:2] = b[0:2] The slice [0:2] represent positions 0 <= x < 2 Replaces the [1, 2] from [1, 2, 3, 4] with ['a', 'b'] Result: a

Re: Memory visualization

2006-03-15 Thread Stephen Kellett
for flow tracing, memory analysis and thread deadlock monitoring. http://www.softwareverify.com Software Verification run with Python 2.2 upwards - no need to modify the python source or binary. Stephen -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.htm

Re: Do I Need This?

2006-04-08 Thread Stephen Prinster
Terry Reedy wrote: There > may be a page at python.com that explains more. > I think you meant python.org. -- http://mail.python.org/mailman/listinfo/python-list

Including standalone="no" in XML declaration

2006-04-14 Thread Stephen Briley
I'm trying to learn about Python and XML.  I would like to be able to add standalone="no" to my xml declaration when writing an xml file, but I am unable to figure out how.  So far, I have the following code: import xml.dom.minidom doc2 = xml.dom.minidom.Document() print doc2.toxml('iso-8859-1')

Re: Python PIL and Vista/Windows 7 .. show() not working ...

2009-11-30 Thread Stephen Hansen
On Mon, Nov 30, 2009 at 9:57 AM, Esmail wrote: > Hello all. > > I am using the PIL 1.1.6 and Python 2.6.x under XP without any > problems. However, I can't display any images under Vista > or Windows 7. I could understand Windows 7 as it's relatively > new, but Vista has been around for a bit. >

Re: Questions about list-creation

2009-11-30 Thread Stephen Hansen
On Mon, Nov 30, 2009 at 9:22 AM, Manuel Graune wrote: > in (most) python documentation the syntax "list()" > and "[]" is treated as being more or less the same > thing. For example "help([])" and "help(list())" point > to the same documentation. Since there are at least > two cases where this simi

Re: Beginner Q. interrogate html object OR file search?

2009-12-02 Thread Stephen Hansen
On Wed, Dec 2, 2009 at 7:24 PM, Mark G wrote: > Hi all, > > I am new to python and don't yet know the libraries well. What would > be the best way to approach this problem: I have a html file parsing > script - the file sits on my harddrive. I want to extract the date > modified from the meta-dat

Re: memory error

2009-12-03 Thread Stephen Hansen
On Thu, Dec 3, 2009 at 5:51 AM, Ahmed, Shakir wrote: > I am getting a memory error while executing a script. Any idea is highly > appreciated. > > Error message: " The instruction at "0x1b009032" referenced memory at > "0x0804:, The memory could not be "written" > > This error is appearing an

Re: memory error

2009-12-04 Thread Stephen Hansen
> > But-- the image does say Pythonwin... are you running this from the > Pythonwin editor/IDE? Does this script crash out if you run it through the > normal 'python'(or pythonw) commands? If not, are you attempting to do any > sort of GUI work in this script? That rarely works within Pythonwin > d

Re: Partial list comprehensions

2009-12-04 Thread Stephen Hansen
> > Is it possible to run a list comprehension over a certain portion of > the list? My goals is to be able to run the comprehension on the > innermost elements of the list, but leaving the outermost intact. > Without seeing an example of what your list is, and what you want to turn it into, its s

Re: Killing Another Bug

2009-12-04 Thread Stephen Hansen
On Fri, Dec 4, 2009 at 7:52 AM, Victor Subervi wrote: > except: > > except: > pass > If you want any hope of fixing the bug, remove both of these. Really -- do not use bare excepts. In the first one, it looks like you're expecting sometimes there to be an exception: that's okay.

Re: Partial list comprehensions

2009-12-04 Thread Stephen Hansen
On Fri, Dec 4, 2009 at 2:11 PM, Joel Davis wrote: > Yes, sort of like that but Hansen's code is actually exactly what I > was getting at, not sure why he deleted it: Huh? I deleted it? --S -- http://mail.python.org/mailman/listinfo/python-list

Re: Got a single octet from socket, what to do ?

2009-12-04 Thread Stephen Hansen
On Fri, Dec 4, 2009 at 6:39 PM, mudit tuli wrote: > I am very new to Python and started getting to know socket programming > recently. > Made a socket server, which receives a "Single Octet"(treated as a single > 8-bit integer field) from a client. > But I am not sure what to do with this "Single

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread Stephen Hansen
On Sat, Dec 5, 2009 at 6:20 PM, W. eWatson wrote: > I'm trying to do a very simple thing. I go to the Analysis folder, and try > to use Win XP Pro to delete the empty and unnamed file in it. One just does > a right-click on the empty file, and then uses Delete. It won't let me > delete it. If I b

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