On 8/11/05, Jorge Louis De Castro <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> I'm interested in writing with my own Python implementation of a Jabber IM
> server and client.
> Anyone knows where I could host my Python Jabber IM server for a reasonable
> monlthy fee? It doesn't need to be
On my Windows XP box running Python 2.4, I attempted to use the 'find'
module per the example in Programming Python (Ch. 2) - i.e.:
>>>import find
>>>find.find('*')
However, Python didn't find the find module. The docs say it's now
deprecated, but don't point to what tool should be used to replac
> read the returned output stream in non-blocking mode. But, I did
> not getting any of the status messages given out by mplayer
Traditionally status messages tend to be sent to stderr
rather than stdout (this means that they don't break Unix
pipelines). But that means that to read them you will
Quoting Nathan Pinno <[EMAIL PROTECTED]>:
> Is it possible to create a def that not only deals cards, but also
> assigns a value to each rank, except that the Jacks, Queens, and Kings
> all are the same value as the 10s?
> If this is possible, how should I go about doing this?
Nearly everything i
You could probably do something like this... (Note: This example is
for Linux - but you can adapt it fairly easily to Windows.)
# E.g. Find every .inf file on a CD-ROM.
path = '/cdrom'
# 'E:\\' or whatever for Windows
inf_list = []
for root, dirs, files in os.walk(path):
for current_fi
I'd do it like this... And there's probably an even quicker way, if
you really sat down and thought about it.
n = int(raw_input("Number: "))
x = n-1
while x > 1:
n *=x
x -=1
print n
The reason why it isn't working is because of
"
while x > 1:
x -= 1
"
When your program hits this p
> Is it possible to create a def that not only deals cards, but also
> assigns a value to each rank, except that the Jacks, Queens, and
> Kings
> all are the same value as the 10s?
Yes. And you probably need to use a dictionary to hold the value
against
the card.
> Sorry if I'm asking what for
> The following code is supposed to take in a number, and print
> number!:
> n = int(raw_input("Number: "))
> x = n-1
> while 1:
>t = n*x
>while x > 1:
>x -= 1
>else:
>break
> print t
>
> Why isn't it working, and how can I make it print out the correct
> output?
So g
> The following code is supposed to take in a number, and print
> number!:
> n = int(raw_input("Number: "))
> x = n-1
> while 1:
>t = n*x
>while x > 1:
>x -= 1
>else:
>break
> print t
>
> Why isn't it working, and how can I make it print out the correct
> output?
So g
Hi,
I have an optionmenu widget that works just fine
except that can't find docs to get hold of events as they happen, kinda
like the command=XYZ of other widgets like buttons.
The code I'm using for the option menu is the
following:
OPTIONS =
["en","pt","es","it","fr","de"]self.start
Jorge Louis De Castro napsal(a):
Hi,
I have an optionmenu widget that
works just fine except that can't find docs to get hold of events as
they happen, kinda like the command=XYZ of other widgets like buttons.
The code I'm using for the option
menu is the following:
> The following code is supposed to take in a number, and print number!:
> n = int(raw_input("Number: "))
> x = n-1
> while 1:
> t = n*x
> while x > 1:
> x -= 1
> else:
> break
> print t
> Why isn't it working, and how can I make it print out the correct output?
One th
Hi All,
I'd like to write some web gallery software from scratch for my
girlfriend. I've looked at the PIL (python imaging library) and I'm
using it to generate thumbnails from given images.
Something else i'd like to get done now though, is building an index of
images.
Are there any libs suited fo
Directly Quoted From the Python Cookbook
1.3 Constructing a Dictionary Without Excessive Quoting
Credit: Brent Burley
1.3.1 Problem
You'd like to construct a dictionary without having to quote the keys.
1.3.2 Solution
Once you get into the swing of Python, you may find yourself
construct
[EMAIL PROTECTED] wrote:
> Note that in Python2.4+, you can use key= instead:
>
> def sortKey(lst):
> return lst[2]
> Quant.sort(key=sortKey)
>
> This is more effient than specifying a different comparison function, because
> the key function is only called once for each element.
And instead of
Hi,
Thanks for your reply. It wasn't lazyness, believe me, I did look around for
solutions and found something similar to yours here:
http://www.astro.washington.edu/owen/TkinterSummary.html#TracingVariables
The problem is that I have a class and it wants the callback function to be
a global n
Jorge Louis de Castro napsal(a):
>Hi,
>
>Thanks for your reply. It wasn't lazyness, believe me, I did look around for
>solutions and found something similar to yours here:
>
>http://www.astro.washington.edu/owen/TkinterSummary.html#TracingVariables
>
>The problem is that I have a class and it wan
Howard,
I believe what's happening in the second example is that you can combine
dictionaries.
...
>>>d2 = {'hello':1,'hi':2}
>>>print d2.items()
[('hi',2),('hello',1)]
so in the second example you can just pass it a list of elements (.items())
and it will concatenate (append?) these to the new di
Hi all
I'm having problems with installing LiveWire for python for Linux
(Linspire 5.0 to be exact) and I'm having trouble compiling setup.py.
Heres the results:
running install
running build
running build_py
running install_lib
creating /usr/lib/python2.3/site-packages/livewires
error: could not
Howard Kao wrote:
> Directly Quoted From the Python Cookbook
> Once you get into the swing of Python, you may find yourself
> constructing a lot of dictionaries. However, the standard way, also
> known as a dictionary display, is just a smidgeon more cluttered than
> you might like, due to
On Mon, 2005-08-15 at 11:52 -0400, Michael Murphy wrote:
> Hi all
>
> I'm having problems with installing LiveWire for python for Linux
> (Linspire 5.0 to be exact) and I'm having trouble compiling setup.py.
> Heres the results:
>
> running install
> running build
> running build_py
> running ins
I put in a 4 and expected 24, and instead got 12. It is supposed to give 4!
not 4*3.
---
Early to bed,
Early to rise,
Makes a man healthy, wealthy, and wise.
--Benjamin Franklin
> I put in a 4 and expected 24, and instead got 12. It is supposed to give
4!
> not 4*3.
[snip rest of message]
nathan
your problem is easy to see...
> >> n = int(raw_input("Number: "))
> >> x = n-1
> >> while 1:
> >>t = n*x
> >>while x > 1:
> >>x -= 1
> >>else:
> >>br
Nathan Pinno napsal(a):
>I put in a 4 and expected 24, and instead got 12. It is supposed to give 4!
>not 4*3.
>---
>
>
Dear Nathan,
Everyone is giving you very good hints but seems to me you keep to
resist :-)
Looks like you always
On 8/15/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I'd like to write some web gallery software from scratch for my girlfriend.
> I've looked at the > PIL (python imaging library) and I'm using it to
> generate thumbnails from given images.
> Something else i'd like to get done
On 8/11/05, Jorge Louis De Castro <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm interested in writing with my own Python implementation of a Jabber IM
> server and client.
> Anyone knows where I could host my Python Jabber IM server for a reasonable
> monlthy fee? It doesn't need to be a top-not
On 8/15/05, Simon Gerber <[EMAIL PROTECTED]> wrote:
> You could probably do something like this... (Note: This example is
> for Linux - but you can adapt it fairly easily to Windows.)
>
>
> # E.g. Find every .inf file on a CD-ROM.
> path = '/cdrom'
> # 'E:\\' or whatever for Windows
> inf_lis
>I put in a 4 and expected 24, and instead got 12. It is supposed to
>give 4!
> not 4*3.
Thanks Nathan. It would be good to get that kind of detail when you
post
the initial message. Your function didn't look like the usual
factorial
function.
FWIW here is my version :-)
def factorial(n):
Hello guys!
Is there a way to convert a file from plaintext(Ascii) to unicode? I
have found all my notes about moving between hex., int's, chr's,
ord's, etc, but all of these things were only riddle exercises to me
and I have a hard time keeping them straight. I'm pretty sure I knew
the answer t
um...
>>> help(unicode)
Help on class unicode in module __builtin__:
[snip help stuff]
| encode(...)
| S.encode([encoding[,errors]]) -> string or unicode
|
| Encodes S using the codec registered for encoding. encoding defaults
| to the default encoding. errors may be given to s
Thanks for the help Luke and Kent.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
List:
I'm forwarding this private message(hope you don't mind Denise)
I personally have no idea what to do, but
someone else might be able to help.
-Luke
- Forwarded Message -
text is a list, so you can't encode it. but you can iterate over each
of the elements and encode them. I have
At 06:49 PM 8/15/2005, D. Hartley wrote:
>Hello guys!
>
>Is there a way to convert a file from plaintext(Ascii) to unicode? I
>have found all my notes about moving between hex., int's, chr's,
>ord's, etc, but all of these things were only riddle exercises to me
>and I have a hard time keeping them
Hi to all:
How can I append some data from file1.py to a combobox
on file2.py?
I know, if you want to append data to a combobox
inside the same script, I would be like follows:
# file1.py
import wx
class Myframe(wx.Frame):
def __init__(self, *args, **kwds):
...
self.mycombobox = wx.Combo
I think Luke's suggestion will work if you use f.read() (to read the whole file
as a single string) instead of f.readlines() and f.write() instead of
writelines().
Kent
luke wrote:
> List:
> I'm forwarding this private message(hope you don't mind Denise)
> I personally have no idea what to do,
35 matches
Mail list logo