Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Paul
indows terminal software, to talk to COM3, to keep the port artificially busy for the purposes of testing. If things were working well in your case, you *might* see something of this form. If not, you'd instead see the name of the process that has "stolen" the com port. virtualbox.exe pid: 1234 ComputerName\UserID E0: File (---) \Device\VCP0 HTH, Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Paul
Adam wrote: "Paul" wrote in message news:jseu9c$sp3$1...@dont-email.me... Adam wrote: "John Nagle" wrote in message news:jse604$1cq$1...@dont-email.me... On 6/26/2012 9:12 PM, Adam wrote: Host OS:Ubuntu 10.04 LTS Guest OS:Windows XP Pro SP3 I am able to

Re: PySerial could not open port COM4: [Error 5] Access is denied - please help

2012-06-27 Thread Paul
panel for the driver, that maps a virtual COM port, to a COM port number, like COM3 and COM4 in this case. Paul -- http://mail.python.org/mailman/listinfo/python-list

doctests/unittest problem with exception

2013-01-25 Thread Paul
Hello. I converted doctests into DocTestSuite() to use with unittest. And try it under Python 3. And, sure, I get errors with unmatched exceptions details (mismatched name of exception class: a.b.c.MyError instead of MyError). So, I have 2 questions: 1) how to turn on option IGNORE_EXCEPTION_DE

Re: Fonts & Tinker

2013-01-25 Thread Paul
class FontSpec: """Wrapper for something like 'Arial 10 bold #red' """ tkf = None # Tk Font spec = "" # specification tkspec = "" # specification for Tk family = None size = 0 color = "black" weight = "normal" slant = "roman" underline = 0 overstrike

Re: Parsing a graph image

2011-05-14 Thread Paul
have a nice day! :) > > Basti > >  signature.asc > < 1KViewDownload Hi, If you are trying to digitize data from the graph, you could try Dagra: http://www.BlueLeafSoftware.com/Products/Dagra/ There is a Python library for reading the files it produces. hth paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Python homework

2017-12-13 Thread paul
from random import randint rolls = [randint(1, 6) for x in range(50)] print("Average: %s" % (sum(rolls) / len(rolls))) print("Most Common: %s" % max(rolls, key=rolls.count)) -- https://mail.python.org/mailman/listinfo/python-list

random.choices() Suggest that the code confirm that cum_weights sequence is in ascending order

2018-05-13 Thread Paul
incorrect results (which could be hard to spot as being incorrect) is much more dangerous. Also, checking that the list is in ascending order need only be done once, and seems like it would be inexpensive. Thanks, Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 176, Issue 16

2018-05-14 Thread Paul
n 400 times. If verification was added, then the the code would do an O(n log n) operation 400 times, plus an O(n) operation done *one* time. So, I'm not sure that this would be a significant efficiency hit (except in rare cases). 2) Paul Moore wrote: > So the people who *really* need cum_weigh

Re: random.choices() Suggest that the code confirm that cum_weights sequence is in ascending order

2018-05-14 Thread Paul
forgot to edit the subject. Sorry. paul c. On Mon, May 14, 2018 at 12:02 PM, Paul wrote: > Hello all, >Thanks for the thoughtful (and non-snarky) replies. > > First, a suggestion for a documentation change: > > To this paragraph: > > *If neither weights nor c

Re: syntax oddities

2018-05-17 Thread Paul
Top posting saves a huge amount of useless scrolling time. Is it frowned upon on this list? On Thu, May 17, 2018, 7:26 AM Tobiah wrote: > Top posting is awesome for the reader plowing through > a thread in order. In that case the cruft at the bottom > is only for occasional reference. > > Ok,

Re: syntax oddities

2018-05-17 Thread Paul
wrote: > > Is it frowned > > upon on this list? > > Trimming your replies saves even more. Yes, it is. > > ChrisA > - > kk. Thanks Paul > > -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax oddities

2018-05-17 Thread Paul
e insisted on, bottom posting. If someone's late to a thread they can read from it the bottom up. But, for everyone who has been keeping up, not having to scroll is a big advantage. I'm not suggesting that the convention on this list be changed, but it's by no means the only opti

