Warning: this post contains arcane knowledge.
Steve Holden wrote:
> praba kar wrote:
>> Python 2.3 creates byte code with *.pyc
>> extention. But Python 2.4 creates bytes code with
>> *.pyo. Is there any difference between *.pyc
>> and *.pyo?.
>>
> Yes. The .pyo files are optimized by remo
On 12 Jul 2005 08:28:45 -0700
"Devan L" <[EMAIL PROTECTED]> wrote:
[ here's some context:
> > I've been playing with a function that creates an anonymous function by
> > compiling a string parameter, and it seems to work pretty well:
> >
> > def fn( text):
> > exec 'def foo' + text.st
Robert wrote:
> Hello
>
> I have created a tool in Python 2.3 under WinXP
> Now I extended this tool and now my tool makes Python crash. I see Dr Watson
> showing a stacktrace.
> This tool also uses wxPython.
>
> Dr Watson says:
> AppName: python.exe
> AppVer: 0.0.0.0
> ModName: python23.dll
> Mo
Mike C. Fletcher a écrit :
> bruno modulix wrote:
>
>> Mike C. Fletcher wrote:
>> (snip)
>>
>>
>>> Though the don't go into extreme detail on decorators (they are
>>> basically syntactic sugar for a particular type of descriptor).
>>>
>>>
>>
>> Err... Could you elaborate on this ? Decorators
Diez B. Roggisch wrote:
>> Does anyone know of any other "gotchas" with eval() I have not found? Or
>> is eval() simply too evil?
>
>
> Yes - and from what I can see on the JSON-Page, it should be _way_
> easier to simply write a parser your own - that ensures that only you
> decide what pytho
"Xah Lee" <[EMAIL PROTECTED]> writes:
[the usual]
+---+ .:\:\:/:/:.
| PLEASE DO NOT |:.:\:\:/:/:.:
| FEED THE TROLLS | :=.' - - '.=:
| | '=(\ 9 9 /)='
| Thank you,
I would like to be able to write something like:
import dcw as dw
import xyz as dw
such that the 'dw' namespace includes definitions from both dcw and xyz,
but in the script above names from dcw1 are lost. How can I combine the
two? (I'd rather not use 'import *'.) Thanks.
Best regards,
Donnal
> +---+ .:\:\:/:/:.
> | PLEASE DO NOT |:.:\:\:/:/:.:
> | FEED THE TROLLS | :=.' - - '.=:
> | | '=(\ 9 9 /)='
> | Thank you, | ( (_) )
>
Dear All
What i want to do is , my input is like
0 2
0 3
0 4
1 2
1 4
2 3
3 4
I am comparing and put the number in group , like ,the first three lines
, all has zero as first input for each line, so the out put should look
like
0 2 3 4
and so on
1 2 4
2 3
3 4
I managed to do what i need , but i
[EMAIL PROTECTED] wrote:
> Hi!
>
> I was wondering what can I do to print the name of a list that is
> inside a list. For example:
>
>
> exported = ['123','456']
> imported = ['789','012']
>
> client1 = ['cl1b','cl1a']
> client2 = ['cl2a','cl2b']
>
> host = ['imported','exported']
> client = [
On Mon, 22 Aug 2005, jan V wrote:
> Please don't use ASCII art... not everyone uses a fixed-width font for his
> newsreader...
Then I humbly submit thet they are using broken and/or badly
configured readers. ;-)
--
Rich Teer, SCNA, SCSA, OpenSolaris CAB member
President,
Rite Onli
Paul Rubin wrote:
> Mike Meyer <[EMAIL PROTECTED]> writes:
>> Even simpler to program in is the model used by Erlang. It's more CSP
>> than threading, though, as it doesn't have shared memory as part of
>> the model. But if you can use the simpler model to solve your problem
>> - you probably shoul
Dear all
Sorry , I confused between two things , what i said in the last e-mail i
already managed to do using C code , But what i need to do using python
is : my input data :
0 2 3 4
1 2 4
2 3
3 4
what i suppose to do is , using the first line and start searching
number by number ,first i hav
Rich Teer wrote:
> On Mon, 22 Aug 2005, jan V wrote:
>
>
>>Please don't use ASCII art... not everyone uses a fixed-width font for his
>>newsreader...
>
>
> Then I humbly submit thet they are using broken and/or badly
> configured readers. ;-)
>
Not to mention the fact that if they
Jim Washington wrote:
> 4. List comprehensions might be troublesome, though it's not clear to me
> how a DoS or exploit is possible with these.
see item 1.
> Or is eval() simply too evil?
yes.
however, running a tokenizer over the source string and rejecting any string
that contains unknown t
Robert Kern wrote:
> Paul Rubin wrote:
>
>>Robert Kern <[EMAIL PROTECTED]> writes:
>>
>>
>http://www.catb.org/~esr/faqs/smart-questions.html
Is it a *smart* way or *necessary* way?
>>>
>>>It's the polite way. And probably the only way you're going to get
>>>your questions actually ans
Russell E. Owen wrote:
>>>The current issue is associated with Tkinter. I'm trying to create a tk
>>>callback function that calls a python "function" (any python callable
>>>entity).
>>>
>>>To do that, I have to create a name for tk that is unique to my python
>>>"function". A hash-like name would
...If the answer is Yes, can you give me an example either in the
server side and the client side?
I googled a lot, but I can't find nothing regarding this.
A lot of thanks.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
km wrote:
> Hi all,
>
> Why is it that the implementation of empty loop so slow in python when
> compared to perl ?
>
> #i did this in python (v 1.5)
> for x in xrange(1000):
> print x
> # this took 0.017 seconds
> --
> #similar code in perl (v 5.6):
> for $x (0..1
> If you want a fast language, try Holden. I've just invented it.
> Unfortunately it gets the answer to every problem wrong unless the
> answer is 42, but boy it runs quickly.
+1 QOTW
(sometimes the zen master has to whack the student on the head)
Peace
Bill Mill
bill.mill at gmail.com
--
http:
Mohammed Altaj <[EMAIL PROTECTED]> wrote:
>
> Dear All
>
> What i want to do is , my input is like
> 0 2
> 0 3
> 0 4
> 1 2
> 1 4
> 2 3
> 3 4
>
> I am comparing and put the number in group , like ,the first three lines
> , all has zero as first input for each line, so the out put should look
> li
km a écrit :
> Hi all,
>
> ya i am sorry i tried with an empty loop first and then one which emits a
> value as the snippet. I have tested it on my machine and now ...
>
> 1) perl (v 5.8) does the job in 0.005 seconds
> 2) but python (v 2.4.1) is horribly slow its 0.61 seconds.
> and using ran
On 22 Aug 2005 11:43:09 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote or
quoted :
>the unix morons, think that the world should truncate lines just like
>their incompetent operating system silently truncate lines (and it
>still DOES, folks! e.g. ps, tar, tcsh.) Around 1998 when i was using
>Outlook E
Hello group, I'm new to Python and have a couple of beginner questions that
I'm hoping someone can answer.
1. Is python something that you would recommend using for server side web
programming? Something like C# or Java? If so, are there any resources
that you could point me to that would help m
Mohammed Altaj wrote:
> Dear All
>
> What i want to do is , my input is like
> 0 2
> 0 3
> 0 4
> 1 2
> 1 4
> 2 3
> 3 4
>
> I am comparing and put the number in group , like ,the first three lines
> , all has zero as first input for each line, so the out put should look
> like
> 0 2 3 4
> and so o
km wrote:
>>thing. If *all* your loops are going to do is print stuff, then you're
>>doing the right thing with the version that "emits values".
>
> ya most of the loops print values.
No, you missed my point. I said if *all* the loops are going to do is
print stuff. In other words, no other
"dcrespo" wrote:
> ...If the answer is Yes, can you give me an example either in the
> server side and the client side?
>
> I googled a lot, but I can't find nothing regarding this.
the XML-RPC specification
http://www.xmlrpc.com/spec
mentions the following data types
four-byte signed i
Hi !
The size of a image is an element ; but resolution is another. It is the
link, between the image and the reality. Size AND resolution can to give the
scale.
Exemple : when you scan a document, the size (in pixels) is not sufficient,
for to reproduce the document. Size + resolution, yes.
km wrote:
> Also the first thing any newbie to python asks me is abt "raw speed
> in comparison with similar languages like perl" when i advocate
> python to perl.
Always the same chorus... Just tell the newbies that speed is not on
their top list.
If most of the world's computer programs wh
Donnal Walter wrote:
> I would like to be able to write something like:
>
> import dcw as dw
> import xyz as dw
>
> such that the 'dw' namespace includes definitions from both dcw and xyz,
> but in the script above names from dcw1 are lost. How can I combine the
> two? (I'd rather not use 'impo
Peter Hansen wrote:
> from path import path
> path('myfile').touch()
import os
os.utime('myfile', None)
is a bit shorter, of course.
>>> help(os.utime)
Help on built-in function utime:
utime(...)
utime(path, (atime, utime))
utime(path, None)
Set the access and modified time of the
42 wrote:
> I was planning on "sanitizing" the language instead of relying on rexec
> and bastion so issues with them shouldn't be relevant.
I think in dealing with security, deciding what might be relevant before
you fully understand the problem is somewhat premature... but it's your
neck. :-)
Donnal Walter wrote:
>I would like to be able to write something like:
>
> import dcw as dw
> import xyz as dw
>
> such that the 'dw' namespace includes definitions from both dcw and xyz,
> but in the script above names from dcw1 are lost. How can I combine the
> two? (I'd rather not use 'import *'
"Joe T." wrote:
> 2. I know there's a Jpython but what use would I get from using Python
> with
> Java? If I'm already familiar with Java programming why would I want to
> use
> Python with Java?
see, e.g.
http://www.onjava.com/pub/a/onjava/2002/03/27/jython.html
http://www.javaworld
[Please mail followups to [EMAIL PROTECTED]
The PEP has been rewritten based on a suggestion by Guido to change
str() rather than adding a new built-in function. Based on my
testing, I believe the idea is feasible. It would be helpful if
people could test the patched Python with their own applic
km wrote:
> Hi all,
>
>> thing. If *all* your loops are going to do is print stuff, then you're
>> doing the right thing with the version that "emits values".
>
> ya most of the loops print values.
In that case, you are interested in IO performance. The time spent handling
the loop is not sign
Steve Holden wrote:
> Robert Kern wrote:
>>Coincidentally, those are exactly the reasons why I posted it in the
>>first place. I care not a whit about decluttering the newgroup, an
>>impossible task.
>
> It's clear that you care not a whit about it. Unfortunately the only way
> to preserve ban
"km" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I agree that python emphasizes on readability which i didnt see in many
> of the languages, but when the application concern is speed, does it
> mean that python is not yet ready? even most of the googling abt python
Funny you sh
In article <[EMAIL PROTECTED]>, jan V
<[EMAIL PROTECTED]> writes
>> +---+ .:\:\:/:/:.
>> | PLEASE DO NOT |:.:\:\:/:/:.:
>> | FEED THE TROLLS | :=.' - - '.=:
>> | | '=(\ 9 9 /)
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
says...
> 42 wrote:
> > I was planning on "sanitizing" the language instead of relying on rexec
> > and bastion so issues with them shouldn't be relevant.
>
> I think in dealing with security, deciding what might be relevant before
> you fully u
On Monday 22 August 2005 03:51 pm, Joe T. wrote:
> 1. Is python something that you would recommend using for server side web
> programming? Something like C# or Java? If so, are there any resources
> that you could point me to that would help me with server side python
> programming for dynamic h
Wow, thanks.that's a neat little functionI'll still check out
the dictionary stuff. For now, this helps a lot though...
THANKS!!!
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> Peter Hansen wrote:
>>from path import path
>>path('myfile').touch()
>
> import os
> os.utime('myfile', None)
>
> is a bit shorter, of course.
And, depending on your needs, quite ineffective:
>>> import os
>>> os.utime('missing.file', None)
Traceback (most recent call l
I'm sorry, I didn't the right question... Of course that I can break
the file and rewrite it on an xmlrpc protocol for transmition, or send
a byte each time through the socket lib. I meant is there a program
already developed that sends and receives files based on xmlrpc calls?
Thanks.
--
http:/
"jan V" <[EMAIL PROTECTED]> writes:
>> +---+ .:\:\:/:/:.
>> | PLEASE DO NOT |:.:\:\:/:/:.:
>> | FEED THE TROLLS | :=.' - - '.=:
>> | | '=(\ 9 9 /)='
>> | Thank you,
On Mon, 22 Aug 2005, Grant Edwards wrote:
> On 2005-08-22, Magnus Lycka <[EMAIL PROTECTED]> wrote:
>
>>> Hi, I'm working on a project were a need to be able to upload firmware
>>> to a microcontroller based Ethernet device. But because of the memory
>>> constraints the controller can only handle
> Another thing you can do is use the compile message and then only allow
> certain bytecodes. Of course this approach means you need to implement
> this in a major version-dependent fashion, but it saves you the work of
> mapping source code to python. Eventually there will be another form
> ava
On Mon, 22 Aug 2005, Steve Holden wrote:
> Tom Anderson wrote:
>
>> On Sun, 21 Aug 2005, John Walton wrote:
>>
>>> Hello, everyone. I just began school, and they already assigned us
>>> science fair. Since I'm in 8th grade, I get to do demonstrations for our
>>> projects. I'm probably going t
Peter Hansen wrote:
> And, depending on your needs, quite ineffective:
>
> >>> import os
> >>> os.utime('missing.file', None)
> Traceback (most recent call last):
> File "", line 1, in ?
> OSError: [Errno 2] No such file or directory: 'missing.file'
>
> >>> from path import path
> >>> path('miss
Well, I can do this using WMI thru VBScript for Windows-Windows
connections. What I would like is a method using python for both
Windows-Windows and Linux-Windows connections. I've looked at pyWMI
(http://tgolden.sc.sabren.com/python/wmi.html), and found it unclear in
it's dealings with remote boxe
Keith Thompson wrote:
> "Xah Lee" <[EMAIL PROTECTED]> writes:
> [the usual]
At least he noticed that tar sucks. There's nothing better than tarring
your backup back to disk, only to notice that the pathnames were "too
long." Great!
--
I believe in Karma. That means I can do bad things to pe
"dcrespo" wrote:
> I'm sorry, I didn't the right question... Of course that I can break
> the file and rewrite it on an xmlrpc protocol for transmition, or send
> a byte each time through the socket lib. I meant is there a program
> already developed that sends and receives files based on xmlrpc c
On Mon, 22 Aug 2005 22:12:25 +0200, Fredrik Lundh wrote:
> however, running a tokenizer over the source string and rejecting any string
> that contains unknown tokens (i.e. anything that's not a literal, comma,
> colon,
> or square or curly bracket) before evaluation might be good enough.
>
> (y
Fredrik Lundh wrote:
> Peter Hansen wrote:
>>I guess it depends on whether "touch" implies creation-when-missing, as
>>with the command line version, or just updating the time.
>
> the OP wanted "to update the modification time of a file without actually
> modifying it". os.utime does exactly tha
"Benjamin Niemann" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> km wrote:
>
>> Hi all,
>>
>>> thing. If *all* your loops are going to do is print stuff, then you're
>>> doing the right thing with the version that "emits values".
>>
>> ya most of the loops print values.
>
> In th
> "Robert" == Robert Kern <[EMAIL PROTECTED]> writes:
Robert> Greg McIntyre wrote:
>> The 2nd option has real potential for me. Although the total
>> amount of code is greater, it factors out some complexity away
>> from the actual job, so that code is not obscured by
>> un
Glad to hear that my efforts to cover some of 2.3's release features in
a mostly-2.2 book were appreciated. I'm probably going to do the same
thing for the 2nd edition of the Nutshell: wait until 2.5 alpha's out
so I can mention _its_ feechurz in a mostly-2.4 book... meaning the 2nd
ed of the Nuts
One of my most popular talks is "re-learning Python" -- can be anywhere
between 1 and 4 hours, depending on level of detail -- it's all about
the changes 1.5.2 -> today's Python, why they came about and why you
would want to use them...
Alex
--
http://mail.python.org/mailman/listinfo/python-lis
Peter Hansen wrote:
> Fredrik Lundh wrote:
>
>>Peter Hansen wrote:
>>
>>>I guess it depends on whether "touch" implies creation-when-missing, as
>>>with the command line version, or just updating the time.
>>
>>the OP wanted "to update the modification time of a file without actually
>>modifying i
> Someone recently produced a distribution capable of running from a CD
> and designed to make it easy to use Python on machines where it wasn't
> actually installed. That might be a useful starting point too, but I
> can't find the right incantation to get Google to bring it up.
>
> regards
>
John Hunter wrote:
>>"Robert" == Robert Kern <[EMAIL PROTECTED]> writes:
>
> Robert> Greg McIntyre wrote:
> >> The 2nd option has real potential for me. Although the total
> >> amount of code is greater, it factors out some complexity away
> >> from the actual job, so that code
> On the other hand, if you've already
planned another pass over the code, that might be the time to look
into this.
Exactly. And when I do that pass I will definitely try buffering the
data 10 or 100 meg at a time before entring the 1 char-at-a-time loop,
or using mmap to similar ends.
--
http:
Bryan wrote:
>>Someone recently produced a distribution capable of running from a CD
>>and designed to make it easy to use Python on machines where it wasn't
>>actually installed. That might be a useful starting point too, but I
>>can't find the right incantation to get Google to bring it up.
>>
[EMAIL PROTECTED] wrote:
> One of my most popular talks is "re-learning Python" -- can be anywhere
> between 1 and 4 hours, depending on level of detail -- it's all about
> the changes 1.5.2 -> today's Python, why they came about and why you
> would want to use them...
>
>
> Alex
>
PyCon TX 2006
42 wrote:
> FWIW I've already given up on making python secure. I agree that odds
> are extremely high that I've missed something. I'm just curious to see
> what one of the holes I left is, preferably without wading through
> hundreds of pages :)
f = [x for x in [].__class__.__bases__[0].__subc
Ramza Brown wrote:
> Steve M wrote:
>
>>
> Also, py2exe will work '100%' without a host python install. I have
> never used it. I have my doubts though?
>
Yes it sure does. I have distributed at least 3 different standalone
python programs using py2exe and I can absolutely garuntee that the
Would you consider releasing an ebook in the mean time?
[EMAIL PROTECTED] wrote:
>Glad to hear that my efforts to cover some of 2.3's release features in
>a mostly-2.2 book were appreciated. I'm probably going to do the same
>thing for the 2nd edition of the Nutshell: wait until 2.5 alpha's out
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> 42 wrote:
> > FWIW I've already given up on making python secure. I agree that odds
> > are extremely high that I've missed something. I'm just curious to see
> > what one of the holes I left is, preferably without wading through
> > h
Peter Hansen wrote:
> You've quoted selectively. He also said "Unix-style 'touch'", from
> which one could quite legitimately infer
nope. read his post again.
--
http://mail.python.org/mailman/listinfo/python-list
Dear Pythoneer,
I'm thinking of making a class out of an rdbms table name(let's
say oracle).
I can dynamically query the column names and their datatypes from
oracle. So at runtime can i create a class object that creates a class
for example employee with methods that can manipulate that table
km wrote:
> Is python runtime slow at all aspects when compared to perl ?
And in addition to all that everyone else has said most of this is
startup time. The python interpreter is a fair bit slower to start up
(i.e. does much more at startup time) than the perl one:
> lenford$ time pyth
I also use Python to access database on Windows.
You can speed up your program by doing that:
Open PythonWin, then click on the "Tools" menu and the item "COM Makepy
Utility".
It will display all libraries available.
Then, select "Microsoft ActiveX Data Objects 2.7 Library" or whatever
last versio
"jan V" <[EMAIL PROTECTED]> wrote:
> > +---+ .:\:\:/:/:.
> > | PLEASE DO NOT |:.:\:\:/:/:.:
> > | FEED THE TROLLS | :=.' - - '.=:
> > | | '=(\ 9 9 /)='
> > | Thank
I try to use python as the language in an asp page with Microsoft IIS
5.0.
I have these two files, req_bad.asp and req_ok.asp
-- req_bad.asp -
<[EMAIL PROTECTED]>
<%
# il y a un problème ici
Response.write('Hello')
%>
-
-- req_ok.asp --
Russell E. Owen wrote:
> I have several situations in my code where I want a unique identifier
> for a method of some object (I think this is called a bound method). I
> want this id to be both unique to that method and also stable (so I can
> regenerate it later if necessary).
>>> def persistent_
101 - 175 of 175 matches
Mail list logo