northof40 wrote:
Given an arbitary package is there some programmatic way to 'ask' what
file the method/function is implemented in ?
Indeed, the inspect module contains several useful functions for the
job, for example
http://docs.python.org/library/inspect.html#inspect.getfile
Emanuele D'Arrigo write:
In what ways would the untrusted string be able to obtain the
original, built-in open function and open a file for writing?
Yes, if you know some tricks:
[cls for cls in object.__subclasses__() if cls.__name__ == 'file'][0]
Christian
--
http://
Ray wrote:
I already find the way to fix it. :-)
I consider it good style when people describe their solution to a
problem, too. Other Python users may run into the same issue someday. :)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
odule-zlib
Have fun!
Christian
--
http://mail.python.org/mailman/listinfo/python-list
urity==3.4.1'.
src/zope/security/_proxy.c:19:20: error: Python.h: No such file or directory
sudo apt-get install python2.4-dev
Have fun :)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ibutes i.e.
The Python web application framework Zope implements the feature under
the name "acquisition". Happy Googling!
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Jan Kaliszewski wrote:
Are you sure, you couldn't have UCS-4-compiled Python distro
for Windows?? :-O
Nope, Windows require UCS-2 builds.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
low level stuff
like bit operations or direct hardware access. However it can be used as
a glue language for low level code written in C or ASM.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
quot;reference is dead, yet callback hasn't been
> called yet")
Yes, you'll definitely see a RuntimeError because you forgot to declare
callback_called as a global variable. :)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Colin J. Williams wrote:
> You might try, at the command line:
>easy_install setuptools
That's not going to work. setuptools provides the easy_install command.
If you have the easy_install command than setuptools is already installed.
Christian
--
http://mail.python.org/mailm
t root privileges.
>
> Any ideas?
Have you read my blog entry about my PEP 370?
http://lipyrary.blogspot.com/2009/08/how-to-add-new-module-search-path.html
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Peng Yu schrieb:
> Hi,
>
> I want to define a function without anything in it body. In C++, I can
> do something like the following because I can use "{}" to denote an
> empty function body. Since python use indentation, I am not sure how
> to do it. Can somebody let me know how to do it in python
class not your instance.
By the way it's called a list in Python, not array.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
?
"apt-get build-dep python2.5" should install all required build
dependencies. Have fun!
Christian
--
http://mail.python.org/mailman/listinfo/python-list
in general it doesn't do what you expect. NaN isn't a
singleton in Python. Python's float type uses IEEE 754 double precision
numbers internally. The double type has much more than billions of NaN
values (IIRC 2**53). isnan() is the only reliable way to detect NaNs. "x
!= x"
File "", line 1, in
TypeError: an integer is required
>>> class Hash(object):
... def __hash__(self):
... return hash((1, 2))
...
>>> hash(Hash())
3713081631934410656
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Mike Driscoll wrote:
> You can use cStringIO to create a "file-like" object in memory:
>
> http://docs.python.org/library/stringio.html
No, you can't with subprocess. The underlying operating system API
requires a file descriptor of a real file.
Christian
--
http:/
class SceneObject(object):
pass
class Cube(SceneObject):
pass
scene = Scene()
scene.cube1 = Cube()
Have fun!
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ual. The first one suffers from a race
condition which may lead to a severe security issue. The file may be
gone or replaced by a different file in the time span between the check
and the call to unlink().
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ython 2.5.4 on Debian Sid.
>
> If anybody understands the error please enlighten me.
__del__ is called in an indeterministic order. Most of the Python
environment is already gone when your __del__ method is called. The
pickle module doesn't have enough bits left to fulfill its job.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
olve this problem?
I know from experience that it's sometimes hard to compile Python
extensions with MinGW32. Have you tried the official builds from the new
download page http://www.firebirdsql.org/index.php?op=devel&sub=python ?
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Sampsa Riikonen wrote:
> => If I start the program in directory "paska2", everythings OK, but if the
> directory name happens to be "python", the importation of the modules goes
> nuts!
What's inside the python/ subdirectory? Do you happen to have a file
called struct.py inside it?
--
http://ma
Y_PATH=/path/to/python_shared_lib:
> $LD_LIBRARY_PATH
> 2. Add path to dynamic linker configuration file. This typically
> is in '/etc/ld.so.conf'. See man page for ld for more information.
3. Set LD_RUN_PATH before you link the shared library or use the -rlink
option of the
Please show us how you are
starting and controlling the Python process in your PHP code.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
his
clearly tells me that the issue is in your PHP script. See
http://en.wikipedia.org/wiki/Fork-exec
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Am 10.09.2010 22:14, schrieb cerr:
> No, the Perl becomes the zombie.
How are you killing the Python process? Are you sending SIGINT, SIGTERM
or SIGKILL? SIGKILL can prevent Python from running its cleanup code.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Am 14.09.2010 16:14, schrieb lsolesen:
> I am trying to install python-mcrypt (http://labix.org/python-mcrypt)
> on Ubuntu, but I cannot get it to work. I have the following python
> installed:
sudo apt-get install python-dev
Christian
--
http://mail.python.org/mailman/listinfo/python-list
headers for mcrypt, too.
sudo apt-get install libmcrypt-dev
Christian
--
http://mail.python.org/mailman/listinfo/python-list
subclass from
something like DictMixin or the appropriate ABC.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
age [1] and LCMS2 [2]
and works very well. So far we have processed several million TIFF files
with more than 100 TB of raw data smoothly. I've permission to release
the software as open source but haven't found time to do a proper release.
Christian Heimes
[1] http://freeimage.sourceforge.n
on beyond the file's end.
>>> with open("sparse", "w") as fh:
... fh.seek(1000**3)
... fh.write("data")
...
$ ls -l --si sparse
-rw-r--r-- 1 heimes heimes 1,1G 2010-09-29 22:25 sparse
$ ls -s sparse
4 sparse
$ du sparse
4 sparse
Christian
--
http://mail.python.org/mailman/listinfo/python-list
using __file__ and os.getcwd() in the module
Use the abspath function of the os.path module:
HERE = os.path.dirname(os.path.abspath(__file__))
Christian
--
http://mail.python.org/mailman/listinfo/python-list
This code snippet enables core dumps for the current Python process. It
should also enable it for child processes.
import resource
resource.setrlimit(resource.RLIMIT_CORE, (-1, -1))
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Am 07.10.2010 22:02, schrieb Chris Rebert:
> On Thu, Oct 7, 2010 at 12:13 PM, kj wrote:
>
>> It would facilitate the implementation of t() to have a simple test
>> for mutability. Is there one?
>
> Non-default hashability is an approximate heuristic:
Except that every user defined class is has
uot;
or
msg = ("WARNING: "
"Pants on fire")
Christian
--
http://mail.python.org/mailman/listinfo/python-list
widget, event):
> pass
> # for each curve of self.listOfCurves: draw it
Don't nest classes. Just don't. This might be a valid and good approach
in some programming languages but it's not Pythonic. Your code can
easily be implemented without nested classes.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
ff with 2.7 or even 2.6. For now
most Linux distributions have Python 2.6. With some care you can write
your app with Python 2 and automatically port it to Python 3 with the
2to3 tool.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
jority has no or only
experimental support for Python 3.1. The overall situation improves
every week.
Christian
PS: I recommend against MySQL, if you need the full power or a RDBMS.
Just try to combine foreign keys with database triggers and you'll see
which major features are still broken in
rebird.
You are looking for a simple yet extremely power persistent layer that
supports even transactions, MVCC and networking? Check out ZODB + ZEO.
You have to store and acces a LOT of data? Hadoop may the solution.
Christian
--
http://mail.python.org/mailman/listinfo/python-list
he MP3 generation will never understand the hard work of a mix tape
created recorded from radio broadcasts. ;)
Christian
--
http://mail.python.org/mailman/listinfo/python-list
arse.)
You were looking at the wrong manual. Read
http://docs.python.org/distutils/setupscript.html#preprocessor-options
Extension(...,
define_macros=[('NDEBUG', '1'),
('HAVE_STRFTIME', None)],
undef_macros=['HAVE_FOO',
ack to the initial question: I highly recommend LXML for any kind of
XML processing, validation, XPath etc. It's super fast, extremely
powerful and supports all features of libxml2 and libxslt. It also
supports DTD, RelaxNG and XML schema.
Christian
[1] http://pypi.python.org/pypi/configobj
[2]
* either learn more XPath. You can do everything with XPath as well,
for example "//houses/name/text()"
* use lambdas instead, for example "names" : lambda x: [y.text for y in
x.xpath("//houses/name")]
Christian
--
http://mail.python.org/mailman/listinfo/python-list
Am 10.11.2010 04:36, schrieb Asun Friere:
> Yes but configuration files are not necessarily meant to be edited by
> humans either!
Yeah, you are right. I'm sorry but every time I read XML and
configuration in one sentence, I see the horror of TomCat or Shibboleth
XML configs popping up.
--
http:
nimal knowledge of Italian, but be
prepared to discuss it in English in the following.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
Am 12.02.17 um 22:07 schrieb BartC:
On 12/02/2017 20:38, Christian Gollwitzer wrote:
Am 12.02.17 um 21:19 schrieb Paolo:
Buonasera, è da un pò che sto cercando come esercizio di scrivere un
file al contrario.
Mi spiego meglio ho un file con N righe e vorrei scriverne un altro con
gli stessi
retical) right way", which is using another table.
Insert your keys into a table, maybe temporary one, and then do
select * from mumble where key in (select key from keytable)
In theory that should also be faster, but unless you have a thousand
keys, there will be no noticeable d
ackage vlc and via an external call to os.system.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
-0308/
This should be the first place to go if you want to learn about Python
language decisions. Asking here will just start the flame fire again.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
and tabs
are merely "allowed" - see PEP8
https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
Both have advantages and disadvantages for indentation. Some ideas how
to get both have never gained widespread adoption:
http://nickgravgaard.com/elastic-tabstops/
use an absolute path...
...which is reality for a lot more people than you might think. On a
German keyboard, / is Shift-7. Same for \ {} [] which require
carpal-tunneling combinations with the right Alt key "Alt Gr".
Especially bad are shortcutrs like Ctrl+\ which appear in some software.
r the
instructions and assign variables to registers.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
here you can sometimes recover portions of the data, the full drive is
completely dead from one point on.
Christian
[1]
https://www.heise.de/newsticker/meldung/SSDs-im-Stresstest-mit-ueberraschenden-Ergebnissen-3580824.html
--
https://mail.python.org/mailman/listinfo/python-list
something;
break" thingy is just an idiom to fake a do..while loop in Python.
C does have it, for example, and it is way better like this than the
abuse of assignment and comma operator in the condition.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
Am 18.04.17 um 08:21 schrieb Chris Angelico:
On Tue, Apr 18, 2017 at 4:06 PM, Christian Gollwitzer wrote:
Am 18.04.17 um 02:18 schrieb Ben Bacarisse:
Thanks (and to Grant). IO seems to be the canonical example. Where
some languages would force one to write
c = sys.stdin.read(1)
while
cense, supports many platforms and gives
reasonable (unoptimized) code. AFAIK Mathworks does that, they ship tcc
on Windows so that you can build .mex files without installing
additional software, though they recommend to get a decent compiler for
performance reasons
Christian
--
https://mai
Am 16.05.17 um 09:53 schrieb Chris Angelico:
On Tue, May 16, 2017 at 5:14 PM, Christian Gollwitzer wrote:
More likely would be the option to ship a C compiler with Python written in
C. For C++ this is way too big, but a pure C compiler can be as small as
1MB. tcc has a liberal license
Am 18.05.17 um 00:21 schrieb Chris Angelico:
On Thu, May 18, 2017 at 8:06 AM, Christian Gollwitzer wrote:
tcc even has a "JIT-mode" of operation (libtcc). For Tcl, there exists an
extension which compiles C code to memory and executes directly from there.
The same thing could b
nload via svn? Isn't everything hosted on git these days, or at least
mirrored somewhere where it can be accessed via git?
Christian
--
https://mail.python.org/mailman/listinfo/python-list
Am 18.05.17 um 10:10 schrieb Christian Gollwitzer:
The whole discussion reminds me of the "bumblebees can't fly" thing.
tcc is a very small compiler (some 100kb) which supports most of C99.
For what it's worth, I compiled Python 3.6.1 on Linux/x86 using tcc. It
wa
Am 21.05.17 um 12:38 schrieb bartc:
On 21/05/2017 10:32, Christian Gollwitzer wrote:
Am 18.05.17 um 10:10 schrieb Christian Gollwitzer:
The whole discussion reminds me of the "bumblebees can't fly" thing.
tcc is a very small compiler (some 100kb) which supports most of C99.
wicth a GUI to configure all the
compile options. Probably no human would be able to set them to a
reasonable value without the help of thsi software.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
the
user can close them freely, then one should withdraw the main window:
root=Tkinter.Tk()
root.withdraw()
now the main window disappears, the user can't incidentally close it.
One can then create additional toplevel windows using
t=Tkinter.Toplevel()
and place anything there. These can be closed without destroying the
application / exiting the main loop.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
s is the
original question.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
not the same thing).
> However, to answer the question you actually asked, yes, all the time.
@ is an actual operator in Python. It was added in Python 3.5 as infix
matrix multiplication operator, e.g.
m3 = m1 @ m2
The operator is defined in PEP 465,
https://www.python.org/dev/pep
elegant and faster approach if you use a non-data
descriptor instead of a property or a lru_cache. If you use a non-data
descriptor property, you can even get rid of subsequent function calls.
I dumped some example code in a gist,
https://gist.github.com/tiran/da7d4c43d493c5aa7d7abc4d8a0678a6
Christ
the
right combination of BasicConstraint, Key Usage and Extended Key Usage.
For my tests I use my own project CA. For example
https://github.com/latchset/custodia/tree/master/tests/ca/ contains a
script to generate a CA and two EE certs. The server cert is valid for
localhost and 127.0.0.1. You can easily extend the configuration to
include one or multiple intermediate CAs.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
re:
https://groups.google.com/d/msg/comp.lang.python/AB42dD5xB_U/pYG6-rnMBQAJ
Maybe it is useful now. If you replace the "askopenfilename" by
"askopenfilenames", it will allow to select multiple files and return
them as a list.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
packaging
(e.g. data files are installed to /usr/share when requested), portability and
customisation (i.e. data files can be replaced by the user or
alternative locations can be specified)?
Regards,
Matthias-Christian
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Apr 01, 2011 at 08:37:35PM +0200, Matthias-Christian Ott wrote:
> I want to include data files with a python package. With distutils it
> seems common to specifiy these files in the data_files argument with a
> non-portable location (e.g. data_files=[('share/examp
A bit of a hack of course, but you can enclose the code that should be
commented out with ''' and ''' or """ and """ (not sure about the name of
this tripple-quoting)
OTOH, some (or even most if not all) Python editors support blockquoting
by pushing a button or using shortcuts. SPE and IDLE for ex
ckage available for image processing using Python 3.4.3?
Or what is the recommendation of Python for image processing?
Do you know any good Python book on the subject or tutorial ?
Thank you enormously,
Christian
--
https://mail.python.org/mailman/listinfo/python-list
thout Make-up (once),
Mrs. Betty Bowers
America's Best Christian
www.bettybowers.com
--
http://mail.python.org/mailman/listinfo/python-list
t for school is shown
-> add a school
-> -> input for Programme is shown
-> -> add a programme
-> -> -> etc..
also the option to add new school and program so can have a one to many
relationship.
Thanks
Christian K
--
Christian Kortenhorst
mod: +353-(0)87-6183349
home: +353-(0)1-4966287
--
http://mail.python.org/mailman/listinfo/python-list
Pyevolve is an evolutionary computation framework written in pure
Python. This is the first release candidate before the 0.6 official
release.
See more information about this release on the official announce at
(http://pyevolve.sourceforge.net/wordpress/?p=1164) or in the
Documentation site at (h
?
Thanx in advance
Mit freundlichen Grüßen
Christian Scheiber
--
https://mail.python.org/mailman/listinfo/python-list
the C code.
Christian
--
https://mail.python.org/mailman/listinfo/python-list
quot;foo" package if "baR()" really exist.
Can I fix this somehow?
I am aware that this would get detected by a unit test. That is the way
I do prefer in most cases. But sometimes not all code segments are
covered by tests. I'm more interested in using a linter or somethi
Hello Dieter,
thanks for your reply.
Am 06.11.2023 19:11 schrieb Dieter Maurer:
One option is a test suite (--> Python's "unittest" package)
with a sufficiently high coverage (near 100 %).
Yes, that is the primary goal. But it is far away in the related
project.
I got a hint that "pylint"
e problems and possible solutions I created
this minimal examples. I also do plan a tutorial repo about Debian
Python Packaging using the same approach with minimal examples
illustrating different use cases.
Thanks in advance,
Christian
--
https://mail.python.org/mailman/listinfo/python-list
What is the "command line" on your Windows 11?
On Windows 10 it usually is "cmd.exe" (Windows Command Prompt).
On Windows 11 it usually is the "Terminal" which is different from
cmd.exe.
--
https://mail.python.org/mailman/listinfo/python-list
Thank you very much for all your responses.
Am 24.10.2024 17:17 schrieb Left Right:
To investigate this, I'd edit the file with the assertion and make it
print the actual value found in os.lstat and func. My guess is that
they are both somehow "lstat", but with different memory addresses.
My
Hello Barry,
thank you for your reply and clarifying the Fedora aspects.
Am 25.10.2024 00:44 schrieb Barry:
What do you mean by the real file sustem?
You cannot write to the /usr file system. Is that what your tests do?
If so that needs changing.
Asking the right questions brings up to impor
Am 25.10.2024 09:06 schrieb Christian Buhtz via Python-list:
On a "regular" system all tests are running.
To clarify: "regular" does not exclude PyFakeFS. It means on my own
local development machine and on the TravsCI machines (Ubuntu 22 with
Python 3.9 up to 3.13) a
iner also has no clue how to solve it or why
it happens.
Can you please have a look (especially at the line "assert func is
os.lstat").
Maybe you have an idea what is the intention behind this error raised by
an "assert" statement inside "shutil.rmtree()".
T
As you can see in the linked issue it seems it was an incompatibility
between the version of Python and PyFakeFS.
In the end it was a Fedora packaging bug because that pyfakefs version
was not compatible with Python 3.13.
Thanks in advance for helping out.
--
https://mail.python.org/mailman/list
example. Pipx is not
intended to install Python packages that are not applications.
Regrads,
Christian
--
https://mail.python.org/mailman/listinfo/python-list
1901 - 1987 of 1987 matches
Mail list logo