Re: python coding contest

2006-01-01 Thread Claudio Grondi
Michael Spencer wrote: > Claudio Grondi wrote: > >> ...I analysed the outcome of it and have >> come to the conclusion, that there were two major factors which >> contributed to squeezing of code: >> >>(1). usage of available variants for coding of the same thing >>(2). sqeezing the size

Re: reading files into dicts

2006-01-01 Thread Alex Martelli
rbt <[EMAIL PROTECTED]> wrote: ... > Thanks to everyone for the tips on eval and repr. I went with the > cPickle suggestion... this is awesome! It was the easiest and quickest > solution performance-wise. Just makes me think, "Wow... how the heck > does pickle do that?!" pickle.py implements

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-01 Thread Alex Martelli
Ilias Lazaridis <[EMAIL PROTECTED]> wrote: ... > >>only hire people with long backstabbing histories. > > > > Such as...? Guido van Rossum? Greg Stein? Vint Cerf? Ben Goodger? ... > The employees you've mentioned should have most possibly the basic > google employment requirement: BS or

Re: Python or Java or maybe PHP?

2006-01-01 Thread Alex Martelli
NOKs <[EMAIL PROTECTED]> wrote: > Thanks! That's really useful. I'm not sure if I'm a "dynamically typed" > guy - coming form C#, very strict language, and C++, statically typed, C#'s pretty close to Java, typing-wise, and C++'s not that far away. I did mention one GOOD statically typed language

How can Python write BBcode modules?

2006-01-01 Thread 如履薄冰
BBcode reference: http://www.phpbb.com/phpBB/faq.php?mode=bbcode I want write a BBcode module in Python, but I'v not idea for this. Who can tell me about this arithmetic? ( I'm so sorry for my poor englist) -- http://mail.python.org/mailman/listinfo/python-list

Re: Rss/xml namespaces sgmllib, sax, minidom

2006-01-01 Thread uche . ogbuji
Sakcee wrote: > I want to build a simple validator for rss2 feeds, that checks basic > structure and reports channels , items , and their attributes etc. > > I have been reading Mark Pilgrims articles on xml.com, diveintopython > and someother stuff on sgmllib, sax.handlers and content handlers, >

Re: Amara (XML) problem on Solaris

2006-01-01 Thread uche . ogbuji
Doru-Catalin Togea wrote: > import amara > > doc = amara.create_document() > doc.xml_append(doc.xml_create_element(u"units")) > > print "OK" > > On Windows XP Pro it runs like this: > > C:\owera\test\xaps2-test>python amara-test1.py > OK > > C:\owera\test\xaps2-test> > > On Solaris it runs like thi

Re: scrape url out of brackets?

2006-01-01 Thread [EMAIL PROTECTED]
so here is the syntax folks!!! for anchor in soup.fetch('a', {'target': '_blank'}): print anchor['href'] [EMAIL PROTECTED] wrote: > so you recommend using some sort of for statement with the html parser > where i tell it to only parse stuff found in the tag for instance? > > Ravi Teja

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-01 Thread Ilias Lazaridis
Alex Martelli wrote: > Anton Vredegoor <[EMAIL PROTECTED]> wrote: >... > >>Google's not a nice company (yeah, I know I'm posting from a google >>account). If you look at their job requirements it's clear they will >>only hire people with long backstabbing histories. > > Such as...? Guido van

Re: Getting terse tracebacks?

2006-01-01 Thread skip
Roy> Is there any way to make the traceback printer built into the Roy> interpreter elide all the directories in pathnames (like Roy> strip_dirs() does for the profiler)? There's a compact traceback printer in asyncore (compact_traceback). I used it as the basis for a compact stack p

Re: Python or Java or maybe PHP?

2006-01-01 Thread NOKs
Thanks! That's really useful. I'm not sure if I'm a "dynamically typed" guy - coming form C#, very strict language, and C++, statically typed, but i definetly searched and see the debate going strong. Not try to start it here, but do you think that statically typed - namely, if I undertood correctl

Re: Xah's Edu Corner: Examples of Quality Technical Writing

2006-01-01 Thread alex . gman
http://en.wikipedia.org/wiki/Image:Dattebayo.jpg -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHONDOCS

