Hallo Liste,
Für euch warscheinlich eine Kleinigkeit, ich suche mir momentan einen
Wolf.
Ich suche für folgenden bash-Aufruf das äquivalent in python
cat *.4go > xxx.4gi
--
cu
Roland Kruggel mailto: rk.liste(a)bbf7.de
System: Intel 3.2Ghz, Debian etch, 2.6.15, KDE 3.4
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de
Hallo *,
ich möchte eine Python-Application einsetzen, welche rlcompleter verwenet. Dieser will das Module readline importiern, findet es aber nicht. Auch in der aktuellen Python Version gibt es so ein Modul 'readline' nicht??
Wo bekomme ich dieses Modul?
Danke für eure Tips,
Katja
----------------------------
katja-suess-imac-g5:~/zope/Redutils/commander zope$ ./commander.py
Traceback (most recent call last):
File "./commander.py", line 14, in ?
from CommanderClass import *
File "/Users/zope/zope/RedUtils/commander/CommanderClass.py", line 16, in ?
from utilities import *
File "/Users/zope/zope/RedUtils/commander/utilities.py", line 5, in ?
from PlainCompleter import PlainCompleter
File "/Users/zope/zope/RedUtils/commander/PlainCompleter.py", line 1, in ?
from rlcompleter import Completer
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/rlcompleter.py", line 42, in ?
import readline
-----------------------------
rlcompleter.py:
"""Word completion for GNU readline 2.0.
This requires the latest extension to the readline module. The completer
completes keywords, built-ins and globals in a selectable namespace (which
defaults to __main__); when completing NAME.NAME..., it evaluates (!) the
expression up to the last dot and completes its attributes.
It's very cool to do "import sys" type "sys.", hit the
completion key (twice), and see the list of names defined by the
sys module!
Tip: to use the tab key as the completion key, call
readline.parse_and_bind("tab: complete")
Notes:
- Exceptions raised by the completer function are *ignored* (and
generally cause the completion to fail). This is a feature -- since
readline sets the tty device in raw (or cbreak) mode, printing a
traceback wouldn't work well without some complicated hoopla to save,
reset and restore the tty state.
- The evaluation of the NAME.NAME... form may cause arbitrary
application defined code to be executed if an object with a
__getattr__ hook is found. Since it is the responsibility of the
application (or the user) to enable this feature, I consider this an
acceptable risk. More complicated expressions (e.g. function calls or
indexing operations) are *not* evaluated.
- GNU readline is also used by the built-in functions input() and
raw_input(), and thus these also benefit/suffer from the completer
features. Clearly an interactive application can benefit by
specifying its own completer function and using raw_input() for all
its input.
- When the original stdin is not a tty device, GNU readline is never
used, and this module (and the readline module) are silently inactive.
"""
import readline
import __builtin__
import __main__
__all__ = ["Completer"]
class Completer:
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de
Hallo zusammen,
ich möchte eine grafische Anwendung (Tkinter) erstellen, die
verschiedene Informationen sammelt und darauf hin den MS Visual Studio
7.1 C++ Compiler (Terminal) startet. Dieser gibt normalerweise seine
Ausgaben auch anf dem Terminal aus. Diese Ausgaben möchte ich allerdings
in ein Text-Widget umlenken. Dies mache ich bereits mit os.popen3 und
das funktioniert auch soweit. Das Problem ist allerdings, das die
Ausgaben erst von den Fileobjects ausgegeben werden, wenn der Compiler
beendet ist. Um denCompilerungsprozess zu überwachen ist dies allerdings
denkbar schlecht. Dies liegt wahrscheinlich daran, dass der Compuiler
Output seitens des Compiler-Prozesses gebuffert wird.
Unter Unix kann man dies scheinbar (?) unter Zuhilfename von "pty"
verhindern, dass steht leider unter Windows nicht zur Verfügung.....
Hier der Code:
#qmakecall ruft qmake mit den zugehöhrigen Parametern auf....
(input, output, error) = os.popen3(qmakecall)
#self.debugWindow ist das TextWidget, das übergeben wird.....
self.debugWindow.insert(END, input.read())
self.debugWindow.insert(END, error.read())
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de
Ja, ich habe genau das gleiche Problem. Nun, mangels
Besseren, habe ich eine Klasse zusammengebastelt, die
allerdings mit Bash-Codes arbeitet.
Aufbauende Kritik oder Verbesserungsvorschlaege sind willkommen.
Gruss Lajos
P.S. Diese ist meine erste Klasse.
class Cline:
'''
The class ``Cline'' enables the printing of a text on
the terminal in color.
Usage:
from cline import *
myline='This text is current.<0;32>This is
green.<0;31>This is red.<0;00>This is current.'
coloredLine=Cline()
coloredLine.write(myline)
The tags contain the bash color codes. These are:
Black 0;30 Dark Gray 1;30
Blue 0;34 Light Blue 1;34
Green 0;32 Light Green 1;32
Cyan 0;36 Light Cyan 1;36
Red 0;31 Light Red 1;31
Purple 0;35 Light Purple 1;35
Brown 0;33 Yellow 1;33
Light Gray 0;37 White 1;37
reset 0;00
The trailing text will be colored according to the
leading tag
until an other tag or end of line occurs.
This class uses the color capabilities of Bash, because
I could not figure
out how to solve it just in Python.
Author: Kuljo
Version: 0.3.0
Date: 2006-03-16
License: GPL
'''
def write(self, text):
import os
line=''
currentCursor=0
oldCursor=0
text=text+'<0;00>'
while 0 == 0: # endless loop
currentCursor=text.find('<', oldCursor)
if currentCursor == -1: # if end of text exeeded
break
if (text[currentCursor+2:currentCursor+3] == ';'
and text[currentCursor+5:currentCursor+6] == '>'): # if
just a gt in text
colorCode=text[oldCursor-5:oldCursor-1]
line=line+text[oldCursor:currentCursor]
oldCursor=currentCursor+6
exec('''os.system("echo -en
'\E[;'''+colorCode+'m'+line+'\'")')
os.system("tput sgr0") ##reset terminal color
line=''
print ''
_________________________________________________________________________
Társasházi gyakorlati kézikönyv - Hasznos és nélkülözhetetlen segítője
minden társasházban lakónak: http://manager.menedzsmentforum.hu/tarsashaz/
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de
Ich suche ein quasi Pickle, nur in XML. Es sollte eine pure Python
Lösung sein.
Im Prinzip was xmlrpclib.dumps() und xmlrpclib.loads() macht. Nur diese
Produzieren sehr schlecht lesbaren, aufgeblähten XML-Code :(
Gleich vorweg, PyYAML3000 wäre auch eine alternative, aber das kann z.Z.
nur in Richtung YAML -> Python...
Marc 'BlackJack' Rintsch, hat im Forum mal eben selber was programmiert:
http://www.python-forum.de/viewtopic.php?p=33200#33200
Allerdings benötigt man dazu das externe Modul ElementTree. Das wird
wohl in Python 2.5 an Board sein, aber solange auf Shared-Hosting-Server
ein uralt Python installiert ist, bringt das erstmal auch nix...
Leider ist auch die erzeugte XML-Daten etwas aufgebläht, wenn auch schon
um einiges besser als xmlrpclib das macht...
Ich stelle mir das ganze ungefähr so vor:
___________________________________________________________________
t = [
"beispiel", 123, "noch was",
{'status':'GM', 'rating':2700},
{'status':'Computer', 'rating':2700},
{'status':'Amateur', 'rating':1400},
{
"eins": {"a":1, "b":2},
"zwei": {"c":2, "d":3},
},
]
<list>
<string>beispiel</string>
<int>123</int>
<string>noch was</string>
<dict>
<string key="status">GM</string>
<int key="rating">2700</int>
</dict>
<dict>
<string key="status">Computer</string>
<int key="rating">2700</int>
</dict>
<dict>
<string key="status">Amateur</string>
<int key="rating">1400</int>
</dict>
<dict>
<dict key="eins">
<dict>
<int key="a">1</int>
<int key="b">2</int>
</dict>
</dict>
<dict key="zwei">
<dict>
<int key="c">2</int>
<int key="d">3</int>
</dict>
</dict>
</dict>
</list>
___________________________________________________________________
Und ich kann einfach nicht glauben, das es dafür nicht auch schon was
fertiges gibt... Gefunden hab ich es allerdings noch nicht...
--
Mfg.
Jens Diemer
----
CMS in pure Python CGI: http://www.pylucid.org
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de
hallo
ich hab mal ne frage:
gibt es irgentwo eine auflistung aller phyton befehle(kostenlos,
möglichst auf deutsch und mit erklärung)
danke schonmal für eure antworten
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de
Die deutsche Übersetzung des Python-Einsteigerkurses
"A Byte of Python" (Version 1.20) kann hier gelesen
oder in verschiedenen Formaten heruntergeladen werden:
http://abop-german.berlios.de
-- Christoph
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de
Hi
gibt es ein Modul welches eine Progressbar in Curses bereithält?
Gruß Carsten
--
Oft genügt schon eine kleine Gehaltserhöhung, und man kann sich die
letzte Steuererhöhung wieder leisten! [ Sandro Paternostro ]
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de
=========================
Leipzig Python User Group
=========================
Zweiter Stammtisch am 16.03.2006
---------------------------------
Wir treffen uns am 16.03.2006. um 20:00 Uhr
im Schulungszentrum der Python Academy, Zur
Schule 20, 04158 Leipzig (Anfahrt:
http://www.python-academy.de/Schulungszentrum/anfahrt.html).
Nach dem die Gründung der Leipzig Python User
Group, der LE-Snakes, bei unserem ersten Treffen
im Februar stattgefunden hat, treffen wir uns nun
regelmäßig jeden zweiten Dienstag im Monat.
Da dieser Termin nun gerade auf den vorletzten
Tag der CeBIT fällt (14.03.2006), haben wir uns
entschieden, den Termin um zwei Tage zu verschieben.
Für das leibliche Wohl wird gesorgt.
Wir bitten um kurze Anmeldung per e-mail an: info(a)python-academy.de
Stefan Schwarzer wird über die Anwendnung von
CherryPy (http://www.cherrypy.org) sprechen.
Zitat von der CherryPy-Homepage: "CherryPy is a
pythonic, object-oriented web development framework."
Teilnehmen kann jeder, der Interesse an Python
hat, die Sprache bereits nutzt oder nutzen möchte.
Die Arbeitssprachen des Treffens ist Deutsch.
English sprechende Python-Entusiastsen sind
trotzdem herzlich eingeladen. Wir übersetzen gern.
Aktuelle Informationen zu den Treffen sind immer unter
http://www.python-academy.de/LE-Snakes/index.html
zu finden.
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de
Kann es sein, das zipfile unter Windows 2000 nicht funktioniert?
Bei einem Freund sind die erzeugten ZIP-Dateien unbrauchbar, aber ich
müßte das noch ausgiebiger testen woran es liegt, allerdings hab ich
selber kein Windows 2000.
Kann das jemand bestätigen?
Offiziell ist wohl kein Bug bekannt, ich hab mal unter
http://sourceforge.net/tracker/?group_id=5470&atid=105470 danach gesucht.
--
Mfg.
Jens Diemer
----
CMS in pure Python CGI: http://www.pylucid.org
_______________________________________________
python-de maillist - python-de(a)python.net
http://python.net/mailman/listinfo/python-de