Re: Creating a PYD file

2010-08-19 Thread Thomas Jollans
On Thursday 19 August 2010, it occurred to Rony to exclaim: > Is a PYD file created from Pyrex faster in execution then a PYD file > created from python source ? How do you plan to create an extension module (*.so, *.pyd on Windows) from Python source then? -- http://mail.python.org/mailman/list

Re: Iterative vs. Recursive coding

2010-08-19 Thread Thomas Jollans
ther good look at the definition of "recursion" I'm sure you were given. To sum it up: "iterate": use a loop. and again. and again. and again. and again. and aga "recurse": consider. recurse. This is another good one: http://mytechquest.com/blog/wp-conte

Re: Reading the access attributes of directories in Windows

2010-08-19 Thread Thomas Jollans
re? Or, apart from the "executable" bit, anything less, for that matter? Just asking. Maybe there are some experts around. - Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading the access attributes of directories in Windows

2010-08-20 Thread Thomas Jollans
On Friday 20 August 2010, it occurred to Nobody to exclaim: > Unix lacks the "Append Data" permission for files, and the "Create Files", > "Create Folders" and "Delete Subfolders and Files" correspond to having > write permission on a directory. How does append differ from write? If you have appen

Re: Looking for an appropriate encoding standard that supports all languages

2010-08-20 Thread Thomas Jollans
On Thursday 19 August 2010, it occurred to ata.jaf to exclaim: > On Aug 17, 11:55 pm, Thomas Jollans wrote: > > On Tuesday 17 August 2010, it occurred to ata.jaf to exclaim: > > > I am developing a little program in Mac with wxPython. > > > But I have problems with the

Re: How to convert bytearray into integer?

2010-08-20 Thread Thomas Jollans
On Tuesday 17 August 2010, it occurred to Jacky to exclaim: > On Aug 17, 3:38 am, Thomas Jollans wrote: > > On Monday 16 August 2010, it occurred to Jacky to exclaim: > > > it's hard to image why socket object provides the interface: > > > socket.recv_from(buf[,

Re: make install DESTDIR

2010-08-20 Thread Thomas Jollans
On Saturday 21 August 2010, it occurred to aj to exclaim: > I am trying to install python with make install DESTDIR=/home/blah > > --prefix=/ ... > creating /lib/python2.6 > error: could not create '/lib/python2.6': Permission denied > make: *** [sharedinstall] Error 1 Obvious

Re: Iterative vs. Recursive coding

2010-08-20 Thread Thomas Jollans
On Saturday 21 August 2010, it occurred to Baba to exclaim: > - every time the procedure calls itself the memory gradually fills up > with the copies until the whole thing winds down again > as the "return" statements start being executed. > - the above point means that a recursive approach is ex

Re: make install DESTDIR

2010-08-21 Thread Thomas Jollans
On Saturday 21 August 2010, it occurred to aj to exclaim: > On Aug 20, 4:39 pm, Thomas Jollans wrote: > > On Saturday 21 August 2010, it occurred to aj to exclaim: > > > I am trying to install python with make install DESTDIR=/home/blah > > > >

Re: Wrong unichr docstring in 2.7

2010-08-22 Thread Thomas Jollans
Would a zero by any other name not look as small? Honestly, I myself find it nonsensical to qualify 0 by specifying a base, unless you go all the way and represent the full uint16_t by saying 0x <= i <= 0x - Thomas [1] http://bugs.python.org/issue1057588 [2] http://www.python.org/dev/peps/pep-0261/ [3] http://docs.python.org/library/functions.html#unichr -- http://mail.python.org/mailman/listinfo/python-list

Re: how to use xdrlib

2010-08-22 Thread Thomas Jollans
, as you see, I am a bit lost here and any hint would be very > appreciated. Basically, you have to know which file format you're dealing with, and use the right unpack functions in the correct order for the specific file you're dealing with. So you need some documentation for the file

Re: Running python script before user login

2010-08-22 Thread Thomas Jollans
On Sunday 22 August 2010, it occurred to Mahmood Naderan to exclaim: > >Specify exactly how it's not working. > > I have wrote a script to send my ip address to an email address. It does > work when I am login (python sendip.py). I then followed the procedure in > https://help.ubuntu.com/community

