hi.
i was wondering, what's the simplest way to echo the standard input to
the standard output, with no modification.
i came up with:
...
while True:
try:
raw_input()
except EOFError:
break
...
but i guess there must be a simpler way.
using bash i simply do 'cat', *sigh*!
bye
hi everyone.
i would like to do some uri-decoding, which means to translate patterns
like "%2b/dhg-%3b %7E" into "+/dhg-; ~": in practice, if a sequence like
"%2b" is found, it should be translated into one character whose hex
ascii code is 2b.
i did this:
...
import re
import sys
modello =
hi.
in perl i can do this:
...
if (open (MYPIPE, "*some_system_command* |"))
{
...
*do_something*
...
while ($answer = )
{
print $answer;
}
...
*do_something_more*
...
}
else
{
...
*do_something_else*
...
}
...
bruno modulix wrote:
> max(01)* wrote:
>
>>hi.
>
>
> (snip)
>
>
>>it doesn't work, since "*do_something*" and *do_something_more* are
>>always executed (it seems like
>>
>>MYPIPE = os.popen("*some_system_command*", &
infidel wrote:
> Here's one technique I use to run an external command in a particular
> module:
>
> stdin, stdout, stderr = os.popen3(cmd)
> stdin.close()
> results = stdout.readlines()
> stdout.close()
> errors = stderr.readlines()
> stderr.close()
max(01)* wrote:
> infidel wrote:
>
>> Here's one technique I use to run an external command in a particular
>> module:
>>
>> stdin, stdout, stderr = os.popen3(cmd)
>> stdin.close()
>> results = stdout.readline
many thanks to all the fellows who cared to answer!
bye
max
--
http://mail.python.org/mailman/listinfo/python-list
hi there.
i have some problems understanding following behaviour.
consider this:
...
$ cat file_input_3.pl
#!/usr/bin/perl
open MIAPIPE, "una_pipe";
while ($riga = )
{
print STDOUT ("$riga");
}
$ cat file_input_3.py
#!/usr/bin/python
import sys
MIAPIPE = open("una_pipe", "r")
fo
Eric Nieuwland wrote:
> max(01)* wrote:
>
>> $ cat file_input_3.py
>> #!/usr/bin/python
>>
>> import sys
>>
>> MIAPIPE = open("una_pipe", "r")
>>
>> for riga in MIAPIPE:
>>print riga,
>> ...
>> [...]
hello everybody.
i am a a bit of a newbie in python/tkinter,and i am experimenting a bit
with widgets like checkbuttons.
in python, you can create a checkbutton instance like this:
self.tergicristalli = IntVar()
self.b1 = Checkbutton(self.pulsanti_spunta)
self.b1.configure(
text = "Tergicr
hi there!
this post is somewhat a generalization of one previous question.
i was wondering if it is possible to pass an argument list as a
parameter to a function. example:
def fun_con_pc(pc1 = "Ciao!", pc2 = 42):
print pc1
print pc2
fun_con_pc()
fun_con_pc(pc1 = "Addio...")
fun_con_pc(pc2 = 66
hi people.
when i create a widget, such as a toplevel window, and then i destroy
it, how can i test that it has been destroyed? the problem is that even
after it has been destroyed, the instance still exists and has a tkinter
name, so testing for None is not feasible:
>>> import Tkinter
>>> fin
Eric Brunel wrote:
On Tue, 29 Mar 2005 10:37:10 GMT, max(01)* <[EMAIL PROTECTED]> wrote:
hi people.
when i create a widget, such as a toplevel window, and then i destroy
it, how can i test that it has been destroyed? the problem is that even
after it has been destroyed, the instance still
Fredrik Lundh wrote:
"max(01)*" <[EMAIL PROTECTED]> wrote:
see what i mean?
not really, but maybe
arg = {"pc2": 666, "pc1": "Addio..."}
fun_con_pc(**arg)
is what you want?
precisely! thanks a lot!
macs
--
http://mail.python.org/mailman/listinfo/python-list
hello.
the following code:
1 from Tkinter import *
2
3 class MiaApp:
4 def __init__(self, genitore):
5 self.mioGenitore = genitore
6 self.i = IntVar()
7 self.i.set(42)
8 self.s = StringVar()
9 self.s.set("Baobab")
10
hello.
the following code:
1 from Tkinter import *
2
3 class MiaApp:
4 def __init__(self, genitore):
5 self.mioGenitore = genitore
6 self.i = IntVar()
7 self.i.set(42)
8 self.s = StringVar()
9 self.s.set("Baobab")
10
Pierre Quentel wrote:
Instead of indexing self.lab by strings, you can index them by the
attributes themselves : self.lab[self.i], and change line 23 into
for var in (self.s, self,i)
For your example, I wouldn't have used the "text" option in the
definition of the labels, then "textvariable
Eric Brunel wrote:
On Tue, 29 Mar 2005 22:32:59 +0200, Pierre Quentel
<[EMAIL PROTECTED]> wrote:
[...]
mr brunel,
i thank you for prompt reply. i will take my time to read it carefully.
meanwhile, i inform you and the ng that someone else gave me a quick and
dirty answer to my problem, namely sub
hi everybody.
suppose that code-1.py imports code-2.py and code-3.py (because it uses
names from both), and that code-2.py imports code-3.py.
if python were c, code-1.c should only *include* code-2.c, because the
latter in turns includes code-3.c.
inclusion of modules in c is a purely preproces
Eric Brunel wrote:
On Tue, 29 Mar 2005 22:32:59 +0200, Pierre Quentel
<[EMAIL PROTECTED]> wrote:
Instead of indexing self.lab by strings, you can index them by the
attributes themselves : self.lab[self.i], and change line 23 into
for var in (self.s, self,i)
I really think this is asking fo
Tim Jarman wrote:
max(01)* wrote:
hi everybody.
suppose that code-1.py imports code-2.py and code-3.py (because it uses
names from both), and that code-2.py imports code-3.py.
if python were c, code-1.c should only *include* code-2.c, because the
latter in turns includes code-3.c.
inclusion of
Peter Hansen wrote:
max(01)* wrote:
hi everybody.
suppose that code-1.py imports code-2.py and code-3.py (because it
uses names from both), and that code-2.py imports code-3.py.
if python were c, code-1.c should only *include* code-2.c, because the
latter in turns includes code-3.c.
inclusion
[EMAIL PROTECTED] wrote:
Your app seems to give the right state values only if you select 'Freni
a posto'. But I see you recognize that with your 'FIXME' note.
also the app seems to have too many variables and widgets defined as
self objects. That isn't necessary unless they will be used outside
Peter Hansen wrote:
max(01)* wrote:
this leads me to another question. since *.pyc files are automatically
created the first time an import statement in executed on a given
module, i guess that if i ship a program with modules for use in a
directory where the user has no write privileges then i
also the app seems to have too many variables and widgets defined as
self objects. That isn't necessary unless they will be used outside
the method they were created in (which labels and buttons usually
aren't), so all you are doing is using up more memory than necessary.
you are right, and at the
Peter Hansen wrote:
max(01)* wrote:
Peter Hansen wrote:
Not required except for performance reasons. If the .pyc
files don't exist, the .py files are recompiled and the
resulting bytecode is simply held in memory and not cached
and the next startup will recompile all over again.
but the
hi.
is there a way to define a class method which prints the instance name?
e.g.:
>>> class class_1:
... def myName(self):
... what should i do here
...
>>> instance_1 = class_1()
>>> instance_1.myName()
'instance_1'
>>>
bye
macs
--
http://mail.python.org/mailman/listinfo/python-list
Andrew Koenig wrote:
"max(01)*" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
is there a way to define a class method which prints the instance name?
The term "the instance name" is misleading, because it assumes, without
saying so explicitly, that e
Irmen de Jong wrote:
max(01)* wrote:
hi.
is there a way to define a class method which prints the instance name?
e.g.:
class class_1:
... def myName(self):
... what should i do here
...
instance_1 = class_1()
instance_1.myName()
'instance_1'
bye
macs
What should the fo
Peter Hansen wrote:
max(01)* wrote:
Peter Hansen wrote:
No it doesn't. I thought I was clear, but I can reword
it for you: the files are compiled *in-memory* and the
results are never written to disk.
> *if* they are compiled, where are they put, if the
corresponding *.py files are
many many thanks to each and everyone who bothered to answer my op.
best regards
macs
--
http://mail.python.org/mailman/listinfo/python-list
Mike Meyer wrote:
"max(01)*" <[EMAIL PROTECTED]> writes:
Peter Hansen wrote:
max(01)* wrote:
hi everybody.
suppose that code-1.py imports code-2.py and code-3.py (because it
uses names from both), and that code-2.py imports code-3.py.
if python were c, code-1.c should only *i
hi.
if i have a single program file, different class instances can share
information in (at least) two fashions:
1. using instance variables:
class AClass:
def __init__(self):
self.att_1 = 42
self.att_2 = "Hello!"
class AnotherClass:
def __init__(self):
self.att_1 = anInstanceOfAC
hi.
i tried to serialize a list of StringVar's, but i got a pickle error.
this got me to thinking that tkinter objects are not picklable (in general).
would somebody confirm and/or give examples?
thanks
macs
--
http://mail.python.org/mailman/listinfo/python-list
hello.
i wrote a very simple tkinter demo program that uses menus, buttons,
labels, entries, frames and secondary toplevels.
it is a python version of a java program made by a colleague.
the user can create ("Scrivi") a record with his second name, first name
and date of birth, save ("Salva") th
Samantha wrote:
I can not get it to run.
S
sorry about that. baybe it is a conflict between tabstop width in my
editor and in my newsreader.
i substituted tabs with spaces and i hope now you can run it.
bye
macs
cuthere
from Tkinter import *
class MiaApp:
def __init__(self, genitore):
hi.
in a previous thread, mr lundh talks about the possibility to create
"domain specific UI languages" using tkinter.
can he (or anyone else who pleases) explain what they are? give some
examples (simple is better)?
bye
macs
--
http://mail.python.org/mailman/listinfo/python-list
hi there.
i installed python2.3-opengl, then i tried one of those demos:
#!/usr/bin/python2.3
# This is statement is required by the build system to query build info
if __name__ == '__build__':
raise Exception
import sys
from OpenGL.GL import *
from OpenGL.GLE import *
from OpenG
Mike Meyer wrote:
> "max(01)*" <[EMAIL PROTECTED]> writes:
>
>
>>$ python GLE.py
>>freeglut (GLE.py): OpenGL GLX extension not supported by display ':0.0'
>>
>>what's up? what's missing?
>
>
> The GLX extension t
Lonnie Princehouse wrote:
> See if you can run `glxgears`, and read the output of `glxinfo`.
$ glxgears
Xlib: extension "GLX" missing on display ":0.0".
Error: couldn't get an RGB, Double-buffered visual
$ glxinfo
name of display: :0.0
Xlib: extension "GLX" missing on display ":0.0".
Xlib: exte
Lonnie Princehouse wrote:
> See if you can run `glxgears`, and read the output of `glxinfo`. If
> neither of those work, you will probably have better luck on a debian
> or XFree86/xorg forum than on c.l.py
>
your hints were helpful anyway. thanks!
ok, i uncommented the line:
Load "glx"
Lonnie Princehouse wrote:
> DRI not working could also be a permissions issue; check to see if it
> works as root.
that's it! :-)
now, how can i make it work as "joe user"?
bye
max
--
http://mail.python.org/mailman/listinfo/python-list
Lonnie Princehouse wrote:
> Welcome to the exciting world of trying to make graphics work on Linux
> =)
>
> DRI is direct rendering.
[...]
> DRI not working could also be a permissions issue; check to see if it
> works as root.
that's it! :-)
now, how can i make it work as "joe user"?
bye
max
43 matches
Mail list logo