? 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 effective.
--
Nick Craig-Wood [EMAIL PROTECTED
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
Nick
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org
. 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
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
, 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
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 windows soon.
--
Nick Craig-Wood [EMAIL
))
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
):
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
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. The producer thread pushes into the appropriate
queues (through
+= 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
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 rather than the ultimate performance!
That would normally be fine
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
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 shutdown.
In the -1 case python will raise a socket.error.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
it
would get much use!
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
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
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 correct thing to write :-
data =
while True
wrote untested. I clearly wasn't pair
programming when I wrote this post ;-)
Posting to comp.lang.python is pair programming with the entire
internet ;-)
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
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.com/nick
--
http://mail.python.org/mailman/listinfo
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 [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http
OSError:
return
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
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 on both of those points.
I must be missing something. What's wrong
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
[link])))
You might want to consider http://pyinotify.sourceforge.net/ depending
on exactly what you are doing...
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python
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
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://www.craig-wood.com/nick
--
http
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 PROTECTED] -- http://www.craig-wood.com/nick
--
http
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:
1. It would only return the non-space-filled part
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...
Before -PriKey = 0x0044F56C,SecKey
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.
I have the declare statements for VB6
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:
This dll was designed to be used from either C or Visual
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 [EMAIL PROTECTED]
declaimed the following in comp.lang.python
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
were what I initialized them to , not what
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
following after implementing his advice
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
wasn't sure if he wanted to be listed
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:
LPBSTR = POINTER(c_void_p)
HANDLE = POINTER(POINTER(c_long))
LPHANDLE
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 do you mean
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,
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 expects C types.
Also observe that CacheSize
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, OpenMode = 3, vHandle = 0
This binds these names to Python ints, but byref
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] wrote:
On 20 Mar, 19:09, Craig [EMAIL PROTECTED] wrote
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,
LPSHORT lpLocatorSize
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
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
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't (but I wouldn't like to say exactly what
it across
OSes unfortunately :-(
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
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
for list size 10
Read back 10 items in 0.0175776958466 s
Written 505 bytes for list size 100
Read back 100 items in 0.175704598427 s
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
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
file
name is also allowed.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
you can plot the
result of your simulation.
You can draw a few buttons (like play and stop) and detect clicks in
them very easily.
If you want loads of parameters then you'll either need to reach for a
GUI toolkit or roll your own menuing system for pygame (which isn't
that hard).
--
Nick Craig
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
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
these create particularly policy compliant .debs but
they are good enough for local usage.
Meanwhile, even stdeb [1] doesn't appear to completely automate the
production of Debian packages using distutils.
Looks interesting though!
[1] http://stdeb.python-hosting.com/
--
Nick Craig-Wood
16.090267.1 kBytes/s
Sleep for 0.499293088913
1432 kb of 10118 kb downloaded 16.089760.1 kBytes/s
Sleep for 0.499292135239
1440 kb of 10118 kb downloaded 16.089254.1 kBytes/s
Sleep for 0.499267101288
...
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org
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
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http
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
my choice variable is not
defined. can someone please enlighten me? :-)
-- Forwarded message --
From: Craig Ward [EMAIL PROTECTED]
Date: Jan 11, 2008 11:21 AM
Subject: newbie question regarding int(input(:))
To: python-list@python.org
Hi experts!
I am trying to write a menu
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
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 isn't already a list or a tuple.
(see the implementation
. 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-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
Hendrik van Rooyen [EMAIL PROTECTED] wrote:
Nick Craig-Wood nic...od.com wrote:
So you might see longs returned when you expected ints if the result
was = 0x800.
did you mean 0x8000 ?
;-)
Yes - well spotted!
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com
.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
sys.exit(1)
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
. Thanks, Craig
--
http://mail.python.org/mailman/listinfo/python-list
...
waiting on child...
waiting on child...
waiting on child...
returncode = 42
Received 11 lines of 488895 bytes total
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
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 the twisted source code!
--
Nick Craig-Wood [EMAIL PROTECTED] -- http
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
blocking subprocess modification here
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440554
You could also try wx.Process and wx.Execute from wxPython.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
attribute is minimal (4 bytes per instance I
think).
No idea about Hessian or Stomp (never heard of them!) but classes with
__slot__s are normal classes which would pickle or unpickle.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo
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
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!
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman
)
if number == myNumer:
count+=1
return int(I*1.0/count+.5)
;-)
Note you can write your middle loop as
for i in range(I):
number = myNumer[:]
random.shuffle(number)
if number == myNumer:
count+=1
--
Nick Craig-Wood [EMAIL
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
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http
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
**(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.craig-wood.com/nick
--
http://mail.python.org
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 and 1-3 may have changed since I last looked
at it!
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig
vague.
The above code has a syntax error in it so obviously isn't from
working code.
PS I really doubt the problem is windows not seeing the created file...
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
to the project?
Regards,
Craig
--
http://mail.python.org/mailman/listinfo/python-list
the () in f.close() !
thanks for pointing that out.
VB programmer!? Thats really harsh..
I used to make that mistake a lot as an ex-perl programmer. I think
ruby is the same.
pychecker will warn about it though.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http
On Oct 6, 2007, at 11:31 PM, goldtech wrote:
Can anyone link me or explain the following:
I open a file in a python script. I want the new file's location to be
on the user's desktop in a Windows XP environment. fileHandle = open
(., 'w' ) what I guess I'm looking for is an
if num = 1:
return num
else:
raise NotImplementedError
There is a bug in that code...
NotImplementedError will never be raised because num won't have been
set. It will raise UnboundLocalError: local variable 'num'
referenced before assignment instead
--
Nick Craig
.
Unit testing was the only way to ensure it worked without disrupting
the plant operation.
Craig
--
http://mail.python.org/mailman/listinfo/python-list
import os
os.sysconf('SC_NPROCESSORS_ONLN')
2
(From my Core 2 Duo laptop running linux)
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
(1,3)*mpq(6,10)*mpq(4,10)+mpq(7,8)
mpq(191,200)
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
connection - it is just accessed from a different process.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
! A python module to do it would be great!
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
Cheating perhaps! Note is_prime will be a probabalistic test for
large numbers...
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
build our app which has python
embedded for ARM using a cross compiler running under debian.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
Gigs_ [EMAIL PROTECTED] wrote:
does anyone know some good tutorial for unittest? (with examples
how unit work)?
There is one in Dive into Python
http://www.diveintopython.org/unit_testing/index.html
Buy the book is my advice!
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig
:
os.readlink(/proc/%d/fd/%d % (os.getpid(), fileno))
A good idea! You can write this slightly more succinctly as
os.readlink(/proc/self/fd/%d % fileno)
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
Erik Jones [EMAIL PROTECTED] wrote:
front, last = l[:len(l) - 1], l[len(l) - 1]
Normally written as
front, last = l[:-1], l[-1]
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
the patch
to the python bug tracker and you'll get that nice glow from helping
others! Remember python is open source and is made by *us* for *us* :-)
If you need help fixing zipfile.py then you'd probably be better off
asking on python-dev.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig
I'm only looking for some initial guidance from the
Python users. TIA
Go for it! Python is such an easy language to write stuff in
(escpecially compared to C++) that you'll have the prototype done very
quickly and you can evaluate the rest of your concerns with working
code!
--
Nick Craig
at least (dunno about windows) unless your dir is on NFS.
If you want more security then make sure dir isn't publically
writeable.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
Hrvoje Niksic [EMAIL PROTECTED] wrote:
Nick Craig-Wood [EMAIL PROTECTED] writes:
If you are running linux 2.6.18 then you can use
/proc/sys/vm/drop_caches for exactly that purpose.
http://www.linuxinsight.com/proc_sys_vm_drop_caches.html
That URL claims that you need to run sync
strace the process to
see what it is doing. There are windwows strace programs (which I've
never tried) too!
You'll probably find it is wedged in TCP socket code.
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
91284
# echo 3 /proc/sys/vm/drop_caches
# free
total used free sharedbuffers cached
Mem: 1036396 588228 448168 0692 91808
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org
...)
--
Nick Craig-Wood [EMAIL PROTECTED] -- http://www.craig-wood.com/nick
--
http://mail.python.org/mailman/listinfo/python-list
boundary. Combined with Perl's 'while ()' construct this seems a great
way to process the files I am interested in.
Without wishing to start a flame war, is there a way to do this in Python?
for para in re.split(r\.\n, input_data):
print para = %r % para
--
Nick Craig-Wood [EMAIL PROTECTED
501 - 600 of 1017 matches
Mail list logo