Re: Running python script before user login

2010-08-22 Thread Thomas Jollans
How about something like this: #!/bin/sh cd /home/mahmood/ python sendip.py >sendip.log 2>&1 ... this will write Python's output to a log file. If there is an exception, you'd be able to see it. > > > // Naderan *Mahmood; > > > > > _

Re: psycopg2 for insertion of binary data to PostgreSQL database

2010-08-22 Thread Thomas Jollans
On Sunday 22 August 2010, it occurred to Julia Jacobson to exclaim: > Thanks a lot, this was the solution. > It would be greate, if you could also show me a way to extract the > inserted binary object from the table on the server to a file on a client. Probably something along the lines of: * exe

Re: Helper classes design question

2010-08-23 Thread Thomas Jollans
/ object I hope you understood at least a bit of my ramblings. Cheers, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Discarding STDERR generated during subprocess.popen

2010-08-23 Thread Thomas Jollans
On Monday 23 August 2010, it occurred to Leon Derczynski to exclaim: > Hi, > > I would like to run an external program, and discard anything written > to stderr during its execution, capturing only stdout. My code > currently looks like: > > def blaheta_tag(filename): > blaheta_dir = '/ho

Re: Installing pymssql

2010-08-23 Thread Thomas Jollans
On Monday 23 August 2010, it occurred to f1crazed to exclaim: > Hello, > > I am new to the python world. I'm trying the install the pymssql > package and have been unsuccessful. I am running Win7 x64. Here is > the output I get when I try to build the pymssql package: > > [snip: missing symbol

Re: problem with simple multiprocessing script on OS X

2010-08-24 Thread Thomas Jollans
On Tuesday 24 August 2010, it occurred to Darren Dale to exclaim: > On Aug 23, 9:58 am, Darren Dale wrote: > > The following script runs without problems on Ubuntu and Windows 7. > > h5py is a package wrapping the hdf5 library (http://code.google.com/p/ > > h5py/): > > > > from multiprocessing im

Re: equivalent of source in python?

2010-08-24 Thread Thomas Jollans
On Tuesday 24 August 2010, it occurred to News123 to exclaim: > On 08/24/2010 09:18 PM, Astan Chee wrote: > > Hi, > > I'm trying to convert my tcsh script to python and am stuck at one part, > > particularly the part of the script that looks like this: > > > > #!/bin/tcsh > > setenv LSFLOG /var/tm

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-05 Thread Thomas Heller
am attempted to use that feature. (Or the > sniffing could be explicitly enabled/disabled by a configure flag.) > Hm, on Linux, gccxml (if its version is compatible with that of the C++ compiler) can probably help a lot. At runtime, no configure step needed. Unfortunately not on Windows. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-05 Thread Thomas Heller
Philip Semanchuk schrieb: > On Jun 5, 2009, at 10:13 AM, Thomas Heller wrote: > >> s...@pobox.com schrieb: >>>>> If there is no C++ compiler available then the proposed layout >>>>> sniffing just >>> wouldn't be done and eithe

Re: Is it possible to disable readline in the interactive interpreter?

2009-06-08 Thread Thomas Heller
t it behaves on 'up' or 'down' keypresses in the same way as the windows console. Does someone have such a configuration? Thomas -- http://mail.python.org/mailman/listinfo/python-list

multiprocessing and process run time

2009-06-19 Thread Thomas Robitaille
aster) p.start() Is there a way that I can then find how long p has been running for? I figured I can use p.pid to get the PID of the process, but I'm not sure where to go from there. Is there an easy way to do this? Thanks, Thomas -- View this message in context: http://www.nabble.com/multi

Re: Python simple web development

2009-06-26 Thread Thomas Allen
ngo and TurboGears > but I am afraid that this is too big for my requirements (am I > wrong ?). > > Can you suggest anything ? I don't think anything's lighter than web.py. http://webpy.org/ Thomas -- http://mail.python.org/mailman/listinfo/python-list

Fast Dictionary Access