Re: best way to remove leading zeros from a tuple like string

2018-05-20 Thread Paul
> > > This works for me: mytuplestring.replace("0","") > > Your regex will also eliminate non-leading zeros. -- https://mail.python.org/mailman/listinfo/python-list

Re: best way to remove leading zeros from a tuple like string

2018-05-20 Thread Paul
On Sun, May 20, 2018, 5:53 PM Paul wrote: > This works for me: mytuplestring.replace("0","") > >> >>> Your regex will also eliminate non-leading zeros. >> >> > If you Google > > regex tester > > you will find several useful sit

Re: best way to remove leading zeros from a tuple like string

2018-05-22 Thread Paul
Thomas Jollans wrote: > On 2018-05-20 23:54, Paul wrote: > > you will find several useful sites where you can test regexes. > > What's the benefit of those compared to simply trying out the regex in a > Python console? > Possibly nothing. But there are obvious bene

Re: List replication operator

2018-05-24 Thread Paul
How would one make a multi-dimensional list now, with truly-separate sub lists? Is there just no way to do it with the replication operator? IE, would I just have to do X = [[], [], [], [], []] or perhaps write a function to insert new sub lists into a list, or...? Thanks > Pau

Re: List replication operator

2018-05-24 Thread Paul
how often would people here have needed this new operator, if it had existed? -- https://mail.python.org/mailman/listinfo/python-list

how to read a syntax diagram

2018-05-27 Thread Paul
ge' specifications is required. I.E., I can specify 'range' outside body, or 'range' as part of body, or both, but I must have 'range' someplace. This is a bit confusing to me ( as opposed to my usual understanding of "required"). Also, w

Re: how to read a syntax diagram

2018-05-27 Thread Paul
oops, please ignore the bit before "update(spreadsheetId=*, range=*, ..." On Sun, May 27, 2018 at 9:17 PM, Paul wrote: > hi, >I'm using the Google Sheets API (the client library rather than the > RESTful interface) and I'm confused about the meaning of the syn

Re: Pink Floyd: is there anybody in here?

2018-05-30 Thread Paul
I see it on the mailing list. Paul C On Wed, May 30, 2018, 10:07 AM Rob Gaddi wrote: > On 05/30/2018 09:34 AM, Paul Rubin wrote: > > I think Usenet posts are no longer getting forwarded to the mailing > > list, but now I wonder if this is getting out at all, even to usenet. >

Re: Sorting and spaces.

2018-05-31 Thread Paul
In the US, at least, spaces should sort before letters. MRAB brought up an important point. It depends on your purpose, of course, but having all the capitalized-beginning items appear separately from all of the lower-cased-beginning items can be very annoying to a user. -- https://mail.python.or

Attachments? Re: Indented multi-line strings (was: "Data blocks" syntax specification draft)

2018-05-31 Thread Paul
guess? E.G., what if I attach a malicious file labeled as .asc? [Peter, I am not suggesting anything about you! ;). ] Paul C. -- https://mail.python.org/mailman/listinfo/python-list

Re: Attachments? Re: Indented multi-line strings (was: "Data blocks" syntax specification draft)

2018-05-31 Thread Paul
ps://github.com/Abdur-rahmaanJ > > On Fri, 1 Jun 2018, 01:49 Paul, wrote: > >> I have heard that attachments to messages are not allowed on this list, >> which makes sense. However I notice that messages from Peter do have an >> attachment, i.e., a signature.asc fi

Re: Jargons of Info Tech industry

2005-10-09 Thread paul
er away from the tenuous connection it has with Python, related discussions on type safety, private/protected/public, using Python in Mozilla, and the disappearance of the Bastion module notwithstanding. Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-23 Thread paul
http://wiki.python.org/moin/SummerOfCode And I hope that the latter project is reviewing some of the other work, if only to avoid the "framework proliferation" that people keep complaining about. Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Chronological Processing of Files

