Hi all,
I just ran a program of mine and got the traceback:
Traceback (most recent call last):
File "C:\PYTHON24\lib\idlelib\rpc.py", line 233, in asyncqueue
self.putmessage((seq, request))
File "C:\PYTHON24\lib\idlelib\rpc.py", line 333, in putmessage
raise IOError
IOError
This stumps
Hello, I am trying to open a socket connection to a named file on my
computer and can not seem to get it working. Any help or advice would
be great.
The details
I attempting to control xfmedia,
http://spuriousinterrupt.org/projects/xfmedia/ , via it's remote from
python and I can not get a conne
> I am a Rubyist, but I've decided to learn Python
Welcome, could be interesting. I'm a pythonista and
have learned Ruby but not used it for anything significant
yet.
> At any rate, so far Python seems to be a very good
> language. Not a great language, but still very good.
There is only one
> > Use a canvas and redraw a rectangle slightly larger every
> > time through the scanning loop.
>
> Thats think this is the easy part...
> The hard part is to make the bar move "with" the program (so every
> port it finishes the bar will slightly move, which depends on the
> total number of ports
Yay! Thanks for the tips Michael/Alan - works a treat, although I must
admit, I'm not sure what Lambda does.
Adam
Lambda is basically a function without a name that can be used inline.
Take for example, this code.
def funct(x):
return sin(x)
is the same as
funct = lambda x: sin(x)
There seems to
Is it possible to put all of those objects in their own module, having the
function you describe as a module defined function? For example pseudo
code
### Lib.py ###
def function(x):
return stuff
class C1:
def __init__(self):
init stuff
def funct(self,arg):
return func
On Sun, 27 Feb 2005 17:55:54 +, Richard gelling
<[EMAIL PROTECTED]> wrote:
>
> No What I get if I was to type in
> ./arg1.py a b c
>
> All I get is
> []
It sounds as though the command shell is not passing along the
additional parameters. Try opening Windows Explorer, and go to the
Folder
On Sun, 27 Feb 2005, Greg T wrote:
> I am a Rubyist, but I've decided to learn Python so that when a
> conversation springs up about the merits of the two languages amd how
> they compare, I will be well informed.
Hi Greg,
Welcome aboard! That sounds great; you can help us understand Ruby bet
> Add a file called 'test.cmd' in the same directory as your 'test.py'
> program with the following content:
>
> ###
> python test.cmd %*
> ###
Scratch that! *grin* Sorry, meant to write that the test.cmd should
contain:
###
python test.py %*
###
Darn it, but I don't have a Windows box handy
> >(I know I'm being a bit silly about asking about what looks like a
> >simple email typo, but computer programming bugs are all-too-often
> >about typos. *grin*
>
> Sorry for the late response, I tried all of the the suggestions,
> including correcting my typo of print sys[1:] and tried print
>
On Sun, 27 Feb 2005 20:20:19 +0200, Xif <[EMAIL PROTECTED]> wrote:
> There are two major classes:
>
> 1) an Excel class, that represents of the whole Excel program
> 2) a Cells class, that abstracts retrieval and editing of cells.
>
> [...]
>
> The difference between the 2 classes is that a Cel
Hi,
I am a Rubyist, but I've decided to learn Python so
that when a conversation springs up about the merits
of the two languages amd how they compare, I will be
well informed. As it stands now, what you usually see
is people well versed in one or the other, making
generalizations when they dont re
yeah, I do the same thing for those useful functions that don't really
fit anywhere else.
I call it helperFunctions or something, so when your're importing
helperFunctions and calling helperFunctions.getCells() it's pretty
obvious what's happening.
Liam Clarke
On Sun, 27 Feb 2005 20:39:41 +0100
On Fri, 25 Feb 2005 05:54:39 -0200, Ismael Garrido
<[EMAIL PROTECTED]> wrote:
> def __init__(self, this, that, new):
> Parent.__init__(self, this, that) #note self
> self.new = new
If the paren's init t has a lot of possible arguments, it may be
easier to do things this way:
class Child(
Yeah, python.exe is the right one... bizarre... I'll have a poke at it
when I get home from work.
Sorry I haven't been more helpful.
Cheers,
Liam Clarke
On Sun, 27 Feb 2005 18:57:30 +, Richard gelling
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> It is actually associated with just 'python', ch
The position to put it is a design choice and there is no single best
solution. What I'd do is to gather all the small "homeless" functions in
a single separate module. And if they come to be too numerous, I'll sort
them in some modules, ...
But that's because I don't like having a single funct
Xif <[EMAIL PROTECTED]> writes:
> Ok, so keeping getCells() as an external function makes sense.
>
> But where exactly do you recommend I'd put it?
>
> In a seperate module, like I currently do, even though it's going to be the
> only piece of code contained inside that module?
I don't see any
On Sun, 27 Feb 2005 16:06:32 -, Alan Gauld <[EMAIL PROTECTED]> wrote:
> > - however, when I click the button, I want self.showButton to know
> > which one of them was pressed. I've seen in other gui programming
> the
> > idea of an id or identifier - I can't see that here. Ideally, I
> would
>
On Sun, 27 Feb 2005 16:00:12 -, Alan Gauld <[EMAIL PROTECTED]> wrote:
> One option:
> Use a set up gif images and update the image periodically
> OR
> Use a canvas and redraw a rectangle slightly larger every
> time through the scanning loop.
Thats think this is the easy part...
The hard part
Hi,
It is actually associated with just 'python', changed it to associate
with 'pythonw' and I got nothing on the same example not even the [], so
I am assuming that 'python' is the correct one?
Liam Clarke wrote:
Yeah, right click on a .py and check if it's associated with pythonw
or python.
Ok, so keeping getCells() as an external function makes sense.
But where exactly do you recommend I'd put it?
In a seperate module, like I currently do, even though it's going to be
the only piece of code contained inside that module?
Xif
Pierre Barbier de Reuille wrote:
Well, for me, the more lo
Hi,
It is actually associated with just 'python', changed it to associate
with 'pythonw' and I got nothing on the same example not even the [], so
I am assuming that 'python' is the correct one?
Liam Clarke wrote:
Yeah, right click on a .py and check if it's associated with pythonw
or pyth
Well, for me, the more logical answer is : multi-inheritance !
If part of your class is the same, (same semantic, same implementation),
then you want to have a base class for that.
If you dislike this kindof inheritance, then your function should be an
external one. Even more because it's 'just'
Yeah, right click on a .py and check if it's associated with pythonw
or python.exe
GL,
Liam Clarke
On Sun, 27 Feb 2005 18:28:18 +, Richard gelling
<[EMAIL PROTECTED]> wrote:
> Hi,
> Yes, I use both Wndows XP and Linux( at work ) . I left that in by
> mistake I am actually just typing in
>
Hi,
Yes, I use both Wndows XP and Linux( at work ) . I left that in by
mistake I am actually just typing in
arg1,py a b c
at the windows XP command prompt
Sorry for the confusion.
Liam Clarke wrote:
Are you using XP still? I've never seen this before -
./arg1.py a b c
But anyhoo, I tri
You could a real generic superclass for the classes, it only needs to
contain that one function.
Personally, I see nothing wrong with chucking one function in a module
on it's own, it's whatever works for you. You could create a class for
it also, and give each of the other classes an instance of
Are you using XP still? I've never seen this before -
> ./arg1.py a b c
But anyhoo, I tried out just
'c:\python23\foo.py'
as opposed to
'c:\python23\python foo.py' and
while foo.py will run, it doesn't echo to the console, as on my
machine running a .py file runs it through pythonw.exe - I'd
Javier Ruere wrote:
Xif wrote:
Hello
There are several different objects. However, they all share the same
function.
Since they are not the same or similar, it's not logical to use a
common superclass.
So I'm asking, what's a good way to allow those objects to share that
function?
The best solution
Hi,
No What I get if I was to type in
./arg1.py a b c
All I get is
[]
If i type at the command prompt
python arg1.py a b c
I get ['a','b','c'] as expected
All the other programs and examples I have typed in work fine just by
typing in the file name, I don't have to preced the file name with
pyt
Xif wrote:
Hello
There are several different objects. However, they all share the same
function.
Since they are not the same or similar, it's not logical to use a
common superclass.
So I'm asking, what's a good way to allow those objects to share that
function?
The best solution I've found so far i
Hello
There are several different objects. However, they all share the same
function.
Since they are not the same or similar, it's not logical to use a
common superclass.
So I'm asking, what's a good way to allow those objects to share that
function?
The best solution I've found so far is to put th
Richard,
if you try to print sys.argv[1:] when sys.argv only contain sys.argv[0]
then you are bound to get an empty list returned, [] .
Im not sure I understand the problem you think you've got but here's
what happens with sys.argv for me, and it's correct.
[argl.py]
$ cat argl.py
#!/usr/bin/py
Danny Yoo wrote:
I am reading ' Learning Python second edition' by Mark Lutz and David
Ascher, and I trying the code examples as I go along. However I am
having a problem with the following, which I don't seem to be able to
resolve :-
# test.py
import sys
print sys[ 1: ]
This I believe
On Sun, 27 Feb 2005 03:24:07 -0800 (PST), Shitiz Bansal
<[EMAIL PROTECTED]> wrote:
>
> The ports which do not respond are the ones which take
> most of the time.You can use the timer object to fix
> the time for each port.For eg. if a port does not
> respond within .1 sec it can reasonably be expe
> - however, when I click the button, I want self.showButton to know
> which one of them was pressed. I've seen in other gui programming
the
> idea of an id or identifier - I can't see that here. Ideally, I
would
> like to know the value of i in self.showButtons - but when I use
> self.showButtons
> Here are the questions (-:
> 1. How do I make a progress bar in Tkinter ?
One option:
Use a set up gif images and update the image periodically
OR
Use a canvas and redraw a rectangle slightly larger every
time through the scanning loop.
The first is easiest the second smoother but much more wor
On Sat, 26 Feb 2005 19:48:25 +
Adam Cripps <[EMAIL PROTECTED]> wrote:
> On Fri, 25 Feb 2005 12:21:18 +0100, Michael Lange
>
> >
> > You see, in my example above I called the list "buttonlist" instead of
> > "button"; maybe this naming
> > helps avoid confusion .
> >
> > Best regards
> >
> 2. I got a while loop which does the port scan
> itself. How can I end
> it while its working ?
using the break statement anywhere inside the loop
will exit the loop.
> 3. For some reason the scan is too slow (2-3 seconds
> for a port). Is
> there a way to make it faster (other port scanner
>
38 matches
Mail list logo