Re: eval and unicode

2008-03-20 Thread Jonathan Gardner
On Mar 20, 2:20 pm, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > >>  >>> eval( u'"徹底したコスト削減 ÁÍŰŐÜÖÚÓÉ трирова"' ) == eval( '"徹底し > >> たコスト削減 ÁÍŰŐÜÖÚÓÉ трирова"' ) > >> True > > > When you feed your unicode data into eval(), it doesn't have any > > encoding or decoding work to do. > > Yes, but what ab

Re: eval and unicode

2008-03-21 Thread Jonathan Gardner
On Mar 21, 1:54 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: >  >>> eval( "# -*- coding: latin2 -*-\n" + expr) > u'\u0170' # You can specify the encoding for eval, that is cool. > I didn't think of that. That's pretty cool. > I hope it is clear now.  Inside eval, an unicode object was created from

Re: Is this doable

2008-03-21 Thread Jonathan Gardner
On Mar 21, 4:48 am, fkallgren <[EMAIL PROTECTED]> wrote: > Hi. > > I have a little problem. I have a script that is in the scheduler > (win32). But every now and then I update this script and I dont want > to go to every computer and update it. So now I want the program to 1) > check for new versio

Re: urllib leaves connections/sockets waiting. BIG problem!!!

2008-03-24 Thread Jonathan Gardner
On Mar 24, 6:57 am, binaryj <[EMAIL PROTECTED]> wrote: > hi i am using urllib2 to do some automated web thing. > basically i hit on sites and check the price what they are offering > for their product and then decide if i want to lower or increase my > pricing.so in short i have to hit hundreds of

TTS in windows

2009-02-11 Thread Jonathan Chacón
Hello, I need to use SAPI5 text to speech with python but I don't find anything that lets me manage speech, tone, volume, etc Does anybody know anything to do this? Thanks and regards Jonathan Chacón -- http://mail.python.org/mailman/listinfo/python-list

RE: TTS in windows

2009-02-11 Thread Jonathan Chacón
problem later Thanks Jonathan Chacón -- http://mail.python.org/mailman/listinfo/python-list

Get an image from a webcam in macOS

2009-02-12 Thread Jonathan Chacón
Hello, I can get an Image from a webcam in windows but I don't know how can I get an image from the webcam in a macbook in leopard. How can I do this? thanks and regards Jonathan Chacón -- http://mail.python.org/mailman/listinfo/python-list

Capture images in macOS X

2009-02-12 Thread Jonathan Chacón
Hello, I need to capture images from the macbook webcam in leopard. Does anybody know how can I do this? Thanks and regards Jonathan Chacón -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2008-12-30 Thread Jonathan Gardner
On Dec 30, 12:35 pm, [email protected] wrote: > I have Section 4.4.1 of SICP rattling around in my head (database > queries), and I'm trying to come up with a simple dictionary-based > database in Python to represent circuit diagrams.  My main confusion > isn't one of implementation, but a m

Re: need help with list/variables

2008-12-30 Thread Jonathan Gardner
On Dec 30, 11:41 am, [email protected] wrote: > > >>> conc = lambda x,y: x[:] + y # concatenate 2 lists without side effects > >>> mylist = ['something\n', 'another something\n', 'something again\n'] > >>> myvar = reduce(conc, mylist) > >>> print myvar > "conc"? "side effects"? Missing Lisp

Re: Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2009-01-01 Thread Jonathan Gardner
On Dec 30 2008, 3:25 pm, [email protected] wrote: > > In a typical SQL database, when you type in "SELECT foo FROM bar WHERE > > baz='bo'", you are not writing a program, at least not in the sense of > > Python or C or Java or Perl where you give instructions on HOW to run > > the program. Y

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Jonathan Gardner
On Jan 5, 2:26 pm, Kangkook Jee wrote: > I'd like to measure number of bytes sent(or recv'd) from my python > application. Does anyone have any idea how can I achieve this? > > I tried to do this by tracing some socket calls (send, sendto, sendAll) >   using 'metaclass' but I could find exactly pl

Re: Measuring bytes of packet sent from python application

