Setting a Script's CPU Priority


In windows: explorer.exe would be a critical system task. (btw iexplorer is for internet explorer).
Posted On: Friday 28th of December 2012 05:25:03 AM Total Views:  159
View Complete with Replies

RELATED TOPICS OF Python Programming PROGRAMMING LANGUAGE




Noob questions about Python

I have recently (today) just started learning/playing with Python. So far I am excited and impressed (coming from PHP background). I have a few questions regarding Python behavior... val = 'string' li = list(val) print li.reverse() returns nothing, but, val = 'string' li = list(val) li.reverse() print li returns what I want. Why does Python do that Also I have been playing around with Binary math and noticed that Python treats: val = 00110 as the integer 72 instead of returning 00110, why does Python do that (and how can I get around it) Grateful for any replies!
VIEWS ON THIS POST

117

Posted on:

Monday 5th November 2012
View Replies!

Re: Puzzled by "is"

Dick Moores wrote: > >>> () is () > True > >>> (1,) is (1,) > False > > Why > >>> a = () >>> b = () >>> c = (1,) >>> d = (1,) >>> a is b True >>> c is d False >>> id(a) 3086553132 >>> id(b) 3086553132 >>> id(c) 3086411340 >>> id(d) 3086390892 There is only one empty tuple. Does that clear it up for you >
VIEWS ON THIS POST

24

Posted on:

Monday 5th November 2012
View Replies!

calling a .net application from Python 2.5

I am working with Python 2.5. I would like to know how to call a .NET application (or .dll) from a Python script. Can anyone help please Thank you.
VIEWS ON THIS POST

86

Posted on:

Monday 5th November 2012
View Replies!

looking for ways to include python in pascal distro

I have found a couple of ways to include python in my pascal program http://arctrix.com/nas/python/standalone.html and an example I compiled from the embeded examples and I was wanting to know if there are more examples or comiled versions I can execute from my program... I am getting an error from the embeded and the standalone would work better with command line support
VIEWS ON THIS POST

145

Posted on:

Monday 5th November 2012
View Replies!

Voluntary Abstract Base Classes

Hi list, Well, the short question is: what are they I've read Guido's python 3000 status report on http://www.artima.com/weblogs/viewpo...thread=208549 where he mentions ABC's but don't quite understand what the whole story is about. Anyone has good use cases Daniel
VIEWS ON THIS POST

14

Posted on:

Monday 5th November 2012
View Replies!

*args and **kwargs

Ok, this is probably definitely a newbie question, but I have looked all over the Python library reference material and tutorials which I can find online and I cannot find a clear definition of what these are and more importantly how to use them. From what I can tell from their use in the examples I've seen, they are for passing a variable number of arguments to a function (which I need to do in a program I am working on). But how do you use them Is there a fixed order in which the arguments within *arg or **kwarg should be passed or will be called within a function I realize this probably involves a long- winded answer to a very simple and common programming problem, so if someone has a link to TFM, I'll gladly go RTFM. I just can't find it.
VIEWS ON THIS POST

46

Posted on:

Monday 5th November 2012
View Replies!

cx_Oracle 4.3

What is cx_Oracle cx_Oracle is a Python extension module that allows access to Oracle and conforms to the Python database API 2.0 specifications with a few exceptions. Where do I get it http://starship.python.net/crew/atuining What's new 1) Added preliminary support for fetching Oracle objects (SQL types) as requested by Kristof Beyls (who kindly provided an initial patch). Additional work needs to be done to support binding and updating objects but the basic structure is now in place. 2) Added connection.maxBytesPerCharacter which indicates the maximum number of bytes each character can use; use this value to also determine the size of local buffers in order to handle discrepancies between the client character set and the server character set.
VIEWS ON THIS POST

18

Posted on:

Monday 5th November 2012
View Replies!

new Python-Ideas mailing list

At Guido's suggestion, a new mailing list has been created named Python-Ideas (http://mail.python.org/mailman/listinfo/python-ideas). This list is meant as a place for speculative, pie-in-the-sky language design ideas to be discussed and honed to the point of practically being a PEP before being presented to python-dev or python-3000. This allows both python-dev and python-3000 to focus more on implementation work or final approval/denial of ideas instead of being flooded with long threads where people discuss ideas that are too nebulous to be considered for inclusion into Python. Like python-dev and python-3000, Python-Ideas requires you subscribe before you can post, but there is no moderator approval required to subscribe. If you are interested in helping me out by being an administrator or moderator for the list, please let me know. -Brett
VIEWS ON THIS POST

