Am 21.04.2023 um 18:07 schrieb Thomas Passin:
On 4/20/2023 5:47 PM, Ralf M. wrote:
Hello,
when I run a script with a "normally" installed python, the directory
the script resides in is automatically added as first element to
sys.path, so that "import my_local_module" find
Am 22.04.2023 um 03:27 schrieb Greg Ewing via Python-list:
How are you invoking your script? Presumably you have some code
in your embedding application that takes a script path and runs
it. Instead of putting the code to update sys.path into every
script, the embedding application could do it be
Am 21.04.2023 um 17:31 schrieb Mats Wichmann:
On 4/20/23 15:47, Ralf M. wrote:
Hello,
when I run a script with a "normally" installed python, the directory
the script resides in is automatically added as first element to
sys.path, so that "import my_local_module" finds m
ot;, 1)[0]
if script_path not in sys.path:
sys.path[0:0] = [script_path]
import my_local_modul
That works, but it's ugly, executing code between imports is frowned
upon, and it needs to be added to every script.
Does anybody have a better idea?
Any help is appreciated.
Ralf M.
--
https://mail.python.org/mailman/listinfo/python-list
Am 17.09.2022 um 00:35 schrieb Dan Stromberg:
On Fri, Sep 16, 2022 at 2:06 PM Ralf M. <mailto:ral...@t-online.de>> wrote:
I would like to replace a method of an instance, but don't know how to
do it properly.
You appear to have a good answer, but... are you sure
Am 16.09.2022 um 23:34 schrieb Eryk Sun:
On 9/16/22, Ralf M. wrote:
I would like to replace a method of an instance, but don't know how to
do it properly.
A function is a descriptor that binds to any object as a method. For example:
>>> f = lambda self, x: self + x
or what sections of the
documentation to read next.
Any ideas / pointers?
Ralf M.
--
https://mail.python.org/mailman/listinfo/python-list
can be used in several
namespaces and as attributes. It's just a bit harder to use
non-identifier names than identifiers.
Whether it's a good idea to use them at all is a different question.
I think the OP wondered about the .0 in the local namespace within list
comprehensions. Unfortunately I cannot say much about that.
Paul
Ralf M.
--
https://mail.python.org/mailman/listinfo/python-list
Am 25.04.2021 um 16:30 schrieb Mats Wichmann:
On 4/24/21 2:57 PM, Chris Angelico wrote:
On Sun, Apr 25, 2021 at 5:57 AM Gisle Vanem
wrote:
With 'py -3.6' or 'py 3.8' I get the expected.
But with 'py -3':
Python 3.8.9 (default, Apr 13 2021, 15:54:59) [GCC 10.2.0 64 bit
(AMD64)] on win32
Hello,
to my last question I got many helpful and enlightening answers.
So I try again with a completely different topic.
https://docs.python.org/3/library/unittest.html#test-discovery
says about test discovery:
"Unittest supports simple test discovery. In order to be compatible with
test disc
nd
another, different instance of En and its members is created.
How do I have to change mod1.py to avoid the problem?
Currently I have moved main() into a new file script.py. That works, but
is not what I wanted.
I doubt it's a bug in the enum module, but should that be the case, I
Am 18.09.2019 um 22:24 schrieb Alexandre Brault:
On 2019-09-18 4:01 p.m., Ralf M. wrote:
I don't know the exact rules of Windows wildcards, so there may be
even more cases of unexpected behavior.
If anyone knows where to find the complete rules (or a python module
that implements the
Am 18.09.2019 um 22:22 schrieb Chris Angelico:
On Thu, Sep 19, 2019 at 6:20 AM Ralf M. wrote:
Am 17.09.2019 um 20:59 schrieb Manfred Lotz:
I have a function like follows
def regex_from_filepat(fpat):
rfpat = fpat.replace('.', '\\.') \
unexpected behavior.
If anyone knows where to find the complete rules (or a python module
that implements them), I would be interested.
Regards,
Ralf
- Details (Win 7 home SP1) -
C:\tmp>more pydirb.py
#!/usr/bin/env python3
import os, re, sys
def regex_from_filepat(fpat):
Recently I wrote a quick and dirty script to do some counting and
statistics. When I re-read it a bit later I noticed that I had been
using two different ways to create two-dimensional (default-)dicts. Now
I'm wondering whether one of them is "better" or more pythonic than the
other.
What I d
Hi Mike,
you can check for the major version with
import sys
sys.version_info.major
On 01.06.2018 04:44, Mike McClain wrote:
OK so I installed python 3.2, which is the latest available as a
package in Debian Wheezy, because I've seen so many folks say it's a
waste of time to play with Py
* David Shi via Python-list :
> Can anyone explain please.
http://stackoverflow.com/questions/2051192/what-is-a-python-egg
--
Ralf Hildebrandt Charite Universitätsmedizin Berlin
ralf.hildebra...@charite.deCampus Benjamin Franklin
https://www.charite
> According to Ralf, python.org is hosted in the Netherlands,
One could change that.
> I want to buy peanut butter, but I don't, because I know that when it comes
> to peanut butter I have no self-control and would eat the entire jar in a
> single sitting. So I simply don'
article wasn't one on
> > our list, which is why we missed this one.
>
> I don't believe that the Python mailing list archives are hosted in a
> country under the jurisdiction of European Law.
The Netherlands it is.
--
Ralf Hildebrandt Charite
that the "next in thread" also was of defamatory content. Removed
as well.
--
Ralf Hildebrandt Charite Universitätsmedizin Berlin
ralf.hildebra...@charite.deCampus Benjamin Franklin
http://www.charite.de Hindenburgdamm 30, 12203 Berlin
Geschäftsbereich
; python-list-owner, on the theory that this will be more useful than
> discussion about it here.
> --
> https://mail.python.org/mailman/listinfo/python-list
The right place is postmas...@python.org, since the owner cannot clean
the archives.
--
Ralf Hildebrandt Ch
iversal wheel
- remove scripts subdirectory
- add --index-url cli parameter
1.1.4 (2014-01-03)
--
- make pypiserver compatible with pip 1.5
(https://github.com/schmir/pypiserver/pull/42)
--
Cheers
Ralf
--
https://mail.python.org/mailman/listinfo/python-list
Fábio Santos writes:
> Seems like it has awesome features, but py3k is really important to me. Is
> this on your roadmap?
Sorry, I don't have a need for python 3 and also don't have a roadmap.
--
Cheers
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
s command 'bdist_bbfreeze'
A new distutils/setuptools command bdist_bbfreeze integrates
bbfreeze into your setup.py.
bbfreeze works on windows and UNIX-like operating systems. bbfreeze
has been tested with python 2.4, 2.5, 2.6 and 2.7 bbfreeze will not
work with python 3 or higher.
--
fix "pypi-server -U" stable/unstable detection, i.e. do not
accidentally update to unstable packages
--
Cheers
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
broken xmlrpc api on pypi.python.org by using HTTPS
--
Cheers
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
for assembly macro for PPC Linux
platforms.
Many thanks to all contributors!
[1] http://opensource.hyves.org/concurrence/
[2] http://eventlet.net/
[3] http://www.gevent.org/
--
Cheers
Ralf Schmitt
--
http://mail.python.org/mailman/listinfo/python-list
or verify, doc_upload and remove_pkg
--
Cheers
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
cumentation
- make the test suite work on python 3
- make pypi-server-standalone work with python 2.5
--
Cheers
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
pp_factory now use the the password_file option to create the
app. Without this the package upload was not working.
- Add --fallback-url argument to pypi-server script to make it
configurable.
--
Cheers
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
python setup.py register' work
- added init scripts to start pypiserver on ubuntu/opensuse
--
Cheers
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
/
[3] http://www.gevent.org/
--
Cheers
Ralf Schmitt
--
http://mail.python.org/mailman/listinfo/python-list
pypiserver work with pip on windows
- add support for password protected uploads
- make pypiserver work with non-root paths
- make pypiserver 'paste compatible'
- allow to serve multiple package directories using paste
--
Cheers,
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
e a way to get the WSGI app
- improved package name and version guessing
- use case insensitive matching when removing archive suffixes
- fix pytz issue #6
--
Cheers,
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
x27;pypi-server -U' compatible with pip 1.1
--
Cheers,
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
://www.gevent.org/
--
Cheers
Ralf Schmitt
--
http://mail.python.org/mailman/listinfo/python-list
x64 windows
* Add a test for greenlet C++ exceptions
* Fix compilation on Solaris with SunStudio
[1] http://opensource.hyves.org/concurrence/
[2] http://eventlet.net/
[3] http://www.gevent.org/
--
Cheers
Ralf Schmitt
--
http://mail.python.org/mailman/listinfo/python-list
build dependencies patch from flub.
* #21 - Can't pass parent=None to greenlet.greenlet()
[1] http://opensource.hyves.org/concurrence/
[2] http://eventlet.net/
[3] http://www.gevent.org/
--
Cheers
Ralf Schmitt
--
http://mail.python.org/mailman/listinfo/python-list
e setup.py install without calling 2to3 by changing source code
to be compatible with both python 2 and python 3. We now ship a
slightly patched version of bottle. The upcoming bottle 0.11
also contains these changes.
- make the single-file pypi-server-standalone.py work with python 3
--
Ch
ctionality to manage package updates
- updated documentation
- python 3 support has been added
--
Cheers,
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
server now scans the given root directory and it's
subdirectories recursively for packages. Files and directories
starting with a dot are now being ignored.
- /favicon.ico now returns a "404 Not Found" error
- pypiserver now contains some unit tests to be run with tox
-
tudio 2010 will be supported?
I am using python 2.6.5, but web searching seemed to show that 2.7 or
3.X didn't support it yet either.
-Ralf Haring
--
http://mail.python.org/mailman/listinfo/python-list
here. Assuming your filename is importme.py and your classname
is Test you can do the following imports:
from sub1.importme import Test
import sub1.importme
You can find further explainations in the official tutorial
http://docs.python.org/tutorial/modules.html
Regards,
Ralf
--
http
are with me a bit of
experience?
Did you try suds https://fedorahosted.org/suds ? I've got good results
with this library.
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
Novice to Professional by
Magnus Lie Hetland. This book provides a gently introduction into Python
and 10 chapters with "complete" projects.
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
t know where to even start on this one.
Thanks for any help/pointers
Peter
Hi,
a good starting point possibly is
http://wwwsearch.sourceforge.net/mechanize/
Regards,
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
that it is
useable at windows and linux. For the socket programming I would like to
suggest using the xmlrpclib. You can find the official documentation
here: http://docs.python.org/library/xmlrpclib.html
Regards,
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
> I think that for whatever reasons, explorer always tries to create
> shell extensions as InProc. CoCreateInstance, which is the usual
> API to create COM instances, allows to specify which one you want.
>
> Thomas
So there is no way to do this, other than to create a "proxy" COM
object as InPr
I'm trying to develop Windows Shell Extensions with the Python Win32
Extensions. Most of the samples are working. However, I have a
slightly different need: I want the Python COM server to run as a
separate process ("LocalServer" or "OutOfProc").
As I understand, both the InProc and LocalServer ve
sys.exit()
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
these are the big ones.
Actually, ff you want to see an Python email client in action have a
look at Chandler: http://chandlerproject.org/ it's written in wxPython.
Regards,
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
l(s)
''
>>>
Regards,
AJ
Hi,
yes, the following evaluates to False:
empty String: ''
empty list: []
empty tuple: ()
empty dict: {}
0, None
and False of course
Regards,
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
npapers.org/index.php/tpp/article/view/71
Regards,
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
in this library were rather
painful but som year ago it was the most sophisticated library.
Regards,
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
and
track binary dependencies.
This release features a new bdist_bbfreeze command, which integrates
bbfreeze into setup.py scripts (contributed by Hartmut Goebel,
thanks).
More information can be found at the python package index:
http://pypi.python.org/pypi/bbfreeze/
Regards,
- Ralf
--
http
any matplotlib)
Try running 'XREF=1 bb-freeze test5-coded-pre.py'. This should open a
browser window with your dependencies...
Regards,
- Ralf
--
http://mail.python.org/mailman/listinfo/python-list
ttests for your code. This will lead to
more testable and shorter chunks of code and your test cases will be
executed on each iteration step.
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
Hi there,
hope somebody here can help me out:
is there a command in matplotlib which resembles DISLIN's "CALL
NEWPAG" ?
I am trying to make multiple plots on several pages, all stored in one
ps (or pdf) document.
Cheers
-Ralf
--
http://mail.python.org/mailman/listinfo/python-list
/_psycopg.so: symbol round:
referenced symbol not found
Any suggestions or help will be appreciated.
Hi,
maybe a stupid question - but why don't you want to use the "official"
package? You can download it here:
http://sunfreeware.mirrors.tds.net/indexsparc10.html
Regards,
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
; sock = urlopen(path)
> page=sock.read()
> if "There is currently no text in this page" in page:
> print "found"
> return True
> else:
> print "not found"
> return False
>
> if __name__=="__main__":
> urlexists("cheese_test")
Are you using the same user in your cgi script and within IDLE?
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
ure if that is needed in this
> situation.
>
> Best Regards,
> Tom
Hi,
have a look at the csv Module: http://docs.python.org/lib/csv-examples.html
Just iterate over your result.
# Untested
import csv
writer = csv.writer(open("some.csv", "wb"))
for row in result:
row = map(str,row)
writer.writerows(row)
writer.close()
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
Ralf Schönian schrieb:
> t_rectenwald schrieb:
>> Hello,
>>
>> I attempting to execute an Oracle query, and write the results to a
>> file in CSV format. To do so, I've done the following:
>>
>> import cx_Oracle
>> db = cx_Oracle.conne
ession_key'] = Config.username
self._br['session_password'] = Config.password
response=self._br.submit()
self._br.set_response(response)
for link in self._br.links(url_regex="www.somesite.com"):
self._br.follow_link(link)
if 'Sign In' in self._br.title():
raise ValueError('Wrong password')
Regards,
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
is there anybody who can help me.
I would like to use a Python Script to download Files from a Server to the
Client, to update the Client.
Thanx
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
Have a look at: Core python programming from Wesley J. Chun printed by
Prentice Hall.
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
ered
>
> thanks
>
Take a look at gaphor: http://gaphor.sourceforge.net/
Regards,
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
from http://python.org/community/jobs/)? If any one
> knows of a resume repository (other than Monster, Dice,
> Costs-an-arm-and-leg job site) please share.
Do not know if you have to give your arm or your leg away, but maybe the
following place is of interest for you:
http://www.opensou
import them by extending the path with
sys.path.append() After changing any file here, I have to restart
Karrigell.
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
> I'm not sure what changed, because it used to work. anyhow thanks a lot!
You forgot to import the string module:
from string import *
Regards,
Ralf Schoenian
--
http://mail.python.org/mailman/listinfo/python-list
Is their anybody with xperience in using the both and can provide me with
some xamples.
Thx a lot
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
ion(s)
in the server (which is true in some sense, since I never made
a policy - I just want a blood DB).
It seems the proper way to use gadfly over the net is to say
echo 'SQL statement;' | ssh -l remoteuser 'gfplus -localoptions'
:-(
Is anybody out there who has used the server+client operation
mode successfully?
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
.
> Time to report a bug, methinks? Makes SQLite look good ...
Carl Waldbieser reported this bug (and a few others, including
fixes) in April 04 (entry 94049[35]). It seems the project
fell asleep four years ago (but in "News" on SF is a more recent
message from the author pointing to
x27; is not defined
which is factually correct (the script only imports sys,
but then tries to instantiate the class "Server" which is
nowhere defined).
Is this a bug somewhere, or is just my installation broken?
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
MAIL PROTECTED]>
SCNR, Ralf
--
http://mail.python.org/mailman/listinfo/python-list
(i.e. no ghc) and is simpler
to use (no questions about inexistent .afm files etc.)
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
le helps only if the data is tabular (i.e. a single relation),
i.e. probably never (otherwise the sending side would have shipped
something like CSV).
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
: 'implementation, not
> API') attributes.
That's what I meant. "A.func" looked like an internal implementation
detail.
>> or be documented.
Having the implementation details documented too would be nice, but
hardly enforceable in real life.
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
change your code.
3. Call dir(classname) at runtime and raise an exception
if it contains a name used by you.
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
John D Salt wrote:
> I'll believe you if you can give me a list of ten things that don't have
> names.
[ sub{$_}, sub{$_+1}, sub{$_+2}, sub{$_+3}, sub{$_+4},
sub{$_+5}, sub{$_+6}, sub{$_+7}, sub{$_+8}, sub{$_+9}]
That was easy.
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
hing near the end of the Camel book (p. 552ff).
This isn't exactly python, but the baby probably won't see
the difference.
SCNR, Ralf
--
http://mail.python.org/mailman/listinfo/python-list
> set a high standard for naming techniques.
So we should rename Python into Cottonmouth to get more attention.
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
a
defun and use it as a hook (nil means "just the current buffer
whatever mode it is in").
Btw., vim seems to try to become a real editor - look at
http://wiki.alu.org/Vim_ECL
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
at this is really homework.
...
> data = data.upper().replace('T', 'U')
...
I'd apply the "inverse" of this line to the codon table
(or a copy thereof, or just adding the entries) in the hope
that changing 37 table entries is less work than changing
each codon in a
proof ;-)
You will have to decide whether you want ">" or ">="
(beware of the former when using floats).
If you cannot assume that the pairs are in order, this
will break.
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
and 3**x%x==3 and 5**x%x==5]
SCNR, Ralf
PS: They both break at 561, and further strengthening of the
condition will not help. Manual loop unrolling as follows works:
[2,3,... ]+[x for x in range(1,99) if False]
For sufficiently small values of 99, this will also be a rather
short
Schüle Daniel schrieb:
> hello NG,
>
> consider this code
>
> >>> def timelogger(f):
> ... def wrapper(*a,**kw):
> ... print "started at %s" % time.ctime()
> ... t0 = time.time()
> ... f(*a, **kw)
> ... t1 = time.time()
> ... print
Diez B. Roggisch wrote:
> AFAIK iso-8859-1 has all codepoints taken - so you won't go beyond that
> in your example.
IIRC the range 128-159 (i.e. control codes with the high bit set)
are unused.
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
Ganesan Rajagopal wrote:
> Try pexpect instead. http://pexpect.sourceforce.net/
^
That's a content-free ad site. You probably mean sourceforGe.
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
)?
Is there a risk that windows hangs up?
Doing several calls of my dll function with the callback, is there a risk
that the calls overlap and information gets lost?
Thanks for your help!
Ralf
--
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX
ind. This is my preferred solution after thinking about it for a
while (and asking myself "what would be best" while writing new Python code):
def __init__(self, self.x, y, self.z)
An approximation to this is attached for experimentation. It is based heavily
on code posted by others in t
aits until the queue is empty instead
of sleep)?
Ralf
--
http://mail.python.org/mailman/listinfo/python-list
% python
Python 2.4.1 (#1, Apr 7 2005, 11:06:30) [C] on osf1V5
Type "help", "copyright", "credits" or "license" for more information.
>>> execfile.__doc__
'execfile(filename[, globals[, locals]])\n\nRead and execute a Python script
from a file.\nThe globals and locals are dictionaries, defaulting
> file_object, data
sys.stdout = StringIO()
show("hello, world.")
If you run this, you will see "hello, world." on the screen. This means the
right side of file_object=sys.stdout is evaluated when the Python code is
parsed/compiled, not when it is executed.
Chee
plain_adopt_grouping: 0.69
autoinit_grouping: 1.14
autoinit_setattr_grouping: 1.07
autoattr_grouping: 1.01
decorated_init_grouping: 0.94
I think your decorator solution looks nice and has a good potential time-wise.
Cheers,
Ralf
it immediately:
in __init__() _y = 2
self.x = 1
self.z = 3
in __init__() _y = 3
self.x = 2
self.z = 1
Traceback (most recent call last):
File "/net/cci/rwgk/decorated_init.py", line 45, in ?
MyClass( z = 1, x = 2, _y = 3 ).show()
File "/net/cci/rwgk/de
if there is a way to hide the _ or self_ from the user of the
class, i.e. given:
class foo(object):
@attribute_decorator
def __init__(self, x, _y, z):
pass
can we make it such that the user can still write
foo(x=1,y=2,z=3)
without the underscore?
Cheers,
Ral
corator doesn't need a "slots" class.
>
> AFAICT this differs from your proposal in that in your proposal you
> want to use '.' as an include prefix the above uses '_' as an exclude
> prefi
x27;t work.
2. This approach is open to full optimization for runtime performance
and should therefore be faster than the redundant conventional
approach. I.e. the arguments can directly be inserted into the
desired dictionary (or slot), without ever being adde
ows immediately what
is going on. In contrast, the __metaclass__ statement is potentially separated
from the __init__ definition by unrelated code, leading to surprises (on top of
intimidation for beginners). I don't think that's the best style. It is
generally better if the framework doesn&
oo slow. But it turns out to be
faster:
overhead: 0.00
plain_grouping: 0.27
update_grouping: 0.43
plain_adopt_grouping: 0.68
autoinit_grouping: 1.15
autoinit_setattr_grouping: 1.08 # yours
autoattr_grouping: 1.06
I am am
1 - 100 of 107 matches
Mail list logo