Re: Why does my callback funtion collapse?

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 03:35:34 -0300, lialie <[EMAIL PROTECTED]> escribió: > I try to callback from a thread in C. But it collapsed. I can't figure > it out. - If you are using threads, you must handle the Global Interpreter Lock (GIL), see http://docs.python.org/api/threads.html - You don't han

Re: how to remove multiple occurrences of a string within a list?

2007-04-05 Thread Hendrik van Rooyen
> On Apr 3, 3:53 pm, "bahoo" <[EMAIL PROTECTED]> wrote: My first submission handles duplicates, but not triplicates and more. Here is one that seems a bit more bulletproof: duplist = [1, 2, 3, 4, 'haha', 1, 2, 3, 4, 5, 1,2,3,4,6,7,7,7,7,7] copylist = duplist[:] fullset = set(duplist) for x in

Re: Why NOT only one class per file?

2007-04-05 Thread Steven Howe
Dennis Lee Bieber wrote: > On 4 Apr 2007 14:23:19 -0700, "Chris Lasher" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> A friend of mine with a programming background in Java and Perl places >> each class in its own separate file in . I informed him that keeping >> all

Re: Why NOT only one class per file?

2007-04-05 Thread Hendrik van Rooyen
"Terry Reedy" <[EMAIL PROTECTED]> wrote: > Ask him why he does not wear a straightjacket all the time. > It is great for one's posture ;-) No it isn't - those funny arms give you round shoulders.. - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Resume of Steve Snow : Database SQL Applications Programmer

2007-04-05 Thread Bruno Desthuilliers
stevesnow a écrit : > -- > > Please forward this work experience & skills summary > to your Database & software development, MIS/IT/Software Department for > review. > > -- > > Here is my full resume in

Re: Requirements For A Visualization Software System For 2010

2007-04-05 Thread Nathan Harmston
You could look at sage.its all python! http://sage.scipy.org/sage/ I wish Xah Lee would stop trolling.oh well Cheers Nathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why NOT only one class per file?

2007-04-05 Thread Bruno Desthuilliers
Sherm Pendley a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > >> Chris Lasher a écrit : >> >>> so I thought I'd ask here to >>> see why the Python idiom is the way it is: why should we NOT be >>> placing classes in their own separate files? >> Because it just sucks. > > ... > >> Ju

Can we make a local variable in a function as global variable???

2007-04-05 Thread sairam
I have some local variables defined in one method and Can I make those variables as global variables? If so , can any one explain me how can I do that Thanks, Sairam -- http://mail.python.org/mailman/listinfo/python-list

Welch essential for learning Tkinter well?

2007-04-05 Thread Dick Moores
In a couple of places recently I've seen Brent Welch's _Practical Programming in Tcl & Tk_ () recommended for learning Tkinter well. So a couple of questions: 1) Is it really good for learning Tkinter, even though it doesn't mention Tkinter at all (in the 4th edition

Re: way to extract only the message from pop3

2007-04-05 Thread Tim Williams
On 3 Apr 2007 12:36:10 -0700, flit <[EMAIL PROTECTED]> wrote: > Hello All, > > Using poplib in python I can extract only the headers using the .top, > there is a way to extract only the message text without the headers? for i in range( M.stat()[0] ): # M.stat returns msg-count and mbox size ms

Re: Why NOT only one class per file?