94

Posted on:

Monday 5th November 2012
View Replies!

ANN: Webware 0.9.3 released

Webware 0.9.3 has been released. This release of Webware for Python includes a couple of fixes and improvements of WebKit and some cleanup of the overall Webware codebase. Please have a look at the WebKit release notes for details. Webware for Python is a suite of Python packages and tools for developing object-oriented, web-based applications. The suite uses well known design patterns and includes a fast Application Server, Servlets, Python Server Pages (PSP), Object-Relational Mapping, Task Scheduling, Session Management, and many other features. Webware is very modular and easily extended. Webware for Python is well proven and platform-independent. It is compatible with multiple web servers, database servers and operating systems. Check out the Webware for Python home page at http://www.w4py.org
VIEWS ON THIS POST

132

Posted on:

Monday 5th November 2012
View Replies!

matplotlib fill command on axes plot problem

I am trying to use the fill command to draw a box around an object in an image. I can get the box drawn, but there seems to be a side effect. The fill command is adding white lines to the top and sometimes right side of my axes plots. I am using small images, 124x200, and after the fill command the axes plot is changed to 140x200, with the top 16 lines being all white. I am running it in interactive mode from the python command line. Here is code that reproduces the problem. from pylab import * im_array = zeros((124,200)) ion() figure() imshow(im_array) hold(True) x=40 y=40 fill([x-5,x+5,x+5,x-5],[y+5,y+5,y-5,y-5],ec='r', fill = False) hold(False) Any thoughts on what I might be doing wrong
VIEWS ON THIS POST

157

Posted on:

Monday 5th November 2012
View Replies!

Re: Core dumped while interacting with OpenOffice.org via pyuno

Le Friday 05 September 2008 15:04:22 Marco Bizzarri, vous avez crit: > Hi all. > > I'm experiencing a core dump while working in the following environment > > - debain etch > - python2.3 > - openoffice.org 2.4 > - Zope 2.8.8 > > I was able to get a core dump, and the backtrace shows the following: > > Core was generated by `python2.3 tests/testActs.py'. > Program terminated with signal 11, Segmentation fault. > #0 0xb6b5219c in \t () from /usr/lib/openoffice/program/libuno_cppu.so.3 ... lot of backtrace ... > #9 0xb68c76c7 in \t () from /usr/lib/openoffice/program/libuno_sal.so.3 > #10 0x08797840 in \t () > #11 0x0989b6e0 in \t () > #12 0x00000000 in \t () > > Now, I can understand that the information I provided are not enough > to give me suggestions on solving this issue; so, I'm asking > suggesions on investigating the issue, namely: > > - should I ask here or is it better if I ask on a openoffice forum Yes. > - should I use a debug-enabled python in order to have more meaningful > backtraces What you need is more a debug enabled version of pyuno libraries. > - is there something else I should do in order to have more clues > ("Read The Fine Manual (tm)" is an acceptable answer) You can try to find which function call exactly provoke the exception, the simplest way is to trace execution flow with some print statments and using non forking zope instance (runzope -d if I remember well). -- _____________ Maric Michaud
VIEWS ON THIS POST

126

Posted on:

Wednesday 7th November 2012
View Replies!

RE: Why nested scope rules do not apply to inner Class?

> Defining it as a nested class saves you one line > of code, but IMHO makes the result just a bit more cluttered, while > reducing the elegance of reusing the metaclass. The whole point of nested class is to avoid polluting the namespace with classes that are only used locally. So the argument about the elegance of reusing is not very valid in that case. I agree that they are other ways using module to avoid namespace pollution,but in some case it is easier to use nested class instead and keep everything in the same file. In my case, I'm trying to use a similar approach as XIST's one, meaning using Python class to model hierarchical data. So clearly nested class is a very nice and easy understandable way to do that. > Here are only a few examples of threads giving good reasons against > class nesting. I've never seen any good arguments for it. There are > dozens of good reasons we don't encourage it and won't actively > support it. > > http://mail.python.org/pipermail/pyt...ch/052454.html > http://mail.python.org/pipermail/pyt...er/029872.html >From what I quickly read in these email threads, except for the pickling issue and the fact that Guido does not like nested classes, I do not see strong argument against it either.
VIEWS ON THIS POST

74

Posted on:

Wednesday 7th November 2012
View Replies!

A fix for OverflowError in 64bits platforms

