Re: Lists & "pointers"

2005-07-23 Thread [EMAIL PROTECTED]
Jan Danielsson wrote: > Hello all, > >I have written a simple whiteboard application. In my application, I > want to be able to set draw attributes. This part works. I have a > dictionary object which contains stuff like: > self.attr['Pen.Color'] = ... > self.attr['Pen.Thickness'] = ... > >

GPRS Connection name on Python s60

2005-07-25 Thread [EMAIL PROTECTED]
Hi, I have a question for the experts of Python for series60! When I use the ".connect" method of the socket, a list with all connection available pop-up, and, after selecting one, the soft go on. My question is that: Can i use the ".connect" method passing connection name, resulting in a connect

Re: Counting processors

2005-07-25 Thread [EMAIL PROTECTED]
I don't think there is direct method. On Linux you can inspect file /proc/cpuinfo to determine the installed cpus. -- http://mail.python.org/mailman/listinfo/python-list

Re: GPRS Connection name on Python s60

2005-07-25 Thread [EMAIL PROTECTED]
Yeah i have already asked it, but, i think i can set before the .connect method, a connection as default, and, when connected, resore default connection! Peter Hansen ha scritto: > [EMAIL PROTECTED] wrote: > > Hi, I have a question for the experts of Python for series60! > > >

Re: how to imput usernames and passwords??

2005-07-25 Thread [EMAIL PROTECTED]
Try cx_Oracle http://www.computronix.com/utilities.shtml#Oracle, it is an excellent library based on the DB API of Python -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write a line in a text file

2005-07-25 Thread [EMAIL PROTECTED]
A recipe is * open your file for reading: f = open('filename.txt', 'r') * read all lines in a list: content = f.readlines() * close the file: f.close() * set the third element in the list to something else: content[2] = 'Blahdiblah' * re-open the file for writing: f = open('filename.txt', 'w') * wr

SciPy and NetCDF

2005-07-26 Thread [EMAIL PROTECTED]
I am going to be doing a lot of work with large data sets stored in various netCDF files, and after checking out the alternatives, I would really like to go with SciPy. The problem is that SciPy offers no native netCDF support. I have checked out pycdf at http://pysclint.sourceforge.net/pycdf/, but

Re: SciPy and NetCDF

2005-07-26 Thread [EMAIL PROTECTED]
Also, I am aware that ScientificPython offers netCDF support, but its lack of robust documentation is a big downer. Plus we haven't been able to successfully install it yet. Scott -- http://mail.python.org/mailman/listinfo/python-list

pylab wxpython