2009-06-27 Thread Thomas Lehmann
Hi! In C++, programming STL you will use the insert method which always provides a position and a flag which indicates whether the position results from a new insertion or an exisiting element. Idea is to have one search only. if data.has_key(key): value = data[key] But this does mean (doe

Re: Beginning with Python; the right choice?

2009-06-27 Thread Thomas Lehmann
> read and have started to go through them.  I was wondering, as someone > with virtually no programming experience (I am a photographer by > trade), is Python the right language for me to try and learn? Well, I'm a 100% C++ programmer but I like programming python for prototyping and tools. The

Column types with DB API

2009-06-28 Thread Thomas Robitaille
-type of a column is, for example if a column is a NUMBER, is there a way to determine if it is a 2, 4, or 8-byte integer or real number? Thanks in advance for any advice, Thomas -- View this message in context: http://www.nabble.com/Column-types-with-DB-API-tp24245424p24245424.html Sent fro

logging of strings with broken encoding

2009-07-02 Thread Thomas Guettler
;view=markup I think msg.encode("UTF-8", 'backslashreplace') would be better here. What do you think? Should I fill a bugreport? Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: logging of strings with broken encoding

2009-07-02 Thread Thomas Guettler
see any logging messages. Thomas Thomas Guettler schrieb: > Hi, > > I have bug in my code, which results in the same error has this one: > ... -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: logging of strings with broken encoding

2009-07-03 Thread Thomas Guettler
Stefan Behnel schrieb: > Thomas Guettler wrote: >> My quick fix is this: >> >> class MyFormatter(logging.Formatter): >> def format(self, record): >> msg=logging.Formatter.format(self, record) >> if isinstance(msg, str): >>

Tkinter only: table widget with canvas...

2009-07-10 Thread Thomas Lehmann
g column? best regards Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter only: table widget with canvas...

2009-07-11 Thread Thomas Lehmann
> > There's a working app at http://cl1p.net/tkinter_table_headers/ > > -John Thank you for this example. However, one issue to that... When resizing the window (vertical) then the header moves away from the table. How can I avoid this with the grid? With "pack" I now this... -- http://mail.pytho

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Thomas Guettler
ers. It would not be difficult to implement this as a class with all fancy methods like startswith() ... Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Workflow Libraries (DB vs Code)

2009-07-21 Thread Thomas Guettler
I prefer python. Feedback welcome, Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de -- http://mail.python.org/mailman/listinfo/python-list

Re: Workflow Libraries (DB vs Code)

2009-07-22 Thread Thomas Guettler
Diez B. Roggisch schrieb: > Thomas Guettler wrote: > >> Hi, >> >> I need to write some simple workflows with web interface. >> >> For the web stuff I will use django, but I am not sure how >> to do the workflow part. > > Did you consider using

Re: unittest

2009-08-14 Thread Richard Thomas
On Aug 15, 4:28 am, Mag Gam wrote: > I am writing an application which has many command line arguments. > For example: foo.py -args "bar bee" > > I would like to create a test suit using unittest so when I add > features to "foo.py" I don't want to break other things. I just heard > about unittest

Re: ncurses getch & unicode (was: decoding keyboard input when using curses)

2009-08-21 Thread Thomas Dickey
On Aug 20, 6:12 pm, Iñigo Serna wrote: > Hi again, > > 2009/8/20 Iñigo Serna > > I have the same problem mentioned > > inhttp://groups.google.com/group/comp.lang.python/browse_thread/thread/...some > > months ago. > > > Python 2.6 program which usesncursesmodule in a terminal configured to use

Re: ncurses getch & unicode (was: decoding keyboard input when using curses)

2009-08-21 Thread Thomas Dickey
On Fri, 21 Aug 2009, Iñigo Serna wrote: 2009/8/21 Thomas Dickey : On Aug 20, 6:12 pm, Iñigo Serna wrote:     c = win.getch() You're using "getch", not "get_wch" (Python's ncurses binding may/may not have the latter). curses getch returns 8-bit values, get

Re: best way to display photos

2009-08-24 Thread Thomas Guettler
http://mirageiv.berlios.de/index.html It is a pygtk image viewer. You can define shortcuts that execute user defined commands. Thomas samwyse schrieb: > I have several thousand photographs that I need to quickly classify, > all by myself. After extensive searches, I have been unable to find &g

Re: os.popen output different from native shell output