2007-04-05 Thread Sherm Pendley
Steven Howe <[EMAIL PROTECTED]> writes: > On class per file was easier to do when Java was developed (remember > it was develop to control vending machines Not quite. Java grew out of a set-top box at Sun, code-named "Oak". >; scary. Reminds me of the movie 'Tron' Vending machines in "Tron" wer

Re: Can we make a local variable in a function as global variable???

2007-04-05 Thread 7stud
On Apr 5, 3:19 am, "sairam" <[EMAIL PROTECTED]> wrote: > I have some local variables defined in one method and Can I make those > variables as global variables? If so , can any one explain me how can > I do that > > Thanks, > Sairam --- num = None def f1(): global num num = 30 def

Re: Why NOT only one class per file?

2007-04-05 Thread Christophe
Chris Lasher a écrit : > A friend of mine with a programming background in Java and Perl places > each class in its own separate file in . I informed him that keeping > all related classes together in a single file is more in the Python > idiom than one file per class. He asked why, and frankly, hi

Re: Why NOT only one class per file?

2007-04-05 Thread Steve Holden
Christophe wrote: > Chris Lasher a écrit : >> A friend of mine with a programming background in Java and Perl places >> each class in its own separate file in . I informed him that keeping >> all related classes together in a single file is more in the Python >> idiom than one file per class. He as

Re: Python and Java

2007-04-05 Thread Steve Holden
Sreelatha G wrote: > Hi > >I am new to python .I need your help in solving my problem. >Is there any way to call python files in a java file .How is it possible? > Jython is an implementation of Python that compiles to Java bytecode, but at the moment there's some version lag so it won't

Re: shelve error

2007-04-05 Thread Steve Holden
7stud wrote: > On Apr 4, 10:22 pm, [EMAIL PROTECTED] wrote: >> how did you generate aaa.txt? > > Ok, I got it to work by supplying a filename that didn't previously > exist. Neither the book I am reading, "Beginning Python: From Novice > to Professional" nor the book I am using as a reference, "P

Re: low level networking in python

2007-04-05 Thread billiejoex
> I wish to do some low level network stuff using python. > I've googled somewhat and came up with pylibpcap[1], trouble is I > can't compile it on my Ubuntu 6.10 workstation. I would suggest pcapy: http://oss.coresecurity.com/projects/pcapy.html Higher level, easier Object-Oriented API and suppor

Re: Why NOT only one class per file?

2007-04-05 Thread Sherm Pendley
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > Sherm Pendley a écrit : > >> It's a stylistic thing, nothing more. > > A bit more than just 'stylistic' IMHO. It's a matter of > convenience. Having to manage hundreds of files each with a dozen > lines of code is a PITA. Yes, but the pain in tha

Re: String manipulation

2007-04-05 Thread marco . minerva
On 4 Apr, 21:47, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] writes: > > Thank you very much, your code works perfectly! > > One thing I forgot: you might want to make the whitespace handling a bit more > robust/general e.g. by using something along the lines of > > set_phra

Re: String manipulation

2007-04-05 Thread Alexander Schmolck
[EMAIL PROTECTED] writes: > On 4 Apr, 21:47, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] writes: > > > Thank you very much, your code works perfectly! > > > > One thing I forgot: you might want to make the whitespace handling a bit > > more > > robust/general e.g. by using

Equivalent of PyEval_ThreadsInitialized for 2.3?

2007-04-05 Thread therve
I ran into a problem with PyGILState_Release under Python < 2.4.2, that forced me to call PyEval_InitThreads() in my extension module. 2.4.2 had a fix for that problem :"It is now safe to call PyGILState_Release() before PyEval_InitThreads()" (from the NEWS file). I can live with this call, but I

Make a FREE Call Any Where Any Time

2007-04-05 Thread Neelam007
Make a FREE Call Any Where Any Time No Download, No Registration, Just Enter Mobile No. and Talk Click Below Link http://surl.in/PCOISCR283817GCJWJUK -- http://mail.python.org/mailman/listinfo/python-list

Storing of folder structure in SQL DB

2007-04-05 Thread Sergei Minayev
Hi All! Can you please help me with the following problem: I need to store a copy of local folders structure in MySQL database. I have chosen the following table structure for that: | id | id_uplink | folder_name | -

Re: Prevent Modification of Script?

2007-04-05 Thread Thomas Bellman
"ts-dev" <[EMAIL PROTECTED]> wrote: > Please correct any wrong assumptions that I might be making.. > In a compiled application its not impossible to by pass the code.. but > its not so easy. The huge amount of existing viruses targeting binaries seems to indicate that binary-only distribution d

Re: Welch essential for learning Tkinter well?

2007-04-05 Thread James Stroud
Dick Moores wrote: > In a couple of places recently I've seen Brent Welch's _Practical > Programming in Tcl & Tk_ () recommended for > learning Tkinter well. > > So a couple of questions: > > 1) Is it really good for learning Tkinter, even though it doesn't > mention

Re: Storing of folder structure in SQL DB