2005-07-27 Thread [EMAIL PROTECTED]
Hello, I make a windows button which show pylab plot. When I click the button the plot is showed, then I close the plot. But the second click will always produce the plot (which can't be closed). Can someone help? pujo -- http://mail.python.org/mailman/listinfo/python-list

Stripping C-style comments using a Python regexp

2005-07-27 Thread [EMAIL PROTECTED]
Hi Folks, I'm trying to strip C/C++ style comments (/* ... */ or // ) from source code using Python regexps. If I don't have to worry about comments embedded in strings, it seems pretty straightforward (this is what I'm using now): cpp_pat = re.compile(r""" /\* .*? \*/ |# C comm

Re: Stripping C-style comments using a Python regexp

2005-07-27 Thread [EMAIL PROTECTED]
Neat! I didn't realize that re.sub could take a function as an argument. Thanks. Lorin -- http://mail.python.org/mailman/listinfo/python-list

anything to do

2005-07-27 Thread [EMAIL PROTECTED]
i hav just finished learning pythob from "A byte of python"(an online book) so i wanted to apply my new skills. to learn and to have some fun. is there any place which lists jobs to be done...you know minor jobs and requests thats nobody has found time to do. i would point out that i am not looking

how to get function signature

2005-07-27 Thread [EMAIL PROTECTED]
Hi, I was working on a dir like function that gives more information than the usual dir, but I am not satisfied with the way I get function arguments for callable members of an object. Take a look at it here: http://nerdierthanthou.nfshost.com/2005/07/mdir-for-python.html. I have seen PythonWin sh

why functions in modules need 'global foo' for integer foo but not dictionary foo?

2005-07-28 Thread [EMAIL PROTECTED]
At top of a module I have an integer like so... foo = 4 In a function in that module I know I need to do 'global foo' to get at the value 4. ... IIRC, for dictionaries you DO NOT have this issue? Why this scope problem with integers but not dictionaries? Chris -- http://mail.python.org/mailm

Re: Friend wants to learn python

2005-07-30 Thread [EMAIL PROTECTED]
I would recommend starting with www.freenetpages.co.uk/hp/alan.gauld . He has a particularly good way of communicating the basics of Python. Also available in a book if he needs that. PDF available from the website. www.bookpool.com has a large selection of books on Python. The "Python: How to Pro

How override ALL function calls? (Is there a "function call function"?)

2005-07-31 Thread [EMAIL PROTECTED]
I'm trying run a homegrown profiler on some Python code. Rather than apply profiler wrapper to ALL functions by hand Is there a low level Python function I can override to modify how ALL functions are called? Chris -- http://mail.python.org/mailman/listinfo/python-list

need for speed

2005-08-01 Thread [EMAIL PROTECTED]
hi everyone can someone suggest me where find a lot programming tricks for achieving the top speed in python? thanks everyone for patience -- http://mail.python.org/mailman/listinfo/python-list

MySQL help

2005-08-01 Thread [EMAIL PROTECTED]
So i'm writing this program to check if a row exists in a table. If it doesn't it inserts it if it does it will update that row with the current info. Well it sorta works but not fully. It goes through and executes the correct querries but when it comes to determining if the row exists it doesn'

Re: MySQL help

2005-08-01 Thread [EMAIL PROTECTED]
I wasn't aware of the replace command I'll take a look at that tomorrow and see if it helps. Thanks >quick tip: are you aware of the mysql's REPLACE command? > -- http://mail.python.org/mailman/listinfo/python-list

time.clock() or time.time()

2005-08-02 Thread [EMAIL PROTECTED]
What's the difference between time.clock() and time.time() (and please don't say clock() is the CPU clock and time() is the actual time because that doesn't help me at all :) I'm trying to benchmark some function calls for Zope project and when I use t0=time.clock(); foo(); print time.clock()-t0 I

a pickle's pickle

2005-08-02 Thread [EMAIL PROTECTED]
I'm trying to pickle a class, and while I get no errors or anything, almost none of the class instance gets pickled, and I don't know why...Here's the pickled output: (i__main__ TrainingMatrix p0 (dp1 S'matrixWords' p2 I4714 sS'numWords' p3 I4714 sS'totalWordsProcessed' p4 I46735 sS'numContexts' p

Re: a pickle's pickle

2005-08-02 Thread [EMAIL PROTECTED]
I intended to pickle the class instance I call trainer...from my code, also in the first post: trainerString = trainDB.read() trainer = loads(trainerString) except EOFError: trainer = TrainingMatrix() ... trainerString = dumps(trainer) ... So basically trainer always gets an

Re: a pickle's pickle

2005-08-02 Thread [EMAIL PROTECTED]
Benji, Thanks so much, you have saved the day ^_^ -- http://mail.python.org/mailman/listinfo/python-list

Re: pre subprocess help needed

2005-08-02 Thread [EMAIL PROTECTED]
You can also use the spawn functions in os, together with the P_WAIT mode. os.spawnlp(os.P_WAIT, 'ls', 'ls') gconfd-martin kde-martin mcop-martin ssh-PhJzdB6333 gpg-bSRhOE ksocket-martin orbit-martin 0 os.spawnlp(os.P_WAIT, 'spam', 'spam') 127 -- http://mail.python.org/mailman/listi

Re: MySQL help

2005-08-03 Thread [EMAIL PROTECTED]
Hey Dennis thanks for the tips I haven't had a chance to take another stab at that code yet but I think I may try some of your suggestions. The SQL statements are valid but something doesn't appear to work right I may try and switch them to what you're suggesting and see if that helps with my probl

Re: Windows command line problem

2005-08-03 Thread [EMAIL PROTECTED]
considering that all the command lines are in sys.argv, it's very simple. -- http://mail.python.org/mailman/listinfo/python-list

Re: Py: a very dangerous language

2005-08-03 Thread [EMAIL PROTECTED]
Luis M. Gonzalez wrote: > Well, I have no problems going to bed. > The problem is that while sleeping, I keep on coding in my head... > Sometimes I reach the "A ha!" state, then I wake up, turn on the my pc > and type the solution. > I'm a little bit worried though... I don't even have erotic drea

substring and regular expression

2005-08-04 Thread [EMAIL PROTECTED]
i have read finding sublist http://groups.google.it/group/comp.lang.python/browse_thread/thread/50b09a0aca285256/5156ada81fc9358a?hl=it#5156ada81fc9358a the problem was in a string to find if we have two substring non overlapping of lenght al least 4 it was done by r=re.compile(r'(?P.{4,}).*(?P=

Re: substring and regular expression

2005-08-04 Thread [EMAIL PROTECTED]
but in general is there a way to include in a re, in this example something like...matches iff p , and q in which p==q[::-1] ? A way to putting a small part of code of python in re? Thanx for your many helps -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows command line problem

2005-08-04 Thread [EMAIL PROTECTED]
Here's an example... BEGIN TEST.PY import sys print "Original:", sys.argv for arg in sys.argv: arg = arg.strip('-\x93\x96') # add chars here you want to strip print "Stripped:", arg END TEST.PY -- http://mail.python.org/mailman/listinfo/python-list

Re: listing users in Plone

2005-08-04 Thread [EMAIL PROTECTED]
Can't help you with #1 as I don't use Plone anymore. I prefer using plain Zope and building my site around that. There's not much that Plone adds for me, besides a skin. As for 2, I do have some experience doing that. First, create a ZSQL statement that does something like this: select * from da

Re: Getting HTML from a loaded page in Firefox

2005-08-04 Thread [EMAIL PROTECTED]
Please explain in more detail exactly what your problem was using the method you described. We can help you, but most would be hard pressed to write your code for you. -- http://mail.python.org/mailman/listinfo/python-list

Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-05 Thread [EMAIL PROTECTED]
I've heard 2 people complain that word 'global' is confusing. Perhaps 'modulescope' or 'module' would be better? Am I the first peope to have thought of this and suggested it? Is this a candidate for Python 3000 yet? Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-05 Thread [EMAIL PROTECTED]
I'm not saying 'modulescope' and 'module' are the only alternatives or even the best anyone can come up with. 'global' has the connotation of being visible *EVERYWHERE* where in Python it is just visible in one module's space. Can you think of a better alternative or do you believe 'global' is th

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-05 Thread [EMAIL PROTECTED]
Python 3000 is not worried about backward compatibility. It is worried more about what is *best* and getting it done. Trust me. Let me ask an academic questionIs 'global' the *best* choice of all choices in Webster's dictionary? If it is then I'll give up and go home. If not then well.

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-05 Thread [EMAIL PROTECTED]
Your solution is the best of them all. However, I don't have the foggiest idea how it would be accomplished. Are you *sure* you can change design so that there is no need for a keyword like 'global'? Please enlighten me. I'd really appreciate it. Chris -- http://mail.python.org/mailman/listi

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or'module' better?)

2005-08-05 Thread [EMAIL PROTECTED]
I appreciate your comments. You give reasons why you think 'global' is a good idea. Are you sure that 'global' is widely assumed to mean global to a *file* in proper CS theory? Coming from CI assumed 'global' meant global to ENTIRE EXECUTABLE!?!? You even admitted you also thought 'global'

Re: substring and regular expression

2005-08-06 Thread [EMAIL PROTECTED]
can you be so kind to show me a small example in spark if u like for remove all string with a substring of length 4 and the reverse of it? i thank you a lot -- http://mail.python.org/mailman/listinfo/python-list

Re: Get directory from http web site

2005-08-06 Thread [EMAIL PROTECTED]
You might want to also modify your c:/python/Lib/urllib.py file. By adding/modifying the following headers. self.addheaders = [('User-agent', 'Mozilla/4.0')] #Trick the server into thinking it is explorer self.addheaders = [('Referer','http://www.infomedia.it')] #Trick the site that you clicked

Re: Euclid's Algorithm in Python?

2005-08-07 Thread [EMAIL PROTECTED]
Erik the Red wrote: > So, I did the following: > --- > a=input("Give me an integer") > b=input("Give me another integer") > > def gcd(a,b): > > if a < b: > a, b = b, a > while b != 0: > a, b = b, a % b > return a > --- > But, in the xterm, it terminates after "Give me

Splitting a string into groups of three characters

2005-08-07 Thread [EMAIL PROTECTED]
Hi, Is there a function that split a string into groups, containing an "x" amount of characters? Ex. TheFunction("Hello World",3) Returns: ['Hell','o W','orl','d'] Any reply would be truly appreciated. Thank You, -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string into groups of three characters

2005-08-07 Thread [EMAIL PROTECTED]
Thank You, For your help, I guess I will just make a couple of these functions and find out which one is that fastest. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a better/simpler logging module?

2005-08-08 Thread [EMAIL PROTECTED]
If you need some simple logging why not create a logger like one of the basic examples, see http://docs.python.org/lib/minimal-example.html, these examples are not that complex. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python -- (just) a successful experiment?

2005-08-08 Thread [EMAIL PROTECTED]
That's it: got to get the PEEPs involved. Acronym of the year (AOTY). -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string into groups of three characters

2005-08-08 Thread [EMAIL PROTECTED]
Yes i know i made a mistake, >['Hell','o W','orl','d'] but you know what I mean lol, I'll probly use John Machin's def nsplit(s, n): return [s[k:k+n] for k in xrange(0, len(s), n)] It seems fast, and does not require any imports. But anyways, thank you for all your help, you rpck! :) --