Hi all, I'm debugging a Plone site in an AMD64 laptop. When I first tried to run Zope, I got this exception: OverflowError: signed integer is greater than maximum In the archives I encounter no solutions. This is what I could find, so I share with you all: It seems that on 64bit platforms, sys.maxint is much greater than list's insertion maximum index. I'm not sure if this a bug in python or a logical bound ---given the amount of RAM it would take to insert 9,223,372,036,854,775,807 items --- Maybe a bug in the documentation, though However, Archetypes.Schema.moveField method documents the use of maxint for inserting at the end of the Schema:: maxint can be used to move the field to the last position possible >>> from sys import maxint >>> spos = schema.copy() >>> spos.moveField('a', pos=maxint) >>> spos.keys() ['b', 'c', 'a'] I have seen this usage in some products. This raises and OverflowError on 64bit platforms. The fix is simple in the code of the caller:: from sys import maxint if maxint >> 33: # Am I running on 64bits maxint = maxint >> 33 theschema.moveField(the_name, pos=maxint) Now, the maxint variable holds an acceptable value. I think the docstring should be appended with a "Note: On 64bits platform this raises an OverflowError blah blah..." Best regards, Manuel.
VIEWS ON THIS POST

53

Posted on:

Wednesday 7th November 2012
View Replies!

RELEASED Python 2.6 final

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On behalf of the Python development team and the Python community, I am happy to announce the release of Python 2.6 final. This is the production-ready version of the latest in the Python 2 series. There are many new features and modules, improvements, bug fixes, and other changes in Python 2.6. Please see the "What's new" page for details http://docs.python.org/dev/whatsnew/2.6.html as well as PEP 361 http://www.python.org/dev/peps/pep-0361/ While Python 2.6 is backward compatible with earlier versions of Python, 2.6 has many tools and features that will help you migrate to Python 3. Wherever possible, Python 3.0 features have been added without affecting existing code. In other cases, the new features can be enabled through the use of __future__ imports and command line switches. Python 3.0 is currently in release candidate and will be available later this year. Both Python 2 and Python 3 will be supported for the foreseeable future. Source tarballs, Windows installers, and Mac disk images can be downloaded from the Python 2.6 page: http://www.python.org/download/releases/2.6/ (Please note that due to quirks in the earth's time zones, the Windows installers will be available shortly.) Bugs can be reported in the Python bug tracker: http://bugs.python.org Enjoy, - -Barry Barry Warsaw barry@python.org Python 2.6/3.0 Release Manager (on behalf of the entire python-dev team) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iQCVAwUBSOREJ3EjvBPtnXfVAQLAigP/aEnrdvAqk7wbNQLFbmBonIr2YQbd1vEu TyTr5imYXFWGNfv1/JMeMBjMfwpHi1bgPEDTLEZdhDRNj/G1h4NqqnpfJS0lfIaU 4JBKwnsO80se/RGyupcs5f09UdKxOljhbFKEw46CHDkd9lE+cqy2yhetEwyx3c3+ AVC11sjcO54= =Oxo3 -----END PGP SIGNATURE----- , On Thu, Oct 2, 2008 at 11:23 AM, wrote: > > nneonneo> Hmm, I was looking forward to trying this out, but the Windows > nneonneo> installer link > nneonneo> (http://www.python.org/ftp/python/2.6/python-2.6.msi) is > nneonneo> presently broken (as is the link for the 64-bit Windows > nneonneo> version). > > We are aware of it. Because of the timing of the release the person who > normally creates the Windows binaries was already asleep. They should be up > a bit later today. > Surely you're joking! Everybody knows that python developers never sleep :-) Congratulations for the final release! Francesco
VIEWS ON THIS POST

43

Posted on:

Wednesday 7th November 2012
View Replies!

Newbie needs help

Greetings all, I'm wanting to maintain what values in one file and call them in another. The purpose being to keep a single location where url's, login's and passwords can be maintained, then called as needed from another file. In file #1 I have... import time import os import sys url = 'http://zoo/' adminlogin = 'Zebra' adminpassword = 'Zebra12$' --------------------------------------------- In file #2 I have the following... from cPAMIE import PAMIE #Imports - used to setup / control finding files import time import os import sys import loginout #name of the file retaining all url/login info from log import log #Create New Pamie Object ie=PAMIE() ie=Visible =1 t=time adminlogin (ie,url) if ie.findText ('Site Status: Active'): log ('PASSED -- ADMIN Module - ADMIN Login & Admin Tab Navigation Successful') else: log ('WARNING -- ADMIN Module Login & Admin Tab Navigation FAILED') time.sleep(2) What am I doing incorrectly to not have file two log in when executed. files are in the same directory. Keep it simple... I'm new at this. THNX
VIEWS ON THIS POST

107

Posted on:

Wednesday 7th November 2012
View Replies!

Relative imports and "import X as Y"

I was looking at PEP 328. It says that relative imports with the dot syntax will only be allowed with the "from" import variety (e.g., "from ..somemodule import somename"). The reason given for this in the PEP is that after import xxx.yyy, "xxx.yyy" is usable in an expression, but the leading period syntax is inconsistent with this (you can't use ".somepackage.somemodule" in an expression). However, this reasoning doesn't apply to "import X as Y", as long as Y is an ordinary name. As a few recent posts here have touched on, there are actual differences between the "import X (as Y)" and "from X import name" varieties, most notably that the second form binds name in the importing namespace whereas the first does not. So, will relative imports in Python 3.0 allow things like "import ...relative.importing.path as prettyname" If not, why not -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown
VIEWS ON THIS POST

64

Posted on:

Wednesday 7th November 2012
View Replies!

Re: Help replacing os.system call with subprocess call

On 07/04/2008, David Harrison wrote: > On 07/04/2008, David Pratt wrote: > > Hi. I am trying to replace a system call with a subprocess call. I have > > tried subprocess.Popen and subprocess.call with but have not been > > successful. The command line would be: > > > > svnadmin dump /my/repository > svndump.db > > > > This is what I am using currently: > > > > os.system('svnadmin dump %s > %s' % (svn_dir, > > os.path.join(backup_dir, 'svndump.db'))) > > > > Many thanks. > > > > -- > > http://mail.python.org/mailman/listinfo/python-list > > > > > David, > > Your probably want something like the following (code untested and off > the cuff ;-) ) > > Cheers > Dave > > --- > > import subprocess > > p = subprocess.Popen( > [ "svnadmin", "dump" ], > stdin=subprocess.PIPE, > stdout=subprocess.PIPE, > stderr=subprocess.PIPE, > close_fds=True > ) > (child_stdout, child_stdin) = (p.stdout, p.stdin) > > f = open('svndump.db') > f.write(child_stdout.read()) > f.close() My inner pendant kicked in so I tested the code using [ 'ls', '-lha' ] and found that the file object should be f = open('svndump.db', 'w') instead :-)
VIEWS ON THIS POST

102

Posted on:

Wednesday 7th November 2012
View Replies!

ZSI receiving complex type problem

I have a ZSI client talking to a perl program through SOAP. The perl program has defined a return type of $esmith::recExtend, where esmith::recExtend is a complex type defined in the WSDL as follows: The perl method returns an esmith::recExtend object as follows: $record = esmith::recExtend->new('dbname, $dbkey, \@prop, \@value, $size); return SOAP:ata->name('get_recordReturn' => $record); The ZSI file is expecting an EsmithRecExtend object to be returned in get_recordReturn. However, executing the above code causes the following error: ZSI.EvaluationException: No Registered xsi:type= (http://namespaces.soaplite.com/perl, esmith__recExtend), subsititue for xsi:type=(http://localhost:esmith/SOAPWrapper, EsmithRecExtend) If I return SOAP:ata->name('get_recordReturn' => $record)- >type('http://localhost:/esmith/SOAPWrapper:EsmithRecExtend), then a TypeError: unpack non sequence exception is thrown. I believe that the TypeError: unpack non sequence is resulting because the ZSI attempts to seperate the type into (namespace, type) with the division between the two defined by the ' : ' character, which is found more than once in the given namespace. Does anyone have any ideas on how to resolve this issue What do I do to return the complex type and have the ZSI client understand it
VIEWS ON THIS POST

411

Posted on:

Wednesday 7th November 2012
View Replies!

Restart crashing modules in windows

I have a python module that keeps on crashing with various windows errors (not BSOD but the less lethal windows XP popup ones). Now these are intentional and rather sporadic so I cant really solve it by attempting to fix the crash; rather what Im trying to do is make another module outside it that restarts this module every time it crashes. Is this possible How do I do this Or does one windows crash in one python module crash python entirely and I have to resort in an external program to restart python everytime it crashes
VIEWS ON THIS POST

184

Posted on:

Wednesday 7th November 2012
View Replies!

Fwd: Python-list Digest, Vol 52, Issue 128

Fredrik Lundh wrote: > > Adrian Wood wrote: > > > > I can call man.state() and then woman.state() or Person.state(man) and > > Person.state(woman) to print the status of each. This takes time and > > space however, and becomes unmanageable if we start talking about a > > large number of objects, and unworkable if there is an unknown number. > > What I'm after is a way to call the status of every instance of Man, > > without knowing their exact names or number. > > > > I've gone through the relevant parts of the online docs, tried to find > > information elsewhere online, and looked for code samples, but the > > ionformation either isn't there, or just isn't clicking with me. I've > > tried tracking the names of each object in a list, and even creating > > each object within a list, but don't seem to be able to find the right > > syntax to make it all work. > > For a start, how about: > > class Person: > ... your class ... > > persons = [] > > man = Person() > persons.add(man) > > woman = Person() > persons.add(woman) > > for p in persons: > print p, p.state() It didn't like using .add for some reason, but once I swapped out all instances of that for .append that worked a treat! Thank you very much, I'll check out your other suggestions later once I feel comfortable with what I have so far.
VIEWS ON THIS POST

26

Posted on:

Wednesday 7th November 2012
View Replies!

System exit hanging in Leopard

, (I posted this once before, but haven't gotten a response. This is a pretty heavy traffic mailing list, so it's hardly surprising, but I'm going to bump the question in case anybody has seen or can replicate (or not replicate) this issue. Thx) I'm using Tkinter to create widgets in Python 2.5 on OS X 10.5. When I call root.quit or sys.exit in any way, the following traceback appears, after which the application stops responding and just gives the spinning rainbow cursor. The IDLE editor and the Python shell remain responsive, and I can kill the application from the command line, but not any other way. I don't see anything problematic in the traceback, but I don't think that the application should be hanging like this. Is this likely a Leopard-related issue
VIEWS ON THIS POST

45

Posted on:

Wednesday 7th November 2012
View Replies!

Re: open remote terminal

Fabian Braennstroem wrote: > Hi Steve, > > Steve Holden wrote: > >> Fabian Braennstroem wrote: >>> >>> >>> I would like to use python to start an terminal, e.g. xterm, and login >>> on a remote machine using rsh or ssh. This could be done using 'xterm -e >>> ssh machine', but after the login I would like to jump to a given >>> directory. Does anyone have an idea how to do this with python >>> >>>
VIEWS ON THIS POST

106

Posted on:

Wednesday 7th November 2012
View Replies!

localizing a sort

I've been working on sorting out some words. My locale is : >>> import locale >>> locale.getdefaultlocale() ('es_AR', 'cp1252') I do : >>> a = '\t\t\t\t\t\t\t' >>> print ''.join(sorted(a, cmp=lambda x,y: locale.strcoll(x,y))) aeiou\t\t\t\t\t\t\t This is not what I am expecting. I was expecting : a\te\ti\t.....etc. The reason is that if you want to order some words (say for a dictionary (paper dict, where you look up words)) this is what happens : >>> a = 'palbra de plabra de pblabra' >>> print ' '.join(sorted(a.split(), cmp=lambda x,y: locale.strcoll(x, y))) de de palbra pblabra plabra While any human being would expect : de de palbra plabra pblabra Does anybody know a way in which I could get the deed output TIA
VIEWS ON THIS POST

22

Posted on:

Wednesday 7th November 2012
View Replies!

twisted.web's xmlrpc with digest authencitation

I recently found a link[1] which demonstrates how to secure a xml-rpc service with basic HTTP-auth. But this get's send in clear-text over the net. There's also the HTTP-Digest auth mechanism which is apparently supported as well by twisted[2]. How do I secure an xml-rpc service using digest-auth then If this works, all my troubles are suddenly gon and I am sold for twisted [1]: http://aspn.activestate.com/ASPN/Coo.../Recipe/526625 [2]: http://twistedmatrix.com/trac/ticket/1475
VIEWS ON THIS POST

84

Posted on:

Wednesday 7th November 2012
View Replies!

Re: [Tutor] Take if offline

Since else is replying to the list, I'll (top) post this: No, not really. He had to give the rule once. Otherwise, he'd have to do it a hundred times a day, and monitor every single post to find out who he had to inform. He'd end up doing not much else with his life, and would flee to a monastery and give up coding forever. You wouldn't want that to happen, would you On 9/25/07, Michael Langford wrote: > I agree with Kent... > > -- > Michael Langford > Phone: 404-386-0495 > Consulting: http://www.TierOneDesign.com/ > Entertaining: > http://www.ThisIsYourCruiseDirectorSpeaking.com > > > On 9/25/07, Kent Johnson wrote: > > Hansen, Mike wrote: > > > Anytime someone posts in HTML, or posts without a subject, or > > > accidentally > > > hijacks a thread, or top-posts, or writes in caps, a couple of posters > > > pop up > > > and complain. Rather than posting to the entire list, I think it'd be > > > best if > > > you send your complaint directly to the "offending" user. I'd prefer to > > > read > > > about Python not read lessons in net/mail-list etiquette. > > > > Hmmm. So instead, whenever someone complains about netiquette on-list we > > should post on-list complaining about it I'm not sure that improves the > > situation any, especially if it sparks a discussion. Perhaps you should > > email your suggestion privately to the offending parties. :-) > > > > I definitely think this list is about how to be part of the Python > > community, as well as how to program in Python. Knowing how to > > participate in a mailing list is part of that. Maybe you could just skip > > those posts, there are not that many of them. > > > > Kent > > _______________________________________________ > > Tutor maillist - Tutor@python.org > > http://mail.python.org/mailman/listinfo/tutor > > > > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > > -- Please read: http://milocast.com/2007/07/31/this-i-believe/
VIEWS ON THIS POST

45

Posted on:

Wednesday 7th November 2012
View Replies!

python video editing libs

Does anyone know of any python or python-wrapped libs for video editing My requirements: - open video files in any of the popular containers (avi, mov, ogg, flv etc) and all the popular codecs (mpeg3, theora, mpeg2 etc) and audio codecs (raw, wav, mp3 etc) - get an abstract video clip object on opening such a file - query the clip object to determine stuff like length, framerate, size etc - iterate through all the frames, and get a frame object with each frame - with a frame object, be able to access individual pixels, add graphic images (eg, via PIL), export frame to graphics file (eg jpeg) - with video clip object, be able to change framerate, insert/remove frames etc, and render out with deed a-v codecs and container - good well-documented API, preferably some usage examples Does anything like this exist Cheers David
VIEWS ON THIS POST

71

Posted on:

Wednesday 7th November 2012
View Replies!

Samsung SyncMaster 940 NW Monitors

Samsung SyncMaster 940 NW Monitors inch, LCD, Colour monitor consumes 38 watts of power per hour, has digital user controls and a maximum resolution of 1280x1024 dpi. The screen is flat with anti-glare and anti-static coating. Its other features like MagicTune, MagicBright and MagicSpeed. It is a wide screen monitor with 5ms response time and a contrast ratio of 700:1. It is available in high glossy black colour. It has DVI-D input. To buy this Samsung SyncMaster 940 NW Monitors Please visit to http://www.naaptol.com/buy-online/WO...er_940_nw.html
VIEWS ON THIS POST

36

Posted on:

Saturday 10th November 2012
View Replies!

Re: Why is math.pi slightly wrong?

Dan Upton wrote: > On Thu, May 22, 2008 at 2:53 PM, Mensanator wrote: >> On May 22, 11:32 am, "Dutton, Sam" wrote: >>> I've noticed that the value of math.pi -- just entering it at the interactive ...
VIEWS ON THIS POST

33

Posted on:

Saturday 10th November 2012
View Replies!

Newbie question about import

Hi all. I'm trying to do something with python import but isn't working for me. Using python 2,5 I've a program structured like this: * a main module called (for example) "mommy" with an __init__.py and a file called "mommy.py" ...
VIEWS ON THIS POST

61

Posted on:

Saturday 10th November 2012
View Replies!

BayPIGgies: October 13, 7:30pm (IronPort)

The next meeting of BayPIGgies will be Thurs, October 13 at 7:30pm at IronPort. Tim Thompson will describe and demonstrate the interaction between Burning Man and Python using two applications, Radio Free Quasar and Ergo. BayPIGgies meetings alternate between IronPort ...
VIEWS ON THIS POST

13

Posted on:

Saturday 10th November 2012
View Replies!

ANN: retest 0.5

what is it ---------- A simple Server which enables tests of Python regular expressions (re module) in a webbrowser. Uses SimpleHTTPServer and AJAX. You need: Python, a modern webbrowser like Firefox, IE (from 5.5), Safari or Opera (from 8) which ...
VIEWS ON THIS POST

94

Posted on:

Saturday 10th November 2012
View Replies!

Recursively Backup Directories

I am writing a script that will backup specified folders from one hard drive to another (for example, backup source "C:\DATA", destination "D: \Backup"), and was thinking of using shutil. What I would like to do is recursively backup the ...
VIEWS ON THIS POST

40

Posted on:

Saturday 10th November 2012
View Replies!

Samba password hashes generator (sambapasswords.py)

Summary ------- sambapasswords.py is a native Python module for generating the NT MD4 and the LanMan password hashes, as used by Samba and various versions of Windows for storing encrypted passwords for the user and machine accounts. This code can ...
VIEWS ON THIS POST

66

Posted on:

Saturday 10th November 2012
View Replies!

Event handling and Late Binding

I have a component that i can only access through late binding. This is working fine , i can use all the exposed methods , but i can't register (/don't know how to ) event handlers for this component. ...
VIEWS ON THIS POST

60

Posted on:

Saturday 10th November 2012
View Replies!

Why is ::= used as assignment operator in doc statements?

Why is statments expressed with ::= as the assigning operator like: http://docs.python.org/ref/grammar.txt br...
VIEWS ON THIS POST

101

Posted on:

Sunday 11th November 2012
View Replies!

RE: Misuse of list comprehensions?

Ian Kelly wrote: > It sounds like the wasteful list creation is the biggest objection to > using a list comprehension. I'm curious what people think of this > alternative, which avoids populating the list by using a generator > ...
VIEWS ON THIS POST

71

Posted on:

Sunday 11th November 2012
View Replies!

tool to calculate color combination

I was just wondering if there is a tool/script in python that allows me to do color calculations; specifically, when I add them. Also I was thinking that for this to work other than a simple way, some form ...
VIEWS ON THIS POST

47

Posted on:

Sunday 11th November 2012
View Replies!

some questions about ejabberd,spark and psi

hi,every buddy I've now installed a jabber server,right it's ejabberd mentioned above and 2 jabber client,right again it's spark and psi and I can connect to jabber server by spark but failed by psi,saying 'certificate failed the authenticity test;Reason:certificate is ...
VIEWS ON THIS POST

112

Posted on:

Sunday 11th November 2012
View Replies!

doctest + sqlobject (TDD)

inspired by the article written by Tarek Ziade in the February 07 issue of the "Linux +" magazine I am experimenting with the doctest module. I have two files, "displeje_pokus.py" and "displeje_pokus.txt" (you can see the simplified contents of ...
VIEWS ON THIS POST

37

Posted on:

Monday 12th November 2012
View Replies!

Re: properties setting each other

Le Wednesday 03 September 2008 16:44:10 Maric Michaud, vous avez crit: > def _setsquare(self, v) : > # some extra logic here > ...
VIEWS ON THIS POST

62

Posted on:

Sunday 25th November 2012
View Replies!

format string to certain line width

! I'm trying to find a way to print out a long string (>400 characters no spaces, tabs or newlines) to a line width of 60 characters. So after every 60 characters a newline would start. Is it possible to ...
VIEWS ON THIS POST

52

Posted on:

Sunday 25th November 2012
View Replies!

pygame.mixer.load not working

import pygame pygame.mixer.music.load(example1.mp3) pygame.mixer.music.play(loops=1, start=0.0) Traceback (most recent call last): File "C:\Python25\myPrograms\pygameProgs\musicexp.py", line 3, in pygame.mixer.music.load(example1.mp3) NameError: name 'example1' is not defined example1 is in the same directory as the script...
VIEWS ON THIS POST

73

Posted on:

Sunday 25th November 2012
View Replies!

Toronto Area Python User's Group Meeting

Our regular PyGTA meeting will be occurring for those not at the PyCon sprints. We'll meet at the regular time (7pm) at the regular place (Linux Caffe, on the corner of Grace and Harbord). Topic: Using Core Image (GL-based Mac ...
VIEWS ON THIS POST

50

Posted on:

Sunday 25th November 2012
View Replies!

Bit twiddling floating point numbers

Hi Is there a simple way to twiddle the bits of a float In particular, I would like to round my float to the n most significant bits. For example - 0.123 in binary is 0.000111111 Rounding to 4 ...
VIEWS ON THIS POST

28

Posted on:

Sunday 25th November 2012
View Replies!

ikaaro 0.20.3 released

This is a Content Management System built on Python & itools, among other features ikaaro provides: - content and document management (index&search, metadata, etc.) - multilingual user interfaces and content - high level modules: wiki, forum, tracker, etc. This release ...
VIEWS ON THIS POST

90

Posted on:

Sunday 25th November 2012
View Replies!

Need help porting a C++ / Python Embedded app to multiple platforms

I am writing a Python / C++ embed app and it need to work on 3 platforms I have the PYTHONPATH variable set correctly and have gone back and downloaded compiled and installed the latest Python 2.5.1 on Solaris and ...
VIEWS ON THIS POST

52

Posted on:

Sunday 25th November 2012
View Replies!

Python-URL! - weekly Python news and links (Dec 31)

QOTW: "I find the best approach is to use multiple languages." - Roger Binns " generators can be re-written with classes using the iterator protocol." - Jean-Paul Calderone Mutable default arguments revisited: http://groups.google.com/group/comp....7b1a1f62c9d91/ itertools.dropwhile/takewhile might be deprecated: http://groups.google.com/group/comp....9a68c0047430a/ Getting n ...
VIEWS ON THIS POST

33

Posted on:

Monday 26th November 2012
View Replies!

[My First] Program

Okay, I started learning Python last weekend on Saturday with some tutorials and a book. With this being my first programming language my program won't amaze you The program I made is a calculator for working out how much turf a person would need given the length and the width of the area. It can add an extra 5% extra for 'Trimming & Wastage' and it suggests an amount after rounding up the total number. (Toggle Plain Text) print "*************************" print "Turf Calculator v1.0.0" print "*************************" import math turf = True while turf: print "\n-------------------------\n" length = input("Enter Length: ") print "\n-------------------------\n" width = input("Enter Width: ") print "\n-------------------------\n" first = length * width second = first / 9.0 total = second / 1.196 add = raw_input('Add 5% for Trimming and Wastage (Y/N): ') print "\n-------------------------\n" if add != 'y' and add != 'Y': print "Total: " + "%.2f" % total + " Rolls\n" print "Suggested Amount: " + `math.ceil(total)` print "\n-------------------------\n" elif add == 'y' or 'Y': final = total * 0.05 last = total + final print "Total: " + "%.2f" % last + " Rolls\n" print "Suggested Amount: " + `math.ceil(last)` + " Rolls" print "\n-------------------------\n" end = raw_input('Re-run Program (Y/N): ') if end != 'y' and end != 'Y': turf = False print "*************************" print "Turf Calculator v1.0.0" print "*************************" import math turf = True while turf: print "\n-------------------------\n" length = input("Enter Length: ") print "\n-------------------------\n" width = input("Enter Width: ") print "\n-------------------------\n" first = length * width second = first / 9.0 total = second / 1.196 add = raw_input('Add 5% for Trimming and Wastage (Y/N): ') print "\n-------------------------\n" if add != 'y' and add != 'Y': print "Total: " + "%.2f" % total + " Rolls\n" print "Suggested Amount: " + `math.ceil(total)` print "\n-------------------------\n" elif add == 'y' or 'Y': final = total * 0.05 last = total + final print "Total: " + "%.2f" % last + " Rolls\n" print "Suggested Amount: " + `math.ceil(last)` + " Rolls" print "\n-------------------------\n" end = raw_input('Re-run Program (Y/N): ') if end != 'y' and end != 'Y': turf = False
VIEWS ON THIS POST

35

Posted on:

Tuesday 27th November 2012
View Replies!

Python Internals

all, i just read that if you make a list of ints, python will allocate a QUADWORD per element in the list! I mean, i've got a gig of ram, but a quadword what the heck does it do with all that space Seems like most of it MUST go to waste. I'm not super concerned about memory effeciency in most of the stuff i'd write in python, but thats not just ineffecient, its downright wasteful. Anyone know why its designed this way Also, if anyone knows of any good documentation that describes the python internals (and maybe some of the logic behind them) i'd love to see it, i havent found much about hacking the internals in python.
VIEWS ON THIS POST

43

Posted on:

Friday 28th December 2012
View Replies!

Python __iter__ and next methods for user defined class / nested list

In Python... I have a nested list defined in a class as: (Toggle Plain Text) self.env = [[ None for i in range(columnCount)] for j in range(rowCount) ] self.env = [[ None for i in range(columnCount)] for j in range(rowCount) ]
VIEWS ON THIS POST

48

Posted on:

Friday 28th December 2012
View Replies!