2007-04-05 Thread Amit Khemka
On 5 Apr 2007 04:58:22 -0700, Sergei Minayev <[EMAIL PROTECTED]> wrote: > Hi All! > Can you please help me with the following problem: > I need to store a copy of local folders structure in MySQL database. > I have chosen the following table structure for that: > ---

Not understanding absolute_import

2007-04-05 Thread Nate Finch
I've been trying to use from absolute_import and it's giving me a hell of a headache. I can't figure out what it's *supposed* to do, or maybe rather, it doesn't seem to be doing what I *think* it's supposed to be doing. For example (actual example from my code, assume all files have "from __futur

Re: Storing of folder structure in SQL DB

2007-04-05 Thread Amit Khemka
On 4/5/07, Amit Khemka <[EMAIL PROTECTED]> wrote: > On 5 Apr 2007 04:58:22 -0700, Sergei Minayev <[EMAIL PROTECTED]> wrote: > An Example: > > import os > root='/my/root/directory' > id =0 > tree={root:(-1, id)} > id+=1 > for path, dirs, files in os.walk(root): > for dir in dirs: >

Re: Why NOT only one class per file?

2007-04-05 Thread Nate Finch
So, here's a view from a guy who's not a python nut and has a long history of professional programming in other languages (C++, C, C#, Java) I think you're all going about this the wrong way. There's no reason to *always* have one class per file. However, there's also no reason to have 1600 line

Re: Calling Fortran from Python

2007-04-05 Thread Mangabasi
On Apr 4, 10:10 pm, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Mangabasi wrote: > >>> Would Python 2.5 work with Visual Studio 6.6? > >> No. > > >> -- > >> Robert Kern > > >> "I have come to believe that the whol

Re: operator overloading

2007-04-05 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Apr 4, 4:55 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: >> "Ziga Seilnacht" <[EMAIL PROTECTED]> wrote in message >> >> news:[EMAIL PROTECTED] >> | This looks like a bug in Python. It works for all the other >> | operators: > [SNIP] >> | >>> i ** 3 >> | 74088 >> | >> |

Re: how to remove multiple occurrences of a string within a list?

2007-04-05 Thread Ayaz Ahmed Khan
"Steven Bethard" typed: >> Or, just: >> >> In [1]: l = ["0024","haha","0024"] >> In [2]: filter(lambda x: x != "0024", l) >> Out[2]: ['haha'] > > Only if you want to make your code harder to read and slower:: Slower, I can see. But harder to read? > There really isn't much use for filter() an

Newbie - Boa Constructor, wxPython problem running Boa

2007-04-05 Thread Anbeyon
Hi all I am a Newbie to the world of Python, wxPython and Boa. Please forgive me if there is a really obvious answer to this one. I am trying to get Python, wxPython and Boa all to install on my Windows XP machine. I have both Python and wxPython running. However, when I launch Boa I get an e

Re: Storing of folder structure in SQL DB

2007-04-05 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Amit Khemka wrote: > On 4/5/07, Amit Khemka <[EMAIL PROTECTED]> wrote: >> On 5 Apr 2007 04:58:22 -0700, Sergei Minayev <[EMAIL PROTECTED]> wrote: > >> An Example: >> >> import os >> root='/my/root/directory' >> id =0 >> tree={root:(-1, id)} >> id+=1 >> for path, dirs, file

Re: Newbie - Boa Constructor, wxPython problem running Boa

2007-04-05 Thread kyosohma
On Apr 5, 8:32 am, "Anbeyon" <[EMAIL PROTECTED]> wrote: > Hi all > > I am a Newbie to the world of Python, wxPython and Boa. Please > forgive me if there is a really obvious answer to this one. > > I am trying to get Python, wxPython and Boa all to install on my > Windows XP machine. > > I have b

Re: Requirements For A Visualization Software System For 2010

2007-04-05 Thread Jon Harrop
Xah Lee wrote: > In this essay, i give a list of requirements that i think is necessary > for a software system for creating scientific visualization for the > next decade (2007-2017). You may be interested in the F# programming language from Microsoft Research. This is a high-performance function

Re: Calling Fortran from Python

2007-04-05 Thread Mangabasi
On Apr 4, 10:10 pm, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Mangabasi wrote: > >>> Would Python 2.5 work with Visual Studio 6.6? > >> No. > > >> -- > >> Robert Kern > > >> "I have come to believe that the whol

Re: AW: Write to a binary file

2007-04-05 Thread Grant Edwards
On 2007-04-05, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > A simplified test programm to compare the function for opening > a file i used ("file()") and your suggested "os.open()" showed > different behaviour. > > My simple testprogramm: > > --- START --- > import os > > msg = chr(0x02) + chr(

snippet manager idea

2007-04-05 Thread [EMAIL PROTECTED]
Hi. I am writing a opensource code snippet manager in python (pyqt4). The idea is that users can upload their snippets to remote subversion server, (if they choose) and add comments to existing snippets, vote for snippet deletion, add flags to snippets: (tested, working, not working... etc) The sni

snippet manager idea

2007-04-05 Thread [EMAIL PROTECTED]
Hi. I am writing a opensource code snippet manager in python (pyqt4). The idea is that users can upload their snippets to remote subversion server, (if they choose) and add comments to existing snippets, vote for snippet deletion, add flags to snippets: (tested, working, not working... etc) The sni

Re: Why NOT only one class per file?

2007-04-05 Thread Bruno Desthuilliers
Nate Finch a écrit : > So, here's a view from a guy who's not a python nut and has a long > history of professional programming in other languages (C++, C, C#, > Java) > > I think you're all going about this the wrong way. There's no reason > to *always* have one class per file. However, there's

Re: AW: Write to a binary file

2007-04-05 Thread Thinker
Grant Edwards wrote: > On 2007-04-05, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > > >> A simplified test programm to compare the function for opening >> a file i used ("file()") and your suggested "os.open()" showed >> different behaviour. >> >> My simple testprogramm: >> >> --- START --- >>

"Plugin" architecture - how to do?

2007-04-05 Thread anglozaxxon
I'm making a program that consists of a main engine + plugins. Both are in Python. My question is, how do I go about importing arbitrary code and have it be able to use the engine's functions, classes, etc? First, here's how it's laid out on the filesystem: -mainstarterscript.py - -__init__.py

[dateutil] bug(s) in dateutil.parser /dateutil.tz

2007-04-05 Thread jholg
Hi all, I'm having some problems with python-datetutil (which is a very, very nice tool, btw). Anybody knows where to adress these other than here? I tried reaching the author but don't seem to get through. Anyhow: 1. There's a bug in dateutil.parser you run into when you try to use a custom p

Re: Python and Java

2007-04-05 Thread Goldfish
On Apr 5, 7:18 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Sreelatha G wrote: > > Hi > > >I am new to python .I need your help in solving my problem. > >Is there any way to call python files in a java file .How is it possible? > Your other option is to utilize a system exec call, and try

AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread erikcw
Hi, I'm trying to build a SQL string sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", (cid, ag, self.data[parent][child]['results']['test']) It raises this error: AttributeError: 'tuple' object has no attribute 'encode' Some of the variables are unicode (test and ag) - is th

Review/commit patch?

2007-04-05 Thread Kevin Walzer
How long does it take for a patch at the Python SF tracker to be reviewed and/or committed? I am unfamiliar with how the process works. (I originally submitted a bug report, then figured out how to patch the item in question, and subsequently submitted a patch.) -- Kevin Walzer Code by Kevin h

Re: Can we make a local variable in a function as global variable???

2007-04-05 Thread Steven Howe
sairam wrote: I have some local variables defined in one method and Can I make those variables as global variables? If so , can any one explain me how can I do that Thanks, Sairam See: http://www.faqs.org/docs/diveintopython/dialect_locals.html When a line of code asks for the value of a

Re: Welch essential for learning Tkinter well?

2007-04-05 Thread Kevin Walzer
James Stroud wrote: >This begs the > question, is anyone truly an expert in Tkinter? Frederick Lundh is, if anyone is. http://www.pythonware.com/library/tkinter/introduction/index.htm (outdated) http://effbot.org/tkinterbook/ (new but incomplete) Coming to Python from a Tcl/Tk background, I fin

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread kyosohma
On Apr 5, 10:31 am, "erikcw" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to build a SQL string > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > (cid, ag, self.data[parent][child]['results']['test']) > > It raises this error: AttributeError: 'tuple' object has no attrib

Re: Review/commit patch?

2007-04-05 Thread Raymond Hettinger
[Kevin Walzer] > How long does it take for a patch at the Python SF tracker to be > reviewed and/or committed? I am unfamiliar with how the process works. > > (I originally submitted a bug report, then figured out how to patch the > item in question, and subsequently submitted a patch.) Which bug

embedded python project

2007-04-05 Thread msy
selamlar; Türkiyeden selamlar. Grubunuza yeni katıldım. Pythonu çok merak ediyorum.Yüksek lisans projemi python ile yapmak istiyorum. Gömülü sistemler üzerine bir konu tasarlamayı düşünüyorum. Basit olursa sevinirim. Önerilerinizi bekliyorum. Şimdiden teşekkürler. Hi from Turkey. I am new in

embedded python project

2007-04-05 Thread msy
selamlar; Türkiyeden selamlar. Grubunuza yeni katıldım. Pythonu çok merak ediyorum.Yüksek lisans projemi python ile yapmak istiyorum. Gömülü sistemler üzerine bir konu tasarlamayı düşünüyorum. Basit olursa sevinirim. Önerilerinizi bekliyorum. Şimdiden teşekkürler. Hi from Turkey. I am new in

Re: Review/commit patch?

2007-04-05 Thread Kevin Walzer
Raymond Hettinger wrote: > [Kevin Walzer] >> How long does it take for a patch at the Python SF tracker to be >> reviewed and/or committed? I am unfamiliar with how the process works. >> >> (I originally submitted a bug report, then figured out how to patch the >> item in question, and subsequently

Re: snippet manager idea

2007-04-05 Thread kyosohma
On Apr 5, 9:41 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi. > I am writing a opensource code snippet manager in python (pyqt4). > The idea is that users can upload their snippets to remote subversion > server, (if they choose) and add comments to existing snippets, vote > for snippet de

Re: way to extract only the message from pop3

2007-04-05 Thread hlubenow
flit wrote: > Hello All, > > Using poplib in python I can extract only the headers using the .top, > there is a way to extract only the message text without the headers? As mentioned before, you should use module "email": #!/usr/bin/env python import popli

Re: Windows service and pyc files

2007-04-05 Thread Laszlo Nagy
> > Have you tried the subprocess module for this rather than os.system? > You might be able to pipe errors to a file with it. You might be able > to use the traceback module for more verbose error catching too. > Okay, I'm tried this instead of os.system: def dumpexc(e): import sys,traceback,

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread erikcw
On Apr 5, 11:41 am, [EMAIL PROTECTED] wrote: > On Apr 5, 10:31 am, "erikcw" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm trying to build a SQL string > > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > > (cid, ag, self.data[parent][child]['results']['test']) > > > It rais

Re: Prevent Modification of Script?

2007-04-05 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > Just throw out the .py files and let it run on the .pyc's alone. Which are very easily decompilable. :-) -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary depends on not understanding it" - Upton Sinclair

Project organization and import redux

2007-04-05 Thread Hamilton, William
I apologize for bringing up something that's a month dead. But, I've been reading through the recent archives and came across this discussion, and want to make sure I understand a particular about the interactive prompt. "Martin Unsal" wrote: > I'm perfectly well aware that I'm not going to be a

Support SSL for Solaris 10

2007-04-05 Thread campos
Hi all, Last time I installed Python 2.5 by default, it didn't support SSL. When I tried to use HTTPS, the following error occured: AttributeError: 'module' object has no attribute 'ssl' In README file: --

Re: Review/commit patch?

2007-04-05 Thread Raymond Hettinger
> > [Kevin Walzer] > >> How long does it take for a patch at the Python SF tracker to be > >> reviewed and/or committed? I am unfamiliar with how the process works. > > >> (I originally submitted a bug report, then figured out how to patch the > >> item in question, and subsequently submitted a pat

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread Paul Boddie
erikcw wrote: > > I'm trying to build a SQL string > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > (cid, ag, self.data[parent][child]['results']['test']) This makes a tuple, though: the first element is the SQL string; the second element contains a tuple of parameters.

Re: Windows service and pyc files

2007-04-05 Thread Laszlo Nagy
> When I call spawn() from a service, this is written into the logfile: > > 2007-04-05 17:52:53,828 INFO .Spawner Spawing > ['C:\\Python25\\lib\\site-packages\\win32\\PythonService.exe', > 'T:\\Python\\Projects\\Test\\Application.py'] > 2007-04-05 17:52:53,828 ERROR .Spawner Traceback (most rece

Re: Why NOT only one class per file?

2007-04-05 Thread John Nagle
Nate Finch wrote: > I think you're all going about this the wrong way. There's no reason > to *always* have one class per file. However, there's also no reason > to have 1600 lines of code and 50 classes in one file either. It's really an operating system thing. We think of programs as livi

Re: Windows service and pyc files

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 13:00:52 -0300, Laszlo Nagy <[EMAIL PROTECTED]> escribió: > p = subprocess.Popen(params, bufsize=1, stdout=fout.fileno(), > stderr=fout.fileno()) > > When I call spawn() from a service, this is written into the logfile: > > 2007-04-05 17:52:53,828 INFO .Spawner Spawing > ['C:

Re: shelve error

2007-04-05 Thread 7stud
On Apr 5, 5:20 am, Steve Holden <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > On Apr 4, 10:22 pm, [EMAIL PROTECTED] wrote: > >> how did you generate aaa.txt? > > > Ok, I got it to work by supplying a filename that didn't previously > > exist. Neither the book I am reading, "Beginning Python: From

Re: Windows service and pyc files

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 13:50:16 -0300, Laszlo Nagy <[EMAIL PROTECTED]> escribió: > 1. subprocess.Popen cannot redirect stderr and stdout when called from a > win32 service. This is not documented, and makes debugging almost > impossible. Without the patch menctioned in my previous message, you mus

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread erikcw
On Apr 5, 12:37 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > erikcw wrote: > > > I'm trying to build a SQL string > > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > > (cid, ag, self.data[parent][child]['results']['test']) > > This makes a tuple, though: the first element

Re: Calling Fortran from Python

2007-04-05 Thread Lenard Lindstrom
Mangabasi wrote: > A little bit of googling solved the problem. instead of > sample = cdll.sample_dll.SAMPLE > > I used > > sample = windll.sample_dll.SAMPLE > > and now it seems to be working without error messages. > > Thanks a lot. > > I remember someone on the ctypes mailing

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread Lenard Lindstrom
erikcw wrote: > Hi, > > I'm trying to build a SQL string > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > (cid, ag, self.data[parent][child]['results']['test']) > I am guessing you want the string formatting operator here: sql = """...""" % (cid, ...) The comma creat

Objects, lists and assigning values

2007-04-05 Thread Manuel Graune
Hello, while trying to learn how to program using objects in python (up to now simple scripts were sufficient for my needs) I stumbled over the a problem while assigning values to an object. The following piece of code shows what I intend to do: <---snip---> class new_class(object): de

Antigen Notification: Antigen found a message matching a filter

2007-04-05 Thread Antigen_VITORIA
Microsoft Antigen for Exchange found a message matching a filter. The message is currently Purged. Message: "Python_list Digest_ Vol 43_ Issue 83" Filter name: "KEYWORD= spam: Timing" Sent from: "[EMAIL PROTECTED]" Folder: "SMTP Messages\Inbound And Outbound" Location: "ITURAN/First Administrative

Python Instructor Needed

2007-04-05 Thread deitel
We have an immediate need for a four- or five-day Intro to Python course in the Midwest United States for late May/early June 2007. We are looking for a Python instructor with outstanding credentials and a proven track record. You would be teaching this course as a third- party contractor. If you a

Re: AW: Write to a binary file

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 11:38:06 -0300, Grant Edwards <[EMAIL PROTECTED]> escribió: > On 2007-04-05, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > >> The output was: >> --- Start --- >> Pytest write> 02 36 00 01 0a b0 77 >> Pytest write> 02 36 00 01 0a >> Pytest write> b0 77 >> --- END --- > > I'm

tkinter canvas

2007-04-05 Thread gigs
I have made drawing area and few butons. How can I make when i click my fill button that later when i click on oval oval gets filled with chousen color? -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows service and pyc files

2007-04-05 Thread Laszlo Nagy
>> 1. subprocess.Popen cannot redirect stderr and stdout when called from a >> win32 service. This is not documented, and makes debugging almost >> impossible. >> > > Without the patch menctioned in my previous message, you must redirect all > stdin, stdout AND stderr (because the child can

Re: AW: Write to a binary file

2007-04-05 Thread Grant Edwards
On 2007-04-05, Thinker <[EMAIL PROTECTED]> wrote: >>> --- START --- >>> import os >>> >>> msg = chr(0x02) + chr(0x36) + chr(0x00) + chr(0x01) + chr(0x0a) + >>> chr(0xb0) + chr(0x77) >>> >>> f = os.open('/dev/pytest', os.O_RDWR) >>> os.write(f,msg) >>> os.close(f) >>> >>> f = file('/dev/pytest', 'w

Re: Objects, lists and assigning values

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 14:13:43 -0300, Manuel Graune <[EMAIL PROTECTED]> escribió: > class new_class(object): > def __init__( self, > internal_list=[]): > self.internal_list= internal_list All your instances share the *same* internal list, because

Re: Windows service and pyc files

2007-04-05 Thread Laszlo Nagy
> With a bit of guessing, I think I've found what's happening. > Since you don't provide a value for stdin, None is used. Inside > subprocess.py, method _get_handles, line 670, GetStdHandle *may* return > None; in that case _make_inheritable fails. > If you print the value of p2cread in line 6

PyDispatcher question

2007-04-05 Thread Jorgen Bodde
Hi all, Hopefully someone can help me. I am fairly new to Python, and I am looking into PyDispatcher. I am familiar with the C++ sigslot variant, and I wonder how similar PyDispatches is. I run in to the following 'problem' (pseudo code, untested here) import pydispatch.dispatcher class A: def

Re: Prevent Modification of Script?

2007-04-05 Thread Subscriber123
If you are *really* worried about the database being attacked and edited, encrypt it by private key: require that the user set a password and use that password every time that s/he accesses the database. I am afraid that you cannot really prevent the database from being deleted completely, but you

Re: how to remove multiple occurrences of a string within a list?

2007-04-05 Thread attn . steven . kuo
On Apr 4, 7:43 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: (snipped) > A "we-don't-need-no-stinkin'-one-liners" more relaxed approach: > > import collections > d = collections.defaultdict(int) > for x in myList: d[x] += 1 > list(x for x in myList if d[x]==1) > > yields O(N) performance (give tha

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread Paul Boddie
Lenard Lindstrom wrote: > > > > I'm trying to build a SQL string > > > > sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", > > (cid, ag, self.data[parent][child]['results']['test']) > > I am guessing you want the string formatting operator here: > > sql = """...""" % (cid, ...)

Looping issues

2007-04-05 Thread brochu121
What I am trying to do is compare two files to each other. If the 2nd file contains the same line the first file contains, I want to print it. I wrote up the following code: correct_settings = open("C:\Python25\Scripts\Output \correct_settings.txt","r") current_settings = open("C:\Python25\Scri

Re: AttributeError: 'tuple' object has no attribute 'encode'

2007-04-05 Thread Paul Boddie
erikcw wrote: > > Here is the full error: (sorry) No problem! It's easier to comment with these details... > Traceback (most recent call last): > File "/home/erik/Desktop/wa.py", line 178, in ? > curHandler.walkData() > File "/home/erik/Desktop/wa.py", line 91, in walkData > sql = """INSERT INT

Re: PyDispatcher question

2007-04-05 Thread Mike C. Fletcher
Jorgen Bodde wrote: > Hi all, > > Hopefully someone can help me. I am fairly new to Python, and I am > looking into PyDispatcher. I am familiar with the C++ sigslot variant, > and I wonder how similar PyDispatches is. I run in to the following > 'problem' (pseudo code, untested here) > Here's so

Re: way to extract only the message from pop3

2007-04-05 Thread Collin Stocks
so get two strings: only headers, and the whole message. find the length of the headers, and chop that off the beginning of the whole message: message=whole_message[len(headers):None] You can omit the word None: it is just there for clarity purposes. On 3 Apr 2007 12:36:10 -0700, flit <[EMAIL

Re: SNMP agent

2007-04-05 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, alain <[EMAIL PROTECTED]> wrote: >On Apr 4, 1:30 pm, alf <[EMAIL PROTECTED]> wrote: > >> twistedmatrix.org? > >I already took a look at it but the agent functionality is somewhat >primitive. I need something production-ready. > >Alain > 'Doesn't exist. I understand

SUMMON - Rapid prototyping of 2D visualizations

2007-04-05 Thread matt . rasmus
I have been using python for the last two years to create various visualizations for my research in computational biology. Over the years, I found that I often needed the same kinds of features for many of my visualizations (OpenGL graphics with basic scrolling and zooming). I have implemented th

Re: Looping issues

2007-04-05 Thread anglozaxxon
On Apr 5, 2:01 pm, [EMAIL PROTECTED] wrote: > What I am trying to do is compare two files to each other. > > If the 2nd file contains the same line the first file contains, I want > to print it. I wrote up the following code: > > correct_settings = open("C:\Python25\Scripts\Output > \correct_settin

Re: Looping issues

2007-04-05 Thread Collin Stocks
I don't know what is wrong with your code yet, but first you should clean it up. Either replace those backslashes with forward slashes, or put r before the first quote in the path string. This prevents special characters from being evaluated as such. Second, you should debug a little. Feel free t

Re: how to remove multiple occurrences of a string within a list?

2007-04-05 Thread Subscriber123
for item in listA: while item in listB: listB.remove(item) where listA is the list of things you want to remove from listB On 3 Apr 2007 11:20:33 -0700, bahoo <[EMAIL PROTECTED]> wrote: Hi, I have a list like ['0024', 'haha', '0024'] and as output I want ['haha'] If I myList.remove

Re: Looping issues

2007-04-05 Thread Collin Stocks
That *shouldn't* be the problem, since files are iterable On 5 Apr 2007 11:18:50 -0700, anglozaxxon <[EMAIL PROTECTED]> wrote: On Apr 5, 2:01 pm, [EMAIL PROTECTED] wrote: > What I am trying to do is compare two files to each other. > > If the 2nd file contains the same line the first file conta

ascii-unicode replacement

2007-04-05 Thread Andrea Valle
Hi to all, I scripted some text files with another language which cannot handle unicode. As I need special character in the resulting text files (IPA extension), my idea was to define some special ascii sequences in the text files, open the text files in Python, replace the special sequen

Re: Looping issues

2007-04-05 Thread brochu121
On Apr 5, 2:18 pm, "anglozaxxon" <[EMAIL PROTECTED]> wrote: > On Apr 5, 2:01 pm, [EMAIL PROTECTED] wrote: > > > > > What I am trying to do is compare two files to each other. > > > If the 2nd file contains the same line the first file contains, I want > > to print it. I wrote up the following code:

Re: Looping issues

2007-04-05 Thread Larry Bates
[EMAIL PROTECTED] wrote: > What I am trying to do is compare two files to each other. > > If the 2nd file contains the same line the first file contains, I want > to print it. I wrote up the following code: > > > > correct_settings = open("C:\Python25\Scripts\Output > \correct_settings.txt","r"

Re: Can we make a local variable in a function as global variable???

2007-04-05 Thread Collin Stocks
As for me, I find this problem annoying, but easy to solve. My solution is: this=__import__(__name__) To set global variable spam to 4, I say: this.spam=4 This always works, and is much more convenient than: global spam spam=4 and then worry about local variables also named spam. On

Re: PyDispatcher question

2007-04-05 Thread Jorgen Bodde
Hi Mike, Thanks for the explanation! The Python shell really threw me off here. I thought it would work exactly the same as in the interpreter itself. :-) Even assigning None to the object exibits the same behaviour as "del" does. COOL! This is what I did sofar: from pydispatch import dispatche

defining functions

2007-04-05 Thread Andre P.S Duarte
How do I define a function, then import it, without having to save it in lib; like "C:\python25\lib". ? -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >