Re: Multi-threaded FTP Question

2006-07-12 Thread Jeremy Jones
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 two FTP

Re: Editing File

2006-07-12 Thread Jeremy Jones
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

Re: Data access from multiple code modules

2006-07-12 Thread Jeremy Jones
[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 does

Re: Editing File

2006-07-12 Thread Jeremy Jones
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 snip [EMAIL PROTECTED] wrote: snip Might be overkill - but pickle the data memeber that contains the information. If you use text

Re: Data access from multiple code modules

2006-07-12 Thread Jeremy Jones
[EMAIL PROTECTED] wrote: snip 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.

Re: Multi-threaded FTP Question

2006-07-11 Thread Jeremy Jones
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: File

Re: Multi-threaded FTP Question

2006-07-11 Thread Jeremy Jones
[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, line 107,

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-02 Thread Jeremy Jones
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 reload()

Re: How could I ask Thread B to call B().Method() from inside Thread A's run?

2005-11-30 Thread Jeremy Jones
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 I do

Re: help with using temporary files

2005-11-22 Thread Jeremy Jones
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 Type

publicity for Python-related projects

2005-11-03 Thread Jeremy Jones
, 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

Re: Web presentation layer/framework for python - recommendations?

2005-10-27 Thread Jeremy Jones
[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. Frankly

Re: socket.error: (32, 'Broken pipe'): need help

2005-10-27 Thread Jeremy Jones
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,

OT: Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Jeremy Jones
Tim Golden wrote: snip 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

Re: Problem ... with threads in Python

2005-10-26 Thread Jeremy Jones
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 project

Re: write a loopin one line; process file paths

2005-10-19 Thread Jeremy Jones
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 is done with

Re: global interpreter lock

2005-10-18 Thread Jeremy Jones
[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

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-13 Thread Jeremy Jones
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 getting

Re: New Python book

2005-10-07 Thread Jeremy Jones
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 on

Re: How to create temp file in memory???

2005-10-05 Thread Jeremy Jones
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

Re: How to create temp file in memory???

2005-10-05 Thread Jeremy Jones
on memory??? Jeremy Jones wrote: 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 If the function takes a file object as an argument, you should be able

Re: New Python book

2005-10-05 Thread Jeremy Jones
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 a

Re: 1 Million users.. I can't Scale!!

2005-09-28 Thread Jeremy Jones
[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 code

Re: 1 Million users.. I can't Scale!!

2005-09-28 Thread Jeremy Jones
[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 What about

Re: File processing

2005-09-23 Thread Jeremy Jones
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: PROJECT_ID =

Re: File processing

2005-09-23 Thread Jeremy Jones
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 you

Re: batch mkdir using a file list

2005-09-23 Thread Jeremy Jones
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 I simply

Re: Perl's documentation come of age

2005-09-21 Thread Jeremy Jones
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 a

Re: Chronological Processing of Files

2005-09-21 Thread Jeremy Jones
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

Re: Britney Spears nude

2005-09-15 Thread Jeremy Jones
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 shape. Will McGugan

Re: python profiling, hotspot and strange execution time

2005-09-08 Thread Jeremy Jones
[EMAIL PROTECTED] wrote: snip 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, but

Re: Manging multiple Python installation

2005-09-08 Thread Jeremy Jones
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. What does it matter? If you *could* pass it to make, what does that buy you? I'm not a make guru, but I'm not sure you

Re: determine if os.system() is done

2005-09-07 Thread Jeremy Jones
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/gzip,-d,access_log.4.gz]);

Re: Manging multiple Python installation

2005-09-07 Thread Jeremy Jones
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

Re: Manging multiple Python installation

2005-09-07 Thread Jeremy Jones
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 way to pass the prefix to the make install? Why make depends on that? A. What does

Re: dual processor

2005-09-06 Thread Jeremy Jones
Michael Sparks wrote: Jeremy Jones wrote: snip 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 mean it that way. (I can see you mean it as extreme skepticism though

Re: python profiling, hotspot and strange execution time

2005-09-06 Thread Jeremy Jones
[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

Re: Python xml.dom, help reading attribute data

2005-09-06 Thread Jeremy Jones
Thierry Lam wrote: Let's say I have the following xml tag: para role=success1/para 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 = '''para role=success1/para''' In [22]:

Re: dual processor

2005-09-05 Thread Jeremy Jones
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: Jeremy Jones [EMAIL PROTECTED] wrote: One Python process will only

Re: dual processor

2005-09-04 Thread Jeremy Jones
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 to be

Re: dual processor

2005-09-04 Thread Jeremy Jones
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 between threads. Or you could use Pyro between

Re: Python Doc Problem Example: os.system

2005-09-04 Thread Jeremy Jones
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, according to the

Re: NYC Opening

2005-09-02 Thread Jeremy Jones
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 I'm pretty

Re: Python and file locking - NFS or MySQL?

2005-09-02 Thread Jeremy Jones
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

Re: Well, another try Re: while c = f.read(1)

2005-08-20 Thread Jeremy Jones
, 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

Re: file handling in a server (.py) file using xmlrpc

2005-07-08 Thread Jeremy Jones
to the browser calling the cgi script, or in your apache logs?) Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: file handling in a server (.py) file using xmlrpc

2005-07-08 Thread Jeremy Jones
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 console session. I'm guessing that in order to read or write files from any sort of a script file

Re: Legacy data parsing

2005-07-08 Thread Jeremy Jones
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

Re: inheriting file object

2005-07-06 Thread Jeremy Jones
(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

Re: I have a question.

2005-06-30 Thread Jeremy Jones
]: 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

Re: tree functions daily exercise: Table

2005-06-21 Thread Jeremy Jones
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 order

Re: references/addrresses in imperative languages

2005-06-19 Thread Jeremy Jones
/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

Re: collect data using threads

2005-06-14 Thread Jeremy Jones
be dangling. Why not use the Queue from the Queue module? You can push stuff in from one side and (have as many threads pushing stuff onto it as you like) and 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

couple of new python articles on onlamp

2005-06-03 Thread Jeremy Jones
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 Jones

file corruption on windows - possible bug

2005-05-09 Thread Jeremy Jones
any idea as to why this is writing over 14,000 \x00 characters to my file to start off with where printable characters should go and then writing the remainder of the file correctly? Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: file corruption on windows - possible bug

2005-05-09 Thread Jeremy Jones
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

Re: SimpleXMLRPCServer - disable output

2005-04-14 Thread Jeremy Jones
. Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleXMLRPCServer - disable output

2005-04-14 Thread Jeremy Jones
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

Re: newbie: dictionary - howto get key value

2005-03-10 Thread Jeremy Jones
]: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', 'john'] I added an additional person named billy with a number of 3 since values in a dictionary don't have to be unique. Jeremy Jones -- http

Re: logging addLevelName

2005-03-09 Thread Jeremy Jones
- 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

Re: [N00B] What's %?

2005-02-10 Thread Jeremy Jones
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

Re: multi threading in multi processor (computer)

2005-02-09 Thread Jeremy Jones
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

Re: Loop in list.

2005-02-08 Thread Jeremy Jones
#SECTION00060 Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

IPython Article on O'Reilly's ONLamp site

2005-01-27 Thread Jeremy Jones
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

when self-absorbed narcissists discover usenet [ was: how to write a tutorial ]

2005-01-26 Thread Jeremy Jones
Brian van den Broek wrote: Terry Reedy said unto the world upon 2005-01-26 14:08: Xah the arrogant wrote, among other things, SNIP 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

Re: DevX: Processing EDI Documents into XML with Python

2005-01-21 Thread Jeremy Jones
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://www.devx.com

Re: ftplib with unknown file names

2005-01-10 Thread Jeremy Jones
://www.python.org/doc/current/lib/ftp-objects.html HTH, Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: collaborative editing

2004-12-10 Thread Jeremy Jones
until the resolve the conflict. Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand a little python

2004-12-06 Thread Jeremy Jones
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 question)

Re: file descriptors fdopen

2004-12-06 Thread Jeremy Jones
') Traceback (most recent call last): File stdin, 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

Re: A little threading problem

2004-12-02 Thread Jeremy Jones
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 book

Re: Semaphore or what should I use?

2004-12-01 Thread Jeremy Jones
into and considering. Jeremy Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: A little threading problem

2004-12-01 Thread Jeremy Jones
his 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