2006-01-01 Thread J. D. Leach
Mike Meyer wrote: > Chris Smith <[EMAIL PROTECTED]> writes: >>> "J" == J D Leach <[EMAIL PROTECTED]> writes: >> I'm stupider; I can't ATFQ for you. >> But last night I stayed at a Holiday Inn Express, and can recommend >> >> http://projects.edgewall.com/python-sidebar/ >> >> Which, assuming

Re: New Python.org website ?

2006-01-01 Thread Aahz
In article <[EMAIL PROTECTED]>, Bugs <[EMAIL PROTECTED]> wrote: > >I thought I read here that a new website design was in the works for >python.org in time for the new year? Is that still true and of so, >anyone know what is it's status? Dunno about "in time for the new year", but there is a n

Re: Problem overriding sys.excepthook

2006-01-01 Thread Patrick Maupin
Lunchtimemama wrote: > Forgive my ignorance, but I'm not quite sure what you mean. I tried > importing the traceback module at the beginning of the script, but that > didn't make a difference. Could you provide example code to illustrate > your comment? Thanks. Assume your main module has your ex

Re: how to scrape url out of href

2006-01-01 Thread [EMAIL PROTECTED]
mike's code worked like a charm. i have one more question. i have an href which looks like this: http://www.cnn.com";> i thought i would use this code to get the href out but it fails, gives me a keyerror: for incident in row('td', {'class':'all'}): n = incident.f

Re: Hypergeometric distribution

2006-01-01 Thread Scott David Daniels
Steven D'Aprano wrote: > On Sun, 01 Jan 2006 14:24:39 -0800, Raven wrote: > >> Thanks Steven for your very interesting post. >> >> This was a critical instance from my problem: >> >from scipy import comb > comb(14354,174) >> inf > > Curious. It wouldn't surprise me if scipy was using flo

Re: New Python.org website ?

2006-01-01 Thread Peter Hansen
Bugs wrote: > I thought I read here that a new website design was in the works for > python.org in time for the new year? Is that still true and of so, > anyone know what is it's status? Which year? If 2007, it might still be true... -- http://mail.python.org/mailman/listinfo/python-list

New Python.org website ?

2006-01-01 Thread Bugs
I thought I read here that a new website design was in the works for python.org in time for the new year? Is that still true and of so, anyone know what is it's status? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

python-dev Summary for 2005-11-16 through 2005-11-30

2006-01-01 Thread Tony Meyer
[The HTML version of this Summary is available at http://www.python.org/dev/summary/2005-11-16_2005-11-30.html] = Summary Announcements = -- Reminder: Python is now on Subversion! --

idle with -n switch

2006-01-01 Thread rbt
What impact does the -n option have on idle.py on Windows? -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex on Darwin, gcc 3.3 optimization trouble

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

Re: Try Python update

2006-01-01 Thread Mike Meyer
"Devan L" <[EMAIL PROTECTED]> writes: >> > On a side note, my brother has tinkered with the C internals and now >> > __subclasses__ is restricted and many, many os and posix commands are >> > restricted (not that you can get them anyways, since importing is >> > broken!) >> I got import to work by

Re: Hypergeometric distribution

2006-01-01 Thread Steven D'Aprano
On Sun, 01 Jan 2006 14:24:39 -0800, Raven wrote: > Thanks Steven for your very interesting post. > > This was a critical instance from my problem: > from scipy import comb comb(14354,174) > inf Curious. It wouldn't surprise me if scipy was using floats, because 'inf' is usually a float

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2006-01-01 Thread Alex Martelli
Anton Vredegoor <[EMAIL PROTECTED]> wrote: ... > Google's not a nice company (yeah, I know I'm posting from a google > account). If you look at their job requirements it's clear they will > only hire people with long backstabbing histories. Such as...? Guido van Rossum? Greg Stein? Vint Cerf?

Re: Line replace

2006-01-01 Thread DarkBlue
Thank you for all the suggestions It appears the safest solution still is using a temp file as was so apt suggested further up here without it I maybe white water rafting without a canoe. I also will test the feasibility to regenerate the whole file from the database. Nx -- http://mail.python

Re: Python or Java or maybe PHP?

