Re: Chardet oddity

2024-10-24 Thread Roland Mueller via Python-list
ke 23. lokak. 2024 klo 20.11 Albert-Jan Roskam via Python-list ( python-list@python.org) kirjoitti: >Today I used chardet.detect in the repl and it returned windows-1252 >(incorrect, because it later resulted in a UnicodeDecodeError). When I > ran >chardet as a script (which uses Unive

Re: Common objects for CLI commands with Typer

2024-10-16 Thread Roland Müller via Python-list
On 9/23/24 22:51, Dan Sommers via Python-list wrote: On 2024-09-23 at 19:00:10 +0100, Barry Scott wrote: On 21 Sep 2024, at 11:40, Dan Sommers via Python-list wrote: But once your code gets big the disciple of using classes helps maintenance. Code with lots of globals is problematic. Eve

Re: Unable to completely remove Python 3.10.9 (64 bit) from Computer

2023-10-04 Thread Roland Müller via Python-list
On 25.9.2023 19.58, Pau Vilchez via Python-list wrote: Hello Python Team, I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my computer. I have tried deleting the Appdata folder then repairing and then uninstalling but it still persists in the remove/a

Re: ChatGPT Generated news poster code

2023-02-12 Thread Roland Müller via Python-list
r too ... But this is too much -Roland -- https://mail.python.org/mailman/listinfo/python-list

Re: Return

2021-12-09 Thread Roland Müller via Python-list
t will continue to run the function. In your example the while loop will continue until the condition 'l<=r' is true. If Python exits the while loop then there is a return -1. BR, Roland Regards Vani On Wed, Dec 8, 2021 at 2:15 AM Roland Mueller wrote: Hello ti

Re: HTML extraction

2021-12-07 Thread Roland Mueller via Python-list
vantages and more, with about the same costs. However, if you're > looking for a no-external-deps option, Python *does* include an HTML > parser in the standard library: > > But isn't bs4 only for SOAP content? Can bs4 or lxml cope with HTML code that does not comply with XML

Re: Return

2021-12-07 Thread Roland Mueller via Python-list
ame__ == "__main__": print(f"f(): {f()}") print(f"g(): {g()}") print(f"h(): {h()}") Result: f(): 42 g(): None h(): None Pydoc: $ pydoc return BR, Roland > Thanks > Vani > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: Free OCR package in Python and selecting appropriate widget for the GUI

2021-09-22 Thread Roland Mueller via Python-list
integrate this into a Python script that makes a call to this external OCR e.g. using Python module subprocess. BR, Roland > Second: > Because, I can not attach a picture to this post, I try to describe my > picture of my GUI. > It is a 3x3 block / matrix (one third of the whole Sudok

Re: Change the display style of the text on the STACKLINE.

2021-09-10 Thread Roland Mueller via Python-list
pe 10. syysk. 2021 klo 17.22 Greg Ewing (greg.ew...@canterbury.ac.nz) kirjoitti: > On 10/09/21 6:11 pm, Roland Mueller wrote: > > When I call print(s) it even shows ABCD and D is underscored. But > copying > > the output to mail looses the underscore ... > > If the term

Re: Change the display style of the text on the STACKLINE.

2021-09-09 Thread Roland Mueller via Python-list
pe 10. syysk. 2021 klo 8.53 hongy...@gmail.com (hongyi.z...@gmail.com) kirjoitti: > On Thursday, September 9, 2021 at 8:57:37 PM UTC+8, Roland Mueller wrote: > > Hello > > > > to 9. syysk. 2021 klo 6.53 hongy...@gmail.com (hongy...@gmail.com) > > kirjoitti: > >

Re: Change the display style of the text on the STACKLINE.

2021-09-09 Thread Roland Mueller via Python-list
d:M-b' Replace D and M with _D_, _M_ >>> percol.view.STACKLINE = re.sub(r'([DM])', r'_\1_', percol.view.STACKLINE) 'Fold:F1,F2,F3 Push:C-p Pop:_M_-p Script:_M_-s _D_ir:_M_-d _D_ircmd:_M_-b' Regards, Roland > How to achieve this purpose? >

Re: Flask – how to write csv file & save using prefilled value of the filename (response.headers["Content-Disposition"]="attachment; filename=xxx")

2021-08-09 Thread Roland Mueller via Python-list
ps://mail.python.org/mailman/listinfo/python-list May be you should use io.StringIO to create a file/stream from an input string. from io import StringIO s = "\n".join(["a","b","c"]) + "\n" for line in StringIO(s): print(f"\t{line}") BR, Roland -- https://mail.python.org/mailman/listinfo/python-list

Re: Where to keep local Python modules?

2021-07-23 Thread Roland Mueller via Python-list
an be checked then in Python: python >>> import sys >>> sys.path ['', '/home/someuser/.local/lib/python', '/usr/lib64/python39.zip', '/usr/lib64/python3.9', '/usr/lib64/python3.9/lib-dynload', '/usr/local/lib/python3.9/

Re: pyttsx3 installation error

2021-07-02 Thread Roland Mueller via Python-list
What's about installing? https://pypi.org/project/pyttsx3/ pe 2. heinäk. 2021 klo 23.41 Nikita Lohale (nikitalohal...@gmail.com) kirjoitti: > Traceback (most recent call last): > File "f:\Nikita\Python programming\Iron Man Jarvis AL\jarvis.py", line > 1, in > import pyttsx3 > ModuleNotFoun

Re: is not recognized as an internal or external command, operable program or batch file.

2021-03-02 Thread Roland Mueller via Python-list
Hello, this is windows setup issue related to the fact that python binary is not in execution path. For setting up you may find instructions by searching for "windows 10 put python to path". One result is following page: https://superuser.com/questions/143119/how-do-i-add-python-to-the-windows-pat

Re: Troubles with Python imports

2021-02-10 Thread Roland Mueller via Python-list
ke 10. helmik. 2021 klo 5.07 Terry Reedy (tjre...@udel.edu) kirjoitti: > On 2/9/2021 9:55 AM, Philipp Daher via Python-list wrote: > > Hello, > > > > I’ve just typed „pip install selenium“ into my command prompt on windows > 10. Although my computer told me that the requirement was already > satis

Re: Python 3.9. 1 not working

2021-02-10 Thread Roland Mueller via Python-list
Hello, Please note that this is not a kind of support service rather than a community where people help each other on voluntary base. In order to get help from here, you should provide enough information about your issue with Python 3.9 that others can figure out what happened. BR, Roland ke

Re: Simple question - end a raw string with a single backslash ?

2020-10-15 Thread Roland Müller via Python-list
= r'end\\'[:-1]     >>> list(a)    ['e', 'n', 'd', '\\'] Neither of which are nice. You can also write r'end' '\\'. It is not too nice, but it looks nicer to me then two other variants. I used the triple single quotes as delimiter: >>> s = r'''a single quote ', a double quote "''' >>> s 'a single quote \', a double quote "' BR, Roland -- https://mail.python.org/mailman/listinfo/python-list

Re: Hot reload Flask app?

2020-10-01 Thread Roland Müller via Python-list
http://www.gevent.org/api/gevent.baseserver.html#gevent.baseserver.BaseServer.stop Running flask app.run(debug=True) will make the Flask server watching the filesystem for source code changes and re-deploy your app. https://pythonhosted.org/Flask-Debug/ -Roland -- https://mail.python.o

Re: Alternatives to XML?

2016-08-26 Thread Roland Koebler
ing some kind of XML-like-fileformat with many non-intuitive assumptions.) Roland PS: On Wed, Aug 24, 2016 at 04:58:54PM +0200, Frank Millman wrote: > Here is a JSON version - > > { > "case": { >"compare": { > "-src": "_par

Re: [Bulk] Re: Alternatives to XML?

2016-08-26 Thread Roland Koebler
t; than some "XML-like" file structure. So, please: - Don't try to write your own (not-quite-)XML-parser. - Read how XML-files work. - Read https://docs.python.org/3/library/xml.html and https://pypi.python.org/pypi/defusedxml/ - Think what you have done. - Use a sensible XML-parser/dumper. This should escape most special- characters for you (at least: < > & " '). Roland -- https://mail.python.org/mailman/listinfo/python-list

Re: Recommendation for GUI lib?

2016-06-07 Thread Roland Koebler via Python-list
Python-bindings. But I was never happy with Qt and think some GUI-concepts of GTK+ are much better than the ones of Qt, and I like Glade much more than the Qt designer. best regards Roland -- https://mail.python.org/mailman/listinfo/python-list

Re: ONE CLICK REST API

2016-04-05 Thread Roland Mueller via Python-list
for yourself: - http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask BR, Roland 2016-04-04 9:09 GMT+03:00 David Shi via Python-list : > Eclipse has got one click app for creating REST services. > What is it equivalent in Python? > Regards. > David

Re: Weird connection problem

2014-10-25 Thread Roland Hedberg
It’s a special HTTPS url and searching further it seems to be a SNI problem talked about here: http://stackoverflow.com/questions/18578439/using-requests-with-tls-doesnt-give-sni-support > 25 okt 2014 kl. 08:48 skrev Joel Goldstick : > > On Sat, Oct 25, 2014 at 9:40 AM, Roland Hedbe

Re: Weird connection problem

2014-10-25 Thread Roland Hedberg
Oh, by the way! To make this more interesting :-/ I saw this behavior on a Linux machine (Ubuntu 14.04 LTS) using Python 2.7.6 if I do the same exercise on a Mac OS X machine also with Python 2.7.6 - no problem what so ever. > 25 okt 2014 kl. 08:40 skrev Roland Hedberg : > > When

Weird connection problem

2014-10-25 Thread Roland Hedberg
104. What gives ? Oh, by the way it’s a HTTPS url. — Roland ”Being able to think like a child is an important attribute of being an adult” - Eddie Izzard -- https://mail.python.org/mailman/listinfo/python-list

Re: Weird SSL problem

2014-10-01 Thread Roland Hedberg
30 sep 2014 kl. 00:55 skrev Ned Deily : > In article , > Roland Hedberg wrote: > >> Hi! >> >> I¹m trying to access >> https://stsadweb.one.microsoft.com/adfs/.well-known/openid-configuration >> >> Doing it the simplest way I get t

Weird SSL problem

2014-09-29 Thread Roland Hedberg
", line 305, in do_handshake self._sslobj.do_handshake() IOError: [Errno socket error] [Errno 54] Connection reset by peer >>> import ssl >>> ssl.OPENSSL_VERSION ’OpenSSL 0.9.8za 5 Jun 2014' Now, using Safari, or curl for that matter, from the same machine works wi

Re: Which OAuth library?

2014-09-02 Thread Roland Hedberg
ct is a profile of OAuth2 it will work in an OAuth2 context too. This implementation is special in that it’s the de facto reference implementation for OpenID Connect. It’s that, due to the fact that I’ve built the OpenID Connect test suit which most today available OpenID Provider implem

Re: Loading modules from files through C++

2014-07-08 Thread Roland Plüss
> On Wed, May 21, 2014 at 3:17 AM, Roland Plüss wrote: >> The important part are the last two lines. An important module is >> lacking the __builtins__ dictionary member so I had to add it. >> >> Hopefully this works also in Py3 should I switch some time later. But

Re: module_traverse segfault

2014-06-16 Thread Roland Plüss
ere sObject is: @@ struct sObjectType : public PyTypeObject{ spModuleGraphics *ownerClass; }; @@ but maybe the documentation is missing something there? > > In any case, switch to 3.4.1 or later for improved gc and finalization. > Not in GenToo yet as far as I know

module_traverse segfault

2014-06-16 Thread Roland Plüss
-- Yours sincerely Plüss Roland Leader and Head Programmer - Game: Epsylon ( http://www.indiedb.com/games/epsylon ) - Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine , http://dragengine.rptd.ch/wiki ) - Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php ) - A

Re: pyflakes best practices?

2014-06-04 Thread Roland Koebler
Hi, I would recommend to use Pylint (http://www.pylint.org/) in addition to pyflakes. Pylint is much more powerful than pyflakes, and largely configurable. Regards Roland -- https://mail.python.org/mailman/listinfo/python-list

Re: Loading modules from files through C++

2014-06-03 Thread Roland Plüss
ll. METH_OLDARGS is no longer supported! This happenes whenever I try to import something. I never used METH_OLDARGS anywhere so I assume something is broken inside python. Maybe wrong error code for not finding some method or wrong arguments? I can't find any useful documentation on what co

Re: Loading modules from files through C++

2014-05-24 Thread Roland Plüss
_doc__': None, '__loader__': '_frozen_importlib.BuiltinImporter'>, '__package__': None} > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named 'MyModule' > Anybody got an idea? Somebody ha

Re: Loading modules from files through C++

2014-05-21 Thread Roland Plüss
On 05/20/2014 07:55 PM, Chris Angelico wrote: > On Wed, May 21, 2014 at 3:17 AM, Roland Plüss wrote: >> The important part are the last two lines. An important module is >> lacking the __builtins__ dictionary member so I had to add it. >> >> Hopefully this works also

Re: Loading modules from files through C++

2014-05-20 Thread Roland Plüss
On 05/19/2014 03:40 AM, Chris Angelico wrote: > On Mon, May 19, 2014 at 5:41 AM, Roland Plüss wrote: >> This exec source_code in module.__dict__ , should this not also be doable >> with PyEval_EvalCode? > General principle: The more code you write in Python and the less in &g

Re: Loading modules from files through C++

2014-05-19 Thread Roland Plüss
On 05/19/2014 03:40 AM, Chris Angelico wrote: > On Mon, May 19, 2014 at 5:41 AM, Roland Plüss wrote: >> This exec source_code in module.__dict__ , should this not also be doable >> with PyEval_EvalCode? > General principle: The more code you write in Python and the less in &g

Re: Loading modules from files through C++

2014-05-18 Thread Roland Plüss
On 05/17/2014 07:05 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 18:28: >> On 05/17/2014 05:49 PM, Stefan Behnel wrote: >>> Roland Plüss, 17.05.2014 17:28: >>>> On 05/17/2014 04:01 PM, Stefan Behnel wrote: >>>>> Roland Plüss, 17.05.2014 15:49:

Re: Loading modules from files through C++

2014-05-17 Thread Roland Plüss
On 05/17/2014 05:49 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 17:28: >> On 05/17/2014 04:01 PM, Stefan Behnel wrote: >>> Roland Plüss, 17.05.2014 15:49: >>>> On 05/17/2014 03:26 PM, Stefan Behnel wrote: >>>>> Roland Plüss, 17.05.2014 15:00:

Re: Loading modules from files through C++

2014-05-17 Thread Roland Plüss
On 05/17/2014 04:01 PM, Stefan Behnel wrote: > Hi, > > please avoid top-posting. > > > Roland Plüss, 17.05.2014 15:49: >> On 05/17/2014 03:26 PM, Stefan Behnel wrote: >>> Roland Plüss, 17.05.2014 15:00: >>>> On 05/17/2014 01:58 PM, Stefan Behne

Re: Loading modules from files through C++

2014-05-17 Thread Roland Plüss
tally different? On 05/17/2014 03:26 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 15:00: >> On 05/17/2014 01:58 PM, Stefan Behnel wrote: >>> Roland Plüss, 17.05.2014 02:27: >>>> I'm using Python in an embedded situation. In particular I have to load >&g

Re: Loading modules from files through C++

2014-05-17 Thread Roland Plüss
That doesn't work in 2.x, doesn't it? On 05/17/2014 01:58 PM, Stefan Behnel wrote: > Roland Plüss, 17.05.2014 02:27: >> I'm using Python in an embedded situation. In particular I have to load >> python scripts through a memory interface so regular python module >

Loading modules from files through C++

2014-05-16 Thread Roland Plüss
te a module from an in-memory c-string when called from within load_module (or anywhere)? -- Yours sincerely Plüss Roland Leader and Head Programmer - Game: Epsylon ( http://www.indiedb.com/games/epsylon ) - Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine , http://dragengine.rp

Re: What's the best way to extract 2 values from a CSV file from each row systematically?

2013-09-27 Thread Roland Mueller
. > a better way to provide column headers is to use the fieldname parameter when creating the CSV reader. fieldnames is a string array that should match the number of columns in the csv file: *class *csv.DictReader(*csvfile*, *fieldnames=None*, *restkey=None*, * restval=None*, *dialect=&#

Re: Ideal way to separate GUI and logic?

2013-07-13 Thread Roland Koebler
-RPC over TCP-sockets and calls functions on the RPi). regards, Roland -- http://mail.python.org/mailman/listinfo/python-list

ANN: template-engine pyratemp 0.3.0/0.2.3

2013-04-23 Thread Roland Koebler
imple-is-better.org/template/pyratemp-0.2.3.tgz on PyPI: - https://pypi.python.org/pypi/pyratemp/0.3.0 - https://pypi.python.org/pypi/pyratemp/0.2.3 --- Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: How to set my gui?

2013-04-19 Thread Roland Koebler
nd threads, and threading in Python. > Otherwise you'll make your life unnecessarily hard. :) For simple tasks, you don't need threads, but can use the glib-functions timeout_add(), idle_add() etc. Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding NaN in JSON

2013-04-18 Thread Roland Koebler
n code. So, better replace the complete encoder.py or use your own patched version of the complete json-module. Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding NaN in JSON

2013-04-17 Thread Roland Koebler
a ValueError to encode such floats. >>> import json >>> json.dumps(float('NaN')) 'NaN' >>> json.dumps(float('inf')) 'Infinity' Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding NaN in JSON

2013-04-17 Thread Roland Koebler
f default(self, obj): if some-check-if-obj-is-NaN: return 'NaN' return json.JSONEncoder.default(self, obj) Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: I hate you all

2013-04-07 Thread Roland Koebler
option, that will make tab stops be 8 > columns apart, and allow any number of spaces like in python 2, > makes the code I write dependent on that option. There's no need to add this to Python 3, since you already have what you want. Simply use: expand yourscript.py | python3 regards Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: round off to two decimal & return float

2013-03-30 Thread Roland Mueller
2013/3/30 Roland Mueller > Hello, > > 2013/3/30 ஆமாச்சு > >> Consider the scenario, >> >> >> a = 10 >> >> "{0:.2f}".format(a) >> '10.00' >> >> This returns a string 10.00. But what is the preferred method to

Re: round off to two decimal & return float

2013-03-30 Thread Roland Mueller
numeric value a and want to have a float with 2 decimals. This can be achieved with the function round(): >>> a = 10 >>> type(a) >>> a = round(10,2) >>> type (a) >>> a 10.0 BR, Roland > I am trying to assign the value to a cell of a s

Re: Inserting-embedding some html data at the end of a .py file

2013-03-07 Thread Roland Koebler
ni...@superhost.gr [~/www/cgi-bin]# > > which used to work ok in v2.6.6 > > can you help? Python 3 introduced some Python 2-incompatible changes. So, please read: http://docs.python.org/release/3.0.1/whatsnew/3.0.html Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Inserting-embedding some html data at the end of a .py file

2013-03-06 Thread Roland Koebler
the > .py files. > > Do you have an idea? as someone said: You're doing it the wrong way. I would recommend to use a template-engine; then you can put the complete html-design (and some design-control-structures) into the template (and *not* into the cgi) and fill data into the template with a python-script. Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding a for inside an html template for substitution

2013-03-05 Thread Roland Koebler
. If you need Django-like templates without Django, you can use Jinja. And if you need a real sandbox (so that you can use untrusted templates), I would recommend Jinja. Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't catch CTRL-C when SimpleXMLRPCServer running ?

2013-02-22 Thread Roland Koebler
Hi, > I would like to stop the script running in response to a CTRL-C. how about "KeyboardInterrupt"? try: ... except KeyboardInterrupt: print "You pressed Ctrl+C" Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a graphical GUI builder?

2013-02-21 Thread Roland Koebler
gainst > user-supplied versions of Qt. The free license is the LGPL, that's not quite correct; things have changed 2009 and Qt now has three different licenses: - commercial licence - GPL (+GPL exceptions) - LGPL + Qt LGPL Exception (because of inline-functions/templates) since Qt 4.5

Re: Is there a graphical GUI builder?

2013-02-21 Thread Roland Koebler
uple of years... regards Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a graphical GUI builder?

2013-02-20 Thread Roland Koebler
most developers who use Qt use this feature, since the fixed layout is the default in Qt designer and it's not really obvious how to change this for beginners... regards Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a graphical GUI builder?

2013-02-20 Thread Roland Koebler
e than having a base widget where all widgets are derived from, or having layout boxes. It means that most widgets are containers, like buttons, notebook labels, checkboxes, radio buttons, scrollbar-windows etc. And I haven't seen anything like this in Qt (or: in Qt Designer). regards Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: working with csv module in python

2013-02-20 Thread Roland Koebler
ng csv module , directly in > python ? If you don't need to parse/mangle the contents, you don't need the csv module. Simple open the resulting file for writing, and then read out the source files and write their contents into the resulting file. regards Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a graphical GUI builder?

2013-02-20 Thread Roland Koebler
hout a fixed layout. It even seems that the QtDesigner doesn't even provide standard- icons (e.g. for open, close, exit etc.) or a file dialog. Am I doing something fundamentally wrong in QtDesigner, or is QtDesigner really that bad? regards Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a graphical GUI builder?

2013-02-20 Thread Roland Koebler
hink about what > you're putting where, rather than going visually "that looks about > right" - but the reward is that it'll look right no matter where you > run your app. Yes, that's also true for GTK+/Glade. But you have the choice to either build you GU

Re: Is there a graphical GUI builder?

2013-02-19 Thread Roland Koebler
on to build GUIs. yes, there are several, depending on the GUI-toolkit (GTK+, Qt, ...) you want to use. But I would recommend Glade and the GTK+-Toolkit. Simply search for Glade, GTK and Python in your favourite search engine, and you will find several tutorials. regards, Roland -- http://mail.py

Re: Slow termination of process

2012-03-27 Thread Roland Hedberg
, RequestHandlerClass) and then httpd = MyTCPServer((hostname, port), Handler) httpd.serve_forever() and this solved my problem! So, thanks again Chris! 27 mar 2012 kl. 15:55 skrev Chris Angelico: > On Wed, Mar 28, 2012 at 12:03 AM, Roland Hedberg wrote: >>

Slow termination of process

2012-03-27 Thread Roland Hedberg
g up a new server fails. Is there anything I can do to get the port released immediately when the tcpserver is terminated. Or is there another way of doing this that will work better ? Roland --- With anchovies there is no common ground --

Re: OAuth 2.0 implementation

2012-03-27 Thread Roland Hedberg
And then to complicate the picture you have OpenID Connect which is an attempt at bringing OpenID and OAuth2.0 together. By the way I have an implementation of OpenID Connect here: https://github.com/rohe/pyoidc -- Roland 27 mar 2012 kl. 11:59 skrev Stuart Bishop: > On Tue, Mar 27, 2012

Support for Galois/Counter Mode (GCM) ?

2011-11-01 Thread Roland Hedberg
Hi ! Is there a crypto library for Python that has support for GCM ?? -- Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Roland Hutchinson
On Wed, 18 May 2011 07:19:08 +0200, Pascal J. Bourguignon wrote: > Roland Hutchinson writes: > >> Sorry to have to contradict you, > > Don't be sorry. > > >> but it really is a textbook example of recursion. Try this psuedo-code >> on for size: >&

Re: English Idiom in Unix: Directory Recursively

2011-05-17 Thread Roland Hutchinson
ggestion: Function to Copy/Delete a Directory > Recursively > How to rsync, unison, wget, curl > Hunspell Tutorial > Mac OS X Resource Fork and Command Line Tips ImageMagick Tutorial > Making System Calls in Perl and Python Unix And Literary Correlation > The U

Python Tools for Visual Studio from Microsoft - Free & Open Source

2011-03-09 Thread roland garros
FYI... http://pytools.codeplex.com Enjoy! -- http://mail.python.org/mailman/listinfo/python-list

Re: returning all matching groups with re.search()

2011-02-10 Thread Roland Mueller
s intended the non-overlapping behaviour of findall() may cause some problem: >>> re.findall('.[aeiou].','fredbarneybettywilma') ['red', 'bar', 'ney', 'bet', 'wil'] >>> re.findall('.[aeiouy].','fredbarneybettywilma') ['red', 'bar', 'ney', 'bet', 'tyw'] BR, Roland -- Mauro Cáceres -- http://mail.python.org/mailman/listinfo/python-list

SAML2 support in Python

2010-10-06 Thread Roland Hedberg
too. https://code.launchpad.net/~roland-hedberg/pysaml2/main For those using Django you should take notice of what Lorenzo Gil Sanchez is doing using PySAML2. https://code.launchpad.net/~lgs/pysaml2/main 2) IdPproxy - a gateway between social media and the SAML2

Re: Speed-up for loops

2010-09-02 Thread Roland Koebler
rds, Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python Sandbox

2010-08-17 Thread Roland Koebler
ltins. But blacklists are *never* secure. Sorry, but you should fully understand this before even thinking about more detailed security. Why are you blacklisting the "known-bad" functions instead of whitelising the allowed ones?? regards, Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python Sandbox

2010-08-16 Thread Roland Koebler
e(expr,"","eval") >>> c.co_names ('__class__',) regards, Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python Sandbox

2010-08-14 Thread Roland Koebler
bad" effects of the code, e.g. by redirecting I/O, limiting resources etc. regards, Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python Sandbox

2010-08-14 Thread Roland Koebler
in this case, strings), list comprehensions and > stuff, to do what they need to do. Python's very easy, I'd like them to > be able to use that easy. I was in the exact same position ;). (Although I don't have fully untrusted/bad users, and so my pseudo-sandbox is sufficient for my cases, even though I haven't proved that it really is secure...) regards, Roland -- http://mail.python.org/mailman/listinfo/python-list

Problem with Elementtree and XMLSchem instance type

2010-07-30 Thread Roland Hedberg
an find and there is nothing that tells me how to get at the mapping. If I print the Element instance the prefix 'fed' is replace by 'ns0' or something like that. Definitely something that has no connection to the original 'fed'. -- Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: stripping fields from xml file into a csv

2010-02-28 Thread Roland Mueller
2010/2/28 Stefan Behnel > Roland Mueller, 28.02.2010 13:01: > > The stylesheet is test.xsl and the insput data test.xml. The following > > Python code the applies the stylesheet on the input data and puts the > output > > into foo. > > > > Python code:

Re: stripping fields from xml file into a csv

2010-02-28 Thread Roland Mueller
way the input processing is defined in an XSLT stylesheet. The stylesheet is test.xsl and the insput data test.xml. The following Python code the applies the stylesheet on the input data and puts the output into foo. Python code: #!/usr/bin/python import sys import libxml2 import libxslt styledoc =

lxml and xmlsec

2009-09-25 Thread Roland Hedberg
Hi! Anyone know if it is possible to use xmlsec together with lxml ? -- Roland -- http://mail.python.org/mailman/listinfo/python-list

module metadata variables

2009-09-17 Thread Roland Koebler
tch for this, except there is any reason against it. regards, Roland -- http://mail.python.org/mailman/listinfo/python-list

A zlib question

2009-07-10 Thread Roland Hedberg
I compress using zlib so it doesn't add a gzip header ? -- Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: can it be shorter?

2009-06-08 Thread Roland Mueller
group of slashes (example s2) >>> print s1 a/ >>> print s2 >>> re.sub('[/]*$','/', s1) 'a/' >>> re.sub('[/]*$','/', s2) '/' -Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: 403 error for python webpage

2009-06-08 Thread Roland Mueller
s xp. > -- > http://mail.python.org/mailman/listinfo/python-list > This sounds like an setup problem for Apache + CGI. You should study the Apache logs. Don't know their location in WIN32, in Linux there are some files named "error_log" and also "access_log". Typic

Re: [ANN] vim patch to support python3 interface

2009-05-25 Thread Roland Puntaier
vim_...@googlegroups.com schrieb am 21.05.2009 14:27:13: > > On 12/05/09 18:35, Roland Puntaier wrote: > > Hello, > > > > I have ported vim's python interface (if_python.c) to the python3 C-API. > > > > The changed files are: > > - Makef

json-rpc in Python

2009-04-15 Thread Roland Hedberg
cx.hu/qxjsonrpc/ Which according to the documentation does not conform to the JSON-RPC specification Have I missed any ? What are people using ? -- Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: classobj() question

2008-02-12 Thread Roland Hedberg
Peter Otten wrote: > Roland Hedberg wrote: > >> I'm in the position that I have a bunch of classes defined before hand >> and then in some special circumstances I need to dynamically create a >> class that has a number of the static classes as parents. >> &

classobj() question

2008-02-12 Thread Roland Hedberg
But, it doesn't perform as I expected. I've made an extremely simple program to try to show what I mean and what I expected. It's attached to this mail. So, how should I have done it ? -- Roland #!/usr/bin/env python class A(object): def __init__(self): if "li

Any python implementation of XML-DSIG ?

2008-02-05 Thread Roland Hedberg
Or is XMLsig for Dynamic Languages (Ruby, Python, PHP and Perl) at http://xmlsig.sourceforge.net/ the only option ? -- Roland -- http://mail.python.org/mailman/listinfo/python-list

strange list comprehension on generator

2007-08-29 Thread Roland Puntaier
() ... #this works as expected def ty(): yield 1 yield 2 yield 3 tg=ty() list(tg) cheers, Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDE

2007-06-20 Thread Roland Puntaier
Hi, With a python-enabled VIM it's possible to execute and thus test the python code. I have the following lines in my vimrc. F2 prints the result of a line evaluation on the bottom or in a window named pyout if there. I open pyout with ":vert rightb new pyout" mapped to F1. F4 does the same on

RE: c[:]()

2007-06-04 Thread Roland Puntaier
rameters in a tree ("tree" in the informatics sense). (end of my guess) I think somehow it should be possible to convey an idea so that others can grasp it. If it does not work the first time, it is good to clarify the points that one found others to misunderstand. Otherwise one risks to be regarded as esoteric. Thanks, Roland -- http://mail.python.org/mailman/listinfo/python-list

Antwort: How to calculate definite integral with python

2007-05-15 Thread Roland Puntaier
Searching the web I have found: from numpy import * def simple_integral(func,a,b,dx = 0.001): return sum(map(lambda x:dx*x, func(arange(a,b,dx simple_integral(sin,0,2*pi) Or in http://pylab.sourceforge.net/ quadrature.py Cheers. [EMAIL PROTECTED] schrieb am 15.05.2007 04:23:00:

Other classes in a module

2007-03-25 Thread Roland Hedberg
Hi! Can an instance of a class in a module, in any simple way find out which other classes that exists in said module ? -- Roland -- http://mail.python.org/mailman/listinfo/python-list

Re: how to mimik a main() function to start a program with entry point?

2007-01-19 Thread Roland Puntaier
ELF for Linux) Whether it is possible from python to make an import of a python module in a python package gone through py2exe, I cannot answer. But I think you mean how to tell py2exe, where the entry point is. Read: http://www.py2exe.org/index.cgi/Tutorial Roland [EMAIL PROTECTED] schrieb

Antwort: Re: SubProcess _make_inheritable

2007-01-11 Thread Roland Puntaier
Thanks for pointing me to the tracker. I've seen there is already an entry for this: [ 1603907 ] subprocess: error redirecting i/o from non-console process Roland Gabriel Genellina <[EMAIL PROTECTED]> schrieb am 11.01.2007 05:24:03: > At Wednesday 10/1/2007 13:10, Roland

  1   2   >