2009-08-25 Thread Thomas Guettler
the ls command natively > from the shell (not via python). I display the ouput via python by > using the print function on the variable that accepts the os.popen > ().read() function. ... Thomas -- Thomas Guettler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de --

Re: os.popen output different from native shell output

2009-08-25 Thread Thomas Guettler
In one of the first chapters of "Advanced programming in the unix environment (second edition)" there is explained how a unix shell works. You could write you own shell using python. This way the python interpreter gets stared only once, and not for every call to "ls".

Re: PyGTK problems after Linux update...

2009-08-28 Thread Thomas Guettler
Looks like your pygtk package does not fit to the installed python package. > from glib._glib import * > ImportError: /usr/lib/python2.6/site-packages/gtk-2.0/glib/_glib.so: > undefined symbol: PyUnicodeUCS4_DecodeUTF8 -- Thomas Guettler, http://www.thomas-guettler.d

Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
- how does one go about getting this incorporated into random so that the entire community can beneffit from it? Sincerely Thomas Philips def student_t(df): # df is the number of degrees of freedom if df < 2 or int(df) != df: raise ValueError, 'student_tvariate: df mus

Re: Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
On Sep 2, 12:28 pm, Mark Dickinson wrote: > On Sep 2, 2:51 pm, Thomas Philips wrote: > > > def student_t(df):         # df is the number of degrees of freedom > >     if df < 2  or int(df) != df: > >        raise ValueError, 'student_tvariate: df must be a integer

Re: Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
On Sep 2, 1:03 pm, Thomas Philips wrote: > On Sep 2, 12:28 pm, Mark Dickinson wrote: > > > On Sep 2, 2:51 pm, Thomas Philips wrote: > > > > def student_t(df):         # df is the number of degrees of freedom > > >     if df < 2  or int(df) != df: > > &g