Re: Splitting a string into groups of three characters

2005-08-08 Thread [EMAIL PROTECTED]
Yes i know i made a mistake, >['Hell','o W','orl','d'] but you know what I mean lol, I'll probly use John Machin's def nsplit(s, n): return [s[k:k+n] for k in xrange(0, len(s), n)] It seems fast, and does not require any imports. But anyways, thank you for all your help, you rock! :) --

Windows embedding problems with stdin and stdout

2005-08-10 Thread [EMAIL PROTECTED]
Hi, I have Python embedded with my other code, and when my other code opens a console and redirects stdout, stdin and stderr to it, then calls PyRun_InteractiveLoop, it immediately returns with an EOF. After some debugging the reason for this appears to be that the stdin and stdout that the ReadL

Re: providing arguments to base.__init__

2005-08-10 Thread [EMAIL PROTECTED]
I only have an answer to the last one: you do not call the 'destructors' of the base classes, so they are not executed. -- http://mail.python.org/mailman/listinfo/python-list

Using PyThreadState_SetAsyncExc with PyEval_CallObject

2005-08-11 Thread [EMAIL PROTECTED]
I am attempting to raise an exception in a thread currently calling PyEval_CallObject from another thread using PyThreadState_SetAsyncExc. The PyEval_CallObject is currently calling of a function with looks like def fun() : import time count = 0 while 1: count = count + 1 time.sleep(

Re: breaking a loop

2005-08-11 Thread [EMAIL PROTECTED]
aight away - see below for the idea [EMAIL PROTECTED]:~ $ python Python 2.4.1 (#2, Mar 30 2005, 21:51:10) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. py> s = raw_input('

any multi-pattern mathching for python

2005-08-11 Thread [EMAIL PROTECTED]
as I know , agrep can handle this , at least the newer version from http://www.tgries.de/agrep/index.html with a -f property. here is a agrep port to python http://www.bio.cam.ac.uk/~mw263/pyagrep.html, but it is some out of date, and in it's discription "matching of multiple input patterns is def

Re: simpli int/str problem

2005-08-12 Thread [EMAIL PROTECTED]
Use substitution like below. Hope this helps py> d = {'str_name': 'etc' , 'int_name' : 112 } py> SQL = "INSERT INTO (`AH`, `BH` ) VALUES ('" + d['str_name'] + "', '" + d['int_name'] + "')" Traceback (most recent call last): File "", line 1, in -toplevel- SQL = "INSERT INTO (`AH`, `BH` ) VAL

Re: Python's Exception, and Capitalization

2005-08-12 Thread [EMAIL PROTECTED]
For youtr try, except, finally: you can construct something like this: try: try: print 'egg' + 1 except ValueError, e: print e finally: print 'spam' It results in: py> spam Traceback (most recent call last): File "C:/Martin/test.py", line 3, in -toplevel- print

pickle.load not working?

2005-08-12 Thread [EMAIL PROTECTED]
derek.cookie = "123456" derek.ip = "127.0.0.1" derek.loggedin = 0 derek.invalid_logins = 0 derek.allow_login = 1 derek.status = "here" derek.realname = "Derek W." derek.phone = "480-XXX-" derek.email = "[EMAIL PROTECTED]" f = file

Running one Python program from another as a different user

2005-08-12 Thread [EMAIL PROTECTED]
Greetings- This is on Linux... I have a daemon running as root and I want to execute another Python program as another user (a regular user). I have the name of the user and can use the 'pwd' and 'grp' modules to get that user's user and group ids. What I don't understand is how to then go about la

Re: Running one Python program from another as a different user

2005-08-12 Thread [EMAIL PROTECTED]
Thanks, that looks very promising... Is there a solution for pre-Python v2.4? I have to have code that works on 2.x, 0<=x<=4. Do I just use the os.popen instead? -Don -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug on Python2.3.4 [FreeBSD]?

2005-08-13 Thread [EMAIL PROTECTED]
Using FreeBSD 4.10 and Python 2.3.4: > uname -a FreeBSD garner_ted 4.10-RELEASE FreeBSD 4.10-RELEASE #7: Thu Apr 28 22:44:58 CDT 2005 >python Python 2.3.4 (#4, Nov 19 2004, 15:37:16) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type "help", "copyright", "credits" or "license" for more information

help with TixComboBox usage in python

2005-08-14 Thread [EMAIL PROTECTED]
Hi, I have to write a code in which based on a user selection in a combo box, pages in NoteBook should be automatically added or deleted. So, I have the following class. class myActionsDialog: def __init__ (self, top): self.ActionsWidget = dict() self.sd=None self.ActionsWidget['Label'] = Labe

Re: Euclid's Algorithm in Python?

2005-08-14 Thread [EMAIL PROTECTED]
Antoon Pardon wrote: > On 2005-08-08, Bengt Richter <[EMAIL PROTECTED]> wrote: > > On 7 Aug 2005 17:31:02 -0700, "Jordan Rastrick" <[EMAIL PROTECTED]> wrote: > > > >>Good point. I suppose I'd only ever seen it implemented with the if > >

seeking Python developers

2005-08-15 Thread [EMAIL PROTECTED]
ls. Arnie Fertig [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Using for in one-liner

2005-08-15 Thread [EMAIL PROTECTED]
to me it seems the ',' is superfluous, this works: python -c "import sys;print ''.join([l for l in sys.stdin.readlines()])" in 2.4.1 - with the comma it works as well but it looks weird, as if you want to un-pack a tuple. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Tkinter compatible with GNOME?

2005-08-15 Thread [EMAIL PROTECTED]
Have you tried starting it in a .xsession file with something like: exec gnome-session & button_prog.py -- http://mail.python.org/mailman/listinfo/python-list

creating/modifying sparse files on linux

2005-08-17 Thread [EMAIL PROTECTED]
Hi, Is there any special support for sparse file handling in python? My initial search didn't bring up much (not a thorough search). I wrote the following pice of code: options.size = 6442450944 options.ranges = ["4096,1024","3,314572800"] fd = open("testfile", "w") fd.seek(options.size-1) f

Re: creating/modifying sparse files on linux

2005-08-17 Thread [EMAIL PROTECTED]
Thanks for the info on xrange. Writing single char is just to get going quickly. I knew that I would have to improve on that. I would like to write chunks of 1MB which would require that I have 1MB string to write. Is there any simple way of generating this 1MB string (other than keep appending to

Re: question about binary and serial info

2005-08-17 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > yeah, i think i got that down, i need help with getting the hex to > binary, then splitting the byte up to compare each bit against the bit > in another byte. The & operator does all 8 comparisons simultaneously. So if the serial port byte is A, the refere

Re: creating/modifying sparse files on linux

2005-08-18 Thread [EMAIL PROTECTED]
My goal is very simple. Have a mechanism to create sparse files and modify them by writing arbitratry ranges of bytes at arbitrary offsets. I did get the information I want (xrange instead of range, and a simple way to generate 1Mb string in memory). Thanks for pointing out about using "len" as va

Re: pickle.load not working?

2005-08-18 Thread [EMAIL PROTECTED]
oh, well how do I make "derek" be an instance of 'chatuser' ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Confused newbie needs help with "__init__() takes exactly 11 arguments (1 given)"

2005-08-18 Thread [EMAIL PROTECTED]
That's great, but it seems like a lot of work just to read in everything. Take a look at the sample that I did with the interpreter... First, X is a simulated input line... --- x = " param1,param2,param3,param4,param5,param6,param7,param8,param9,comments blah , blah, test" --- Ok, so just like you

Re: List of string

2005-08-18 Thread [EMAIL PROTECTED]
to quote you : "['0134314244133', '132443', '234'] 2nd and 3rd strings are also substrings from the 1st one , so it should be removed " Actually, no, the 2nd string does not substring match the first, nor does the 3rd. If you are referring to matching individual characters, then yes, characters

Re: up to date books?

2005-08-18 Thread [EMAIL PROTECTED]
I would suggest Alex Martelli's "Python in a Nutshell" or the "Python Cookbook" as the best Python books from Oreilly. I also like M. Pilgrim's "Dive into Python". -- http://mail.python.org/mailman/listinfo/python-list

Re: python html

2005-08-19 Thread [EMAIL PROTECTED]
Steve Young wrote: > Hi, I am looking for something where I can go through > a html page and make change the url's for all the > links, images, href's, etc... easily. If anyone knows > of something, please let me know. Thanks. BeautifulSoup or PyMeld Lorenzo -- http://mail.python.org/mailman/l

Re: Confused newbie needs help with "__init__() takes exactly 11 arguments (1 given)"

2005-08-19 Thread [EMAIL PROTECTED]
it looks like your problem is in this line: reviews = [Review(*[field.strip() for field in row]) for row in reader] ouch! split that up a bit so we can understand what the heck you are trying to do here. Also, it appears the whole thing is in these [ ] ? why? -- http://mail.python.org/mailman/li

Re: while c = f.read(1)

2005-08-19 Thread [EMAIL PROTECTED]
Alright, everyone seems to have gone off on a tangent here, so I'll try to stick to your code... """ This is what I would ideally like: f = open("blah.txt", "r") while c = f.read(1): # ... work on c But I get a syntax error. while c = f.read(1): ^ SyntaxError: invalid

Re: Confused newbie needs help with "__init__() takes exactly 11 arguments (1 given)"

2005-08-19 Thread [EMAIL PROTECTED]
d'oh I'm an idiot... you are making a 'list' object. -- http://mail.python.org/mailman/listinfo/python-list

Is mymodule.myvariable a 'global'? (What is proper definition of 'global variable'?)

2005-08-21 Thread [EMAIL PROTECTED]
Python lets me access module level variables from *anywhere*. All I have to do is add module name in front. e.g. mymodule.myvariable Is this considered a 'global'? Or, does a 'global variable' have to be accessible anywhere *without* a namespace in front? (I'm not sure what proper academic de

Re: TKinter

2005-08-21 Thread [EMAIL PROTECTED]
It's pretty hard to know what the problem is with the vague description you've provided. Why not post your problem code or, if there's a lot of it, create a small sample that has the problematic behaviour. Better yet, post your message to [EMAIL PROTECTED] cheers S -- http://

Re: global interpreter lock

2005-08-21 Thread [EMAIL PROTECTED]
time; it's improved somewhat since then but still requires some custom C coding). I don't have much desire to throw out decades of work by OS implementors on protected memory without a pretty darn good reason. -- http://mail.python.org/mailman/listinfo/python-list

Re: As Simple As Possible?

2005-08-21 Thread [EMAIL PROTECTED]
Jorgen Grahn wrote: > More importantly, I think: it's not polite for a programming language to > make it hard to communicate with the rest of your environment. > > Java pissed me off when I looked at it back in the 1990s, because I was on > Unix, and the language would barely give me access to the

sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
Hi, I'm working on a project were a need to be able to upload firmware to a microcontroller based Ethernet device. But because of the memory constraints the controller can only handle packages of 300 bytes each time. So therefore the firmware file must be sent in chunks and i need a header in each

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
aaah, well i believe that in Windows XPSP2 has disabled raw socket support (yes i sadly have to use windows) so that's no option. But I'll try to put a time delay and check what happens. Or otherwise perhaps i could do a socket.close each time, but that's a terrible waste of packets. -- http://ma

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
I'm going to try the timed wait alternative, if i get it the application to work properly i'll post the results in this group and the code if anyone want's it. It's such a contrast to code a tcp-server for the microcontroller (MC9S12NE64) in C and coding in python :-) I really hope embedded python

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread [EMAIL PROTECTED]
yeah, i didn't mean running python on the HC12 but using compiled python on a ARM7 or simular would be nice. There was a project for embedded python but it seems to have died. Yeah i've been thinking about using UDP but then i would have to impliment checksums and having a reliable way to send and

yapsnmp port issues

2005-08-23 Thread [EMAIL PROTECTED]
Hello c.l.py, Does anyone else have experience with that? I'm somewhat stuck. The problem is basically the same as here: http://groups-beta.google.com/group/mailing.unix.net-snmp-users/browse_thread/thread/92fdea477a2f67ba/48924041d27b748b?tvc=2&q=yapsnmp+port#48924041d27b748b that is, I can't for

Re: High Level FTP library

2005-08-23 Thread [EMAIL PROTECTED]
Paulo Pinto wrote: > Hello, > > Is there any Python library similar to NET::FTP from Perl? > ftplib seems too lowlevel. > > I already found a few, but would like to get one that is > endorsed by the community. > > Thanks, > Paulo Have you looked at ftputil? http://www.sschwarzer.net/python/pytho

Re: where does __class__ come from?

2005-08-23 Thread [EMAIL PROTECTED]
see http://docs.python.org/lib/specialattrs.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading just a few lines from a text file

2005-08-23 Thread [EMAIL PROTECTED]
I just did strace on "tail -20 ". Apparently, it does seek to the end and reads enough data to cover 20 lines. I guess it is calculating this "size" by counting 20 new lines .You may try to do the same thing. Thanks, Raghu. -- http://mail.python.org/mailman/listinfo/python-list

Re: yapsnmp port issues

2005-08-24 Thread [EMAIL PROTECTED]
Solved the problem all by myself. Patch (and rationale) available on sourceforge. -- http://mail.python.org/mailman/listinfo/python-list

Default function arguments behaving badly

2005-08-24 Thread [EMAIL PROTECTED]
Hi I'm having some trouble with a function I've written in Python: def myFunction(l1,l2,result=[]): index=0 for i in l1: result.append([]) if type(i)==list: myFunction(i,l2,result[index]) else: for j in l2: result[index].appe

Re: Default function arguments behaving badly

2005-08-24 Thread [EMAIL PROTECTED]
That works perfectly - Thanks! I'm always getting tripped up by the mutability of lists, I should really learn to look out for it more... -- http://mail.python.org/mailman/listinfo/python-list

Re: variable hell

2005-08-25 Thread [EMAIL PROTECTED]
Hey, if the man wants to write it that way, let the man write it that way. If it works for him, great... he's sure confused the heck out of all of us, and that translates into job security for him! As you can see, the name of the post is 'variable hell' and that is exactly what he is creating, so "

Re: Experience regarding Python tutorials?

2005-08-25 Thread [EMAIL PROTECTED]
I'd say, start with Python and work yourself into more complex languages. Python teaches you to indent properly, and it is good with being simple, yet powerful at the same time. I'd be happy to teach you the basics with Python. I've taught a few people how to program, and they learn Python pretty q

minimalist regular expression

2005-08-25 Thread [EMAIL PROTECTED]
Exists some tool, programs or some able to compute the minimal regular expression, namely ,taking a series of regular exoression, the minimal one that makes the same matching? thanx in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: minimalist regular expression

2005-08-25 Thread [EMAIL PROTECTED]
very nice -- http://mail.python.org/mailman/listinfo/python-list

Re: a dummy python question

2005-08-25 Thread [EMAIL PROTECTED]
7;: outer(3) = end scope_test.py = [EMAIL PROTECTED] ~]$ ./scope_test.py 3 2 1 0 [EMAIL PROTECTED] ~]$ python Python 2.3.4 (#1, Feb 2 2005, 11:44:13) [GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2 Type "help", "copyright", "credits" or "

Re: New Arrival to Python

2005-08-25 Thread [EMAIL PROTECTED]
1. Whichever one works best for you, of course. :) There are lots of editors and IDEs out there. I find myself coming back to Emacs and jEdit the most, but there are a sizable number of vi partisans (benighted heathens tho they be) and an increasing number of Eclipse, Wing and Komodo partisans.

Re: pickle.load not working?

2005-08-25 Thread [EMAIL PROTECTED]
I get it, I missed the little parintheses or however you spell it. () . -- http://mail.python.org/mailman/listinfo/python-list

Re: minimalist regular expression

2005-08-26 Thread [EMAIL PROTECTED]
the shortest description in regex way -- http://mail.python.org/mailman/listinfo/python-list

Re: telnet.read_until() from telnetlib

2005-08-26 Thread [EMAIL PROTECTED]
Czesc Jacek: Please post the minimum code necessary to duplicate the problem. Dzieki, Derek Wilson -- http://mail.python.org/mailman/listinfo/python-list

Re: How to know if connection is active when using telnetlib?

2005-08-26 Thread [EMAIL PROTECTED]
Well, running this code: -- >>> import telnetlib >>> c = telnetlib.Telnet("blah") -- throws this exception: -- socket.gaierror: (11001, 'getaddrinfo failed') -- note that this is the same as your "telnetlib.Telnet.open". So, you will want to use TRY: and EXCEPT: to

Re: telnet.read_until() from telnetlib

2005-08-26 Thread [EMAIL PROTECTED]
after doing some research, I would suggest trying self.telnet.expect(). This will give you more data about the cause of the failures. -- http://mail.python.org/mailman/listinfo/python-list

<    3   4   5   6   7   8   9   10   11   12   >