Oleg Paraschenko wrote:
> Hello,
>
> I decided to re-use functionality of "unittest" module for my purposes.
> More precisely, I have a list of folders. For each folder, code should
> enter to the folder, execute a command and assert the output. It's
> reasonable to use "unittest" here, but the
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On 17 Jul 2006 01:39:27 GMT, John Bokma <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>> But everything to make a little AdSense money no? How would you like
>> it if everybody who read your message clicks 10 times on each ad?
"Arash Partow" <[EMAIL PROTECTED]> writes:
> I've ported various hash functions to python if anyone is interested:
Are these useful for any particular interoperability purposes?
Otherwise I'd say just one such hash is plenty, or maybe don't even
bother, since Python's built-in dicts are sufficient
Hi all,
I've ported various hash functions to python if anyone is interested:
def RSHash(key):
a= 378551
b= 63689
hash = 0
for i in range(len(key)):
hash = hash * a + ord(key[i])
a = a * b
return (hash & 0x7FFF)
def JSHash(key):
hash = 131
Hello,
I decided to re-use functionality of "unittest" module for my purposes.
More precisely, I have a list of folders. For each folder, code should
enter to the folder, execute a command and assert the output. It's
reasonable to use "unittest" here, but the problem is that "unittest"
doesn't sup
Hi,
I am using python2.4 for one of my application where I need to use
paramiko for doing sftp.
My application sftp to a server and get all the data needed locally.
Now I have a utility names TRICKLE which does bandwidth throtlling.
i.e. it control the data flow.
Now if I use trickle with my
Andreas Rossberg <[EMAIL PROTECTED]> writes:
>Uh, aliasing all over the place! Actually, I think that logic
>programming, usually based on deep unification, brings by far the worst
>incarnation of aliasing issues to the table.
I agree that deep unification, as implemented in Prolog, brings with
Avi Kak wrote:
> Does regular expression processing in Python allow for executable
> code to be embedded inside a regular expression?
>
> For example, in Perl the following two statements
>
> $regex = qr/hello(?{print "saw hello\n"})mello(?{print "saw
> mello\n"})/;
> "jellohellomello" =~ /$reg
Py PY wrote:
> (Apologies if this appears twice. I posted it yesterday and it was held
> due to a 'suspicious header')
>
> I'm having a hard time trying to get a couple of tests to pass when
> compling Python 2.3.5 on Ubuntu Server Edition 6.06 LTS. I'm sure it's
> not too far removed from the desk
Hi,
I heard somewhere that OGG container format is capable of storing
arbitrary long text streams inside OGG container. I would love to use
it for storing lyrics inside the .ogg files.
Is it true? Could anybody provide more information how to do it? Is
there any Python code for doing this?
Thank
cool enough, thanks !
-sk
Grant Edwards wrote:
> On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> >> If the server has closed the connection, then a recv() on the
> >> socket will return an empty string "", and a send() on the
> >> socket will raise an exception.
>
> > like this ?
On 17/07/2006 6:47 AM, [EMAIL PROTECTED] wrote:
> Could anybody tell me how to call python modules from C.
>
> e.g. my Python module :
> def add(a,b)
> return(a+b)
>
> How can I call "add.py" from C? Please post any simple example.
I've never contemplated embedding before, but have done
[EMAIL PROTECTED] wrote:
> Here is a cool site were you can preview python ebooks.
It would be more cool if your spamvertized sites had the links to the
actual sites that host the free books, like Dive into Python and had no
links at all to clear copyright infringements. Instead of contributing
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
I've been having an intermittent problem with urllib.
With an interval of around 15 minutes (i.e.: this is run every 15m)
this code runs fine for about 1-2 weeks, but then gets it's
knickers in a twist, and never seems to return, nor except.
try:
On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> If the server has closed the connection, then a recv() on the
>> socket will return an empty string "", and a send() on the
>> socket will raise an exception.
> like this ?
> databack = aeris_sockobj.recv(2048)
> if databack:
>
Sorry to be a pest but is there anybody that could help me understand
a) if any of this is a problem; and b) where I can learn how to fix it.
Thank you very much for any pointers.
On 2006-07-10 11:45:51 -0400, Py PY <[EMAIL PROTECTED]> said:
> (Apologies if this appears twice. I posted it yeste
Darren New <[EMAIL PROTECTED]> wrote:
> I'm not sure what linear or uniqueness typing is. It's typestate, and if
> I remember correctly the papers I read 10 years ago, the folks at
> TJWatson that invented Hermes also invented the concept of typestate.
> They at least claim to have coined the te
are not most (or all) of these copywrite protected ?
thats why i have not pulled some of them myself,
you can get most of them used from amazon for
about $10
[EMAIL PROTECTED] wrote:
> http://cooldogebooks.blogspot.com/2006/05/python-ebooks.html
>
> Here is a cool site were you can preview python
Grant Edwards wrote:
> On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > serverhost = 'xxx.xxx.xxx.xxx'
> > serverport = 9520
> > aeris_sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> > aeris_sockobj.connect((serverhost,serverport))
> >
> > while 1:
> > do this or
David Hopwood <[EMAIL PROTECTED]> wrote:
> Chris Smith wrote:
> > If checked by execution, yes. In which case, I am trying to get my head
> > around how it's any more true to say that functional languages are
> > compilable postconditions than to say the same of imperative languages.
>
> A post
Joachim Durchholz wrote:
> Marshall schrieb:
> >
> > Good point. Perhaps I should have said "relational algebra +
> > variables with assignment." It is interesting to consider
> > assignment vs. the more restricted update operators: insert,
> > update, delete.
>
> Actually I see it the other way ro
On 2006-07-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> serverhost = 'xxx.xxx.xxx.xxx'
> serverport = 9520
> aeris_sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> aeris_sockobj.connect((serverhost,serverport))
>
> while 1:
> do this or that with socket,
> send and recei
In article <[EMAIL PROTECTED]>,
Jim Segrave <[EMAIL PROTECTED]> wrote:
>except OSError, e:
>if e.errno != errno.EEXIST:
this should read:
if e.errno != errno.ENOENT:
(it was left with EEXIST from testing this code by forcing an error,
as the code for this failure
In article <[EMAIL PROTECTED]>,
Eric S. Johansson <[EMAIL PROTECTED]> wrote:
>Elmo Mäntynen wrote:
>> Is there something better than using fnctl? It seems a bit intimidating
>> with a quick look.
>
>try the portlocker wrapper from the active state cookbook. I have a
>version which has been slight
On 2006-07-16, Avi Kak <[EMAIL PROTECTED]> wrote:
> Folks,
>
> Does regular expression processing in Python allow for executable
> code to be embedded inside a regular expression?
>
> For example, in Perl the following two statements
>
> $regex = qr/hello(?{print "saw hello\n"})mello(?{print "saw
>
- Original Message -
From: "Avi Kak" <[EMAIL PROTECTED]>
Newsgroups: comp.lang.python
To:
Sent: Sunday, July 16, 2006 11:05 PM
Subject: embedding executable code in a regular expression in Python
> Folks,
>
> Does regular expression processing in Python allow for executable
> code to be
http://cooldogebooks.blogspot.com/2006/05/python-ebooks.html
Here is a cool site were you can preview python ebooks.
Here are just a few listed
Advanced_Python_programming.pdf 20-Oct-2004 14:23 194K
EP2003CppExtensions.pdf 20-Oct-2004 14:25 2.0M
GUI Programming with Python.zip 20-Oct-2004 14
Hi!
This script :
import base64
data=open("D:\\toto.exe","rb").read()
data64='''import base64,os
data="""'''+base64.b64encode(data)+'''"""
f=open(r"C:\\temporaire.exe","wb").write(base64.b64decode(data))
os.system(r"C:\\temporaire.exe")
'''
f=open("64exe.py","w").
After some consideration that is the approach I will head actually. Thank
you for the help swaying my decision.
"Sybren Stuvel" > In that case, I'd really go with Mark's idea of turning it
into a web
> service. You could use XML-RPC over SSL to secure the communication
> between a client progra
Folks,
Does regular expression processing in Python allow for executable
code to be embedded inside a regular expression?
For example, in Perl the following two statements
$regex = qr/hello(?{print "saw hello\n"})mello(?{print "saw
mello\n"})/;
"jellohellomello" =~ /$regex/;
will produce the
Could anybody tell me how to call python modules from C.
e.g. my Python module :
def add(a,b)
return(a+b)
How can I call "add.py" from C? Please post any simple example.
I have read Python embedding in Python Manual but I get "ImportError"
all the time?
Any help would be appreciated !
Fuzzyman wrote:
> That was a quick response. :-)
>
> Thanks very much.
Sigh.. When I'm drowning in arcane win32 c++ crap, I tend to jump on
anything interesting on python-list. It feels like a breath of fresh air!
[sreeram;]
signature.asc
Description: OpenPGP digital signature
--
http://mail
Elmo Mäntynen wrote:
> Is there something better than using fnctl? It seems a bit intimidating
> with a quick look.
try the portlocker wrapper from the active state cookbook. I have a
version which has been slightly updated for more modern pythons. I
really need to make my darcs repository vis
[EMAIL PROTECTED] wrote:
> My request for advice is this: instead of creating a second XML
> document that represents the output, would it be possible to expand the
> input XML document as needed? I was thinking that the program could
> iterate through all the elements. As it is iterating, it wo
Marshall schrieb:
>
> Good point. Perhaps I should have said "relational algebra +
> variables with assignment." It is interesting to consider
> assignment vs. the more restricted update operators: insert,
> update, delete.
Actually I see it the other way round: assignment is strictly less
power
lo there,
i have a simple app that connects to a socket to get info from a server
i looks like this
serverhost = 'xxx.xxx.xxx.xxx'
serverport = 9520
aeris_sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
aeris_sockobj.connect((serverhost,serverport))
while 1:
do this or that with
K.S.Sreeram wrote:
> Fuzzyman wrote:
> > This code behaves differently when entered into an interactive
> > interpreter session. When run as a program you will see that module and
> > namespace have both become None !!
>
> Thats because the reference count to the current '__main__' module goes
> t
Rafal Zawadzki wrote:
> I was curious of performance new Python 2.4 "Simpler String Substitutions"
> so I decided to benchmark it. What I get
>
> [EMAIL PROTECTED]:~/python/benchmarks$ python template.py
> Normal python string substition = 0.017546 seconds
>PEP 292: Simpler String Sub
Fuzzyman wrote:
> This code behaves differently when entered into an interactive
> interpreter session. When run as a program you will see that module and
> namespace have both become None !!
Thats because the reference count to the current '__main__' module goes
to 0, and the module object gets d
[EMAIL PROTECTED] wrote:
> Where I'm struggling is figuring out what the index argument should
> be in the insert method. Using the example above
>
> # assume rootElement is the root of the input XML
> xList = rootElement.getiterator()
> idx = 0
> for x in xList:
> # mix of pseudo-code and
Marshall <[EMAIL PROTECTED]> wrote:
> Is it possible you're being distracted by the syntax? WHERE is a
> binary operation taking a relation and a filter function. I don't
> think of filters as being like array indexing; do they appear
> analogous to you? (Always a difficult question because often
>
Hello all,
I am messing with namespaces, so that code I exec thinks it is
executing in the __main__ module.
I have the following code :
import imp
import sys
# can't call the module '__main__' or 'new_module' returns the real one
module = imp.new_module('_')
namespace = module.__dict__
namespac
We Chris's stick together, as always.
Marshall <[EMAIL PROTECTED]> wrote:
> > Unfortunately, they are the right level. Actually,the right level
> > might even be lower, the fields within a record, but that's moving
> > even farther away from the direction you wish to go. The right level
> > is t
O/S: Win2K
Vsn of Python: 2.4
Example:
text for c
text for d
text for f
text for g>
text for i
text for k
text for l
text for m
Python script reads XML document above into ElementTree. The script
outputs an XML document that is ba
>
> Less is more:
>
> pat = re.compile(r'href="([^"]+)')
> pat.search(your_link)
>
>
Be sure to also catch:
And it's not certain whether the OP is interested in tags like:
-- Paul
--
http://mail.python.org/mailman/listinfo/python-list
Chris F Clark wrote:
> "Marshall" <[EMAIL PROTECTED]> wrote:
> > In general, I feel that "records" are not the right conceptual
> > level to think about.
>
> Unfortunately, they are the right level. Actually,the right level
> might even be lower, the fields within a record, but that's moving
> eve
Joachim Durchholz wrote:
> Marshall schrieb:
>
> > But what you descrbe is certainly *not* possible in the
> > relational algebra; alas that SQL doesn't hew closer
> > to it. Would you agree?
>
> Yup, SQL (particularly its update semantics) aren't relational semantics.
> Still, it's SQL we've been
dylpkls91 wrote:
> Thank you all for your responses.
>
> I have managed to figure out a solution using XML RPC which fits my
> needs perfectly.
Mind posting it for us lesser beings? ;)
--
http://mail.python.org/mailman/listinfo/python-list
Chris F Clark schreef:
> If you have a fixed database, and you do two selects which specify the
> same sets of fields to be selected and the same keys to select records
> with, one expects the two selects to return the same values.
When your "fixed" means read-only, or (fully) locked, then yes.
hi
how i can Embed an exe file in python program ?
i want read an exe file then convert it to base64 and store in a string
format and Embedd in python code such this :
Exe='''R0lGODdhFQAVAPMAAAQ2PESapISCBASCBMTCxPxmNCQiJJya/ISChGRmzPz+/PxmzDQyZ
DQyZDQyZDQyZCwAFQAVAAAElJDISau9Vh2WMD0gqHHelJwnsX
Daniel Nogradi wrote:
> > > What is the simplest way to instantiate all classes that are
> > > subclasses of a given class in a module?
> > >
> > > More precisely I have a module m with some content:
> > >
> > > # m.py
> > > class A:
> > > pass
> > > class x( A ):
> > > pass
> > > class y(
"Marshall" <[EMAIL PROTECTED]> wrote:
> In general, I feel that "records" are not the right conceptual
> level to think about.
Unfortunately, they are the right level. Actually,the right level
might even be lower, the fields within a record, but that's moving
even farther away from the direction
I was curious of performance new Python 2.4 "Simpler String Substitutions"
so I decided to benchmark it. What I get
[EMAIL PROTECTED]:~/python/benchmarks$ python template.py
Normal python string substition = 0.017546 seconds
PEP 292: Simpler String Substitutions = 0.243750 seconds
[EMAIL PROTECTED] wrote:
> Chris> Yeah, "import readline" works just fine. My problem isn't hard to
> Chris> replicate. Can anyone else on Linux get command history to work
> Chris> with the following code? Note, it should be saved and run from a
> Chris> file.
>
> Command history
> > What is the simplest way to instantiate all classes that are
> > subclasses of a given class in a module?
> >
> > More precisely I have a module m with some content:
> >
> > # m.py
> > class A:
> > pass
> > class x( A ):
> > pass
> > class y( A ):
> > pass
> > # all kinds of other o
> > >>> from inspect import isclass
> > >>>
> > >>> class x:
> > ... def __getattr__( self, attr ):
> > ... pass
> > ...
> > >>> y = x( )
> > >>> isclass( y )
> > True
>
> Which reinforces Michael Spencer's instinct that the inspect.isclass()
> implementation is a bit too clever
Wou
Daniel Nogradi wrote:
> Thanks, this looks pretty good. However there is some wierdness with
> isclass: whenever a class has a __getattr__ method an instance of it
> will be detected by isclass as a class (although it is not).
>
> >>> from inspect import isclass
> >>>
> >>> class x:
> ... de
On 2006-07-15 19:46:16, Ben C wrote:
> There isn't any practical difference, as you say, if all the setter does
> is set. But it might easily do a few other subtle things, in particular
> wait for a good moment to actually effect the change.
I agree. But even then, for me there's no practical dif
> > More precisely I have a module m with some content:
> >
> > # m.py
> > class A:
> > pass
> > class x( A ):
> > pass
> > class y( A ):
> > pass
> > # all kinds of other objects follow
> > # end of m.py
> >
> > and then in another module I have currently:
> >
> > # n.py
> > import m
>
Daniel Nogradi wrote:
> What is the simplest way to instantiate all classes that are
> subclasses of a given class in a module?
>
> More precisely I have a module m with some content:
>
> # m.py
> class A:
> pass
> class x( A ):
> pass
> class y( A ):
> pass
> # all kinds of other objec
In <[EMAIL PROTECTED]>, Daniel Nogradi
wrote:
> More precisely I have a module m with some content:
>
> # m.py
> class A:
> pass
> class x( A ):
> pass
> class y( A ):
> pass
> # all kinds of other objects follow
> # end of m.py
>
> and then in another module I have currently:
>
> #
"Boomshiki" <[EMAIL PROTECTED]> writes:
> I am aware that someone can recreate what we have done, but for them
> to cut, paste, sell is kind of a rip off.
Unless you factor that into your business model, and create compelling
value that doesn't depend on the secrecy of something you place under
t
"Boomshiki" <[EMAIL PROTECTED]> writes:
> I don't mean to be the dick who does not support open source, but
> the rent does not pay itself these days.
Non sequitur. The license terms for the software are orthogonal to
whether one charges money for it. Viz the numerous businesses
worldwide happily
[EMAIL PROTECTED] wrote:
> David Boddie wrote:
>
> > However, you will have difficulty using the examples in that book
> > because it was written for PyQt3.
>
> Ah yes, it doesn't recognise "QApplication" now. Never mind.
QApplication is still there. You can access it via the Qt module and
create
John Machin wrote:
>> 'sed' is not recognized as an internal or external command,
>> operable program or batch file.
>
> aarrbejaysus #2: Download the installer from
>
> http://gnuwin32.sourceforge.net/packages/sed.htm
in a way, this kind of advice reminds me of
http://thedailywtf.co
Boomshiki wrote:
> And trust me, I am not worried about 16 yr olds using it without paying, why
> would they want to? I am worried about them cracking in to where their
> grades are kept.
what does "hiding your source code" has to do with that ?
--
http://mail.python.org/mailman/listinfo/p
In Windows if you click the Help dropdown, IDLE launches a help window
as it should. The help contents are included in the installation.
In Linux, clicking Help launches a web browser, which is a perfectly
good UI for viewing help. However, instead of loading a static HTML
file from the disk lik
"Boomshiki" <[EMAIL PROTECTED]> writes:
> And trust me, I am not worried about 16 yr olds using it without paying, why
> would they want to? I am worried about them cracking in to where their
> grades are kept.
You should assume they have the source code in that case. In fact
you're better off
Boomshiki wrote:
> And trust me, I am not worried about 16 yr olds using it without paying, why
> would they want to? I am worried about them cracking in to where their
> grades are kept.
what you need is data security... *not* code obfuscation..
[sreeram;]
signature.asc
Description: OpenPG
I am aware that someone can recreate what we have done, but for them to cut,
paste, sell is kind of a rip off.
And trust me, I am not worried about 16 yr olds using it without paying, why
would they want to? I am worried about them cracking in to where their
grades are kept.
--
http://mail.
What is the simplest way to instantiate all classes that are
subclasses of a given class in a module?
More precisely I have a module m with some content:
# m.py
class A:
pass
class x( A ):
pass
class y( A ):
pass
# all kinds of other objects follow
# end of m.py
and then in another m
"Boomshiki" <[EMAIL PROTECTED]> writes:
> Now the big issue at hand is how well will I be able to mask my source code?
Not all that well, but it really doesn't matter. Someone who sees
what the program does can write another one like it, without seeing
your source code.
--
http://mail.python.or
In <[EMAIL PROTECTED]>, Boomshiki wrote:
> Now the big issue at hand is how well will I be able to mask my source code?
> After all I wouldn't want some someone walking off to the bank with our hard
> work. That and almost any 16 yr old can look at Python source and know what
> it is talking ab
Chris> Yeah, "import readline" works just fine. My problem isn't hard to
Chris> replicate. Can anyone else on Linux get command history to work
Chris> with the following code? Note, it should be saved and run from a
Chris> file.
Command history across sessions or just command reca
I don't mean to be the dick who does not support open source, but the rent
does not pay itself these days.
What I got is a huge undertaking that will change the way teachers handing
their grading sytem (that is as far as I can go without breaking my terms in
the contract).
Now I have a variet
Does anybody know some GUI (preferably QT) application which can be
use to explore pickled python objects? Similar functionality has a
PyDev Debugger in Eclipse, but I would like to have a standalone
application. I know that it is not hard to write it, but I don't want
to again invent a wheel ;o)
On 13 Jul 2006 23:12:05 -0700, Paul McGuire <[EMAIL PROTECTED]> wrote:
Pyparsing is also good for recognizing basic HTML tags and theirattributes, regardless of the order of the attributes.-- PaultestText = """sldkjflsa;fajhere it would be 'mystylesheet.css'. I used the following regex to getthis v
Carl J. Van Arsdall wrote:
> This raises a good question. Is there a need for python to change
> somewhat to work better in an embedded profile?
When I asked this question last on python-dev, there was exactly one
response, and that was "yes, it needs to change".
The natural question then is "
Bryan:
> do you think that pygame would be a good alternative to matplotlib to create
> some graphs such simple bar and line graphs?
For graphs MatPlotLib is usually better, and its antialiasing library
(Anti-Grain Geometry) is wonderful. Pygame gives a bit more freedom but
you have to do all for
Marshall schrieb:
> Joachim Durchholz wrote:
>> Marshall schrieb:
>>> I would say, records in SQL have value, and their
>>> identity is exactly their value.
>>
>> Definitely not. You can have two equal records and update just one of
>> them, yielding non-equal records; by my definition (and by int
On 16/07/2006 5:16 PM, Fredrik Lundh wrote:
> Bill Pursell wrote:
>
>> Some might argue that this is not really doing
>> it in Python. In fact, I would argue that! But if
>> you're at a command prompt and you want to
>> see line 7358, it's much easier to type
>> % sed -n 7358p
aarrbejaysus #1:
On Sunday 16 July 2006 1:09 am, [EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
> > Phil Thompson wrote:
> > > For Qt4 use the binary installer from...
> > >
> > > http://www.trolltech.com/developer/downloads/qt/windows
> > >
> > > For PyQt4 use the binary installer from...
> > >
> > > http://w
In message <[EMAIL PROTECTED]>, Yi Xing
wrote:
> I want to read specific lines of a huge txt file (I know the line #).
> Each line might have different sizes. Is there a convenient and fast
> way of doing this in Python? Thanks.
file("myfile.txt").readlines()[LineNr]
Convenient, yes. Fast, n
In message <[EMAIL PROTECTED]>, Fredrik
Lundh wrote:
> Bill Pursell wrote:
>
>> Some might argue that this is not really doing
>> it in Python. In fact, I would argue that! But if
>> you're at a command prompt and you want to
>> see line 7358, it's much easier to type
>> % sed -n 7358p
>> than
On 2006-07-14, Adonis <[EMAIL PROTECTED]> wrote:
> Satya Kiran wrote:
>> Hello,
>> I have upgraded to Python2.4 on my Red Hat 9.0 Linux box.
>> I want to work with IDLE and ran a search to check it's presence.
>> Here is what I get.
>>
>> [EMAIL PROTECTED] bin]# find / -iname idlelib
>> /usr/local
Bill Pursell wrote:
> Some might argue that this is not really doing
> it in Python. In fact, I would argue that! But if
> you're at a command prompt and you want to
> see line 7358, it's much easier to type
> % sed -n 7358p
> than it is to write the python one-liner.
'sed' is not recognized as
Announcing
--
The 2.6.3.3 release of wxPython is now available for download at
http://wxpython.org/download.php. This is a mostly bug fix release
and also includes builds for Python 2.5 on Mac and also Windows. A
summary of other changes is listed below and at
http://wxpython.org/recentc
87 matches
Mail list logo