Joachim Durchholz wrote:
Marshall schrieb:
Joachim Durchholz wrote:
Chris Smith schrieb:
For example, I wrote that example using variables of type int. If we
were to suppose that we were actually working with variables of type
Person, then things get a little more complicated. We
Bruno Desthuilliers wrote:
I decided to change the name of an attribute. Problem is I've used the
attribute in several places spanning thousands of lines of code. If I
had encapsulated the attribute via an accessor, I wouldn't need to do
an unreliable and tedious search and replace
find and
sreekant wrote:
Hi folks
What am I doing wrong in the following? I just want to run fluidsynth in
the background.
Others have pointed you at os.popen. In non-crippled languages, use
processes (e.g. popen) when you wish to preserve the years of hard work
that OS designers put into protected
Sriram Krishnan wrote:
I'm running Python 2.4.3 on Windows Vista June CTP. I'm not able to
open any site using the urllib2 and related family of modules
I think you need to break the error further down. Try httplib instead
of urllib, and see what connect does. Then break this down into socket
sreekant [EMAIL PROTECTED] (S) wrote:
S Hi folks
S What am I doing wrong in the following? I just want to run fluidsynth in
S the background.
S #
S class MyThread(threading.Thread):
S def __init__(self, cmd, callback):
S self.__cmd = cmd
S
Please send me an anti-virus version. I can not read your attacked file!python-list@python.org wrote: Please read the document.
Want to be your own boss? Learn how on Yahoo! Small Business.
--
http://mail.python.org/mailman/listinfo/python-list
In article [EMAIL PROTECTED],
Robin Becker [EMAIL PROTECTED] wrote:
Michael Yanowitz wrote:
..
I need to detect whether the operating system I am running on (not the
Python version) is 64bit or 32bit. One requirement is that I need to
include support for non-Intel/AMD architectures.
Any Idea !!!???
---
First Iranian Python Programming Community -- www.Python.ir
--
http://mail.python.org/mailman/listinfo/python-list
Bryan wrote:
and how do you make sure that everything subclasses this base class ?
in this hypothetical case, i was assuming len() would be put in object and
every
class subclasses object implicitly or explicitly (ie, new style classes only).
if it was done that way, would len(obj) ==
Hi,
I'm still looking for an elegant and clear means to
terminate the main script in Python.
Unfortunately, Python doesn't allow a 'return'
instruction in the main script.
Using sys.exit(0) produces an error
message which looks dangerous to an
uninitiated user.
The same is true for an
ZeD wrote:
Bruno Desthuilliers wrote:
I decided to change the name of an attribute. Problem is I've used the
attribute in several places spanning thousands of lines of code. If I
had encapsulated the attribute via an accessor, I wouldn't need to do
an unreliable and tedious search and replace
I suggest you search the download files on Xampp's sourceforge site and
look for an older version with Apache 2.0.55 . I'm not sure, but I
think xampp version 1.5.1 will be ok
I did this just a few days ago, you could be right, but version 1.5.1
had no release notes, and a dodgy release
Helmut Jarausch wrote:
Using sys.exit(0) produces an error
message which looks dangerous to an
uninitiated user.
sys.exit(0) doesn't print anything at all.
$ python
import sys
sys.exit(0)
$
however, sys.exit() raises an exception to tell the runtime that it wants
to terminate the program,
Uh... this may sound silly, but aren't .so files UNIX/Linux/Solaris
shared object files...
Yes, but apache uses them (or at least the same file extension) for
modules on Windows and Linux, so mod_python.so is correct.
--
http://mail.python.org/mailman/listinfo/python-list
Bayazee wrote:
hi
i want a free hosting for python .
Then setting up your own hosting might be a good solution - if you can
have a decent internet connection.
www.python.ir -- Persian Python Community !
I'm afraid I won't be able to contribute !-)
--
bruno desthuilliers
python -c print
I decided in the end to use fork and all is well.
Thanks
sree
--
http://mail.python.org/mailman/listinfo/python-list
hi all,
how to get out of the python shell which is executing a command?
how to use images in the background of a page in Tkinter?
--
http://mail.python.org/mailman/listinfo/python-list
iapain wrote:
No, I cant change permission or delete the module, the best would be
something to detect 'import os' in user code ..
trust me, implementing a restricted execution model for Python that actually
works is a *lot* harder than that.
googling for python restricted execution might
[EMAIL PROTECTED] wrote:
Hi,
I already have a couple of newbie books on Python itself, but would
rather get started with a nice to use IDE and I am therefore looking
for a good IDE to learn Python. On my computer I have installed eric
(http://ericide.python-hosting.com/) but it lacks any
David Hopwood wrote:
Yes, I'm well aware that most of this thread has been off-topic for c.l.p.m,
but it is no less off-topic for the other groups (except possibly
c.l.functional),
and I can't trim the Newsgroups line down to nothing.
is someone forcing your to post off-topic stuff against
Helmut Jarausch [EMAIL PROTECTED] writes:
Using sys.exit(0) produces an error message which looks dangerous to an
uninitiated user.
What message? Your program should exit silently when you call sys.exit(0).
Ganesan
--
Ganesan Rajagopal
--
I'm sorry, perhaps I'm being slow today, but just why are they dangerous?
More dangerous than, say, mutable lists and mutable dicts? Unless I'm
missing something, the worst that can happen is that people will write
inefficient code, and they'll be caught out by the same sort of things
that
I'm hoping to write a program that will read any number of urls from
stdin (1 per line), download them, and process them. So far my script
(below) works well for small numbers of urls. However, it does not
scale to more than 200 urls or so, because it issues HTTP requests for
all of the urls
Chris Smith [EMAIL PROTECTED] writes:
No what happens if right here you code
b := 16;
Does that again change the type of b? Or is that an illegal
instruction, because b has the local type of (18..22)?
It arranges that the expression b after that line (barring further
changes) has
rzimerman wrote:
I'm hoping to write a program that will read any number of urls from
stdin (1 per line), download them, and process them. So far my script
(below) works well for small numbers of urls. However, it does not
scale to more than 200 urls or so, because it issues HTTP requests for
TY wrote:
Hi,
Can someone point me to a Howto or Tutorial for tokenize module for a
newbie? I read the documentation but it doesn't have a lot of info...
Here's another useful example :
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
All the best,
Fuzzyman
Hi,
I want to generate all non-empty substrings of a string of length =2.
Also,
each substring is to be paired with 'string - substring' part and vice
versa.
Thus, ['abc'] gives me [['a', 'bc'], ['bc', 'a'], ['ab', 'c'], ['c',
'ab'], ['b', 'ac'], ['ac', 'b']] etc.
Similarly, 'abcd' should give
Bryan wrote:
Fredrik Lundh wrote:
Bryan wrote:
could you get the same result by putting these methods in base
class object that everything subclasses?
and how do you make sure that everything subclasses this base class ?
/F
in this hypothetical case, i was assuming len() would be put
rzimerman wrote:
Is Twisted the best library for me to be using? I do like Twisted, but
it seems more suited to batch mode operations. Is there some way that I
could continue registering url requests while the reactor is running?
Is there a way to specify a time out per page request, rather
Hello,
Thanks for the responses. The reason I want to change the name of the
attribute is because it doesn't reflect the purpose of the attribute,
anymore. The attribute was originally a string object, but not anymore.
It is primarily a readability issue. There are also a few key
attributes I
Laszlo Nagy wrote:
I'm looking for a library that can do the following:
* Parse a simple structured text file (XML or HTML etc.)
* Render its output to an image
* I would like to give the maximum width of the image (but not the
minimum)
* I would like to use my custom
hi all,
how to get out of the python shell which is executing a command?
how to use images in the background of a page in Tkinter?
on Unix, ctrl-c or ctrl-d may do the job.
on Windows, ctrl-z will do
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-07-10, Terry Reedy [EMAIL PROTECTED] wrote:
Antoon Pardon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I disagree. The += version only evaluates the index once, but still has
to find the object twice.
No it does not *have* to find the object twice and no it does *not*
Fredrik Lundh wrote:
Helmut Jarausch wrote:
Using sys.exit(0) produces an error
message which looks dangerous to an
uninitiated user.
sys.exit(0) doesn't print anything at all.
Yes, sorry, I was trying in in 'idle'
There you get
Traceback (most recent call last):
File pyshell#1, line
Ernesto wrote:
Within the scope of one Python file (say myFile.py), I'd like to print
a message on ANY exception that occurs in THAT file, dependent on a
condition.
Here's the pseudocode:
if anyExceptionOccurs():
if myCondition:
print Here's my global exception message
Ernesto wrote:
Within the scope of one Python file (say myFile.py), I'd like to print
a message on ANY exception that occurs in THAT file, dependent on a
condition.
condition = True
def handle_any_exception(function):
def trampoline(*args, **kwargs):
try:
mystilleef wrote:
Hello,
Thanks for the responses. The reason I want to change the name of the
attribute is because it doesn't reflect the purpose of the attribute,
anymore. The attribute was originally a string object, but not anymore.
It is primarily a readability issue. There are also a
I'm a little bit confused about what is the best way to run a shell command,
if I want to run a command like
xx -a -b yy
where I'm not interested in the output, I only want to make sure that the
command was executed OK. How should I invoke this (in a Unix/linux
Hi,
my collegues and I recently held a coding style review.
All of the code we produced is used in house on a commerical project.
One of the minor issues I raised was the common idiom of specifing:
pre
if len(x) 0:
do_something()
/pre
Instead of using the language-defined bahviour, as
Hi,
How can I get CPU Serial number , or motherboard serial number with
python . I need an idetification of a computer
ThanX
---
iranian python community -- www.python.ir
--
http://mail.python.org/mailman/listinfo/python-list
In article [EMAIL PROTECTED],
Donald Duck [EMAIL PROTECTED] wrote:
I'm a little bit confused about what is the best way to run a shell command,
if I want to run a command like
xx -a -b yy
where I'm not interested in the output, I only want to make sure
horizon5 wrote:
Hi,
my collegues and I recently held a coding style review.
All of the code we produced is used in house on a commerical project.
One of the minor issues I raised was the common idiom of specifing:
pre
if len(x) 0:
do_something()
/pre
Instead of using the
On Tue, 11 Jul 2006 04:52:42 -0700, horizon5 wrote:
Hi,
my collegues and I recently held a coding style review.
All of the code we produced is used in house on a commerical project.
One of the minor issues I raised was the common idiom of specifing:
pre
if len(x) 0:
do_something()
--sample code begin-
import threading
import wmi
def run(*args):
c = wmi.WMI ()
memory=c.Win32_LogicalMemoryConfiguration()[0]
info='Total Virtual Memory: '\
+str(int(memory.TotalVirtualMemory)/1024)\
googling for python restricted execution might give you some clues.
I've already assumed that there is no rexec for me as i am using python
2.4. Yeah its much more difficult that my imagination. Should I go for
alternatives like
1. Assume every one who is using this webide, wont corrupt system
iapain wrote:
I've already assumed that there is no rexec for me as i am using python
2.4. Yeah its much more difficult that my imagination. Should I go for
alternatives like
1. Assume every one who is using this webide, wont corrupt system
2. Use some tricks to encrypt the user path and do
horizon5 wrote:
Hi,
my collegues and I recently held a coding style review.
All of the code we produced is used in house on a commerical project.
One of the minor issues I raised was the common idiom of specifing:
pre
if len(x) 0:
do_something()
/pre
Instead of using the
Chen Houwu wrote:
--sample code begin-
import threading
import wmi
def run(*args):
c = wmi.WMI ()
memory=c.Win32_LogicalMemoryConfiguration()[0]
info='Total Virtual Memory: '\
unless you're willing to build a restricted runtime that runs on top of the
core inter-
preter, you should assume that anyone writing a Python script that's executed
by
your program has access to everything that your Python process has access
to...
I think using replacements I can ban
thanks to solve my big problem :-)
I will try it later.
--
http://mail.python.org/mailman/listinfo/python-list
isinstance(1, object)
True
What's 1 . len() ?
That's easy!
since 1 is actually syntactic sugar for set([set([])]), clearly 1.len()
== 1.
;-)
v.
(actually, make that frozenset([frozenset([])])...)
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
Bryan wrote:
and how do you make sure that everything subclasses this base class ?
in this hypothetical case, i was assuming len() would be put in object and
every
class subclasses object implicitly or explicitly (ie, new style classes
only).
if it was done that
Hi all,
In a framework I've written to test out website, I use something like
the following to add functionality at various points:
#---
def do_work(callable, data):
assertion = False
try:
assertion = callable.is_assertion
except:
pass
I'm trying to use ftp in python in a multi-threaded way on a windows
box - python version 2.4.3. Problem is that it appears that it's only
possible to have five instances/threads at one point in time. Errors
look like:
File C:\Python24\lib\ftplib.py, line 107, in __init__
Ant [EMAIL PROTECTED] wrote:
The question is, is this a reasonable thing to do?
absolutely. a test framework DSL is a perfectly valid use case for
function attributes.
It works, but is it considered bad practice to add attributes to functions?
nope (at least not in small doses ;-)
And are
Yes, I highly recommend the subprocess module. subprocess.call() can
do almost anything you want to do, and the options are all pretty
intuitive Whenever I need to write quick scripts for myself, it's what
I use.
THN
Roy Smith wrote:
In article [EMAIL PROTECTED],
Donald Duck [EMAIL
On 11 Jul 2006 06:45:42 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I'm trying to use ftp in python in a multi-threaded way on a windowsbox - python version
2.4.3.Problem is that it appears that it's onlypossible to have five instances/threads at one point in time.Errorslook like: File
Hi
I would like to
1. import an existing Excel-sheet (a template)
2. and add some data to it
3. and save it under a different name afterwards.
To me it seems, that pyExcelerator does not support the reading for
modification of an Excel-sheet. It allows only the parse_xls but I would
Luis M. González wrote:
I'm curious, why it didn't work?
I sent them an email recently, asking about mod_python support, and
they replied afirmatively, and very quickly. They also said that they
can install other scripts on demand.
But I never tried them though...
I'd like to know more
Le mardi 11 juillet 2006 13:52, horizon5 a écrit :
Arguments that have been presented for using codelen(x) 0/code to
test emptiness of a container include:
- It's safer
- Not relying on weird behaviour of the language
- Explicit is better than implicit (as stated by 'this' module, Zen
On Tue, 11 Jul 2006 06:21:39 -0700, iapain wrote:
unless you're willing to build a restricted runtime that runs on top of the
core inter-
preter, you should assume that anyone writing a Python script that's
executed by
your program has access to everything that your Python process has
Sybren Stuvel wrote:
Ant enlightened us with:
try:
assertion = callable.is_assertion
except:
pass
Try to make a habit out of catching only the exceptions you know will
be thrown. Catching everything generally is a bad idea. In this case,
my bet is that catching
Marco Aschwanden wrote:
Hi
I would like to
1. import an existing Excel-sheet (a template)
2. and add some data to it
3. and save it under a different name afterwards.
To me it seems, that pyExcelerator does not support the reading for
modification of an Excel-sheet. It allows
Bayazee wrote:
Hi,
How can I get CPU Serial number , or motherboard serial number with
python . I need an idetification of a computer
ThanX
---
iranian python community -- www.python.ir
If you are on a windows box with WMI (2000 or
my_innocent_object = __import__(''.join([chr(110+x) for x in [1, 5]]))
Thats really smart way, yeah i had plan to scan and detect but I think
its not gonna work.
Creating a restricted execution environment is *hard*. As far as I know,
even Microsoft has never attempted it. And for all of
Chris Smith wrote:
David Hopwood [EMAIL PROTECTED] wrote:
Maybe I'm not understanding what you mean by complete. Of course any
type system of this expressive power will be incomplete (whether or not
it can express conditions 3 to 5), in the sense that it cannot prove all
true assertions about
At work we have a fairly large application (about 20 packages, 300+ modules)
that looks like we might be heading into a bit of a plateau stage. Now
seems like a good time to identify and delete old, unused code that's flown
under the radar screen for awhile simply because nobody was looking for
where I'm not interested in the output, I only want to make sure that the
command was executed OK. How should I invoke this (in a Unix/linux
environment)?
Remember few things about executing program within python
1. Create a subprocess or child process and execute it.
2. You should use Timeout
I just got a new PC with Windows XP, and I want to run Leo on it. Leo
uses the os.access() function to check for read-only files. For some
reason, os.access(filename, os.W_OK) always returns false.
I wrote a 2-liner Python script to just test os.access on any file.
I have tried this with Python
Fredrik Lundh wrote:
Sybren Stuvel wrote:
Ant enlightened us with:
try:
assertion = callable.is_assertion
except:
pass
Try to make a habit out of catching only the exceptions you know will
be thrown. Catching everything generally is a bad idea. In this case,
my
iapain wrote:
my_innocent_object = __import__(''.join([chr(110+x) for x in [1, 5]]))
Thats really smart way, yeah i had plan to scan and detect but I think
its not gonna work.
Creating a restricted execution environment is *hard*. As far as I know,
even Microsoft has never attempted
Hi,
Following are my files.
In the format:
Filename
content
config1.txt
#DataBase Repository file
dbRepository = omsa_disney.xml
config2.txt
# Configfile for sendmail
[Sendmail]
userprefix = testuser
pyConfig.py
import re
def pyConfig():
fhandle
Juergen Huber wrote:
how would i fix the following problem:
now i have an input file with a fix name and an output file!
i have this two files hardcoded written in the sourcecode of this
function!
in the future i will start this script with the command line.
the syntax should be look
Peter Otten wrote:
You would normally expect that you can turn off a flag by setting it to
False instead of deleting it -- which is also how the OP's code works. So I
would prefer
assertion = getattr(callable, is_assertion, False)
agreed (but note that the OP used a decorator to set the
Antoon Pardon [EMAIL PROTECTED] (AP) wrote:
AP As I read the language reference the x stands for a target expression.
AP Now what does it mean to evaluate a target expression like col[key].
AP IMO it means finding the location of the item in the collection: the
AP bucket in the directory, the
sreekant [EMAIL PROTECTED] (S) wrote:
S I decided in the end to use fork and all is well.
But how are you doing the callback then? From your code it looks like the
callback is called after the external command finishes. The callback would
then be called in the child process, not in the parent
Phoe6 [EMAIL PROTECTED] wrote:
How do I compare the performance of pyConfig.py vs pyConparse.py using
timeit module?
$ python -m timeit -s import pyConfig pyConfig.pyConfig()
$ python -m timeit -s import pyConparse pyConparse.pyConParse()
note that timeit runs the benchmarked function
End of July is our aggressive but still-achievable target: everythingwas scheduled from the start to hit OSCON '06 (and the release of Python
2.5 -- whether 2.5 final will be out at OSCON is still uncertain,though).Currently the schedule has Python 2.5 final due August 8th, and RC1 August 1st.
David Hopwood [EMAIL PROTECTED] wrote:
I don't think that placing too much emphasis on any individual example is
the right way of thinking about this. What matters is that, over the range
of typical programs written in the language, the value of the increased
confidence in program correctness
Fredrik Lundh wrote:
$ python -m timeit -s import pyConfig pyConfig.pyConfig()
$ python -m timeit -s import pyConparse pyConparse.pyConParse()
note that timeit runs the benchmarked function multiple times, so you may want
to remove the print statements.
Thanks a lot Fredrik!. I did not know
Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote:
Chris Smith [EMAIL PROTECTED] writes:
No what happens if right here you code
b := 16;
Does that again change the type of b? Or is that an illegal
instruction, because b has the local type of (18..22)?
It arranges that the
On behalf of the Python development team and the Python
community, I'm happy to announce the second BETA release
of Python 2.5.
This is an *beta* release of Python 2.5. As such, it is not
suitable for a production environment. It is being released
to solicit feedback and hopefully discover bugs,
I'm pretty sure it doesn't support reading an existing document. That
would be useful.
On 7/11/06, Larry Bates [EMAIL PROTECTED] wrote:
Marco Aschwanden wrote:
Hi
I would like to
1. import an existing Excel-sheet (a template)
2. and add some data to it
3. and save it under a
Phoe6
$ python -m timeit -s import pyConfig pyConfig.pyConfig()
$ python -m timeit -s import pyConparse pyConparse.pyConParse()
note that timeit runs the benchmarked function multiple times, so you may
want
to remove the print statements.
Thanks a lot Fredrik!. I did not know that timeit
In article [EMAIL PROTECTED],
J Rice [EMAIL PROTECTED] wrote:
I have a question:
When should syslog.closelog() be called? I have a daemon that spends
most of its time asleep and quiet, but writes messages to the mail log
when active. Should I open the log at the start and keep it open until
In article [EMAIL PROTECTED],
iapain [EMAIL PROTECTED] wrote:
.
.
.
Does that mean there is no way to implement restricted enviorment?
.
.
.
The most
Marshall wrote:
Now, I'm not fully up to speed on DBC. The contract specifications,
these are specified statically, but checked dynamically, is that
right?
Yes, but there's a bunch more to it than that. The handling of
exceptions, an in particular exceptions caused by failed pre/post
Marcin 'Qrczak' Kowalczyk wrote:
The assignment might be performed in a function called there, so it's
not visible locally.
In Hermes, which actually does this sort of constraint propagation, you
don't have the ability[1] to munge some other routine's[2] local
variables, so that becomes a
Chris Smith wrote:
Specialized
language already exist that reliably (as in, all the time) move array
bounds checking to compile time;
It sounds like this means the programmer has to code up what it means to
index off an array, yes? Otherwise, I can't imagine how it would work.
x :=
Chris Smith wrote:
Going back to my
handy copy of Pierce's book again, he claims that range checking is a
solved problem in theory, and the only remaining work is in how to
integrate it into a program without prohibitive amounts of type
annotation.
This is in TAPL? Or ATTPL? Can you cite it
Steven D'Aprano wrote:
Creating a restricted execution environment is *hard*. As far as I know,
even Microsoft has never attempted it. And for all of Sun's resources and
talent, security holes are sometimes found even in Java.
Java is not the only restricted execution environment around.
Hello all,
I'm writing a windows application with a Tkinter GUI.
Tkinter ignores the Windows user setting for system default font size -
which can be 'normal', 'large' or 'extra large'.
Does anyone know how to retrieve this information from the win32api, or
using win32com ?
All the best,
Sybren wrote:
Try to make a habit out of catching only the exceptions you know will
be thrown.
Yes - you are right of course - this was just a minimal example of
course to illustrate the sort of thing I'm using function attriutes
for.
Fredrik Lundh wrote:
Peter Otten wrote:
assertion =
[EMAIL PROTECTED] wrote:
At work we have a fairly large application (about 20 packages, 300+ modules)
that looks like we might be heading into a bit of a plateau stage. Now
seems like a good time to identify and delete old, unused code that's flown
under the radar screen for awhile simply
The most knowledgeable people have effectively given up, in
regard to Python.
I guess now I am up with only one option, i.e hope that user input code
wont be evil to the system. **which is rarely possible**
--
http://mail.python.org/mailman/listinfo/python-list
Sybren Stuvel wrote:
Ant enlightened us with:
try:
assertion = callable.is_assertion
except:
pass
Try to make a habit out of catching only the exceptions you know will
be thrown. Catching everything generally is a bad idea. In this case,
my bet is that
K.S.Sreeram [EMAIL PROTECTED] writes:
Java is not the only restricted execution environment around.
Javascript, as implemented by most browsers, is an excellent lightweight
restricted execution environment, and there are many browsers which have
good implementations.
And we hear about browser
On Tue, 11 Jul 2006 14:59:46 GMT, David Hopwood
[EMAIL PROTECTED] wrote:
What matters is that, over the range
of typical programs written in the language, the value of the increased
confidence in program correctness outweighs the effort involved in both
adding annotations, and understanding
Marshall [EMAIL PROTECTED] wrote:
Chris Smith wrote:
Going back to my
handy copy of Pierce's book again, he claims that range checking is a
solved problem in theory, and the only remaining work is in how to
integrate it into a program without prohibitive amounts of type
annotation.
Simon I haven't used it myself, but pychecker
Simon (http://pychecker.sourceforge.net/) is supposed to be able to
Simon perform such stunts. From the page: Types of problems that can
Simon be found include: Unused globals and locals (module or variable)
Thanks. I've used both
1 - 100 of 203 matches
Mail list logo