2009-01-05 Thread Jonathan Gardner
On Jan 5, 3:23 pm, Kangkook Jee wrote: > Jonathan Gardner wrote: > > A good universal tool on the Linux platform is tcpdump. It takes some > > learning, but is very useful for this kind of task. You can use a tool > > like ethereal to visualize the data that tcpdump gathers.

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-06 Thread Jonathan Gardner
On Jan 6, 8:13 am, sturlamolden wrote: > On Jan 6, 4:32 pm, mark wrote: > > > > Is it possible to > > switch between the custom DSL and the standard Python interpreter? > > > > - Write the DSL interpreter in Python. > There are Python modules out there that make writing a language interpreter al

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-06 Thread Jonathan Gardner
On Jan 6, 8:18 am, sturlamolden wrote: > On Jan 6, 4:32 pm, mark wrote: > > > I want to implement a internal DSL in Python. I would like the syntax > > as human readable as possible. > > Also beware that Python is not Lisp. You cannot define new syntax (yes > I've seen the goto joke). This isn't

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-06 Thread Jonathan Gardner
On Jan 6, 12:24 pm, J Kenneth King wrote: > Jonathan Gardner writes: > > On Jan 6, 8:18 am, sturlamolden wrote: > >> On Jan 6, 4:32 pm, mark wrote: > > >> > I want to implement a internal DSL in Python. I would like the syntax > >> > as human

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-07 Thread Jonathan Gardner
On Jan 7, 7:50 am, J Kenneth King wrote: > Jonathan Gardner writes: > > On Jan 6, 12:24 pm, J Kenneth King wrote: > >> Jonathan Gardner writes: > >> > On Jan 6, 8:18 am, sturlamolden wrote: > >> >> On Jan 6, 4:32 pm, mark wrote: > > >

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-07 Thread Jonathan Gardner
On Jan 7, 9:16 am, "Chris Mellon" wrote: > > The OP wants a Ruby-style DSL by which he means "something that lets > me write words instead of expressions". The ruby syntax is amenable to > this, python (and lisp, for that matter) syntax is not and you can't > implement that style of internal DSL i

Re: Making a decorator a staticmethod

2009-01-08 Thread Jonathan Gardner
On Jan 8, 11:18 am, "Zac Burns" wrote: > > In my use case (not the example below) the decorator returns a > function of the form def f(self, *args, **kwargs) which makes use of > attributes on the instance self. So, it only makes sense to use the > staticmethod in the class and in the baseclass. M

Re: Tree views - Best design practices

2009-01-08 Thread Jonathan Gardner
On Jan 8, 8:16 am, MRAB wrote: > Filip Gruszczyński wrote: > > Hi! > > > I have certain design problem, which I cannot solve elegantly. Maybe > > you know some good design patterns for this kind of tasks. > > > Task: > > > We have a model which has two kinds of objects: groups and elements. > > Gr

Re: Tree views - Best design practices

2009-01-08 Thread Jonathan Gardner
On Jan 8, 1:00 pm, "Filip Gruszczyński" wrote: > > Is it really any better than asking for class? I mean, if I need to > add another class to a hierarchy which behaves differently, will it be > more flexible (actually you have to add another method to every class > and check for in the gui). I bel

Re: Tree views - Best design practices

2009-01-08 Thread Jonathan Gardner
On Jan 8, 1:00 pm, "Filip Gruszczyński" wrote: > > Is it really any better than asking for class? I mean, if I need to > add another class to a hierarchy which behaves differently, will it be > more flexible (actually you have to add another method to every class > and check for in the gui). I bel

Re: Tree views - Best design practices

2009-01-08 Thread Jonathan Gardner
On Jan 8, 1:50 pm, "Filip Gruszczyński" wrote: > > But I am looking for a different type of flexibility. I would like to > be able to add more classes to my hierarchy and not have to change my > code in many places when I add new class to the hierarchy. If I have > to change every class in the hie

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-09 Thread Jonathan Gardner
On Jan 8, 7:25 am, J Kenneth King wrote: > Jonathan Gardner writes: > > It seems we're defining "DSL" in two different ways. > > You can't write a DSL in Python because you can't change the syntax and > you don't have macros. > > You can

Re: looking for tips on how to implement "ruby-style" Domain Specific Language in Python

2009-01-09 Thread Jonathan Gardner
On Jan 8, 8:03 am, Kay Schluehr wrote: > On 8 Jan., 16:25, J Kenneth King wrote: > > > As another poster mentioned, eventually PyPy will be done and then > > you'll get more of an "in-Python" DSL. > > May I ask why you consider it as important that the interpreter is > written in Python? I see no

Re: Measuring bytes of packet sent from python application

2009-01-09 Thread Jonathan Gardner
On Jan 5, 6:08 pm, Grant Edwards wrote: > On 2009-01-05, Kangkook Jee wrote: > > I'm still struggling to solve it within python process since > > it looks cleaner but it doesn't seems to be easy at all. > > I don't why adding bunches of code to your app would be > "cleaner" than gathering data us

Wanted: something more Pythonic than _winreg.

2008-10-10 Thread Jonathan Fine
Hello I'm using the _winreg module to change Windows registry settings, but its rather low level, and I'd prefer to be working with something more Pythonic. Does anyone have any recommendations? Jonathan -- http://mail.python.org/mailman/listinfo/python-list

IDLE on py3k

2008-10-13 Thread Jonathan Saxton
Being a bit of an old fart, I much prefer to do my text editing on a dark background. I find the paper-emulation paradigm an interesting idea but lacking in ergonomic value. With a bit of jiggering I was able to get the 2.5 version of IDLE to work the way I want, namely a black background with te

Re: Question

2008-10-13 Thread Jonathan Gardner
On Oct 13, 9:31 pm, "Aditi Meher" <[EMAIL PROTECTED]> wrote: > > I am connecting database using python,and i am inserting some data into it. > e.g.name and roll nos(some 100 records are stored) > > My question is "I want to display 10 records at a time and want to > store remaining records into buf

Re: How do I count the distance between strings in a list?

2009-02-23 Thread Jonathan Gardner
On Feb 23, 9:35 pm, collin wrote: > For example, if I were to have the code > > randomlist = ["1", "2", "3", "4"] > > And I want to count the distance between strings "1" and "4" which is > 3, what command can I use to do this? You'd have to get the indexes of the two items and subtract them. The

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-26 Thread Jonathan Gardner
On Feb 20, 6:31 am, Trip Technician wrote: > anyone interested in looking at the following problem. > > we are trying to express numbers as minimal expressions using only the > digits one two and three, with conventional arithmetic. so for > instance > > 33 = 2^(3+2)+1 = 3^3+(3*2) > > are both min

how to maximize a window with pygame

2009-03-10 Thread Jonathan Chacón
Hello I want to have a maximized window with pygame how can I know the resolution of the screen to create de pygame window with the good size? thanks and regards Jonathan Chacón -- http://mail.python.org/mailman/listinfo/python-list

Re: suggestion on a complicated inter-process communication

2009-04-27 Thread Jonathan Gardner
On Apr 27, 8:59 pm, Way wrote: > Hello friends, > > I have a little messy situation on IPC. Please if you can, give me > some suggestion on how to implement. Thanks a lot! > > -> denotes create > > MainProcess -> Process1 -> Process3 (from os.system) >                    | >                     ->

Feedparser problem

2009-06-04 Thread Jonathan Nelson
I'm trying to add a feedreader element to my django project. I'm using Mark Pilgrim's great feedparser library. I've used it before without any problems. I'm getting a TypeError I can't figure out. I've tried searching google, bing, google groups to no avail. Here's the dpaste of what I'm tryin

IDE for Python

2008-05-16 Thread Jonathan Barbero
Hi! I´m newbie with Python and to learn it better I want to use a good IDE to concentrate on Python power. There is any IDE like Eclipse for Java for Python? If not, what is the best Python´s IDE for you? Thanks, Jonathan. -- http://mail.python.org/mailman/listinfo/python-list

Re: What replaces `` in py3k?

2008-05-21 Thread Jonathan Gardner
On May 21, 10:45 am, bukzor <[EMAIL PROTECTED]> wrote: > What are backticks going to be translated into? repr -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Jonathan Gardner
On Jun 10, 11:21 am, "Russ P." <[EMAIL PROTECTED]> wrote: > I took a risk in choosing Python, and I would > feel better about it if Python would move up to the next level with > more advanced features such as (optional) static typing and private > declarations. But every time I propose something li

question about import

2008-06-11 Thread Jonathan Vanasco
I'm a little unclear about import / __import__ I'm exploring dynamically importing modules for a project, and ran into this behavior works as expected: app = __import__( myapp ) appModel = __import__( myapp.model ) but... appname= 'myapp' app = __import__( "%s" % appname ) ap

Re: question about import

2008-06-12 Thread Jonathan Vanasco
On Jun 11, 1:45 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Is it cursed upon? Didn't know that. I didn't either. Until I asked some people how to do it, and was admonished for even suggesting the concept. > However, __import__ only gives you the topmost module - in your case myapp. ah,

Re: go to specific line in text file

2008-06-18 Thread Jonathan Gardner
On Jun 17, 3:10 am, Patrick David <[EMAIL PROTECTED]> wrote: > > I am searching for a way to jump to a specific line in a text file, let's > say to line no. 9000. > Is there any method like file.seek() which leads me to a given line instead > of a given byte? > As others have said, no. But if you'

Learning Python in a group

2008-06-22 Thread Jonathan Roberts
Hi all, I'm looking to learn Python (as my first programming language) and I'm pretty sure I'd be more successful doing this with a group of other people. I've currently got one other person to learn with me, and we plan to work remotely over the net using tools such as IM/VoiP/Gobby/WIkis etc. W

Re: Learning Python in a group

2008-06-22 Thread Jonathan Roberts
> If you want people to meet with you (in person) as a mentor you should > probably ask on your local Python or Linux users group mailing list. We're not really too worried about doing it in person - mostly because the people doing it so far are all at least 1000 miles away from each other :) Bes

Re: Learning Python in a group

2008-06-22 Thread Jonathan Roberts
> I'm sure that many (myself included) would be happy to help out, but > due to timezone differences, working hours, etc you may only get > responses up to 24 hours (or more) later. Awesome, heh I'm sure we'll have questions for the list in good time :) > > What needs does your (non-face-to-face)

Re: ask for a RE pattern to match TABLE in html

2008-06-26 Thread Jonathan Gardner
On Jun 26, 11:07 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-06-26, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > > > Why not use an HTML parser instead? > > > > Stating it differently: in order to correctly recognize HTML > tags, you must use an HTML parser.  Trying to write an HTML > pa

Re: ask for a RE pattern to match TABLE in html

2008-06-26 Thread Jonathan Gardner
On Jun 26, 3:22 pm, MRAB <[EMAIL PROTECTED]> wrote: > Try something like: > > re.compile(r'.*?', re.DOTALL) So you would pick up strings like "foo"? I doubt that is what oyster wants. -- http://mail.python.org/mailman/listinfo/python-list

Re: ask for a RE pattern to match TABLE in html

2008-06-30 Thread Jonathan Gardner
On Jun 27, 10:32 am, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > (ii) The regexes in languages like Python and Perl include > features that are not part of the formal CS notion of > "regular expression". Do they include something that > does allow parsing nested delimiters properly? > In perl,

Re: x, = y (???)

2008-07-17 Thread Jonathan Gardner
On Jul 17, 12:55 pm, kj <[EMAIL PROTECTED]> wrote: > I still don't get it.  If we write > >   y  = 'Y' >   x, = y > > what's the difference now between x and y?  And if there's no > difference, what's the point of performing such "unpacking"? > Try: y = "abc" x, = y You were unpacking y into

Re: x, = y (???)

2008-07-17 Thread Jonathan Gardner
On Jul 17, 12:55 pm, kj <[EMAIL PROTECTED]> wrote: > what's the point of performing such "unpacking"? record = [name, address, telephone] ... name, address, telephone = record -- http://mail.python.org/mailman/listinfo/python-list

How do I find out from inside pdb which namespace contains an object?

2008-08-03 Thread Jonathan Mark
I am inside a Pdb-like Plone debugging tool and I get the following error at the prompt. I was wondering how to find out from inside the debugger which namespace the collective.dancing.channel object is located in. : collective.dancing.channel.tool_added(DelegateNichols.portal_newsletters, None) c

Re: How do I find out from inside pdb which namespace contains an object?

2008-08-03 Thread Jonathan Mark
Never mind. I had to run "import collective.dancing" first. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to best explain a "subtle" difference between Python and Perl ?

2008-08-12 Thread Jonathan Gardner
On Aug 12, 9:17 am, Palindrom <[EMAIL PROTECTED]> wrote: > Hi everyone ! > > I'd like to apologize in advance for my bad english, it's not my > mother tongue... > > My girlfriend (who is a newbie in Python, but knows Perl quite well) > asked me this morning why the following code snippets didn't gi

Python Variable System

2008-08-13 Thread Jonathan Gardner
Nigel Rantor wrote: The Python system is the same as the Java system, apart from Java's primitive types, which is a completely different discussion that I really don't want to get into right now. So, everything is by reference. I am not too familiar with Java's system. I understand, and ag

Re: Python 3.0 new integer division

2008-04-08 Thread Jonathan Gardner
On Apr 8, 9:13 am, "Hutch" <[EMAIL PROTECTED]> wrote: > We now have a float result when two integers are divided in the same mannor > as 2.4 or 2.5. > I can handle that and use the Floor division but a simple question. > > Why in the world would you round down the last presented digit to a 6 > inst

Re: Python 3.0 new integer division

2008-04-08 Thread Jonathan Gardner
On Apr 8, 2:25 pm, Grzegorz Słodkowicz <[EMAIL PROTECTED]> wrote: > > Isn't Decimal a BCD implementation? Yep, you are right and I am wrong. http://www.python.org/dev/peps/pep-0327/#why-not-rational -- http://mail.python.org/mailman/listinfo/python-list

Question on threads

2008-04-11 Thread Jonathan Shao
Hi all, I'm a beginner to Python, so please bear with me. Is there a way of guarenteeing that all created threads in a program are finished before the main program exits? I know that using join() can guarentee this, but from the test scripts I've run, it seems like join() also forces each individ

Re: Question on threads

2008-04-11 Thread Jonathan Shao
On Fri, Apr 11, 2008 at 3:29 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Jonathan Shao wrote: > > > Hi all, > > I'm a beginner to Python, so please bear with me. > > Is there a way of guarenteeing that all created threads in a program > > are finis

Re: urllib working differently when run from crontab

2008-04-13 Thread Jonathan Gardner
On Apr 13, 8:50 pm, VictorMiller <[EMAIL PROTECTED]> wrote: > I've written a python script which, using urllib, and urllib2 will > fetch a number of files that that I'm interested in from various > websites (they're updated everyday).  When I run the script from my > command line everything works a

Interesting timing issue I noticed

2008-04-14 Thread Jonathan Shao
The project I'm working on is motion detection, involving a bit of image processing. No worries: no image processing background needed. Suffice to say that I initially wrote a script that goes through every pixel of a 320x240 picture (turned into an array using PIL) and performs some calculatiosn.

Re: Interesting timing issue I noticed

2008-04-15 Thread Jonathan Shao
I've written up a stripped down version of the code. I apologize for the bad coding; I am in a bit of a hurry. import random import sys import time sizeX = 320 sizeY = 240 borderX = 20 borderY = 20 # generates a zero matrix def generate_zero(): matrix = [[0 for y in range(sizeY)] for x in ra

Interesting timing issue I noticed

2008-04-16 Thread Jonathan Shao
*Gabriel Genellina* gagsl-py2 at yahoo.com.ar *Wed Apr 16 08:44:10 CEST 2008* > Another thing would be to rearrange the loops so the outer one executes less times; if you know that borderX<-- http://mail.python.org/mailman/listinfo/python-list

Re: I just killed GIL!!!

2008-04-17 Thread Jonathan Gardner
On Apr 16, 5:37 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > One single process of CPython is using all the cpu power > of my dual-core laptop. Are they stuck in a while loop, waiting for their resource to become available? Using 100% of the CPU is a bug, not a feature. If you can't rewrite your

Re: I just killed GIL!!!

2008-04-17 Thread Jonathan Gardner
On Apr 17, 1:18 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Apr 17, 3:37 am, Jonathan Gardner <[EMAIL PROTECTED]> > wrote: > > If you can't rewrite > > your algorithm to be disk or network bound, next optimization step is > > C. > > I'm sor

Re: I just killed GIL!!!

2008-04-17 Thread Jonathan Gardner
On Apr 17, 6:40 am, Steve Holden <[EMAIL PROTECTED]> wrote: > I'd love to be wrong about that, but the GIL *has* been the subject of > extensive efforts to kill it over the last five years, and it has > survived despite the best efforts of the developers. > To add to that... In my mind, I see thr

Re: I just killed GIL!!!

2008-04-17 Thread Jonathan Gardner
On Apr 17, 8:19 am, sturlamolden <[EMAIL PROTECTED]> wrote: > > An there you have the answer. It's really very simple :-) > That's an interesting hack. Now, how do the processes communicate with each other without stepping on each other's work and without using a lock? Once you get that solved,

Re: I just killed GIL!!!

2008-04-17 Thread Jonathan Gardner
On Apr 17, 9:48 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On Apr 17, 5:46 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > > Have you tackled the communication problem? The way I see it, one > > interpreter cannot "see" objects created in the other because they > > have separate pools of ... e

help with docutils

2008-04-17 Thread Jonathan Lukens
I am trying generate html from a reST document, both the body of the document and a table of contents, each contained in separate variables. I had initially assumed that there would be a 'toc' key in publish_parts, but apparently there is not. Is there a relatively easy way to achieve this? -- h

Re: How to find the parent of an old-style class?

2008-04-24 Thread Jonathan Gardner
On Apr 24, 7:16 am, Jasper <[EMAIL PROTECTED]> wrote: > I'm stuck using a library based on old style classes, and need to find > a class's parent at runtime. > > With new style classes you can use .__base__ to inspect a parent, but > I can't remember how this was done in days of yore, before object

Re: function that accepts any amount of arguments?

2008-04-24 Thread Jonathan Gardner
On Apr 24, 5:28 am, malkarouri <[EMAIL PROTECTED]> wrote: > > What's wrong with raising ZeroDivisionError (not stopping the > exception in the first place)? > Because when I use your module, call avg (or mean) without args, I should see an error that says, "Hey, you have to pass at least one value

Generating test data from an XML Schema

2008-09-17 Thread Jonathan Fine
ting the schema would probably be quite helpful. Has anyone seen anything that might help generate test data from a schema? -- Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Generating test data from an XML Schema

2008-09-17 Thread Jonathan Fine
ce I'll look at these tools, in case they can help me. Thank you for the suggestion. -- Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Tkinter setting alpha

2008-10-03 Thread Jonathan Hayward
h (ideally) fading in and out? 2: If I go with Tkinter, how can I port lines like those quoted above to be able to get and set a Frame's alpha value? -- -- Jonathan Hayward, [EMAIL PROTECTED] ** To see an award-winning website with stories, essays, artwork, ** games, and a four-dimensional maze, w

Re: Using len()

2006-03-11 Thread Jonathan Gardner
Methinks you are confused about the structure of your program. If we write the program out in plain English in the form of a recipe, it should look something like this: 1. Get input. 2. Check to see if they guessed right. 3. If not, go back to 1. This structure hints at an infinite loop. The bre

Re: why no block comments in Python?

2006-03-11 Thread Jonathan Gardner
Warby wrote: > ...and I forgot to mention that the output of grep and diff is far more > understandable in the absence of block comments! Which is why people do this /anyway/. (Kind of makes block comments pointless, doesn't it? /* This is a * really * really * long * block comment */ -- h

xmlrpclib and carriagereturn (\r)

2006-03-17 Thread Jonathan Ballet
;\n\n testmethod\n \n\n \n bla\n\rbla\n\r bla\n \n\n \n""" >>> >>> xmlrpclib.loads(data) (('bla\n\nbla\n\n\tbla',), u'testmethod') >>> ... whereas I expected to have (('bla\n\rbla\n\r\tbla',), u'testmethod') It seems to be a rather strange comportement from xmlrpclib. Is it known ? So, what happens here ? How could I solve this problem ? Thanks for any answers, Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: xmlrpclib and carriagereturn (\r)

2006-03-18 Thread Jonathan Ballet
Le Sat, 18 Mar 2006 02:17:36 -0800, Ben Cartwright a écrit : > Jonathan Ballet wrote: >> The problem is, xmlrpclib "eats" those carriage return characters when >> loading the XMLRPC request, and replace it by "\n". So I got "bla\n\nbla". >> >

Re: xmlrpclib and carriagereturn (\r)

2006-03-18 Thread Jonathan Ballet
Le Sat, 18 Mar 2006 08:54:49 +0100, Fredrik Lundh a écrit : > Jonathan Ballet wrote: > [snip] > > XMLRPC is XML, and XML normalizes line feeds: > > http://www.w3.org/TR/2004/REC-xml-20040204/#sec-line-ends > > relying on non-standard line terminators in text is

Re: whats your favourite object relational mapper?

2006-03-19 Thread Jonathan Ellis
t's significantly more sophisticated than the others, and it's already quite usable and even stable (if the 0.1.3 to 0.1.4 transition is any indication), although I think technically still alpha. -Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: whats your favourite object relational mapper?

2006-03-20 Thread Jonathan Ellis
Giovanni Bajo wrote: > Jonathan Ellis wrote: > > > ... which, of course, goes to show how stupid a metric this is, now > > that even Ian Bicking has admitted that SqlObject in its current form > > is a dead end. > > > Got a pointer? http://blog.ianbicki

Re: whats your favourite object relational mapper?

2006-03-20 Thread Jonathan Ellis
ce you can always pick up the pieces yourself, but it's clear the 0.x series is not a place to expect much in the way of new developments from its author. -Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Dictionaries in Sets - dict objects are unhashable?

2006-03-21 Thread Jonathan Gardner
Welcome to Python, where all types are either static (and thus hashable) or volatile (and thus not hashable.) The way hash tables work (which is what powers the set and dict types), you have to be able to get a number from an instance of the type, with the following conditions true: (1) Every equ

Re: Threads and sys.excepthook

2006-03-28 Thread Jonathan Ellis
rfectly. Looks like the interpreter is shutting down before all the exception processing finishes. -Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: MOO meets Python

2006-04-03 Thread Jonathan Ellis
Aahz wrote: > http://playsh.org/ > http://sourceforge.net/projects/playsh Damn, I thought you meant MOO as in Master of Orion. -Jonathan -- http://mail.python.org/mailman/listinfo/python-list

os.execvp() is giving me trouble

2006-04-07 Thread Jonathan Crowell
Hi All, Sorry if this is a newbie question.  I promise I have RTFMed, though. Here goes: I'm trying to invoke an external program from python.  The program is jar.exe, which is part of java.  The following is the command I want to send: jar -xvf file1.jar jile2.jar file3.jar os.execvp(file, a

calling the java jar utility from python

2006-04-07 Thread Jonathan Crowell
Hi.  I want to invoke the java jar utility from my python script and pass it a couple of arguments.  Can anyone tell me how to do this? Thanks, Jon -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error

Re: Why aren't these more popular (Myghty & Pylons)?

2006-04-15 Thread Jonathan Ellis
ike it, but I would really like to > hear from people (if there are such) using it in real world > applications... http://techspot.zzzeek.org/index.php?/archives/7-Bittorrent.com,-running-Myghty-Again.html -Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Anything equivalent to cassert in C++?

2009-11-27 Thread Jonathan Hartley
On Nov 26, 6:08 pm, Jean-Michel Pichavant wrote: > Peng Yu wrote: > > There are some assertion code (testing if a condition is false, if it > > is false, raise an Error object) in my python, which is useful when I > > test my package.  But such case would never occur when in the produce > > code.

top-like behavior

2009-11-30 Thread Jonathan Haddad
Is there a specific library used for displaying up to date consoles in the same way top behaves? Thanks in advance, Jon -- http://mail.python.org/mailman/listinfo/python-list

Re: top-like behavior

2009-11-30 Thread Jonathan Haddad
ode for "iotop"[2] which would make a good > example (it's a "top"-like program written in Python, used for monitoring > I/O transactions on a per-process basis) > > > -tkc > > > [1] > http://www.mail-archive.com/[email protected]/msg23499

Re: Bored.

2009-11-30 Thread Jonathan Gardner
On Nov 30, 2:14 pm, Necronymouse wrote: > Hello, I am learning python for about 2 years and I am bored. Not with > python but I have a little problem, when i want to write something I > realise that somebody had alredy written it! So i don´t want to make a > copy of something but i wanna get bette

Re: Python without wrapper script

2009-12-03 Thread Jonathan Hartley
On Dec 2, 4:12 pm, Ulrich Eckhardt wrote: > eric.frederich wrote: > > Is there a way to set up environment variables in python itself > > without having a wrapper script. > > Yes, sure, you can set environment variables... > > > The wrapper script is now something like > > > #!/bin/bash > > >

Re: Python without wrapper script

2009-12-03 Thread Jonathan Hartley
On Dec 3, 3:13 pm, Jonathan Hartley wrote: > On Dec 2, 4:12 pm, Ulrich Eckhardt wrote: > > > > > eric.frederich wrote: > > > Is there a way to set up environment variables in python itself > > > without having a wrapper script. > > > Yes, sure, you

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-17 Thread Jonathan Hartley
he msvc runtime 9.0 dll? (for Python 2.6.4) Malcome said: > (I assume I need just a matching pair of MSVCR90.DLL and MSVCP90.DLL?) 5) Whatwhatwhat again? More than one DLL is required? Are there ever any more than these two? Sorry to be dense. Terse links to useful sources of information appreciated. I've read the whole py2exe wiki and been googling the last hour. Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-21 Thread Jonathan Hartley
On Dec 17, 8:39 pm, Christian Heimes wrote: > Jonathan Hartley wrote: > > Only this week I sent a py2exe-derived executable to someone else (a > > non-developer) and it would not run on their WinXP machine ("'The > > system cannot execute the specified pr

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-21 Thread Jonathan Hartley
On Dec 17, 11:16 pm, Mark Hammond wrote: > On 18/12/2009 7:44 AM, Ross Ridge wrote: > > > The "P" DLL is for C++ and so the original poster may not actually need > > it.  I'm pretty sure Python itself doesn't need it, and py2exe shouldn't > > either, but wxPython, or more precisely wxWidgets, almo

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-24 Thread Jonathan Hartley
On Dec 21, 2:56 pm, Ross Ridge wrote: > Jonathan Hartley   wrote: > > >Many thanks for that, but my issue is that my programs work fine for > >me on my computer - but then fail on other people's computers. I'd > >very strongly prefer for my user

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-26 Thread Jonathan Hartley
On Dec 26, 3:14 pm, Ross Ridge wrote: > Jonathan Hartley   wrote: > > >Am I right to infer that if I want to distribute a py2exe'd > >application legally, and have half a chance of it working on a non- > >developer's machine, then I have to: > &

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread Jonathan Hartley
On 27/12/2009 05:18, Stephen Hansen wrote: Jonathan Hartley mailto:[email protected]>> writes: These are non-technical users, so I'd rather send them a single executable that 'just works', [break] rather than asking them to install Python and then

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread Jonathan Hartley
On Dec 27, 1:51 pm, [email protected] wrote: > Hi Martin, > > > You'll need to include Microsoft.VC90.CRT.manifest and msvcr90.dll. > > Thank you for your answers. From my research and testing on this topic: > > 1. Can I safely place these 2 files in the same folder as my Py2exe > generated EXE fi

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread Jonathan Hartley
On Dec 29, 2:24 pm, Jonathan Hartley wrote: > On Dec 27, 1:51 pm, [email protected] wrote: > > > > > Hi Martin, > > > > You'll need to include Microsoft.VC90.CRT.manifest and msvcr90.dll. > > > Thank you for your answers. From my research and testin

Re: Which version of MSVC?90.DLL's to distribute with Python 2.6 based Py2exe executables?

2009-12-29 Thread Jonathan Hartley
On 29/12/2009 18:31, [email protected] wrote: Jonathan, I'm going to try to run vcredist_x86.exe automatically (as opposed to asking my users to download and run it manually). I don't currently have any installer, so I'm going to run vcredist_x86.exe on my application start

<    1   2   3   4   5   6   7   >