2006-01-01 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Hi everyone, > > I need to write a web app, that will support millions of user accounts, > template-based user pages and files upload. The client is going to be > written in Flash. I wondered if I coudl get your opinions - what do you > think is the best language to u

Re: Try Python update

2006-01-01 Thread Devan L
Mike Meyer wrote: > "Devan L" <[EMAIL PROTECTED]> writes: > >> If you want to try an online P{ython tool that lets you save code, try > >> Devan L's at http://www.datamech.com/devan/trypython/trypython.py. > > My code uses one of the recipes from the Python Cookbook, 7.6 Pickling > > Code Objects.

Re: how-to POST form data to ASP pages?

2006-01-01 Thread livin
The library is the PC version of 2.3 --- I have done some more testing. I simplified my .py to only 2 lines... import urllib urllib.urlopen('http://192.168.1.11', urllib.urlencode({'control_device': 'Kitchen Lights=off'})) I get this error... File "Q:\python\python23.zlib\urllib.py", line 78,

Re: python coding contest

2006-01-01 Thread Alex Martelli
Christian Tismer <[EMAIL PROTECTED]> wrote: > Hans Nowak wrote: > > >... for u in(3,14,10)) > > > > can be written as: > > > >... for u in 3,14,10) > > > > which would shave off a character. Tuples don't always need parentheses... > > This would work with a list comprehension. > Do

Re: how to scrape url out of href

2006-01-01 Thread Mike Meyer
[EMAIL PROTECTED] writes: > i need to scrape a url out of an href. it seems that people recommend > that i use beautiful soup but had some problems. What problem are you having with BeautifulSoup? It's working fine for here. > does anyone have sample code for scraping the actual url out of an hr

Re: how to scrape url out of href

2006-01-01 Thread homepricemaps
sorry paul-i'm an extremely beginner programmer, if that! ;-) can you give me an example? thanks in advance Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > does anyone have sample code for scraping the actual url out of an href > > like this one > > > > http://www.cnn.com"; target="_blank"> > >

Build Python using Mars compiler?

2006-01-01 Thread rzed
Has anyone tried to compile Python (on Windows) using the Digital Mars compiler? If so, can you give some hints how you did it? Or ... can anyone suggest an approach to compiling from the ground up using a compiler that isn't mentioned in the thicket of #ifdefs? Where to start? What to look ou

Re: Python as a Server vs Running Under Apache

2006-01-01 Thread Mike Meyer
"mojosam" <[EMAIL PROTECTED]> writes: > Is this advice accurate? Are there other things to consider? Isn't > there just some way (short of running something like Zope) that would > keep Python resident in the server's RAM? This is a shared server, so > the web host probably doesn't like stuff si

Re: python coding contest

2006-01-01 Thread Michael Spencer
Claudio Grondi wrote: > ...I analysed the outcome of it and have > come to the conclusion, that there were two major factors which > contributed to squeezing of code: > >(1). usage of available variants for coding of the same thing >(2). sqeezing the size of used numeric and string litera

Re: how to scrape url out of href

2006-01-01 Thread Paul Rubin
[EMAIL PROTECTED] writes: > does anyone have sample code for scraping the actual url out of an href > like this one > > http://www.cnn.com"; target="_blank"> If you've got the tag by itself like that, just use a regexp to get the href out. -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric RandomArray seed problem

2006-01-01 Thread Sean Richards
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hello, > > I tried calling RandomArray.seed() > by calling RandomArray.get_seed() I get the seed number (x,y). > My problem is that x is always 113611 any advice? In [1]: from RandomArray import * In [2]: seed? Type: function Base Cla

how to scrape url out of href

2006-01-01 Thread homepricemaps
i need to scrape a url out of an href. it seems that people recommend that i use beautiful soup but had some problems. does anyone have sample code for scraping the actual url out of an href like this one http://www.cnn.com"; target="_blank"> -- http://mail.python.org/mailman/listinfo/python-l

Re: Try Python update

