[EMAIL PROTECTED] wrote:
Is there standard library modules handling this ? currently I need to
turn it into a long integer and do the shift and compare.
A little Googling turned up this:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440560
-Peter
--
I have a sample up here:
http://blog.vrplumber.com/scripts/recordingdevices.py
using wxPython. The sample application is Linux-specific, but it should
give you a fairly good idea of how to use the system tray icon control
in wxPython.
HTH,
Mike
Mike Pippin wrote:
How would I have an
Thanks everyone for your comments and suggestions!
I haven't quite decided which approach I'll take, but it's nice to have
some options.
Paul
Tom Anderson wrote:
On Fri, 21 Oct 2005, Paul Dale wrote:
Is it possible to bind a list member or variable to a variable such that
temp = 5
list
quoth the James Colannino:
Hey everyone. First off, I'm new to the list. I had had a little bit
of experience with Perl before discovering Python. The more Python I
learn, the more I love it :) I just have a quick question to ask. I
know that this is probably a simple question, but I've
On Fri, 21 Oct 2005 20:13:32 -, Grant Edwards [EMAIL PROTECTED] wrote:
On 2005-10-21, Mike Meyer [EMAIL PROTECTED] wrote:
Grant Edwards [EMAIL PROTECTED] writes:
My point: the OP wanted to know how to export an environment
variable to a child process. Either of the lines of code above
Tom Anderson wrote:
This is taken from the AI 754 standard, i take it? :)
Seriously, that's horrible. Fredrik, you are a bad man, and run a bad
railway.
However, looking at the page the OP cites, the only mention of that
operator i can find is in Dylan, and in Dylan, it's nothing
James Hu [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
There are 2 wxPython application, A and B and need to exchange msg.
I do not think that wx even has a mechanism for sending events between
applications.?
You need some other tool, like a socket, a named pibe, some windows
Michael Ekstrand wrote:
On Friday 21 October 2005 07:07, bruno modulix wrote:
Python is more like Java.
troll
Err... Python is more like what Java would have been if Java was a
smart dynamic hi-level object oriented language !-)
/troll
+1. Python is easily applicable to most of the
kery [EMAIL PROTECTED] 10/23/05 9:33 am
Alex Martelli wrote:
microsnot [EMAIL PROTECTED] wrote:
Any suggestions for Linux, specifically SuSE or perhaps Red Hat?
Thanks in advance,
Kery
Eric3
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
bruno modulix wrote:
... Another language that failed to make it to the mainstream but is
worth giving a try is Smalltalk - the father of OOPLs (Simula being the
GrandFather).
I would say Simula is the forefather of modern OOPLs, and Smalltalk is
the
I just downloaded and I think installed python. I am not sure if I
did cause it does'nt respond to the commands that the read me file
told me to use. Also can someone suggest a trial program I can maybe
write for fun?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
thanks, that is basically what I am doing and since it is a recipe, I
would assume there is no standard library module for it.
Peter Hansen wrote:
[EMAIL PROTECTED] wrote:
Is there standard library modules handling this ? currently I need to
turn it into a long integer and do the shift and
Alex Martelli wrote:
(snip)
Here's a tiny script showing some similarities and differences:
def f()
i = 0
while i 100
j = 923567 + i
i += 1
end
end
f()
comment out the 'end' statements, and at colons
s/at/add/
at the end of the def
and while statements, and
Tom Anderson wrote:
On Fri, 21 Oct 2005, vdrab wrote:
You can tell everything is well in the world of dynamic languages when
someone posts a question with nuclear flame war potential like python
vs. ruby and after a while people go off singing hymns about the beauty
of Scheme...
+1
On Monday 24 October 2005 10:21, [EMAIL PROTECTED] wrote:
thanks, that is basically what I am doing and since it is a recipe, I
would assume there is no standard library module for it.
Well, http://py.vaults.ca/~x/parnassus/apyllo.py/126307487 lists a few.
I had used IPy in the past. But
thatchmatic wrote:
I just downloaded and I think installed python. I am not sure if I
did cause it does'nt respond to the commands that the read me file
told me to use. Also can someone suggest a trial program I can maybe
write for fun?
what happens when you type
python
at a command
On Sunday 23 October 2005 03:46, thatchmatic wrote:
I just downloaded and I think installed python. I am not sure if I
did cause it does'nt respond to the commands that the read me file
told me to use. Also can someone suggest a trial program I can maybe
write for fun?
Try
[EMAIL PROTECTED] wrote:
I don't know if this is the appropriate place to post a Zope question
Nope. You'd better use the zope mailing-list for this.
OT
but I figure many here are familiar with it. I'm confused about the
role of the ZMI when it comes to development.
As it's name implies, the
PyPK wrote:
hmm Thats one thing. Also I was thinking of something like benefites of
python over other languages.
That's fairly context-dependant *and* subjective.
--
bruno desthuilliers
python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL
Alex Martelli wrote:
I like to present code that seems like it should work, but has some kind
of relatively subtle problem, either of correctness in some corner case,
or of performance, etc -- and I ask them what they would say if they
were to code-review that code, or how they would help a
Hello All,
I'm working ( and a beginner ) with mixing Python scripting and C++.
And I need some little help. :)
I've searched on the net, but found no answer. So I ask you directly.
Globally, I'd like to do 2 things.
The first, when I'm in the program, I call a script, which call a function
On Sun, 23 Oct 2005 14:54:38 +1000, microsnot
[EMAIL PROTECTED] wrote:
I'm new to Python but am wondering what IDE Python developers use?
I use DrPython ;)
I use Mac
OS X 10.4.2. I have PythonIDE which comes with MacPython but I don't think
that has even rudimentary intellisense.
DrPython
On 23 Oct 2005 18:39:17 -0700, Brendan [EMAIL PROTECTED] wrote:
As mentioned, there isn't a whole lot. I've beta tested Komodo, and it
looks promising. SPE might start working now that stani has a mac.
For now I use TextWrangler - a free text editor with good python
support.
Hello vpr,
I've written a p2p program using socketserver that's nice and quick.
I'd like to give the user a tray applet (part of the p2p service) that
will allow the user to activate / deactivate / config and exit the
service.
However I'm starting to bang my head on the mainloop funtions
Op 2005-10-21, Christopher Subich schreef [EMAIL PROTECTED]:
Antoon Pardon wrote:
It would be better if cmp would give an indication it
can't compare two objects instead of giving incorrect
and inconsistent results.
If two objects aren't totally comparable, then using 'cmp' on them is
Hello,
I'm designing a small briefcase program that will allow me to quickly
upload, download, and delete files in a briefcase. The only real
things that I have left to do are to design a method for checking if
the file exists, preventing it from overwriting files from other
directories, and
Joey C. wrote:
thefile = params[upfile.file]
if os.path.getsize(thefile) = conf[upmax]:
print File Size Okay. #Add Functions Later...
else:
print File Too Large. #Here, too.
CGItb reported the following error:
TypeError: coercing to Unicode: need string or buffer, instance
Steven D'Aprano wrote:
Alex Martelli wrote:
Those two are easy. However, and this is where I show my hard-won
ignorance, and admit that I don't see the problem with the property
examples:
class Base(object)
def getFoo(self): ...
def setFoo(self): ...
foo =
[EMAIL PROTECTED] wrote:
counting that out(regardless whether it is (dis)advantage or not), what
else a block can do but not a named function ?
My limited understanding is that the advantage is
- simpler syntax
- high level of integration into the standard library (*many* methods that take
Fast install: just go to the update manager (inside the help menu) and add
update site: http://pydev.sf.net/updates/ (eclipse should do the rest)
Too easy! Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
thanks. Seems that my programs are very simple and don't need these
feature yet.
Kent Johnson wrote:
[EMAIL PROTECTED] wrote:
counting that out(regardless whether it is (dis)advantage or not), what
else a block can do but not a named function ?
My limited understanding is that the
Op 2005-10-23, David Schwartz schreef [EMAIL PROTECTED]:
Roedy Green [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]
On Sat, 22 Oct 2005 16:10:24 -0700, David Schwartz
[EMAIL PROTECTED] wrote or quoted :
If the deal didn't give you more than it cost you, all you had to do
Any ideas?
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
Those two are easy. However, and this is where I show
my hard-won ignorance, and admit that I don't see the
problem with the property examples:
class Base(object)
def getFoo(self): ...
def setFoo(self): ...
foo = property(getFoo, setFoo)
bruno modulix wrote:
Scott David Daniels wrote:
bruno modulix wrote:
... Another language that failed to make it to the mainstream but is
worth giving a try is Smalltalk - the father of OOPLs (Simula being the
GrandFather).
I would say Simula is the forefather of modern OOPLs, and Smalltalk is
I got confused by the following information from the help for FIND:
find(s, *args)
find(s, sub [,start [,end]]) - in
what does *args mean (especially the '*')?
also, in the sub, why put a comma before start?
what does 'in' mean?
--
http://mail.python.org/mailman/listinfo/python-list
Just look in the archives of the Pythonmac mailinglist. We have
discussed this very subject intensively recently, with a pretty
extensive review of the different IDEs available.
Looking through the mailing list. Any specific subject/dates I should be
looking for?
Suggestions for plugins for
Mac users of SPE collected money for me to buy a Mac. This means that
in the near future SPE will be especially improved for Mac. So feedback
from Mac users is more than welcome and will probably be taken into
account. SPE is a free, open source IDE with a lot of features like a
debugger, UML
Shi Mu wrote:
I got confused by the following information from the help for FIND:
find(s, *args)
what FIND ?
help(str.find)
Help on method_descriptor:
find(...)
S.find(sub [,start [,end]]) - int
Return the lowest index in S where substring sub is found,
such that sub is
Antoon Pardon wrote:
Op 2005-10-21, Christopher Subich schreef [EMAIL PROTECTED]:
Antoon Pardon wrote:
It would be better if cmp would give an indication it
can't compare two objects instead of giving incorrect
and inconsistent results.
If two objects aren't totally comparable, then using
Any other ideas? or examples of using subprocess to do what I was
asking?
Kent Johnson wrote:
jas wrote:
I would like to redirect the output from os.system to a variable, but
am having trouble. I tried using os.popen(..).read() ...but that
doesn't give me exactly what i want.
Here is
thatchmatic wrote:
I just downloaded and I think installed python. I am not sure if I
did cause it does'nt respond to the commands that the read me file
told me to use. Also can someone suggest a trial program I can maybe
write for fun?
Thanks.
1:
Alex Martelli wrote:
... remember Pascal's Lettres Provinciales,
and the famous apology about I am sorry that this letter is so long,
but I did not have the time to write a shorter one!-)
This observation applies to code too. I usually spend most of my time
in making short programs
that would
darren kirby wrote:
quoth the James Colannino:
So, for example, in Perl I could do something like:
@files = `ls`;
So I guess I'm looking for something similiar to the backticks in Perl.
Forgive me if I've asked something that's a bit basic for this list.
Any help would be greatly appreciated :)
Scott David Daniels:
Sorry, I was being too cute by half. If Simula is the fore father
(4 away) then Smalltalk is half as far (2) away. Hence the toofather.
Toofather by analogy with the homophones fore and four we use the
homophones two and too.
We could smear the homophones further
[EMAIL PROTECTED] wrote:
thanks, that is basically what I am doing and since it is a recipe, I
would assume there is no standard library module for it.
Well, since a Google search for site:docs.python.org subnet turns up
nothing, one would assume not, but it would be hard to prove it without
Hi,
I am trying to create a small utility program which would be configured
in registry. Something like this
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\ShortCut\command]
@=\python C:\\workspace\\python\\Tut\\ShortCut.py\
It gives me access denied exception when I try it.
Op 2005-10-24, Steve Holden schreef [EMAIL PROTECTED]:
Antoon Pardon wrote:
set([1]) = set([2])
False
set([2]) = set([1])
False
Set orderingd are explicitly documented as being based on proper
subsetting. This is an abuse of the operators to make subset tests more
convenient
Hi everybody,
Thanks to significant code contributions by Daniel Smertnig, I am proud
to announce release 2.0 of the Informix implementation of the Python
DB-API, a mere 5 weeks after release 1.5.
Downloads and info at http://informixdb.sourceforge.net/
This release features the following
In the PythonWin's interactive window,
why sometimes I need type the command two times to make it work?
for example, I execute print testList two times to make it work.
Why?
print testList
print testList
['w', 'e', ' ', 'w', 'a', 'n', 't', ' ', 't', 'o', ' ', 'l', 'e', 'a',
'r', 'n', ' ', 'p',
I see that, although I don't totall grasp the code. However, I am
looking to basically emulate a command prompt. i.e. everything u see
in the windows command prompt should be displayed back in python.
How can I do it without files?
Kent Johnson wrote:
jas wrote:
Any other ideas? or examples
In comp.lang.perl.misc David Schwartz [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
In comp.lang.perl.misc David Schwartz [EMAIL PROTECTED] wrote:
Mike Meyer [EMAIL PROTECTED] wrote in message
Sorry, but nobody but the government actually owns
On Mon, 24 Oct 2005 09:23:58 +, Antoon Pardon wrote:
Op 2005-10-21, Christopher Subich schreef [EMAIL PROTECTED]:
Antoon Pardon wrote:
It would be better if cmp would give an indication it
can't compare two objects instead of giving incorrect
and inconsistent results.
If two objects
Is there any difference if I remove the '/'
from the following statement?
intMatrix2 = [[1,1,2,4,1,7,1,7,6,9],\
[1,2,5,3,9,1,1,1,9,1],\
[0,0,5,1,1,1,9,7,7,7]]
print intMatrix2
I removed one '\' and it still works.
So what is the use of '\'?
--
Ok, I tried this...
C:\python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32
Type help, copyright, credits or license for more information.
import subprocess as sp
p = sp.Popen(cmd, stdout=sp.PIPE)
result = p.communicate(ipconfig)
'result' is not recognized as
Lots of thanks for your help, My code can return the right result now.
Thanks again!
On Sun, 23 Oct 2005 17:27:49 +0200, Fredrik Lundh
[EMAIL PROTECTED] wrote:
Gonnasi wrote:
With
glob.glob(*)
or
os.listdir(cwd)
I can get a combined file list with directory list, but I just wanna a
It Will Work
If you do as I have done! Just Do It! follow the 4 steps
$6.00 to $15,000.00 in 30 days!
Steps: Follow the Logic, Just Do it and It will work
$$$ in 4 easy steps
1. Set Up a Free Paypal Account. 2. Send $1.00 to six Email Accounts from
your Paypal Account 3. Delete email address
jas wrote:
Any other ideas? or examples of using subprocess to do what I was
asking?
Actually I thought I was giving an example of what you were asking:
- on windows
- send a series of commands to a command process
- capture the result to a variable
The example I referenced sends a series of
On Mon, 24 Oct 2005 12:35:13 GMT, [EMAIL PROTECTED] wrote,
quoted or indirectly quoted someone who said :
I see that you cannot make a reasoned argument against the fact that
property in the form of houses is taxed in America.
And what has his inability to do that to your satisfaction got to do
In comp.lang.perl.misc David Schwartz [EMAIL PROTECTED] wrote:
This is about whether we're talking *ABOUT* America, you idiot. It's as
if he said the press has no freedom, and I replied, if you want to talk
about some country where that's true, fine, but this discussion presumed
jas wrote:
Ok, I tried this...
C:\python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32
Type help, copyright, credits or license for more information.
import subprocess as sp
p = sp.Popen(cmd, stdout=sp.PIPE)
result = p.communicate(ipconfig)
'result' is
Op 2005-10-24, Steven D'Aprano schreef [EMAIL PROTECTED]:
On Mon, 24 Oct 2005 09:23:58 +, Antoon Pardon wrote:
Op 2005-10-21, Christopher Subich schreef [EMAIL PROTECTED]:
Antoon Pardon wrote:
It would be better if cmp would give an indication it
can't compare two objects instead of
On Monday 24 October 2005 15:02, Shi Mu wrote:
Is there any difference if I remove the '/'
from the following statement?
You probably mean '\' instead of '/'.
intMatrix2 = [[1,1,2,4,1,7,1,7,6,9],\
[1,2,5,3,9,1,1,1,9,1],\
[0,0,5,1,1,1,9,7,7,7]]
print intMatrix2
I
Shi Mu wrote:
Is there any difference if I remove the '/'
\
from the following statement?
intMatrix2 = [[1,1,2,4,1,7,1,7,6,9],\
[1,2,5,3,9,1,1,1,9,1],\
[0,0,5,1,1,1,9,7,7,7]]
print intMatrix2
I removed one '\' and it
Hello,
Python regular expressions must not have more than 100 capturing
groups. The source code responsible for this reads as follows:
# XXX: fl get rid of this limitation!
if p.pattern.groups 100:
raise AssertionError(
sorry, but this version only supports 100
doesn't sound to encouraging :)
How about something with os.popen?
in = os.popen(cmd, w)
in.write(hostname)
I tried this, and I get IOError: [Errno 22] Invalid Argument
I am not sure why this isnt working.
Steve Holden wrote:
jas wrote:
Ok, I tried this...
C:\python
Python 2.4.1
On Wed, 19 Oct 2005 11:48:01 +0200, Xah Lee [EMAIL PROTECTED] wrote:
Thanks a lot for various notes. Bonono?
I will have to look at the itertools module. Just went to the doc
http://www.python.org/doc/2.4.1/lib/module-itertools.html
looks interesting.
But I believe Python is designed for
Xah Lee wrote:
Dear Peter Hansen,
My messages speak themselfs. You and your cohorts's stamping of it does
not change its nature. And if this is done with repetitiousness, it
gives away your nature.
Taunt not the cohorts of Peter Hansen!
Graham
--
After further playing - it seems that the server_close() just takes
time to execute. I have found that if I wait a while (1-3 seconds) the
second connection will fail as well. Locking is already built into my
handler class - so I'll just use it to prevent further connections
until server_close()
darren kirby [EMAIL PROTECTED] writes:
If all you want is filenames this will work:
import glob
files = [%s % f for f in glob.glob(*)]
What's the point of doing %s % f? How is this different from just
file = [f for f in glob.glob(*)]?
mike
--
Mike Meyer [EMAIL PROTECTED]
Fredrik Lundh wrote:
Ernesto wrote:
Thanks. Can anyone provide an example of using *subprocess* to run
helloWorld.C through the python interpreter.
compile helloWorld, and run:
import subprocess
subprocess.call(helloWorld)
(any special reason why you couldn't figure this out
Hi,
I would like to start a new process and be able to read/write from/to
it. I have tried things like...
import subprocess as sp
p = sp.Popen(cmd.exe, stdout=sp.PIPE)
p.stdin.write(hostname\n)
however, it doesn't seem to work. I think the cmd.exe is catching it.
I also tried
f =
Hi !
i am having a strange experience with the pickle module. I use
python2.4 and i really don't understand what is happening on ! take a
look at this :
code
import pickle
print hello
/code
trace
hello
hello
/trace
code
#import pickle
print hello
/code
trace
hello
/trace
I just don't get it.
On 2005-10-24, Eric Brunel [EMAIL PROTECTED] wrote:
The only think you can export an environment variable to is a
child process
Well, you know that, and I know that too. From my experience,
many people don't...
True. Using Unix for 20+ years probably warps one's perception
of what's
Hi,
I'm running Python 2.3.5/2.4.2 on OSX 10.4.2, and am trying to run CGI
scripts using the builtin Apache. For ease, I've symlinked my custom
modules into the /Library/Python/2.3/site-packages directory, and they
import OK via command line python. However, when I perform the import
from a
Ernesto wrote:
Thanks. Can anyone provide an example of using *subprocess* to run
helloWorld.C through the python interpreter.
compile helloWorld, and run:
import subprocess
subprocess.call(helloWorld)
(any special reason why you couldn't figure this out yourself, given the
ychaouche wrote:
i am having a strange experience with the pickle module. I use
python2.4 and i really don't understand what is happening on !
take a look at this :
code
import pickle
print hello
/code
trace
hello
hello
/trace
did you perhaps name your test program pickle.py ?
/F
Kent Johnson [EMAIL PROTECTED] wrote:
...
For example to open a file and read from it uses two closures, one to wrap
a block with the file open/close, one to iterate lines (from the pickaxe
book):
File.open(testfile) do |file|
file.each_line { |line| puts line }
end
Good example --
On Saturday 22 October 2005 05:44 pm, Tim Tyler wrote:
Microsoft still comes in at number 2 - on:
http://dmoz.org/Society/Issues/Business/Allegedly_Unethical_Firms/
Few companies are more despised than Microsoft.
Wrong URL?
No such list appears at that site, although it does link to several
Steven D'Aprano [EMAIL PROTECTED] wrote:
...
my hard-won ignorance, and admit that I don't see the
problem with the property examples:
class Sic:
def getFoo(self): ...
def setFoo(self): ...
foo = property(getFoo, setFoo)
Sorry for skipping the 2nd
Michele Simionato [EMAIL PROTECTED] wrote:
Alex Martelli wrote:
... remember Pascal's Lettres Provinciales,
and the famous apology about I am sorry that this letter is so long,
but I did not have the time to write a shorter one!-)
This observation applies to code too. I usually spend
Joerg Or is there a way to circumvent [capturing groups limitation]?
Sure, submit a patch to SourceForge that removes the restriction.
I've never come anywhere close to creating regular expressions that need to
capture 100 groups even though I generate regular expressions from a
higher-level
There was just recently announced -- iplib-0.9:
http://groups.google.com/group/comp.lang.python.announce/browse_frm/thread/e289a42714213fb1/ec53921d1545bf69#ec53921d1545bf69
It appears to be pure python and has facilities for dealing with
netmasks. (v4 only).
-- George
--
On Monday 24 October 2005 08:19 am, Roedy Green wrote:
On Mon, 24 Oct 2005 12:35:13 GMT, [EMAIL PROTECTED] wrote,
quoted or indirectly quoted someone who said :
I see that you cannot make a reasoned argument against the fact that
property in the form of houses is taxed in America.
And
Alex Martelli wrote:
class Base(object)
def getFoo(self): ...
def setFoo(self): ...
foo = property(getFoo, setFoo)
class Derived(Base):
def getFoo(self):
[snip]
the solution, in Python 2.4 and earlier, is to use
one extra level of indirection:
Alex Martelli:
Michele Simionato:
cutting off non-essential features (and you can discover that a feature
is non essential only after having implemented it)
This one is difficult if you have RELEASED the program with the feature
you now want to remove, sigh.
Yeah, but I used the wrong word
jas wrote:
Ok, I tried this...
C:\python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32
Type help, copyright, credits or license for more information.
import subprocess as sp
p = sp.Popen(cmd, stdout=sp.PIPE)
result = p.communicate(ipconfig)
'result' is
Kent,
Yes, your example does work. So did os.popen...however, the problem
is specific to cmd.exe.
Have you tried that yet?
Thanks!
Kent Johnson wrote:
jas wrote:
Ok, I tried this...
C:\python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32
Type
Mike Meyer wrote:
darren kirby [EMAIL PROTECTED] writes:
If all you want is filenames this will work:
import glob
files = [%s % f for f in glob.glob(*)]
What's the point of doing %s % f? How is this different from just
file = [f for f in glob.glob(*)]?
Answering narrowly, the difference
Fredrik Lundh wrote:
the page was written before the type/class unification in Python 2.2,
at a time where the word type had a stricter meaning (referring to C-
level types, not user-level classes).
Gotcha. Thanks.
That writeup is definitely on my required reading list for new Python
Thanks, that is certainly a start. As you mentioned, the cd could is
an issue.
Perhaps checking to see if the line ends with is sufficient?
Dennis Lee Bieber wrote:
On 24 Oct 2005 07:20:42 -0700, jas [EMAIL PROTECTED] declaimed the
following in comp.lang.python:
Hi,
I would like to
actually, i can't check for only because if you a dir, a line can
end with a but is not the end of the output
jas wrote:
Thanks, that is certainly a start. As you mentioned, the cd could is
an issue.
Perhaps checking to see if the line ends with is sufficient?
Dennis Lee Bieber wrote:
Kent Johnson wrote:
import os
files = os.listdir('.')
Thanks, that's good to know. I still need to use os.popen() for a few
things, but I'll be needing filenames also, so when I try to get
filenames I'll use the above.
James
--
My blog: http://www.crazydrclaw.com/
My homepage:
What about having a thread which reads from subprocess.Popen()'s
stdout...instead of read/write, read/write. just always read, and
write when needed?
any comments on that idea?
jas wrote:
actually, i can't check for only because if you a dir, a line can
end with a but is not the end of the
let me try.
1) ''.join(lots_of_pieces)
2) This doesn't even work, if something is removed, the list is too
short. So:
[x for x in somelist if not isbad(x)]
well, list comprehension is Python 2.4 and 2.3 is the standard in many
OSes, so it is possibly not the most portable solution
I had to look
A couple of strategic gc.collect() calls can be useful. You can also tweak
how the garbage collector gets run by changing settings in the gc module.
-Chris
On Fri, Oct 21, 2005 at 04:13:09PM -0400, Robby Dermody wrote:
Hey guys (thus begins a book of a post :),
I'm in the process of
I have been writing a program that is designed to return an 8 byte
string from C to Python. Occasionally one or more of these bytes will
be null, but the size of it will always be known. How can I write an
extention module that will return the correct bytes, and not just until
the null? I would
I think that you want to use
return PyString_FromStringAndSize(buf, 8);
Jeff
pgp3nNxegNjmk.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
On 24 Oct 2005 11:28:23 -0700, Tuvas [EMAIL PROTECTED] wrote:
I have been writing a program that is designed to return an 8 byte
string from C to Python. Occasionally one or more of these bytes will
be null, but the size of it will always be known. How can I write an
extention module that will
Tuvas wrote:
I have been writing a program that is designed to return an 8 byte
string from C to Python. Occasionally one or more of these bytes will
be null, but the size of it will always be known. How can I write an
extention module that will return the correct bytes, and not just until
1 - 100 of 165 matches
Mail list logo