[EMAIL PROTECTED] wrote:
> Doh! How simple. Why didn't I think of that? I'm too used to procedural
> scripts where you'd just put everything in a global data structure. I
> know this is bad, but it's hard to get out of that mentality.
Sounds like you got it. Just pass it on down as needed.
-
D wrote:
> Thanks, guys. So overall, would it just be easier (and not too rigged)
> if any changes were made by just editing the text file? I want to do
> [EMAIL PROTECTED] wrote:
> > Might be overkill - but pickle the data memeber that contains the
> > information. If you use text inste
[EMAIL PROTECTED] wrote:
> Lets say that I have an application consisting of 3 files. A main.py
> file, gui.py and a data.py which handles persistent data storage.
> Suppose data.py defines a class 'MyDB' which reads in data from a
> database, and main.py creates an instance of this object. How do
D wrote:
> Hi, I currently have a Python app with a Tkinter GUI frontend that I
> use for system administration. Everytime it launches, it reads a text
> file which contains info about each host I wish to monitor - each field
> (such as IP, hostname, etc.) is delimited by !!. Now, I want to be
>
Dennis Lee Bieber wrote:
> On 11 Jul 2006 06:45:42 -0700, [EMAIL PROTECTED] declaimed the
> following in comp.lang.python:
>
> Could it be that the SERVER is limiting things to 5
> concurrent/parallel connections from any single IP?
>
> I know I've encountered sites that only allowed t
[EMAIL PROTECTED] wrote:
> I'm trying to use ftp in python in a multi-threaded way on a windows
> box - python version 2.4.3. Problem is that it appears that it's only
> possible to have five instances/threads at one point in time. Errors
> look like:
>
>File "C:\Python24\lib\ftplib.py", lin
On 11 Jul 2006 06:45:42 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I'm trying to use ftp in python in a multi-threaded way on a windowsbox - python version
2.4.3. Problem is that it appears that it's onlypossible to have five instances/threads at one point in time. Errorslook like: Fi
sandorf wrote:
>I'm using the Windows version of Python and IDLE. When I debug my .py
>file, my modification to the .py file does not seem to take effect
>unless I restart IDLE. Saving the file and re-importing it doesn't help
>
>either. Where's the problem?
>
>Thanks.
>
>
>
No problem. Just r
could ildg wrote:
> I have 2 thead instances,
> A and B,
> In A's run method, if I call B.Method(), it will be executed in thead A,
> but I want B.Method() to be executed in B's thread.
> That's to say, I want to tell Thead B to do B's stuff in B's thread,
> kinda like PostMessage in win32.
> Can
Gerard Flanagan wrote:
>Hello
>
> I'm sure its basic but I'm confused about the error I get with the
>following code. Any help on basic tempfile usage?
>
>
>ActivePython 2.4.1 Build 247 (ActiveState Corp.) based on
>Python 2.4.1 (#65, Jun 20 2005, 17:01:55) [MSC v.1310 32 bit (Intel)]
>on win32
>
#x27;s homepage, the release (or news) information, and what the
project is about. I'm planning on posting nightly at around 5PM GMT +5
(10PM Eastern time in the states), so email that I receive before that
time should be posted the same day.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
Junhua Deng (AL/EAB) wrote:
>Hi,
>I have a simple server-client application with threading. It works fine when
>both server and client on the same machine, but I get the following error
>message if the server is on another machine:
>
>... ...
>self.socket.send(outgoingMsg)
>socket.error: (32
[EMAIL PROTECTED] wrote:
>Hi,
>I am a python newbie and need some advice.
>I have been charged with redeveloping a web application with a front end
>written in python that has a backend of XML files.
>Currently it doesn't adequately separate out the presentation code from the
>content code.
>Fra
Negoescu Constantin wrote:
> Hello.
>
> I know that Python is */not fully threadsafe/*. Unlike Java, where
> threading was considered to be so important that it is a part of the
> syntax, in Python threads were laid down at the altar of Portability.
> But, i really have to finish a projec
Tim Golden wrote:
>As it happens, (and I suspect I'll have to don my flameproof suit here),
>I prefer the Windows command line to bash/readline for day-to-day use,
>including in Python. Why? Because it does what I can't for the life of
>me get readline to do: you can type the first few letters
Xah Lee wrote:
>Peter Hansen wrote:
>
>
>>Xah Lee wrote:
>>
>>
>>>If you think i have a point, ...
>>>
>>>
>>You have neither that, nor a clue.
>>
>>
>
>Dear Peter Hansen,
>
>My messages speak themselfs. You and your cohorts's stamping of it does
>not change its nature. And if this
[EMAIL PROTECTED] wrote:
>I just need confirmation that I think right.
>
>Is the files thread_xxx.h (xxx = nt, os2 or whatever) responsible for
>the
>global interpreter lock in a multithreaded environment?
>
>I'm currently writing my own thread_VW for VxWorks, thats why I'm
>asking.
>
>//Tommy
>
Kenneth McDonald wrote:
>For unfortunate reasons, I'm considering switching back to Win XP
>(from OS X) as my "main" system. Windows has so many annoyances that
>I can only compare it to driving in the Bay Area at rush hour (OS X
>is like driving in Portland at rush hour--not as bad, but get
Maurice LING wrote:
>I had the opportunity to glance through the book in Borders yesterday.
>On the whole, I think it is well covered and is very readable. Perhaps I
>was looking for a specific aspect, and I find that threads did not get
>enough attention. Looking at the index pages, the topics
Dick Moores wrote:
>(Sorry, my previous post should not have had "Tutor" in the subject header.)
>
>Magnus Lie Hetland's new book, _Beginning Python: From Novice to
>Professional_ was published by Apress on Sept. 26 (in the U.S.). My copy
>arrived in the mail a couple of days ago. Very much worth
this temp file on memory???
>
>
>
>Jeremy Jones wrote:
>
>
>>Wenhua Zhao wrote:
>>
>>
>>
>>>A.T.T
>>>
>>>Thanks a lot.
>>>
>>>
>>>
>>>
>>If you could elaborate a bit more, it m
Wenhua Zhao wrote:
>A.T.T
>
>Thanks a lot.
>
>
If you could elaborate a bit more, it might be helpful. I'm guessing
you want something like StringIO or cStringIO.
- jmj
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
>Damjan> Is there some python module that provides a multi process Queue?
>
>Skip> Not as cleanly encapsulated as Queue, but writing a class that
>Skip> does that shouldn't be all that difficult using a socket and the
>Skip> pickle module.
>
>Jeremy> Wh
[EMAIL PROTECTED] wrote:
>Damjan> Is there some python module that provides a multi process Queue?
>
>Not as cleanly encapsulated as Queue, but writing a class that does that
>shouldn't be all that difficult using a socket and the pickle module.
>
>Skip
>
>
>
What about bsddb? The example
DataSmash wrote:
>Hello,
>I think I've tried everything now and can't figure out how to do it.
>I want to read in a text list from the current directory,
>and for each line in the list, make a system directory for that name.
>
>My text file would look something like this:
>1144
>1145
>1146
>1147
>
Gopal wrote:
>Thanks for the reference. However, I'm not understanding how to use it.
>Could you please provide with an example? Like I open the file, read
>line and give it to parser?
>
>Please help me.
>
>
>
I had thought of recommending what Peter Hansen recommended - just
importing the text
Gopal wrote:
>Hello,
>
>I'm Gopal. I'm looking for a solution to the following problem:
>
>I need to create a text file config.txt having some parameters. I'm
>thinking of going with this format by having "Param Name - value". Note
>that the value is a string/number; something like this:
>
>PROJEC
yoda wrote:
>This feels like a stupid question but I'll ask it anyway.
>
>
Definitely not a stupid question.
>How can I process files chronologically (newest last) when using
>os.walk()?
>
>
>
Try this:
In [16]: file_list = [(os.stat(f)[8], f) for f in [os.path.join(i[0],
j) for i in os.w
Ed Hotchkiss wrote:
> I'm new to Python, not programming. I agree with the point regarding
> the interpreter. what is that? who uses that!? Why are most examples
> like that, rather than executed as .py files?
I think showing examples at the Python interpreter prompt is *very*
helpful and IMHO
Will McGugan wrote:
>Tim Peters wrote:
>
>
>>[john basha]
>>
>>
>>
>>>send me the britney nude photos
>>>
>>>
>>Because they're a new feature, you'll have to wait for Python 2.5 to
>>be released.
>>
>>
>
>She has just spawned a child process. Give her to Python 2.6 to get back
>in
Roel Schroeven wrote:
>Jeremy Jones wrote:
>
>
>
>>Andy Leszczynski wrote:
>>
>>
>>>Is there any way to pass the prefix to the "make install"? Why "make"
>>>depends on that?
>>>
>>>A.
>>>
>&g
[EMAIL PROTECTED] wrote:
>I am not sure to understand the big difference between "time spent in
>different areas of code" and "how long did this thing take to run?".
>Looking at python doc for deterministic profiling, I understand the
>implementation difference, and the performance implications,
Andy Leszczynski wrote:
>Jeremy Jones wrote:
>
>
>>Andy Leszczynski wrote:
>>
>>Download the source, untar, cd to the new directory, run:
>>
>>./configure --prefix=/opt/mypython
>>make
>>make install
>>
>>
>
>Is there any
Andy Leszczynski wrote:
>Hi,
>I run Mandrake 10.0 with python 2.3 installed by default. I want to keep
>it as it is but need another, very customized Python installation based
>of 2.3 as well. I would prefer to have it the way it is on Windows, one
>folder e.g. /opt/mypython with all the stuff
Thomas Bellman wrote:
>"Xah Lee" <[EMAIL PROTECTED]> writes:
>
>
>
>>suppose i'm calling two system processes, one to unzip, and one to
>>tail to get the last line. How can i determine when the first
>>process is done?
>>
>>
>
>
>
>>Example:
>>
>>
>
>
>
>>subprocess.Popen([r"/sw/bin/
Thierry Lam wrote:
>Let's say I have the following xml tag:
>
>1
>
>I can't figure out what kind of python xml.dom codes I should invoke to
>read the data 1? Any help please?
>
>Thanks
>Thierry
>
>
>
In [20]: import xml.dom.minidom
In [21]: s = '''1'''
In [22]: x = xml.dom.minidom.parseString(
[EMAIL PROTECTED] wrote:
>Hi there,
>
> I have some scientific application written in python. There is a
>good deal of list processing, but also some "simple" computation such
>as basic linear algebra involved. I would like to speed things up
>implementing some of the functions in C. So I need p
Michael Sparks wrote:
>Jeremy Jones wrote:
>
>
>
>
>>And maybe
>>Steve's magical thinking programming language will have a ton of merit.
>>
>>
>
>I see no reason to use such derisory tones, though I'm sure you didn't mea
Steve Jorgensen wrote:
>On Mon, 05 Sep 2005 21:43:07 +0100, Michael Sparks <[EMAIL PROTECTED]> wrote:
>
>
>
>>Steve Jorgensen wrote:
>>
>>
>>
>>>On 05 Sep 2005 10:29:48 GMT, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
>
Michael Sparks wrote:
>Steve Jorgensen wrote:
>
>
>
>>On 05 Sep 2005 10:29:48 GMT, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>>Jeremy Jones <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>> On
Xah Lee wrote:
>Python Doc Problem Example: os.system
>
>Xah Lee, 2005-09
>
>today i'm trying to use Python to call shell commands. e.g. in Perl
>something like
>
>output=qx(ls)
>
>in Python i quickly located the the function due to its
>well-named-ness:
>
>import os
>os.system("ls")
>
>
>however,
Paul Rubin wrote:
>Jeremy Jones <[EMAIL PROTECTED]> writes:
>
>
>>to pass data around between processes. Or an idea I've been tinkering
>>with lately is to use a BSD DB between processes as a queue just like
>>Queue.Queue in the standard library does bet
John Brawley wrote:
>Greetings, all.
>I have a program I'm trying to speed up by putting it on a new machine.
>The new machine is a Compaq W6000 2.0 GHz workstation with dual XEON
>processors.
>I've gained about 7x speed over my old machine, which was a 300 MHz AMD
>K6II, but I think there ought t
Christopher DeMarco wrote:
>Hi all...
>
>...I've got a Python script running on a bunch of boxen sharing some
>common NFS-exported space. I need (not want :) to lock files for
>writing, and I need (not want :) to do it safely (i.e. atomically).
>I'm doing this in Linux; NFS4 is available. As I u
Diez B. Roggisch wrote:
>Kevin McGann wrote:
>
>
>>-Expert Java or C++
>>
>>
>
>Now why exactly do you post that in c.l.python?
>
>
>
>>THEY ARE LOCATED IN NEW YORK, THIS IS FULL-TIME ONLY, WILL NOT CONSIDER
>>ANYONE FROM OUTSIDE THE US! THIS TEAM IS AN ELITE TEAM, YOU BETTER BE
>>GOOD
necessity of X keyword or Y function or Z
module. Convenience - probably. Necessity - no.
>in the
>news-group as long as they are the principle keywords distinguished from
>the conventional languages like c/c++, pascal, etc.
>
>-James
>
>
So, if you have a question that's in line with Robert's advice, please
post it and it will have a much higher chance of getting answered. I
sincerely hope this helps.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
": http://gnosis.cx/TPiP/ Don't know
what all you're needing to do, but that small snip smells like it needs
a state machine which this book has an excellent, simple one in (I
think) chapter 4.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
uwb wrote:
>Jeremy Jones wrote:
>
>
>
>>uwb wrote:
>>
>>
>>
>>>I've got a call to glob in a .py file sitting in an apache cgi-bin
>>>directory which refuses to work while the exact same code works from a
>>>python conso
at all? Spitting out an error? If so, what error? (And is it an error
to the browser calling the cgi script, or in your apache logs?)
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
ot;
And used it like this:
In [1]: import test_file
In [2]: f = test_file.MyFile("foobar.file", "w")
In [3]: f.write("foo\n")
In [4]: f.doing_something()
in my own method
But do you really need to subclass file, or can you just use a file
instance in your class?
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
921336622176518
In [17]: random.random()
Out[17]: 0.65521407248459007
In [18]: random.random()
Out[18]: 0.74525381787627598
In [20]: r = range(10)
In [21]: random.shuffle(r)
In [22]: r
Out[22]: [6, 4, 9, 7, 2, 0, 8, 3, 5, 1]
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee wrote:
>Very very nice! I don't know scheme well... but oh the macros, such a
>wonderful facility...
>
>
Macros suck. They created by moron so-called computer scientists and IT
puntits in order opress the programming masses. But I say we must bring
freedom to all programmers. In ord
lysis of the same situation in Java, see
>http://xahlee.org/java-a-day/assign_array_to_list.html
>
>How to write a tutorial
>http://xahlee.org/Periodic_dosage_dir/t2/xlali_skami_cukta.html
>
> Xah
> [EMAIL PROTECTED]
>∑ http://xahlee.org/
>
>
>
It's really bad enough that you waste the time of the folks on
comp.lang.python. Why cross post like you are? I really fail to see
the point.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
for
nothing else than to rest from simulating in my head 1, 2, 3, 5, 10
threads in the ``get_data()`` method while various threads are in the
``on_received()`` method. Aaaagghhh.needmotrin..
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
nd pull stuff off from the other side (again, you can have
as many consumers as you'd like as well) in a thread safe manner.
HTH,
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
I've got a couple of new articles on ONLamp:
Writing Google Desktop Search Plugins
http://www.onlamp.com/pub/a/python/2005/06/01/kongulo.html
and
Python Standard Logging
http://www.onlamp.com/pub/a/python/2005/06/02/logging.html
Comments, criticisms, flames all welcome.
Jeremy
Fredrik Lundh wrote:
Jeremy Jones wrote:
#
file_dict = {}
a_list = [("a", "a%s" % i) for i in range(2500)]
b_list = [("b", "b%s" % i) for i in range(2500)]
c_list = [("c", "c%s" % i) for
nd no "\x00" characters (file size
difference on Windows and Linux is due to line ending). I'm still doing
a setdefault on the dictionary to create an object if the key doesn't
exist, but I'm using a cStringIO object rather than a file object. So,
I'm treating this ju
or jmjones at weather dot com.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
codecraig wrote:
Jeremy Jones wrote:
codecraig wrote:
Hi,
I thought I posted this, but its been about 10min and hasnt shown
up
on the group.
Basically I created a SimpleXMLRPCServer and when one of its
methods
ould be able to change logRequests to 0 and that should fix it. I just
tested it at a prompt and it worked just fine.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
on:
In [1]:phone = {'mike':10,'sue':8,'john':3, 'billy':3}
In [2]:phone.items()
Out[2]:[('billy', 3), ('mike', 10), ('john', 3), ('sue', 8)]
In [3]:[i[0] for i in phone.items() if i[1] == 3]
Out[3]:['billy
gger - INFO - this is info
2005-03-09 12:28:33,401 - mylogger - CLIENT - this is client
2005-03-09 12:28:33,458 - mylogger - WARNING - this is warning
2005-03-09 12:28:33,460 - mylogger - ERROR - this is error
2005-03-09 12:28:33,518 - mylogger - CRITICAL - this is critical
HTH,
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
ator (I think it's also called modulus).
107 % 4 == 3
because
107 / 4 == 26 R3
and 7 % 3 == 1
because 7 / 3 == 2 R1
HTH,
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
cussed, the Python
developper were more into multi-process systems when it comes to
multi-processors.
I think I even heard some discussion about efficient inter-process
messaging system, but I can't remember where :o)
Hope it'll help.
Pierre
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
ython/2.0/index.html#SECTION000600000
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
n. IPython has
become an indispensible tool in my toolbox. I cannot say enough great
things about it.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
Brian van den Broek wrote:
Terry Reedy said unto the world upon 2005-01-26 14:08:
Xah the arrogant wrote, among other things,
However, there are several errors in the above that would mislead a
Python learner. I advise any such to ignore Xah's writings.
Terry J. Reedy
Hi all,
here's a thought
Claudio Grondi wrote:
"You don't have to rely on expensive and proprietary EDI conversion software
to parse, validate, and translate EDI X12 data to and from XML; you can
build your own translator with any modern programming language, such as
Python."
by Jeremy Jones
http
r the nlst command:
http://www.python.org/doc/current/lib/ftp-objects.html
HTH,
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
MATCH-ALL cmap1',
'MaTch Ip AnY',
'CLASS-map Match-Any cmap2',
'MaTch AnY',
'Policy-map policy1',
'Class cmap1',
'policy-Map policy2',
'Service-PoLicy policy1',
'claSS cmap2']
In [15]: commands_lower = [string.lo
than a Vorpal Bunny. Those things
are vicious.
Something that reflects power and excellence.
I see some similarities between Vorpal Bunnies and Python (the language):
- Pleasing to the eye
- Deceptively powerful
- Gets the job done - and then some
What do you think?
Vorpal Bunny. Because ever
commits will not
be able to commit the change until the resolve the conflict.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
>>> foo = os.fdopen('foo.txt', 'w')
Traceback (most recent call last):
File "", line 1, in ?
TypeError: an integer is required
Thanks in advance!
Scott
If you just want to create a file for writing to, you probably want:
foo = open('foo.txt', 'w')
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
McCarty, Greg wrote:
Ok, I'm new to python,
and I'm trying to come to grips with
a few things. Got
lots of years of
experience with Java and asp/aspx,
etc. Trying to relate
Python's behavior to what
I already know.
Here's the python code
(line #'s added for my questio
many are interested, but cannot make it this round). I can
provide directions to anyone needing them.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
Alban Hertroys wrote:
Jeremy Jones wrote:
(not waiting, because it already did happen). What is it exactly
that you are trying to accomplish? I'm sure there is a better approach.
I think I saw at least a bit of the light, reading up on readers and
writers (A colleague showed up with a
ion
already happened), waiting to be notified from the main thread, and the
main thread is waiting on thread B (again, in this case) to call
mainCond.notify(). This approach is a deadlock just wanting to happen
(not waiting, because it already did happen). What is it exactly that
you are trying to accomplish? I'm sure there is a better approach.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
nting to do
that, but it's worth looking into and considering.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
7;, f))]
['gconfd-root', '.X11-unix', '.ICE-unix', '.mozilla', '.font-unix']
Just as a side note, and just preference, but I typically (almost
always) prefer using os.path.join() rather than using the "+" operator
to put a path together.
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list
80 matches
Mail list logo