2005-09-21 Thread Paul
untested, ugly, but something like this would sort all the files in the directory on os.path.getctime (not using os.walk() though). I'm sure there is probably better ways to do it :) filelist = [] def walkdir(currdir): for files in os.listdir(currdir): path = os.path.join(currdir, fil

Re: Calling python scripts from C# programs

2005-09-22 Thread Paul
Another option is to implement the needed python code in COM server and call that from C#. A simple example of python COM server can be seen about halfway down the page here http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html -- http://mail.python.org/mailman/listinfo/python-list

Daemon module

2005-02-07 Thread paul
or my purposes. It would be great if people can use this as a starting point to develop further features. I'd also be very interested in feedback about whether the code does the right sequence of calls to start a daemon. Best wishes, Paul -- http://mail.python.org/mailman/listinfo/python-list

Sorting in huge files

2004-12-07 Thread Paul
mments? How long should I hope this sort will take? It will sound weird, but I actually have 12 different key maps and I want to sort this with respect to each map, so I will have to sort 12 times. Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting in huge files

2004-12-07 Thread Paul
I really do need to sort. It is complicated and I haven't said why, but it will help in finding similar keys later on. Sorry I can't be more precise, this has to do with my research. Your two other suggestions with itertools and operator are more useful, but I was mostly wondering about performanc

Re: Sorting in huge files

2004-12-07 Thread Paul
I really do need to sort. It is complicated and I haven't said why, but it will help in finding similar keys later on. Sorry I can't be more precise, this has to do with my research. Your two other suggestions with itertools and operator are more useful, but I was mostly wondering about performanc

Re: Sorting in huge files

2004-12-09 Thread Paul
The reason I am not telling you much about the data is not because I am afraid anyone would steal my ideas, or because I have a non-disclosure agreement or that I don't want to end up pumping gas. It is just that it is pretty freaking damn hard to even explain what is going on. Probably a bit harde

Re: Sorting in huge files

2004-12-09 Thread Paul
Thanks! I definitely didn't want to go into any elaborate programming for this, and the Unix sort is perfect for this. It sorted a tenth of my data in about 8 min, which is entirely satisfactory to me (assuming it will take ~ 20 times more to do the whole thing). Your answer greatly helped!

isbntools. (python script to download book informaiton)

2005-04-13 Thread paul
Hello, I am trying to make up a catalogue of my books. I found tools on isbntools.com in python. YAY i thought. Something happens! But I cant seem to get the part to download the books information from amazon.com working correctly. It connects, but I think the regular expressions used in the co

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread Paul
should cough out the same info, as you entered in the first place. That was one of my test cases, when porting the code maybe 30 years ago. (And no, I didn't keep a copy of the code. We didn't do stuff like that back then. I didn't even have a computer at home back then.) Paul -- https://mail.python.org/mailman/listinfo/python-list

Thread handling issue

2011-10-07 Thread Paul
I'm wondering what the best solution for this problem is. I've got a wxpython app, in one part a user makes some selections then opens a dialog to select where to output. At which point the app starts a thread processing their selection while they're choosing an output location, hopefully ready

Re: Thread handling issue

2011-10-07 Thread Paul
Tim Golden timgolden.me.uk> writes: > > On 07/10/2011 09:29, Paul wrote: > > I'm wondering what the best solution for this problem is. > > > > I've got a wxpython app, in one part a user makes some selections then > > opens a > > dialog to sele

Re: Thread handling issue

2011-10-08 Thread Paul
Basically there can be quite a big job to do based on the user selection and I've pipelined it so after the user selects the output location the next job can get started so long as the first job (preparing the data) has been running for 5 or so seconds roughly. Its just a lot nicer to have this

Re: Thread handling issue

2011-10-08 Thread Paul
Tim Golden timgolden.me.uk> writes: > > On 07/10/2011 11:15, Paul wrote: > > My first thought was to use a flag but wouldn't the new thread see the cancel > > flag and stop as well? I could set it back but then any other threads might have > > been busy and n

Re: Convert StringIO to string

2006-10-16 Thread paul
r.write('new rss_ticker(%s, %s, %s)\n' % (rsspath, titleintro, tickeropt)) scripter.write('\n') return scripter.getvalue() I'm still curious what all this StringIO stuff is for ;) cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: wx.grid question (trying to use code from Grid_Example.py)

2006-10-16 Thread paul
l name 'self' is not defined > Script terminated. This has nothing to do with wx, you just don't use "self" if you're _calling_ a method. So: def create_grid(): win = Grid_MegaExample.MegaTable(data, colnames, pugins) win.Show(True) should get you to the ne

Re: correct parameter usage for "select * where id in ..."

2006-10-28 Thread paul
','.join("?"*len(vals))+")" >>> print sql 'select * from table where value in (?,?,?,?,?)' cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Draw rectangle on a Window DC

2007-01-04 Thread paul
ition allows this, you better do so or you'll get fired. Use chalk so you can wipe it off the case if your boss changes his/her mind. Disclaimer: I haven't tested this and the DC might get unstable or crash... scnr Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-26 Thread paul
block ?-) > The error will remain unnoticed and the argument might survive another few function calls but eventually fails deep down somewhere with: TypeError: cannot concatenate 'str' and 'list' objects then you have to examine the traceback and hope the real error

Re: Problems Drawing Over Network

2007-05-05 Thread paul
Andrew schrieb: > Hello Everyone [snipped stuff] Sorry not being helpful, but I suggest you post a minimal sample of your code demonstrating your program. cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools.groupby

2007-05-27 Thread paul
rg/pipermail/python-ideas/2007-May/000807.html > > In the thread, I don't really make a proposal, so much > as a problem statement, but my radical idea is that > lists of dictionaries fit the relational model > perfectly, so why not allow some kind of native SQL >

Re: Why PHP is so much more popular for web-development

2007-07-26 Thread paul
27;d need e.g. mod_proxy + CherryPy on a high port as a long running process. That's just not possible in most shared hosting envs, plus you'd have to monitor cherrypy and whatnot. Don't get me wrong, I'm not defending PHP but from a deployment POV python is definitely more complex. cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast socket write

2007-08-22 Thread paul
Greg Copeland schrieb: > On Aug 21, 9:40 pm, Bikal KC <[EMAIL PROTECTED]> wrote: >> Greg Copeland wrote: >>> I'm having a brain cramp right now. I can't see to recall the name of >> Is your cramp gone now ? :P > > > I wish. If anyone can remember the name of this module I'd realy > appreciate i

pySerial in a daemon process

2007-08-26 Thread paul
euid() to my uid, it fails. What do I need to do to get this to work? Many thanks, Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: pySerial in a daemon process

2007-08-26 Thread paul
On Aug 26, 5:20 pm, Bjoern Schliessmann wrote: > paul wrote: > > If I put these back in and try to run the daemon, the script fails > > when I try to connect to the serial port, with this error: > > serial.serialutil.SerialException: Could not open port: [Errno 13] > &g

Re: SQLite3 trapping OperationalError

2007-03-10 Thread paul
is a mysqlism > > I've tried >cursor.execute("select * from debtor where key > is not null ") FROM sqlite_master SELECT name WHERE type='table'; cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Mastering Python

2007-03-16 Thread paul
Paul McGuire schrieb: > What does Python have that C++ doesn't? > - The biggie: dynamic typing (sometimes called "duck typing"). > Dynamic typing is a huge simplifier for development: > . no variable declarations > . no method type signatures > . no inte

Re: Delete a function

2007-03-21 Thread paul
(compactLogin) you haven't imported compactLogin but dvlogin from the compactLogin namespace. Try: import compactLogin ...do something with compactLogin.dvlogin... reload(compactLogin) cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: I18n issue with optik

2007-04-02 Thread paul
s.stdout > (or why can I set it without any error but nothing changes?) AFAIK you can't. If the terminal is limited to ascii it won't be able to display anything else; it might not even have the right font, so how are you supposed to fix that? The .encode(encoding, "replace"

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-15 Thread paul
;> ls = [1,2,3].reverse() >>>> ls >>>> >>>> print [1,2,3].reverse() > None > I mean, why ls is empty after assignment? That's what "in-place" means, [].reverse() changes the list in-place and does not return the list to the caller. cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: how to creating html files with python

2007-10-27 Thread paul
asier: If you like XML, use genshi. If you plan to generate something else than HTML, use cheetah. Use google or whatever search engine you prefer to find those packages. cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: asyncore DoS vulnerability

2007-02-02 Thread paul
Jean-Paul Calderone schrieb: > It could ask the application. On the other hand, maybe asyncore remains in > a perfectly consistent state even after it raises this exception, and it is > already "asking" by letting this exception propagate up: if the application > is free t

Re: when will python 2.5 take in mainstream?

2007-02-04 Thread paul
pts can't work on that. What do you mean by "that"? I just use the 2.5 icons with 2.4 and all my scripts are happy ;) thanks Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: I need a crack for pyext1.2.5 plugin

2007-02-18 Thread paul
ware developers should pay their bills and further ignore some of his drivel. > I have version 1.2.5. > I use Eclipse 'cos it's simply great!! > If somebody could tell me some alternative... The author of pydev-extension provides pydev FOR FREE!! If you want pydev-extensio

Re: Python good for data mining?

2007-11-04 Thread paul
ds are calling external programs (slow) or using some IPC method (socket, xmlrpc, corba). > > I really like Python for a number of reasons, and would like to avoid > Java. Have you looked at jython? cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: How to display unicode with the CGI module?

2007-11-25 Thread paul
thinking of "unicode objects" and "strings" as seperate types (which they are). So there is no such thing like "unicode string" and you always need to think about when to encode() your unicode objects. However, this will change in py3k..., what's the new rule of thumb? cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: How to display unicode with the CGI module?

2007-11-26 Thread paul
greg schrieb: > paul wrote: >> However, this will change in py3k..., >> what's the new rule of thumb? [snipp] > So you won't be able to get away with ignoring encoding > issues in py3k. On the plus side, it should all be handled > in a much more consistent

Re: An Object's Type

2007-12-06 Thread paul
e you can tell the caller right away she's doing something wrong. greetings Paul BTW: are type annotations to be backported to 2.x? -- http://mail.python.org/mailman/listinfo/python-list

Re: An Object's Type

2007-12-07 Thread paul
Chris Mellon schrieb: > On Dec 6, 2007 5:52 AM, paul <[EMAIL PROTECTED]> wrote: >> function or method. I hope type annotations in py3k will allow for >> something like constraints in C# where you can tell the caller right >> away she's doing something wrong. &g

Re: Terminate capability ....

2007-12-16 Thread paul
l /IM explorer.exe') cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: XML-XSD Processing/Creation.

2008-01-02 Thread paul
s? This might be worth looking at: http://www.rexx.com/~dkuhlman/#generateDS cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: SuPy - Script Sketchup with Python

2009-02-06 Thread paul
version and is highly experimental. Let me know if it works for you and whether you have any problems. cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: AJAX Post requests

2009-02-10 Thread Paul
On Feb 10, 7:37 am, Tim Roberts wrote: > PJ wrote: > > >I have a simple web server using  BaseHTTPServer, and the def do_POST > >(self) function works fine for regular forms that are submitted to it, > >but when I send anAJAXPOST to it it does nothing (I've tried to just > >get it to print to che

BaseHttpServer

2009-02-15 Thread Paul
the local connection) - does anyone have any hints/tips for speeding it up? Thanks, Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: BaseHttpServer

2009-02-15 Thread Paul
On Feb 15, 8:46 pm, Steve Holden wrote: > Paul wrote: > > Hi, > > I currently have a webserver using BaseHttpServe that serves images > > like this: > > if self.path.endswith(".jpg"): > >                 print(curdir + sep + self.path) > >    

Re: Split entries from LDAP

2008-10-12 Thread paul
print "\tValue(s): %s" ", ".join(value) print the ", ".join(value) creates a string from a list, check the docs for dictionaries for other syntax elements. cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Append a new value to dict

2008-10-13 Thread paul
e.setdefault( k, [] ).append( v ) In Perl, the code looks like this: $h{ $key } = $value ; Whats wrong with: mytable[key] = value cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Are there any FOSS Python Single-Sign-on Servers?

2008-11-11 Thread paul
Phillip B Oldham schrieb: Are there any FOSS Python Single-Sign-on Servers? [snip] I've searched around but can only seem to find OpenID servers, which will probably be too "open" for our needs. So if it is not OpenID, which protocol are you going to implement? cheers

Re: duck-type-checking?

2008-11-13 Thread paul
tly-not-sortable-list-type diskussion and the endless repetition of the greatest of all after-the-fact theories ever "duck typing". cheers Paul BTW: Back to Java? No, not really. -- http://mail.python.org/mailman/listinfo/python-list

yaml for persistence

2009-03-03 Thread Paul
class User(object): def __init__(self, uid): self.uid = uid self.__dict__.update(yaml.load(str('uid')+'.yaml')) def save(self): f=open(str(self.uid)+'.yaml') yaml.dump(self.__dict__, f) is there a better way to persist usin

Re: A design problem I met again and again.

2009-04-03 Thread paul
} def start(type, id): func = start_methods.get(type, None) if func: func(id) else: raise ... Or maybe look at trac's (http://trac.edgewall.com) use of Components and Interfaces. Very lightweight and modular. You can start reading here: http://trac.edgewall.org/browser/trunk/tr