2006-01-01 Thread Mike Meyer
"Devan L" <[EMAIL PROTECTED]> writes: >> If you want to try an online P{ython tool that lets you save code, try >> Devan L's at http://www.datamech.com/devan/trypython/trypython.py. > My code uses one of the recipes from the Python Cookbook, 7.6 Pickling > Code Objects. It's limited to closures tho

Re: Problem overriding sys.excepthook

2006-01-01 Thread Lunchtimemama
Forgive my ignorance, but I'm not quite sure what you mean. I tried importing the traceback module at the beginning of the script, but that didn't make a difference. Could you provide example code to illustrate your comment? Thanks. -LTM -- http://mail.python.org/mailman/listinfo/python-list

Getting terse tracebacks?

2006-01-01 Thread Roy Smith
Is there any way to make the traceback printer built into the interpreter elide all the directories in pathnames (like strip_dirs() does for the profiler)? I'm working in a deep directory tree, and the full pathnames to my python source files are pushing 150 characters. I either need a laptop wit

Re: Preventing control characters from entering an XML file

2006-01-01 Thread Scott David Daniels
Frank Niessink wrote: > ... > Character Range > Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | > [#x1-#x10]" > > - What is the easiest/most pythonic (preferably build-in) way of > checking a unicode string for control characters and weeding those > characters out? dr

Re: Hypergeometric distribution

2006-01-01 Thread Paul Rubin
"Raven" <[EMAIL PROTECTED]> writes: > Yes I am calculating hundreds of hypergeometric probabilities so I need > fast calculations Can you use Stirling's approximation to get the logs of the factorials? -- http://mail.python.org/mailman/listinfo/python-list

The New Extension IDE - EXTEIDE

2006-01-01 Thread EXTEIDE (sent by Nabble.com)
EXTEIDE is freeware. Anyone can download now. Please visit http://www.exteide.com Thanks. Sent from the Python - python-list forum at Nabble.com: The New Extension IDE - EXTEIDE -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as a Server vs Running Under Apache

2006-01-01 Thread Jean-Paul Calderone
On 1 Jan 2006 14:44:07 -0800, mojosam <[EMAIL PROTECTED]> wrote: >I guess I'm a little confused, and this certainly comes from not yet >having tried to do anything with Python on a web server. > >I remarked once to a Python programmer that it appeared to me that if I >had a web page that called a P

Tkinter app hanging on windows

2006-01-01 Thread msoulier
Hello, I have a very simple Tkinter application that I'm using to dispatch a mechanize crawl of a web form, when a button is clicked. Most of the time it will be idle, until the user decides to unminimize it and click that button. Unfortunately, I'm finding that after several hours of being up, w

Re: loops breaks and returns

2006-01-01 Thread Sam Pointon
rbt wrote: > Is it more appropriate to do this: > > while 1: > if x: > return x > > Or this: > > while 1: > if x: > break > return x > > Or, does it matter? I would pick the first form if that's the only place where x would be returned from the function. However, if the

Re: Problem overriding sys.excepthook

2006-01-01 Thread Patrick Maupin
Lunchtimemama wrote: > Yo all, I'm getting into Python for the first time and I'm really > having a blast. I've hit a bit of a snag and was wondering if someone > could lend some insight. Here be the code: > > import sys > def myexcepthook(type, value, tb): > import traceback > rawreport = tra

Re: Try Python update

2006-01-01 Thread Devan L
Mike Meyer wrote: > After spending time I should have been sleeping working on it, the try > python site is much more functional. It now allows statements, > including multi-line statements and expressions. You can't create code > objects yet, so it's still more a programmable calculator than > an

Re: Python as a Server vs Running Under Apache

2006-01-01 Thread mojosam
I guess I'm a little confused, and this certainly comes from not yet having tried to do anything with Python on a web server. I remarked once to a Python programmer that it appeared to me that if I had a web page that called a Python program, that the server would: 1. Load Python 2. Run the progra

Re: Hypergeometric distribution

2006-01-01 Thread Raven
Thanks Steven for your very interesting post. This was a critical instance from my problem: >>>from scipy import comb >>> comb(14354,174) inf The scipy.stats.distributions.hypergeom function uses the scipy.comb function, so it returned nan since it tries to divide an infinite. I did not tried to

Re: loops breaks and returns

2006-01-01 Thread Peter Hansen
rbt wrote: > Is it more appropriate to do this: > > while 1: > if x: > return x > > Or this: > > while 1: > if x: > break > return x The former would be considered bad style by some people. Others would consider it perfectly acceptable in a small function (say, no

Re: MidiToText : EventDispatcher instance has no attribute 'sysex_events'

2006-01-01 Thread Max M
Carsten Haese wrote: > On Fri, 2005-12-30 at 09:52, tim wrote: > >>Trying to convert midi to text using MidiToText.py. >>I get the following: >> >>midi_port: 0 >>Traceback (most recent call last): >> File "MidiToText.py", line 176, in ? >>midiIn.read() >> File "C:\Python24\Lib\site-packages\

Re: Memoization and encapsulation

2006-01-01 Thread Tom Anderson
On Sat, 31 Dec 2005 [EMAIL PROTECTED] wrote: >just> I actually prefer such a global variable to the default arg >just> trick. The idiom I generally use is: > >just> _cache = {} >just> def func(x): >just> result = _cache.get(x) >just> if result is None: >just>

Problem overriding sys.excepthook

2006-01-01 Thread Lunchtimemama
Yo all, I'm getting into Python for the first time and I'm really having a blast. I've hit a bit of a snag and was wondering if someone could lend some insight. Here be the code: import sys def myexcepthook(type, value, tb): import traceback rawreport = traceback.format_exception(type, value,

loops breaks and returns

2006-01-01 Thread rbt
Is it more appropriate to do this: while 1: if x: return x Or this: while 1: if x: break return x Or, does it matter? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python article in Free Software Magazine

2006-01-01 Thread Ed Jensen
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > I don't want to nit-pick all my way through the article, which > is very decent and is worth reading, but I will say one more thing: you > describe Python as "an expressive, interpreted language". Python is no > more interpreted than Java. Like Java, it

Re: Python article in Free Software Magazine

2006-01-01 Thread Ed Jensen
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > I don't want to nit-pick all my way through the article, which > is very decent and is worth reading, but I will say one more thing: you > describe Python as "an expressive, interpreted language". Python is no > more interpreted than Java. Like Java, it

Re: how-to POST form data to ASP pages?

2006-01-01 Thread livin
The library is the PC version of 2.3 --- I have done some more testing. I simplified my .py to only 2 lines... import urllib urllib.urlopen('http://192.168.1.11', urllib.urlencode({'control_device': 'Kitchen Lights=off'})) I get this error... File "Q:\python\python23.zlib\urllib.py", line 78,

Re: how-to POST form data to ASP pages?

2006-01-01 Thread Alan Kennedy
[livin] > I have tried the code you suggested and .. > .. Either way I get this error log... > > File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen > File "Q:\python\python23.zlib\urllib.py", line 183, in open > File "Q:\python\python23.zlib\urllib.py", line 297, in open_http > File "Q

Preventing control characters from entering an XML file

2006-01-01 Thread Frank Niessink
Hi list, First of all, I wish you all a happy 2006. I have a small question that googling didn't turn up an answer for. So hopefully you'll be kind enough to send me in the right direction. I'm developing a desktop application, called Task Coach, that saves its domain objects (tasks, mostly :-

Re: python coding contest

2006-01-01 Thread Jacob Hallen
In article <[EMAIL PROTECTED]>, Simon Hengel <[EMAIL PROTECTED]> wrote: >Hello, > >> After all, I'd really love to set up another contest with >> different measures and criteria. > >for future events i will take a close look at other possibilities for >doing a ranking. At the moment the 22c3 and t

Python or Java or maybe PHP?

2006-01-01 Thread liorm
Hi everyone, I need to write a web app, that will support millions of user accounts, template-based user pages and files upload. The client is going to be written in Flash. I wondered if I coudl get your opinions - what do you think is the best language to use for the server? Python or Java? And I

Re: python coding contest

2006-01-01 Thread Claudio Grondi
Claudio Grondi wrote: > Steven D'Aprano wrote: > >> On Sun, 01 Jan 2006 15:49:58 +0100, Claudio Grondi wrote: >> >> >> >>> What I have thought about as a simpler/better solution is a method >>> allowing to avoid processing the content of the string or long >>> integer object by looping over its

Re: how-to POST form data to ASP pages?

2006-01-01 Thread livin
Hi Alan, I have tried the code you suggested and a more simple set of post parameters (below). import urllib name_value_pairs = {'control_device': 'Kitchen Lights=off'} params = urllib.urlencode(name_value_pairs) urllib.urlopen("http://192.168.1.11:80";, params)

Re: Try Python update

2006-01-01 Thread UrsusMaximus
Cool. I think its really a good thing. Could come in handy when one is on a strange Windows machine with no Python installed, or when using a PDA that doesn't have Python etc. And its just a neat feat. ;-))) Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Filling out forms with python

2006-01-01 Thread Christoph Haas
On Friday 30 December 2005 06:30, Steve Young wrote: > Hi, I was wondering if there's a way to fill out forms online using > python. Say for example if you wanted to make a search on some search > engine without having to actually open a browser or something like that. Try twill: http://www.idyll.

Re: Compressing folders in Windows using Python.

2006-01-01 Thread Tim N. van der Leeuw
Christian Tismer wrote: > sri2097 wrote: > > Hi, > > I'm trying to zip a particular fiolder and place the zipped folder into > > a target folder using python. I have used the following command in > > 'ubuntu'. > > > > zip_command = 'zip -qr %s %s' % (target, ' '.join(source)) > > > > I execute

Re: Compressing folders in Windows using Python.

2006-01-01 Thread Christian Tismer
sri2097 wrote: > Hi, > I'm trying to zip a particular fiolder and place the zipped folder into > a target folder using python. I have used the following command in > 'ubuntu'. > > zip_command = 'zip -qr %s %s' % (target, ' '.join(source)) > > I execute this using os.command(zip_command). It w

Re: Problems with Tkinter

2006-01-01 Thread Mario Wehbrink
Steffen Mutter schrieb in comp.lang.python: > fenster.title = 'Demofenster' Try: fenster.title("Demofenster") instead Mario -- Mario Wehbrink -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with Tkinter

2006-01-01 Thread Steffen Mutter
Am Sun, 01 Jan 2006 18:36:56 +0100 schrieb Kevin: > Try: > > fenster.title("Demofenster") Exactly. I had a look in Michael Lauer's 'Python & GUI-Toolkits' meanwhile, so I found the clue. > "title" a class method, not a variable. Yep. Thank you: > Kevin. Steffen -- http://mail.python.org/ma

Re: Problems with Tkinter

2006-01-01 Thread Cousin Stanley
> My first try fiddling around with GUIs ended disappointing, > instead of showing the window title as expected 'Demofenster' > ist still shows 'tk' instead. > > What did I do wrong? > > > #!/usr/bin/env python > > from Tkinter import * > fenster = Tk() > fenster.title = 'Demofenster' > fenster

Re: python coding contest

2006-01-01 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Steven D'Aprano wrote: > >>I'm reminded of a time I was going for a drive in the country when I drove >>past an apple orchid. Standing in the orchid was a farmer with a pig. He >>lifted the pig into the air, and the pig then bit an apple and slowly >>chewed it. The farme

Re: Problems with Tkinter

2006-01-01 Thread Kevin
Try: fenster.title("Demofenster") "title" a class method, not a variable. Kevin. "Steffen Mutter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all and a happy new year! > > My first try fiddling around with GUIs ended disappointing, instead of > showing the window title as

Re: bsddb3 locking questions

2006-01-01 Thread Eric S. Johansson
man, I'm in really bad form replying to myself twice but I'me solved the problem at least in a simple form. Eric S. Johansson wrote: > Eric S. Johansson wrote: >> are there any simple examples of how to do record locking with bsddb3? #!/usr/bin/python from bsddb import db # th

Re: Help please with binary file read

2006-01-01 Thread Stewart Arnold
Grant Perfect! Thanks :) Stewart "Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2006-01-01, Stewart Arnold <[EMAIL PROTECTED]> wrote: > >> I'm trying to convert a Real Basic routine into Python and I >> can't read the long integer data from a file. > > http://d

Problems with Tkinter

2006-01-01 Thread Steffen Mutter
Hi all and a happy new year! My first try fiddling around with GUIs ended disappointing, instead of showing the window title as expected 'Demofenster' ist still shows 'tk' instead. What did I do wrong? #!/usr/bin/env python from Tkinter import * fenster = Tk() fenster.title = 'Demofenster' fen

Re: how-to POST form data to ASP pages?

2006-01-01 Thread Alan Kennedy
[livin] > I'm not a coder really at all (I dabble with vbscript & jscript) but an > asking for help to get this working. > > I have tried this... > > params = urllib.urlencode({'action': 'hs.ExecX10ByName "Kitchen > Espresso Machine", "On", 100'}) > urllib.urlopen("http://192.168.1.

Re: python coding contest

2006-01-01 Thread bonono
Steven D'Aprano wrote: > I'm reminded of a time I was going for a drive in the country when I drove > past an apple orchid. Standing in the orchid was a farmer with a pig. He > lifted the pig into the air, and the pig then bit an apple and slowly > chewed it. The farmer then carried him over to an

Re: how-to POST form data to ASP pages?

2006-01-01 Thread livin
Mike, I'm not a coder really at all (I dabble with vbscript & jscript) but an asking for help to get this working. I have tried this... params = urllib.urlencode({'action': 'hs.ExecX10ByName "Kitchen Espresso Machine", "On", 100'}) urllib.urlopen("http://192.168.1.11:80/hact/kitchen

Re: python coding contest

2006-01-01 Thread Claudio Grondi
Steven D'Aprano wrote: > On Sun, 01 Jan 2006 15:49:58 +0100, Claudio Grondi wrote: > > > >>What I have thought about as a simpler/better solution is a method >>allowing to avoid processing the content of the string or long integer >>object by looping over its content. > > > How can you avoi

LocaWapp: localhost web applications (v.03 - 2005 Dec 31)

2006-01-01 Thread LocaWapp
http://cheeseshop.python.org/packages/source/L/LocaWapp/locawapp-03.tar.gz LocaWapp: localhost web applications (v.03 - 2005 Dec 31) Copyright (c) 2005 RDJ This code is distributed for your utility but WITHOUT ANY WARRANTY. http://LocaWapp.blogspot.com - Run: pyt

Try Python update

2006-01-01 Thread Mike Meyer
After spending time I should have been sleeping working on it, the try python site is much more functional. It now allows statements, including multi-line statements and expressions. You can't create code objects yet, so it's still more a programmable calculator than anything real. I've got some o

Re: how to show Chinese Characters in the value set of a dictionary

2006-01-01 Thread Diez B. Roggisch
zxo102 schrieb: > Hi there, > I have a dictionary with values of Chinses Characters. For > example, > > dict = {} dict['c1']="中国一" dict['c2']="中国二" dict.values() > > ['\xd6\xd0\xb9\xfa\xb6\xfe', '\xd6\xd0\xb9\xfa\xd2\xbb'] > > Since the result of dict.values will be insert

Re: Line replace

2006-01-01 Thread Mike Meyer
DarkBlue <[EMAIL PROTECTED]> writes: > pseudocode is like this: > > get newlinetext from database # this is ok done with kinterbas > preferably check if file not in use by other process > open file and find desired marker > go to line after marker and replace that one with newlinetext > close the

Re: how to show Chinese Characters in the value set of a dictionary

2006-01-01 Thread Nikos Kouremenos
On Sun, 01 Jan 2006 07:35:31 -0800, zxo102 wrote: > > Hi there, > I have a dictionary with values of Chinses Characters. For > example, > dict = {} dict['c1']="中国一" dict['c2']="中国二" dict.values() > ['\xd6\xd0\xb9\xfa\xb6\xfe', '\xd6\xd0\xb9\xfa\xd2\xbb'] > > Since the

Re: Global Variables in OOP and Python

2006-01-01 Thread Steven D'Aprano
On Sun, 01 Jan 2006 06:48:48 -0800, Kay Schluehr wrote: >> Agree about from module import * being bad, but it is still generally poor >> practice for the same reason using global variables is generally poor >> practice. > > No, I don't think so. The general wisdom is that global variables are > b

Re: Help please with binary file read

2006-01-01 Thread Grant Edwards
On 2006-01-01, Stewart Arnold <[EMAIL PROTECTED]> wrote: > I'm trying to convert a Real Basic routine into Python and I > can't read the long integer data from a file. http://docs.python.org/lib/module-struct.html -- Grant Edwards grante Yow! Here I am in 53

Re: python coding contest

2006-01-01 Thread Steven D'Aprano
On Sun, 01 Jan 2006 15:49:58 +0100, Claudio Grondi wrote: > What I have thought about as a simpler/better solution is a method > allowing to avoid processing the content of the string or long integer > object by looping over its content. How can you avoid looping over its content? Whether you

Re: Python article in Free Software Magazine

2006-01-01 Thread Kirk Strauser
On Sunday 01 January 2006 01:06 am, Steven D'Aprano wrote: > I don't want to nit-pick all my way through the article, There's nothing wrong with that, and if I hadn't been prepared for it, I wouldn't have posted the link in here. You have fair points. Unfortunately, though, the word length of t

how to show Chinese Characters in the value set of a dictionary

2006-01-01 Thread zxo102
Hi there, I have a dictionary with values of Chinses Characters. For example, >>> dict = {} >>> dict['c1']="中国一" >>> dict['c2']="中国二" >>> dict.values() ['\xd6\xd0\xb9\xfa\xb6\xfe', '\xd6\xd0\xb9\xfa\xd2\xbb'] Since the result of dict.values will be inserted into web pages and handled by jav

Help please with binary file read

2006-01-01 Thread Stewart Arnold
I'm trying to convert a Real Basic routine into Python and I can't read the long integer data from a file. Here is the Real Basic code: b=f.OpenAsBinaryFile b.LittleEndian=True i=b.ReadByte titles=b.ReadLong shows=b.ReadLong i=b.ReadLong And here is my code:

Re: Xah's Edu Corner: Tech Geekers and their Style

2006-01-01 Thread John W. Kennedy
Xah Lee wrote: > With all the whizbang of styles and features in CSS2, a basic, > necessary, functional layout feature as multi-columns is not there yet. > This is a indication of the fatuousness of the IT industry's > technologies and its people. No, this is an indication of what happens to an in

Re: Compressing folders in Windows using Python.

2006-01-01 Thread bren[at]gillatt.org
Heiko Wundram wrote: > Steven D'Aprano wrote: > >>>But when I run this script in Windows XP, I get an error while >>>executing the above zip command. >> >>Would you like to tell us what error you get? > > > I presume the error he's seeing is something along the line of: > > "zip: Bad command or

Re: python coding contest

2006-01-01 Thread Claudio Grondi
Steven D'Aprano wrote: > On Sun, 01 Jan 2006 03:34:33 +0100, Claudio Grondi wrote: > > >>>Please send me comments, suggestions and ideas. >> >>Now, after the contest is over I analysed the outcome of it and have >>come to the conclusion, that there were two major factors which >>contributed to

Re: Global Variables in OOP and Python

2006-01-01 Thread Kay Schluehr
Steven D'Aprano wrote: > On Fri, 30 Dec 2005 20:00:51 -0500, Mike Meyer wrote: > > > >> The other way I thought of is to create a separate class that consists > >> of the variables and to use the > >> > >> from import * > >> > >> in all of the files (namespaces) where it is needed. > > > > Except

Re: python coding contest

2006-01-01 Thread Claudio Grondi
Claudio Grondi wrote: >> Please send me comments, suggestions and ideas. > > > Now, after the contest is over I analysed the outcome of it and have > come to the conclusion, that there were two major factors which > contributed to squeezing of code: > > (1). usage of available variants for c

Re: Line replace

2006-01-01 Thread DarkBlue
> OK, why don't you store those changing lines in the database? > > Can you arrange for those changeable lines to be fixed length, i.e. > by padding with spaces or something? If you can, then you could just > overwrite them in place. Use flock or fcntl (Un*x) or the comparable > Windows locking

Re: logging module example

2006-01-01 Thread Chris Smith
One thing that made little sense to me when I was first working on this is the following variation on the original script: #--begin test script-- import logging forest = ["root","trunk","branch","leaf"] lumber_jack = {forest[0] : logging.DEBUG ,forest[1] : logging.INFO

Re: Line replace

2006-01-01 Thread Paul Rubin
DarkBlue <[EMAIL PROTECTED]> writes: > The markers are just there to have a static way to find the line > after the marker, which is the one which might have to be changed. OK, why don't you store those changing lines in the database? Can you arrange for those changeable lines to be fixed length,

  1   2   >