Re: Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
On Sep 2, 2:37 pm, Mark Dickinson wrote: > On Sep 2, 6:15 pm, Thomas Philips wrote: > > > I mis-spoke - the variance is infinite when df=2 (the variance is df/ > > (df-2), > > Yes:  the variance is infinite both for df=2 and df=1, and Student's t > with df=1 does

Zipped and pickle

2009-09-16 Thread Thomas Lehmann
How do I implement best to use pickle that way that the file is zipped? -- http://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Re: How to improve this code?

2009-09-16 Thread Thomas Lehmann
> otherwise. Given this, I'm just trying to write a method > are_elements_present(aList) whose job is to return True if and only if > all elements in aList are present in page's HTML. So here is how > missingItems = [str(ele) for ele in eleLocators if not selenium.is_element_present(ele)] if len(m

Re: Zipped and pickle

2009-09-16 Thread Thomas Lehmann
ario for writing and reading the data... APPENDIX: import pickle import zipfile def test1(): print("test1...") # create data data = {} data["first name" ] = "Thomas" data["second name"] = "Lehmann" data["hobbie

Tkinter - Text - bullets

2009-09-18 Thread Thomas Lehmann
My intention is to write a small custom widget displaying text where the text can have a simple wiki syntax. The main interest is to support heading, bold, italic, underline, itemization and enumeration. How can I implement itemization using the Tkinter.Text widget? (bullets) -- http://mail.pytho

ANN: Resolver One 1.6.5 released

2009-09-18 Thread Giles Thomas
an Open Source project, we offer free licenses for that: <http://www.resolversystems.com/opensource/> Best regards, Giles -- Giles Thomas giles.tho...@resolversystems.com +44 (0) 20 7253 6372 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England an

Re: Tkinter - Text - bullets

2009-09-19 Thread Thomas Lehmann
> Something like this maybe? > > from Tkinter import * > > root = Tk() > txt = Text(root, wrap='word') > txt.pack() > > txt.tag_configure('text_body', font=('Times', 18), lmargin1=0, > lmargin2=0) > txt.tag_configure('bulleted_list', font=('Times', 18), lmargin1='10m', > lmargin2='15m', tabs=[

Re: Tkinter - Text - bullets

2009-09-21 Thread Thomas Lehmann
> This is probably why you had all these alignment problems. But it's > weird, because the script I posted is copied and pasted from a really > script that I've run, and which doesn't cause any error. What is the > version of tcl/tk used by your Tkinter module? And what is your Python > version? U

Re: Can PySerial's write method be called by multiple threads?

2010-08-25 Thread Thomas Jollans
On Wednesday 25 August 2010, it occurred to Joel Koltner to exclaim: > I have a multi-threaded application where several of the threads need to > write to a serial port that's being handled by pySerial. If pySerial > thread-safe in the sense that pySerial.write behaves atomically? I.e., if > thre

Re: split string into multi-character "letters"

2010-08-25 Thread Thomas Jollans
On Wednesday 25 August 2010, it occurred to Jed to exclaim: > Hi, I'm seeking help with a fairly simple string processing task. > I've simplified what I'm actually doing into a hypothetical > equivalent. > Suppose I want to take a word in Spanish, and divide it into > individual letters. The probl

Re: Python Editor or IDE ActiveX control

2010-08-26 Thread Thomas Jollans
On Thursday 26 August 2010, it occurred to Sathish S to exclaim: > Hi Ppl, > > Is there any python IDE or editor that has an ActiveX control which could > be embed in other Windows applications. I'm basically looking to write a > application that can show the indentations of python, change the col

Re: PyGeo

2010-08-29 Thread Thomas Jollans
ied it? If not, then why not? Try it. Maybe it just works. As far as I know, distutils haven't changed much, carefully avoiding any changes that could break packages. I think it's entirely possible that the web page author claiming "the installation" doesn't work was re

Re: PyGeo

2010-08-30 Thread Thomas Jollans
ssages, so we have something to build upon when trying to figure out what's wrong. - Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert (unicode) text to image?

2010-08-30 Thread Thomas Jollans
On Monday 30 August 2010, it occurred to ru...@yahoo.com to exclaim: > Face the facts dude. The Python docs have some major problems. > They were pretty good when Python was a new, cool, project used > by a handful of geeks. They are good relative to the "average" > (whatever that is) open source

Re: How to convert (unicode) text to image?

2010-08-30 Thread Thomas Jollans
On Monday 30 August 2010, it occurred to Paul Rubin to exclaim: > Thomas Jollans writes: > > Actually, the Python standard library reference manual is excellent. At > > least that's my opinion > > What exactly are you comparing the Python docs to, I wonder? Obviou

Re: Optimising literals away

2010-08-30 Thread Thomas Jollans
On Monday 30 August 2010, it occurred to Tobias Weber to exclaim: > Hi, > whenever I type an "object literal" I'm unsure what optimisation will do > to it. > > def m(arg): > if arg & set([1,2,3]): > return 4 > > Is the set created every time the method is called? What about a > frozenset? O

Re: PyGeo

2010-08-31 Thread Thomas Jollans
isual.ui.display" with "visual.display", and try again. And the fix the next problem, and so on, until it works, when you can send a patch to the old maintainer. http://www.vpython.org/webdoc/visual/index.html - Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: sendmail error

2010-08-31 Thread Thomas Jollans
27;t. This information is not useless! Also, when replying: - Quote properly. While top posting is discouraged, the most important bit is to clearly distinguish quoted material from new material. Make it possible from the structure of the message you're sending which parts you wrote and which parts you're just quoting. - Keep your reply on-list. - Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Stackless Python and EVE Online

2010-08-31 Thread Thomas Jollans
On Tuesday 31 August 2010, it occurred to Roman Sokolyuk to exclaim: > Hi, > > I am new to Python and I wanted to understand something... > > The EVE Online Client is build using Stackless Python > > So when I install the client on my machine, how doe sit get run if I do not > have Python instal

Re: sendmail error

2010-08-31 Thread Thomas Jollans
deed. > > > > > From: Thomas Jollans > To: python-list@python.org > Sent: Tue, August 31, 2010 4:46:58 PM > Subject: Re: sendmail error > > On Tuesday 31 August 2010, it occurred to sandric ionut to exclaim: > > Hello: > >

Re: Python libs on Windows ME

2010-08-31 Thread Thomas Jollans
On Tuesday 31 August 2010, it occurred to hexusne...@gmail.com to exclaim: > I'm not guessing that this is a problem on Windows 98, but on Windows > ME modules in /Lib don't seem to load. Examples include site.py and > os.py which are both located in the top level Lib directory. The same > thing

Re: C++ - Python API

2010-09-01 Thread Thomas Jollans
On Wednesday 01 September 2010, it occurred to Markus Kraus to exclaim: > So the feature overview: First, the obligatory things you don't want to hear: Have you had a look at similar efforts? A while ago, Aahz posted something very similar on this very list. You should be able to find it in any

Re: Windows vs. file.read

2010-09-02 Thread Thomas Jollans
On Thursday 02 September 2010, it occurred to ipatrol6...@yahoo.com to exclaim: > Correct in that regard. In Python 3.x, strings are by default considered > UTF-8. Wheras ASCII isn't a problem because it's fixed-width, UTF-8 will > give you a different character depending on the last byte value. T

Re: what should __iter__ return?

2010-09-03 Thread Thomas Jollans
On Friday 03 September 2010, it occurred to ernest to exclaim: > Hi, > > What is better: > > def __iter__(self): > for i in len(self): > yield self[i] > > or > > def __iter__(self): > return iter([self[i] for i in range(len(self))]) > > The first one, I would say is more correc

Re: ssh browser? where?

2010-09-05 Thread Thomas Jollans
On Sunday 05 September 2010, it occurred to alex goretoy to exclaim: > why not ssh browser traffic? why use SSL certificate authorities which > can't be trusted in the first place? > Is SSH not proven to be secure? > > To this day I have not seen ssh module for say Apache web server, why not? > >

Re: Extracting item from list of tuples?

2010-09-05 Thread Thomas Jollans
On Sunday 05 September 2010, it occurred to Roy Smith to exclaim: > I'm using httplib, and want to get the Location header from the > response. The getheaders() method gives you back a list of (name, > value) tuples. It would be a lot more convenient if it gave you back a > dict, but it is what i

Re: accessing a text file

2010-09-06 Thread Thomas Jollans
On Monday 06 September 2010, it occurred to Baba to exclaim: > On 6 sep, 00:01, Benjamin Kaplan wrote: > > On Sun, Sep 5, 2010 at 5:47 PM, Baba wrote: > > > level: beginner > > > > > > how can i access the contents of a text file in Python? > > > > > > i would like to compare a string (word) wi

Re: using modules

2010-09-06 Thread Richard Thomas
On Sep 6, 5:55 pm, Sal Lopez wrote: > The following code runs OK under 3.1: > > @filename=cats_and_dogs.py > > #!/usr/bin/python > > def make_sound(animal): >     print(animal + ' says ' + sounds[animal]) > > sounds = { "cat": "meow", "dog": "woof" } > > for i in sounds.keys(): >     make_sound(i)

Re: console-editor written in python

2010-09-08 Thread Thomas Jollans
On Wednesday 08 September 2010, it occurred to Tanje Toolate to exclaim: > hi there, > > > greetings. > > i am looking for a small, console-based (opensource) texteditor, > written in python (or as shellscript!), but i'm not finding something > usable. Why? (Also, I can't imagine anyone writing

Re: cPickle segfault with nested dicts in threaded env

2010-09-08 Thread Thomas Jollans
On Wednesday 08 September 2010, it occurred to Kenneth Dombrowski to exclaim: > Environment is FreeBSD 8, Python 2.5.5 Which architecture? Also, Python 2.5 is frightfully old. There's not really any problem with still using it, but nobody's maintaining it upstream, so don't bother reporting a b

Re: Automatic delegation in Python 3

2010-09-08 Thread Thomas Jollans
On Wednesday 08 September 2010, it occurred to Steven D'Aprano to exclaim: > What's going on here? I *think* this has something to do with special > double-underscore methods being looked up on the class, not the instance, > for new-style classes, but I'm not entirely sure. Yes, special methods ar

Re: Why does linecache avoid ? How can I get equivalent of inspect.getsource() for an interactive session?

2010-09-09 Thread Thomas Jollans
On Thursday 09 September 2010, it occurred to Mark Hirota to exclaim: > Here's my goal: > > To enable a function for interactive session use that, when invoked, > will "put" source code for a specified object into a plaintext file. > Based on some initial research, this seems similar to ipython's

Re: bug in python documentation?

2010-09-11 Thread Thomas Jollans
On Saturday 11 September 2010, it occurred to Vito 'ZeD' De Tullio to exclaim: > from http://docs.python.org/library/unittest.html > > $ python test_unittest.py > .E. > == > ERROR: test_sample (__main__.TestSequenceFunctions) > --

Re: [Python-ideas] with statement syntax forces ugly line breaks?

2010-09-11 Thread Thomas Jollans
On Saturday 11 September 2010, it occurred to Lawrence D'Oliveiro to exclaim: > In message , MRAB > > wrote: > > On 08/09/2010 19:07, Georg Brandl wrote: > >> Thus spake the Lord: Thou shalt indent with four spaces. No more, no > >> less. Four shall be the number of spaces thou shalt indent, and t

Re: Distribute Non Library

2010-09-12 Thread Thomas Jollans
On Sunday 12 September 2010, it occurred to narke to exclaim: > My simple tool writing in python get bigger and bigger and I think I'd > better split my code into several files. But, unlike what in some other > languages, there is no way to compile these several files into a single > executable. B

Re: Python script for MySQL Passwords Unreliable on first boot (rc.local)

2010-09-13 Thread Thomas Jollans
On Monday 13 September 2010, it occurred to cloudcontrol to exclaim: > The script below works great when logged in as root and run from the > command line, but when run at first boot using /etc/rc.local in Ubuntu > 10.04, it fails about 25% of the time- the system root, mysql root and > some mysql

Re: is there a way to get the encoding of python file

2010-09-13 Thread Thomas Jollans
On Monday 13 September 2010, it occurred to Robert Kern to exclaim: > On 9/13/10 2:00 PM, Stef Mientki wrote: > > On 12-09-2010 19:28, Robert Kern wrote: > >> On 9/12/10 4:14 AM, Stef Mientki wrote: > >>>hello, > >>> > >>> Is it possible to get the encoding of a python file from the first >

Re: Cross Compiling Python for ARM

2010-09-14 Thread Thomas Jollans
On Tuesday 14 September 2010, it occurred to Neil Benn to exclaim: > # > ./python > > -sh: ./python: not found I'm guessing either there is no file ./python, or /bin/sh is fundamentally broken. -- http://mail.python.org/mailman/listinfo/python-list

Re: String formatting with the format string syntax

2010-09-14 Thread Thomas Jollans
On Tuesday 14 September 2010, it occurred to Miki to exclaim: > You can use ** syntax: > >>> english = {'hello':'hello'} > >>> s.format(**english) No, you can't. This only works with dicts, not with arbitrary mappings, or dict subclasses that try to do some kind of funny stuff. > > On Sep 14,

Re: socket.error: [Errno 98] Address already in use

2010-09-15 Thread Thomas Jollans
On Wednesday 15 September 2010, it occurred to cerr to exclaim: > Hi There, > > I get a socket error "[Errno 98] Address already in use" when i try to > open a socket that got closed before with close(). How come close() > doesn't close the socket properly? > My socket code : > > s = socket.soc

Re: distutils, cygwin, 'not a regular file'

2010-09-15 Thread Thomas Jollans
On Wednesday 15 September 2010, it occurred to Paul Watson to exclaim: > So, what is not a regular file about this? Is there any way to find out > which files are being considered irregular? Regular files are the kind of files used to store bytes. Other kinds of files you might find in a file sy

Re: Debugger - fails to "continue" with breakpoint set

2010-09-15 Thread Thomas Jollans
On Wednesday 15 September 2010, it occurred to Ed Greenberg to exclaim: > I'm pretty new to Python, but I am really enjoying it as an alternative > to Perl and PHP. > > When I run the debugger [import pdb; pdb.set_trace()] and then do next > and step, and evaluate variables, etc, when I hit 'c' fo

Re: Problem building python 2.7 with --enable-shared

2010-09-16 Thread Thomas Jollans
On Thursday 16 September 2010, it occurred to Marten Lehmann to exclaim: > Hello, > > I've build python 2.7 successfully by just calling configure, make and > make install. But to use python within PostgreSQL, I need to built > python with --enable-shared. > > I tried to do so (configure --enable

Re: Learning inheritance

2010-09-19 Thread Thomas Jollans
On 2010-09-19 09:22, Niklasro wrote: > util.py: > url = os.environ.get("HTTP_HOST", os.environ["SERVER_NAME"]) #declared > as class variable(?) > There is no class here, so this is no class variable, and you're not inheriting anything. You're simply using a module. > And viola just test if util

Re: ctypes and buffers

2010-09-19 Thread Thomas Jollans
On Sunday 19 September 2010, it occurred to Carl Banks to exclaim: > I am creating a ctypes buffer from an existing non-ctypes object that > supports buffer protocol using the following code: > > > from ctypes import * > > PyObject_AsReadBuffer = pythonapi.PyObject_AsReadBuffer > PyObject_AsRead

Re: C++ - Python API

2010-09-19 Thread Thomas Jollans
On Sunday 19 September 2010, it occurred to Aahz to exclaim: > In article , > > Thomas Jollans wrote: > >On Wednesday 01 September 2010, it occurred to Markus Kraus to exclaim: > >> So the feature overview: > >First, the obligatory things you don't want

Re: develop for Windows on GNU/Linux, using Python

2010-09-20 Thread Thomas Jollans
On Monday 20 September 2010, it occurred to Default User to exclaim: > On Sun, Sep 19, 2010 at 14:31, J.O. Aho wrote: > > Kev Dwyer wrote: > > > if you have C-extensions in > > > your code you'll need to compile them over Windows. If you want to > > > program against the Windows API you'll need a

Re: Check whether file is being written to

2010-09-23 Thread Thomas Jollans
On Thursday 23 September 2010, it occurred to loial to exclaim: > How can I check whether a file is being written to by another process > before I access it? > > Platform is unix. As such, you can't. But you can lock the file using the functions in the fcntl module. -- http://mail.python.org/ma

Re: Scheduling in python

2010-09-23 Thread Thomas Jollans
On Thursday 23 September 2010, it occurred to loial to exclaim: > I want to enable my end users to be able to schedule a task(actually > running another python or shell script). Rather than scheduling it > directly in cron, are there any python modules I could use? If you have a "master" process r

Re: Playing sounds at time indexes

2010-09-23 Thread Thomas Jollans
On Wednesday 22 September 2010, it occurred to OKB (not okblacke) to exclaim: > I'm looking for an audio library for Python. I googled and found a > few, but none of them seem to have a simple way to play a particular > sound file from a particular start-time to an end-time. Like, I'd want

Re: inspect.getmodulename giving unexpected results

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to Geoff Bache to exclaim: > Hi all, > > I'm trying to examine some things in my stack. The information I get > out of inspect.stack() gives file names and I would like to convert > them to module names. I naturally assumes inspect.getmodulename would > fix

Re: inspect.getmodulename giving unexpected results

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to Geoff Bache to exclaim: > > > Unfortunately, it doesn't seem to do that in some cases. Consider the > > > > > following code: > > It does behave as documented: it does not find package names, or > > investigate sys.modules > > Possibly, although for me

Re: Python 2.6: How to turn off cgitb.py's DeprecationWarning: BaseException.message has been deprecated

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to pyt...@bdurham.com to exclaim: > Python 2.6: We're using the standard lib's cgitb module to > provide diagnostic messages when unexpected exceptions occur. > > Unfortunately, this module raises a DeprecationWarning like below > when it is used: > > C:\P

Re: SocketServer: replace network by hard drive

2010-09-24 Thread Thomas Jollans
On Friday 24 September 2010, it occurred to antoine to exclaim: > Hello, > > I would like to create a python server for which the requests are > passed by files on the hard drive instead of a network. > I am currently looking at the SocketServer python module, hoping for > an easy modification. >

Re: Pyflakes and IPython does not work for Emacs on Windows?

2010-09-25 Thread Thomas Jollans
On Saturday 25 September 2010, it occurred to Dsrt Egle to exclaim: > Thanks for your reply, Ben. Actually I have the paths "C:\Python25;C: > \Python25\Scripts" in the %PATH% variable, and the %PYTHONPATH% has > the following: > > [...] > > Looking at the file C:\Python25\Lib\site-packages\pyflak

<    26   27   28   29   30   31   32   33   34   35   >