Re: Computed attribute names

2009-04-08 Thread paul
.compile([^anothercharset] self.type = "IBM029" errs = self.(self.type).findall(aCardImage) same here, or use a class/module-level dict like symbol_table = { 'IBM029': re.compile([^...]), 'IBM026': re.compile([^...]) } and symbol_table[self.type].findall(someth

__import__ function broken in 2.6

2009-04-25 Thread Paul
ork. Perhaps I am just not able to understand exactly what is going on here. Can anyone offer some assistance? Thank you, Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: __import__ function broken in 2.6

2009-04-25 Thread Paul
We found a quick workaround to make import work with paths. We just append the folder we want to the system's path: sys.path.append( moduleFolder ) If anyone has a better solution, that would be great. Until then, this is ugly, but it works. -- http://mail.python.org/mailman/listi

Re: eval(WsgiApplication)

2009-05-02 Thread paul
gert schrieb: I would like to read the following from a text file Hi gert, I'm puzzled, what is wrong with using wsgi as advertised? Just import your code and insert it in the wsgi chain no? cheers Paul from json import loads from gert.db import Db def application(environ, res

Re: Any way to loop through object variables?

2008-05-29 Thread paul
Dave Challis schrieb: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ah thanks, vars(...) was exactly what I was after. I'd come across dir() before, but this returns more than I need. It seems vars() misses class attributes tho... cheers Paul -- http://mail.python.org/mailman/lis

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-05-29 Thread paul
Have you shown this stuff to the google AppEngine folks! Thats being touted as the thing that'll make web-2 easy but you have to write code (Python) which will turn off 99% of possible users. What made Hypercard really great (and Supercard on DOS, and the new clones like Revolution) is that it w

Re: Dynamically naming objects.

2008-06-06 Thread Paul
Something like this? class User: def __init__(self, name): self.name = name def __str__(self): return self.name n = 10 users = [] for i in range(n): users.append(User('user%d' % i)) print users[9] print users[4] Cheers, Pau

Re: Python XML-RPC Server with clientside Javascript

2008-07-05 Thread paul
e you're running in the "same origin" javascript security restriction enforced by the browser. That is, the origin of your javascript is file://... and you're trying to access http://localhost:8765. This is not allowed. hth Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: FOSS projects exhibiting clean/good OOP?

2008-07-15 Thread paul
also a good example how code benefits from interfaces wrt. structuring and documentation. cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with displaying images in CherryPy

2008-07-19 Thread paul
seem covered in any documentation that i could find. Whats wrong with this page? http://www.cherrypy.org/wiki/StaticContent cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Strong/weak typing

2008-08-01 Thread paul
or am I missing something Pythonic? I'd say so. In a function/method body I do reuse generic names like data,counter,etc. but I never change say an instance variable to another type (except from None). Principle of least surprise applies here. cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a python code periodically

2008-04-08 Thread paul
rg/simple/Recur/ cheers Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a python code periodically

2008-04-10 Thread paul
Larry Bates schrieb: > paul wrote: >> Maryam Saeedi schrieb: >>> Hi, >>> >>> I was wondering if you know how can I run a python code once every five >>> minutes for a period of time either using python or some other program >>> like >

Re: is file open in system ? - other than lsof

2008-04-19 Thread paul
an do this with inotify. It's an event based notification mechanism for linux kernel 2.6.13 and up. It has python bindings available (google for pyinotify). You will receive events like IN_OPEN,IN_CLOSE,etc. and keep track of opened files this way. hth Paul -- http://mail.python.org/mai

confusing thread behavior

2009-12-03 Thread paul
I have been experiencing strange thread behavior when I pass a message received via a Queue to a wx.PostEvent method (from wxPython). The relevant code in the thread is: def run(self): while self.is_running: task = self.queue.get() wx.PostEvent(self.app.handle_task, task) sel

Re: confusing thread behavior

2009-12-03 Thread paul
On Dec 3, 2:03 pm, Mike Driscoll wrote: > On Dec 3, 3:42 pm, paul wrote: > > > > > > > I have been experiencing strange thread behavior when I pass a message > > received via a Queue to a wx.PostEvent method (from wxPython). The > > relevant code

Re: how can i use lxml with win32com?

2009-10-25 Thread paul
been renamed to getPageText(). Try: text = PAMIE('http://www.cnn.com').getPageText() cheers Paul and following is orginal source until i was found in internet. from BeautifulSoup import BeautifulSoup from PAM30 import PAMIE url = 'http://www.cnn.com' ie = PAMIE(url) bs = B

Re: how can i use lxml with win32com?

2009-10-25 Thread paul
elca schrieb: Hi, thanks a lot. studying alone is tough thing :) how can i improve my skill... 1. Stop top-posting. 2. Read documentation 3. Use the interactive prompt cheers Paul paul kölle wrote: elca schrieb: Hello, Hi, following is script source which can beautifulsoup and

Problems embedding python 2.6 in C++

2010-02-01 Thread Paul
ue after each function call. The module import is created at C++ object constructor and then Py_DECREF'd in the desctuctor Anyone else had issues of this kind? My next try will be to use sub-interpreters per thread. Thanks, Paul. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems embedding python 2.6 in C++

2010-02-01 Thread Paul
nd what is going on a bit more. Can anyone shed any further light? Regards, Paul. On Tue, Feb 2, 2010 at 11:59 AM, Gabriel Genellina wrote: > En Mon, 01 Feb 2010 18:21:56 -0300, Paul escribió: > > > I'm extending some old Visual Studio 6 code to add embedded python >> sc

Embedding Python in a C extension

2010-06-02 Thread Paul
I have a problem with embedding Python into a C extension in Windows Vista. I have implemented a timer routine in C as an extension, which I can import into Python 2.6.5 and run. Each timer interval, the extension calls a C CALLBACK function. I want to be able to have this CALLBACK function call a

[Fwd: Re: [ANN] Pyjamas 0.5 Web Widget Set and python-to-javascript Compiler released]

2010-06-10 Thread Paul
The python-announce-list-ow...@python.org suggested you might have a solution to my problem. Please help if you can. Thanks, Paul Original Message Subject: Re: [ANN] Pyjamas 0.5 Web Widget Set and python-to-javascript Compiler released Date: Thu, 10 Jun 2010 17:43:48

Python/C++ timer intermittent bug

2010-06-30 Thread Paul
I have a problem with threading using the Python/C API. I have an extension that implements a timer, and the C++ timer callback function calls a Python function. The relevant code looks like this: static PyObject *timer_setmodname( PyObject *pSelf, PyObject *pArgs ) { char *b; PyA

  1   2   3   4   5   6   7   8   9   10   >