call last):
File "", line 1, in
TypeError: expected LP_c_char instance, got _ctypes.PointerType
>>> databuftype = c_char * 10
>>> databuf = databuftype()
>>> cbuffer.cpBuffer = databuf
>>> databuf
<__main__.c_char_Array_10 o
uint),
("open", cstreamopen),
("close", cstreamclose), # etc...
This will involve you re-ordering your definitions.
Or alternatively, you could cast the function pointer to a c_void_p
first, eg
data.u.pStream.open = c_void_p( c
an "Invalid Parameter" errorcode. there's also no useful
> data whereas datainfo gets written correctly. I know that my cdStream
> can't work, facing the C-code, but what'd be the right cdStream class?
> What can I do? Any ideas?
I've noted some obvious problems above.
To get this to work will require some C knowledge. If they supply
some example C code I'd work through that translating it line by line
to python+ctypes.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
this...
from ctypes import *
Array = c_int64 * 100
a = Array()
for i in range(100):
a[i] = 2**63 - i
for i in range(100):
print a[i]
prints
-9223372036854775808
9223372036854775807
9223372036854775806
[snip]
9223372036854775710
9223372036854775709
ctypes arrays are fixed len
t is hard to write tests for wx GUIs though
(but not impossible).
When you've finished you'll have 3 files full of classes. You may
have a few utility functions too.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> Nick Craig-Wood a ?crit :
> > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> >>> Can someone suggest an efficient way of calling method whose name is
> >>> passed in a variable?
> >>>
de("hex")
'400921fb54442d18'
>>> struct.unpack(">d", "400921FB54442D18".decode("hex"))
(3.1415926535897931,)
>>> struct.unpack(">d", "400921FB54442D19".decode("hex"))
(3.1415926535897936,)
>>>
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
4] OSCL_getCurrentStaticParams
[ 5] OSCL_getErrorString
[ 6] OSCL_getIdent
[snip]
This is a dll we used in a project, and those names exactly worked
with ctypes, eg some snips from the ctypes code
self.dll = cdll.LoadLibrary("OurSharedCodeLibrary")
self.dll.OSCL_getErrorString.restype = c_char_p
def getErrorString(self, status):
return self.dll.OSCL_getErrorString(c_int(status))
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
nt call last):
File "", line 1, in
TypeError: 'int' object is not callable
>>> getattr(obj, 'f')(1)
False
>>>
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
L).
I think candygram is crying out to be married with stackless &or PyPy.
It also needs an IPC channel to compete with Erlang directly.
If you are interested in stackless python vs Erlang then take a look
at this...
http://muharem.wordpress.com/2007/07/31/erlang-vs-stackless-python-a-first-
y manipulation)...
So instead of f(a, *args) have f(a, list_of_args).
The f(*args) syntax is tempting to use for a function which takes a
variable number of arguments, but I usually find myself re-writing it
to take a list because of exactly these sort of problems. In fact I'd
be as bold to
Mel <[EMAIL PROTECTED]> wrote:
> Mensanator wrote:
> > On May 22, 10:30??am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> >> Dave Parker <[EMAIL PROTECTED]> wrote:
> >> > But after getting input from children and teachers, etc, it started
> &g
8.
8
2> X = 10.
** exception error: no match of right hand side value 10
3>
That error message is the erlang interpreter saying "Hey I know X is
8, and you've said it is 10 - that can't be right", which is pretty
much what math teachers say too...
--
Nick Craig-Wood <[EM
drummed into me to always use
parameters for user input and I was really suprised PHP didn't have
them.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
be stored at an arbitrary
> > bit-position in the file
>
> Yes. I need arbitrary, 8bits, than 10 bits for something else, than
> sequence of bytes, than 10 bits again, etc.
You could try
http://construct.wikispaces.com/
which could well do exactly what you want.
--
Nick Cr
do more of those!" - as a battle scarred C programmer I'd agree ;-)
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
hon with a bit of searching. Also
I believe twisted supports them directly or you could easily roll your
own.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
est.instances()
Which prints
[]
[<__main__.Test object at 0xb7d4eb6c>, <__main__.Test object at 0xb7d4eb4c>]
[<__main__.Test object at 0xb7d4eb6c>]
[]
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
rd with xmlrpc.
>
> I have looked at various solutions including:
>
> - PyOrbit - too heavy weight
> - Pyro - uses pickle, I do not trust it
It is possible to change the serialization used by Pyro
http://pyro.sourceforge.net/manual/9-security.html#pickle
to the the 'g
error_text = "".join(format_exception(type, value, traceback))
wx.MessageDialog(None, error_text, 'Custom Error:', wx.OK).ShowModal()
def OnClick(self, evt):
"Click with a deliberate mistake"
adsfsfsdf
if __name__ == "__main__":
a
vailable as a 3rd party
module for 2.3 and 2.4. As is sqlite3.
So in my opinion the real difference between the 2.2, 2.3, 2.4 and 2.5
are the built in modules. The actual language changes are very minor.
If you write your code for 2.5 which is probably a good idea, you'll
have no problem ba
file size...
> Are you sure the script runs to completion? Output a message at the
> end, to be sure.
Check the ownership of all the files too. Remember that the web
server (and hence your cgi) will likely run as nobody or www-data.
You are unlikely to be logging in as one of those users.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
gt; Is there a way to get it using pexpect ?
If I understand you correctly what you need to do is run "echo $$" on
the remote shell then "exec tunnel_command". The $$ will print the
pid and the exec will run tunnel_command without changing the pid.
--
Nick Craig-Wood <[EMA
SDK doing the same? As it is a hobby
> project, I don't like to spend money on the SDK.
Pick yourself up a cue-cat barcode reader, eg from here or ebay
http://www.librarything.com/cuecat
These appear as a keyboard and "type" the barcode in to your program.
Cheap and eff
y!
> I thought that it would be very nice if the built-in sum() function used
> this algorithm by default. Has this been brought up before? Would this
> have any disadvantages (apart from a slight performance impact, but
> Python is a high-level language anyway ...)?
sum() gets used for any numerical types not just floats...
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
er idea ? Suggestions with
> reasoning would be very helpful.
Jython seems to be based off python 2.2 so you would be limited to 2.2
features in that case. No big deal in my opinion.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
immediately after plugging the port in.
I do a lot of this sort of thing at work (not with cars though with
satellite equipment) and it is always the first packet and the first
response which is the hard part. After that it is usually plain
sailing!
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
ues since it's
> event-driven.
It took me a while but I found the documentation on this eventually
http://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IReactorProcess.html
Looks interesting - I'll have to try it next time I'm reaching for
pexpect
Thanks
N
t;):
g=open(os.path.join(r+,files))
shutil.copyfileobj(g,f)
g.close()
f.close()
Any help would be great.
Thanks,
Craig Dalton
Business Applications Systems Analyst
Sentara Healthcare Systems
Information Technology
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
eceive output,
read exit code type jobs.
For jobs which require interactivity ie send input, receive output,
send input, receive output, ... it doesn't work well. There isn't a
good cross platform solution for this yet. pyexpect works well under
unix and is hopefully being ported to
= os.path.join(self.home, "."+self.NAME)
if not os.path.isdir(self.config_dir):
os.makedirs(self.config_dir, mode=0700)
self.config_file = os.path.join(self.config_dir, "config")
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
lf.sock = None
raise ServerDisconnectedException()
self.rx_buf += rx
return message
Sorry I mis-understood your original post!
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
Terry <[EMAIL PROTECTED]> wrote:
> On Apr 28, 5:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> > David <[EMAIL PROTECTED]> wrote:
> > > Another idea would be to have multiple queues, one per thread or per
> > > message type "group
Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Nick Craig-Wood <[EMAIL PROTECTED]> writes:
>
> >> Note that appending to a string is almost never a good idea, since it
> >> can result in quadratic allocation.
> >
> > My aim was clear exposition
Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
> Nick Craig-Wood <[EMAIL PROTECTED]> writes:
>
> > What you are missing is that if the recv ever returns no bytes at all
> > then the other end has closed the connection. So something like this
> > is the corr
7;, 'AUG', 'WWQWAWQWW', 'QWW', 'AGG')
>>>
> This way, I could scan for genes, remove the first letter, scan for
> more genes, remove the first letter again, and scan for more genes.
> This would hypothetically yield different genes, since the frame
> would be shifted.
Of you could just unconstrain the first match and it will do them all
at once :-
(AUG)((\w\w\w)*?)(AGG)
You could run this with re.findall, but beware that this will only
return non-overlapping matches which may not be what you want.
I'm not sure re's are the best tool for the job, but they should give
you a quick idea of what the answers might be.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
impossible
to tell how much data has been sent.
There should really be a recvall for symmetry, but I don't think it
would get much use!
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
o be put in and all the threads will have
to do is Queue.get() and be sure they've got a message they can deal
with.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
new = client.recv(256)
if not new:
break
data += new
>From the man page for recv
RETURN VALUE
These calls return the number of bytes received, or -1 if an
error occurred. The return value will be 0 when the peer has
performed an orderly shutd
learning the
> language idioms).
When you are up to speed in python I suggest you check out gmpy for
number theory algorithms.
Eg :-
import gmpy
p = 2
while 1:
print p
p = gmpy.next_prime(p)
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.co
return v/len(x)
> >>
> >
> > think you want total/len(x) in return statement
> >
> Yes indeed, how glad I am I wrote "untested". I clearly wasn't pair
> programming when I wrote this post ;-)
Posting to comp.lang.python is pair programming wit
uses pexpect fairly extensively to
> interface with all sorts of other systems. We recently received
> funding from Microsoft to do a native port of Sage (and all of its
> components to Windows. Part of this will most likely be a port of
> pexpect to Windows.
Hooray!
--
Nick Craig-Wood &
Mark Wooding <[EMAIL PROTECTED]> wrote:
> Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> > Harishankar <[EMAIL PROTECTED]> wrote:
> >> 1. Create non-blocking pipes which can be read in a separate thread
> >> [...]
> >
> > You are correct o
if killpg:
os.killpg(pgid, signal.SIGKILL)
else:
os.kill(pid, signal.SIGKILL)
except OSError:
return
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
dict unshareable, while immutable int
and str objects can still be shared. Further, mutable objects that
provide an explicit API for use between threads are also shareable.
----
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
if not os.path.exists(link):
continue
open_files.setdefault(link, []).append(pid)
for link in sorted(open_files.keys()):
print "%s : %s" % (link, ", ".join(map(str, open_files[link])))
You m
ying to use it in thread Y which won't work".
You can probably make bsddb work with threads, but I wasted too much
time trying without success!
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
I spent weeks trying to get it to behave
when threading. I gave up in the end and changed to sqlite :-(
At least if you make a mistake with sqlite and use the wrong handle in
the wrong place when threading it gives you a very clear error.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://ww
function howMany(item,lst) which accepts
> an item and a lst of items and returns the number of times item occurs
> in lst. For example, howMany(3,[1,2,3,2,3]) should return 2.
Read section 4.1, 4.2 and 4.6 from here
http://docs.python.org/tut/node6.html
--
Nick Craig-Wood <[EMAIL
On Mar 26, 12:24 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Tue, 25 Mar 2008 08:24:13 -0700 (PDT), Craig <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> > 41 0 0 0
> > 7 0 0 0
> > Which makes sense for two reasons:
> >
On Mar 25, 2:02 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Mon, 24 Mar 2008 15:21:11 -0700 (PDT), Craig <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> > And this is what I got:
> > VmxGet test - looking for valid record...
&g
On Mar 24, 3:45 pm, Craig <[EMAIL PROTECTED]> wrote:
> On Mar 24, 12:27 pm, Craig <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Mar 23, 7:59 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
>
> > > On Sun, 23 Mar 2008 14:24:52 -0700 (PDT), Craig <
On Mar 24, 12:27 pm, Craig <[EMAIL PROTECTED]> wrote:
> On Mar 23, 7:59 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Sun, 23 Mar 2008 14:24:52 -0700 (PDT), Craig <[EMAIL PROTECTED]>
> > declaimed the following in comp.lang.python:
>
On Mar 23, 7:59 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Sun, 23 Mar 2008 14:24:52 -0700 (PDT), Craig <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
>
> > This dll was designed to be used from either C or Visual Basic 6.
>
&
On Mar 23, 4:48 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Sat, 22 Mar 2008 19:05:31 -0700 (PDT), Craig <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> > I got back exactly what I expected for TypeDef, but SecKey and PriKey
> >
On Mar 22, 10:03 pm, Tim Roberts <[EMAIL PROTECTED]> wrote:
> Godzilla <[EMAIL PROTECTED]> wrote:
>
> >Just found out that win32api.GetTickCount() returns a tick count in
> >milli-second since XP started. Not sure whether that is reliable.
> >Anyone uses that for calculating elapsed time?
>
> What
On Mar 22, 9:40 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Sat, 22 Mar 2008 15:12:47 -0700 (PDT), Craig <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
>
>
>
> > Anyway, I have the following for "types":
> >
On Mar 22, 3:13 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Fri, 21 Mar 2008 23:21:48 -0700 (PDT), Craig <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> > Sorry, I wasn't trying to exclude any credit from Dennis, I just
> >
On Mar 21, 4:04 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Thu, 20 Mar 2008 16:50:18 -0700 (PDT), Craig <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
>
> > I received a direct email from someone, and I came up with the
> >
On Mar 20, 6:26 pm, sturlamolden <[EMAIL PROTECTED]> wrote:
> On 20 Mar, 19:09, Craig <[EMAIL PROTECTED]> wrote:
>
> > The following is the C++ prototype for one of the functions:
> > short FAR PASCAL VmxOpen(BSTR*Filespec,
> >
On Mar 20, 4:55 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> On Thu, Mar 20, 2008 at 3:42 PM, Craig <[EMAIL PROTECTED]> wrote:
>
> > On Mar 20, 2:38 pm, Craig <[EMAIL PROTECTED]> wrote:
> > > On Mar 20, 2:29 pm, sturlamolden <[EMAIL PROTECTED
On Mar 20, 2:38 pm, Craig <[EMAIL PROTECTED]> wrote:
> On Mar 20, 2:29 pm, sturlamolden <[EMAIL PROTECTED]> wrote:
>
> > On 20 Mar, 19:09, Craig <[EMAIL PROTECTED]> wrote:
>
> > The culprit i here:
>
> > > Before - X = 0, CacheSize = 0, OpenMo
On Mar 20, 2:29 pm, sturlamolden <[EMAIL PROTECTED]> wrote:
> On 20 Mar, 19:09, Craig <[EMAIL PROTECTED]> wrote:
>
> The culprit i here:
>
> > Before - X = 0, CacheSize = 0, OpenMode = 3, vHandle = 0
>
> This binds these names to Python ints, but byref ex
I use a proprietary dll from Software Source (vbis5032.dll). I have
successfully used it from Visual Basic 6, Fujitsu Cobol and from Perl.
I would now like to use it from Python.
The following is the C++ prototype for one of the functions:
short FAR PASCAL VmxOpen(BSTR*Filespec,
sing the ptrace
interface.
Both those things will require the relevant rights and neither is
quite as easy as you might hope for!
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
TimeHorse <[EMAIL PROTECTED]> wrote:
> On Feb 22, 4:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> > Interestingly enough this was changed in recent linux kernels.
> > Process levels in linus kernels are logarithmic now, whereas before
> > they weren'
this code? I looked
at the examples but I couldn't see one? Having a simple nameserver
written in python would be very useful indeed...
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
20 job gets only 4%.
I think you are on to a loser here trying to normalise it across
OSes unfortunately :-(
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
n__.Y object at 0xb7d9fc2c>]
[<__main__.Y object at 0xb7d9fc8c>]
(It behaves slightly differently in the interactive interpreter for
reasons I don't understand - so save it to a file and try it!)
In fact I find most of the times I wanted __del__ can be fixed by
using a weakref.WeakValueDictionary or weakref.WeakKeyDictionary for a
much better result.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
tances.
The syntax isn't so great when you set things which aren't valid
keywords though...
eg
{ (1,2,3) : 'a', (4,5,6) : 'b' }
vs
dict([ ((1,2,3), 'a'), ((4,5,6), 'b') ])
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
or list size 1000
Read back 1000 items in 0.000352478027344 s
Written 50005 bytes for list size 1
Read back 1 items in 0.00165479183197 s
Written 55 bytes for list size 10
Read back 10 items in 0.0175776958466 s
Written 505 bytes for list size 100
Read back 100 i
'dummy' would both be OK.
As for me personally, I usually use '_' but sometimes use 'dummy'
depending on the surrounding code.
Note that this idiom is fairly common in python too
wanted, _, _, _, also_wanted = a_list
which looks quite neat to my eyes.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
ine)
This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty. If a filename is '-', it
is also replaced by sys.stdin. To specify an alternative list of
filenames, pass it as the first argument to input(). A single file
name is also allowed.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
n't
that hard).
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
> production of Debian packages using distutils.
Looks interesting though!
> [1] http://stdeb.python-hosting.com/
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
which becomes
effectively part of the OS. The package manager tracks every file it
installes to ensure ovewrites can't happen etc...
/usr/local/bin is for stuff installed from source, not using the
package manager.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
bject
the ftphandler code relies on.
I see you attempt to kill the ftp server with ftpd.stop(). That is
good, but you don't wait for the thread to finish (it might take up to
a second in ftpd.server_forever if I understand correctly).
I expect if you put a self.join() at the end of the stop() method the
problem will go away.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
have a second input and I can't put the int(input(":") in the function
because I get the error 'int' is not callable plus my choice variable is not
defined. can someone please enlighten me? :-)
-- Forwarded message --
From: Craig Ward <[EMAIL PROTEC
Hi experts!
I am trying to write a menu script that will execute bash scripts.
Everything is fine until the script executes and I want to see if there are
any more options to run before quitting. Example:
def menu(opt1 = "something", opt2 = "something else"):
--
Computers are like air condition
ursion depth exceeded
16 16 maximum recursion depth exceeded
17 False
[snip]
89 False
90 90 maximum recursion depth exceeded
91 False
92 False
93 93 maximum recursion depth exceeded
94 False
95 False
96 96 maximum recursion depth exceeded
97 False
98 False
99 99 maximum recursion depth exceeded
--
N
0118 kb downloaded 21.304672.1 kBytes/s
Sleep for 0.497982025146
40 kb of 10118 kb downloaded 19.979510.1 kBytes/s
Sleep for 0.497948884964
48 kb of 10118 kb downloaded 19.184721.1 kBytes/s
Sleep for 0.498008966446
...
1416 kb of 10118 kb downloaded 16.090774.1 kBytes/s
Sleep for 0.499262094498
1424
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Nick Craig-Wood wrote:
>
> > Using keywords[:] stops the creation of another temporary list.
>
> in CPython, "list[:] = iter" actually creates a temporary list object on
> the inside, in case "iter"
>>> print a, b
[5, 6, 7] [5, 6, 7]
Using keywords[:] stops the creation of another temporary list. The
other behaviour may or may not be what you want!
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
d I have to close it.
> I cannot find the reason. Can somebody give me a hint to let it work
> well? Thanks
I tried it but it doesn't work at all on linux.
I suggest you use wxPython and stop re-inventing the wheel!
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wo
Hendrik van Rooyen <[EMAIL PROTECTED]> wrote:
> "Nick Craig-Wood" wrote:
> > So you might see longs returned when you expected ints if the result
> > was >= 0x800.
>
> did you mean 0x8000 ?
>
> ;-)
Yes - well spotted!
--
Nick Crai
at
> those few posted code lines.
Actually any number >= 2**31 won't fit in a python int.
>>> 2**31
2147483648L
According to my headers DWORD is defined like this
typedef unsigned long DWORD;
So you might see longs returned when you expected ints if the result
was >= 0x800.
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
quot;"
print >>sys.stderr, globals()['__doc__']
print >>sys.stderr, error
sys.exit(1)
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
enjoy. Thanks, Craig
--
http://mail.python.org/mailman/listinfo/python-list
latform (using a shared QT) and see how much extra RAM it uses.
> is there an exaample of going thru a passworded proxy using twisted
> client classes? i have trouble understanding how to adapt the
> proxy example on page 58 in the twisted book to my needs.
I advise looking at
ines += 1
total += len(line)
print "Received %d lines of %d bytes total" % (lines, total)
#
Which runs like this on my machine
$ python subprocess-shell-nb.py
waiting on child...
waiting on child...
waiting on child...
waiting
python expect module to work around these
problems. Unfortunately there isn't a windows version :-(
You could try the non blocking subprocess modification here
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554
You could also try wx.Process and wx.Execute from wxPython.
--
Nic
, "credits" or "license" for more information.
>>> from sqlite3 import dbapi2
>>> import sqlite3
>>> set(dir(sqlite3)) ^ set(dir(dbapi2))
set(['__path__', 'dbapi2'])
>>>
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
instances (about 1,000,000 in our case) and adding __slots__
to it!
I'd guess that if you __slot__-ed the Domain class then you'll find
the overhead of a type attribute is minimal (4 bytes per instance I
think).
No idea about Hessian or Stomp (never heard of them!) but classes with
__s
p
I've used py2exe and nsis quite a few times - works well.
Note that py2exe can bundle your app into a single exe which you can
just run which may be good enough (no need for an installer).
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
r own GUI in pygame
to do exactly what you want for your embedded device.
> I'm not really sure what the differences are between those two. The
> latter seems to be a little more active.
Pygame is the way I've always done SDL stuff in python - never even
heard of PySDL!
-
:
number = myNumer[:]
random.shuffle(number)
if number == myNumer:
count+=1
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
etty
>
> Removing this (or just disabling it for the user who must run the
> cron job) should eliminate the error. Note that you will also need
> to disable authentication either via the NOPASSWD tag or the
> "authenticate" Defaults option.
Check the PATH in cron also
--
e a program to demonstrate the problem?
You are best off reporting bugs here - then they won't get lost!
http://bugs.python.org/
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
return math.exp(-n)*(n**(n-0.5))*math.sqrt(2*math.pi)*(1. + 1./12/n +
1./288/n**2 - 139./51840/n**3)
Works for non integer factorials also...
See here for background
http://mathworld.wolfram.com/StirlingsSeries.html
--
Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.cr
application in Qt on Mac, Win or Linux look like a
> native app.
I'd recommend wxPython over those becase
1) native look and feel on all platforms
2) doesn't require expensive licensing for non-commercial apps (QT)
3) Isn't a pain to install on windows (GTK)
That said, times change an
301 - 400 of 861 matches
Mail list logo