Attaching to a Python Interpreter a la Tcl

2005-02-23 Thread DE
Hello, Some long time ago, I used to use Tcl/Tk. I had an tcl embedded into my app. The coolest thing was however, I was able to attach to the interpreter (built in to my app) via a tcl shell in which I could type in regular tcl code which would be interpreted by the interpreter of my application

Terminating a thread from the parent

2005-05-23 Thread DE
Hello, I have an app with embedded Python. Python scripts create their own threads and I need to terminate these threads at the point where the user wants to leave the application. I use threading.Thread as base classes. I have tried to use call the join method of the python thread objects from C

Re: Terminating a thread from the parent

2005-05-24 Thread DE
I appreciate your posts guys. It answers my questions and I like the idea of overriding join method. I will use this one. -- http://mail.python.org/mailman/listinfo/python-list

Windows Installer with Debug Dlls and Libs

2005-06-09 Thread DE
n you give me any hints on this nasty problem ? Thanks, DE -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Installer with Debug Dlls and Libs

2005-06-09 Thread DE
Thanks Trent. That's good news. Does ActivateState produce the debug package everytime they build a python release ? If this is a policy at ActivateState, I will feel myself on better grounds :) Ciao, DE -- http://mail.python.org/mailman/listinfo/python-list

Indentation for code readability

2007-03-30 Thread DE
Hello, Here is what I do in C++ and can not right now in python : pushMatrix() { drawStuff(); pushMatrix(); { drawSomeOtherStuff() } popMatrix(); } popMatrix(); The curly brackets have no functional meaning but increase the readability significantly. I want

Re: Indentation for code readability

2007-03-30 Thread DE
Thanks Peter. This sounds like to right solution for my case, because in addition to indentation, I can automate push and pop. I'll investigate this further. I appreciate. -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation for code readability

2007-03-30 Thread DE
> > I don't understand why you are indenting > the function calls. What does the > indentation and spacing signify? The indentation of function calls increases readability not in the sense that it is easier to decrypt the code, but rather it is analogous to the coordinate system transformations th

Re: Indentation for code readability

2007-03-30 Thread DE
Thanks Duncan. I guess you and Peter have been typing in the same minute :) It really looks like a good solution, I wasn't aware this with statement in Python. I can imagine the context handler coming handy in other cases too. Devrim -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation for code readability

2007-03-30 Thread DE
> > > The curly brackets have no functional meaning... > > "Curly brackets have no functional meaning"? Surely you must be > thinking of C, but not C++. Some of the most powerful idioms (idia?) > of C++ make use of functionality that runs when a closing bracket > causes local variables to fall ou

Re: "py" command for Linux and Mac?

2022-05-12 Thread De ongekruisigde
On 2022-05-12, Mats Wichmann wrote: > On 5/12/22 10:25, Dan Stromberg wrote: >> Hi folks. >> >> I heard there's a Windows-like "py" command for Linux (and Mac?). >> >> I'm finally getting to porting a particular project's Python 2.7 code to >> 3.x, and one of the first steps will probably be cha

Re: How to test characters of a string

2022-06-07 Thread De ongekruisigde
On 2022-06-07, Dave wrote: > Hi, > > I’m new to Python and have a simple problem that I can’t seem to find the > answer. > > I want to test the first two characters of a string to check if the are > numeric (00 to 99) and if so remove the fist three chars from the string. > > Example: if “05 Tr

Re: How to test characters of a string

2022-06-07 Thread De ongekruisigde
On 2022-06-07, Stefan Ram wrote: > Dave writes: >>Example: if "05 Trinket" I want "Trinket" > > We're not supposed to write complete solutions, Okay, wasn't aware of this group policy; will keep it in mind. -- You're rewriting parts of Quake in *Python*? MUAHAHAHA -- https://mail.python.

Re: How to test characters of a string

2022-06-07 Thread De ongekruisigde
ileName[0].isdigit() and myCompareFileName[1].isdigit(): > myCompareFileName = myCompareFileName[3:] > > if myCompareFileName != myTitleName: > print('File Name Mismatch - Artist: ',myArtistName,' Album: > ',myAlbumName,' Track:',myTitleName,

Re: How to test characters of a string

2022-06-07 Thread De ongekruisigde
On 2022-06-08, Christian Gollwitzer wrote: > Am 07.06.22 um 21:56 schrieb Dave: >> It depends on the language I’m using, in Objective C, I’d use isNumeric, >> just wanted to know what the equivalent is in Python. >> > > Your problem is also a typical case for regular expressions. You can > crea

Re: How to replace characters in a string?

2022-06-08 Thread De ongekruisigde
On 2022-06-08, Dave wrote: > Hi All, > > I decided to start a new thread as this really is a new subject. > > I've got two that appear to be identical, but fail to compare. After getting > the ascii encoding I see that they are indeed different, my question is how > can I replace the \u2019m wit

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
On 2022-06-08, dn wrote: > On 08/06/2022 10.18, De ongekruisigde wrote: >> On 2022-06-08, Christian Gollwitzer wrote: >>> Am 07.06.22 um 21:56 schrieb Dave: >>>> It depends on the language I’m using, in Objective C, I’d use isNumeric, >>>> just wante

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
On 2022-06-08, Dave wrote: > I hate regEx and avoid it whenever possible, I’ve never found something that > was impossible to do without it. I love regular expressions and use them where appropriate. Saves tons of code and is often much more readable than the pages of code required to do the sam

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
On 2022-06-08, Christian Gollwitzer wrote: > Am 07.06.22 um 23:01 schrieb Christian Gollwitzer: > >>> In [3]: re.sub(r'^\d+\s*', '', s) Out[3]: 'Trinket' >>> > > that RE does match what you intended to do, but not exactly what you > wrote in the OP. that would be '^\d\d.' start with exactly two

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
On 2022-06-08, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2022-06-08 at 08:07:40 -0000, > De ongekruisigde wrote: > >> Depending on the problem a regular expression may be the much simpler >> solution. I love them for e.g. te

Re: How to test characters of a string

2022-06-08 Thread De ongekruisigde
-06-09 at 03:18:56 +1000, >> > Chris Angelico wrote: >> > >> > > On Thu, 9 Jun 2022 at 03:15, <2qdxy4rzwzuui...@potatochowder.com> wrote: >> > > > >> > > > On 2022-06-08 at 08:07:40 -, >> > > > De ongekruisigde wro

Re: WHAT THE ERROR ON MY CODE???

2022-06-28 Thread De ongekruisigde
On 2022-06-28, Chris Angelico wrote: > ‪On Wed, 29 Jun 2022 at 01:37, ‫נתי שטרן‬‎ wrote:‬ >> headers["Authorization"] = "Basic >> YjMwMzcwODY3NTUzNDMwNTg5NzA2MjkyNDFmMDE1YWY6VjNKYTk2Y1F4RTFzeTdYbzRnbkt0a2k1djhscXUyU01oSE5VWUwwRg==" >> > > The error is that you just revealed your credentials to th

How to uninstall/update modules

2008-10-10 Thread pjacobi . de
Dear All, It seems I don't understand how Python packages are handled. Here's my specific problem * I'm on Win32 * I've installed Enthought Python 2.5 because it got all the numerical stuff included * Later I tried to install Twisted 8.1 Twisted ended up in C:\Python\Lib\site-packages\twisted

RegExp: "wontmatch"-function

2008-10-13 Thread pjacobi . de
Dear All, I'm looking for a function which, given a regexp re and and a string str, returns whether re won't match any string starting with str. (so it would always return False if str is "" or if str itself matches re -- but that are only the easy cases). I have the vague feeling that the inter

Re: python3 - the hardest hello world ever ?

2008-10-14 Thread pjacobi . de
Hi Helmut, All, > do I miss something (I do hope so) or is switching to Python3 > really hard for Latin1-users? It's as complicated as ever -- if you have used unicode strings in the past (as the 3.0 strings now are always unicode strings). > # sys.setfilesystemencoding('latin1') This cares abo

Re: Anyone Have (XP) 2.4.4 Installed and Can Check This Simple matplotlib Program?

2008-10-14 Thread pjacobi . de
On Oct 15, 6:38 am, "W. eWatson" <[EMAIL PROTECTED]> wrote: > I'm going to try another stab at this problem again. I'd like someone with > 2.4.4 and matplotlib-0.98.3.win32-py2.4exe to try it (below). IMHO an important detail of your configuration is missing. What's your numerical library? Did yo

Re: Finding the instance reference of an object

2008-10-31 Thread pjacobi . de
Instead of comparing integers: > x = 1 > y = x # does assignment make copies? > y += 1 > assert x == 1 > => succeeds, which implies that Python makes a copy when assigning with lists: > x = [1] > y = x # does assignment make copies? > y += [1] > assert x == [1] > => fails, which implies that P

Re: encoding in lxml

2008-11-03 Thread pjacobi . de
Hi Mike, > I read an HTML document from a third-party site. It is supposed to be > in UTF-8, but unfortunately from time to time it's not. There will be host of more lightweight solutions, but you can opt to sanizite incominhg HTML with HTML Tidy (python binding available). It will replace inval

hospedagem de sites - planos de hospedagem - hospedagem 41677

2005-03-27 Thread hospedagem de site hospedagem de sites
Tudo sobre hospedagem de sites , planos profissionais , economicos e muitos outros , sua empresa na internet por apenas 2,99 ao mês! http://www.hosting4u.com.br hospedagem hospedagem hospedagem hospedagem hospedagem hospedagem hospedagem hospedagem hospedagem hospedagem

Please help with Threading

2013-05-18 Thread Jurgens de Bruin
This is my first script where I want to use the python threading module. I have a large dataset which is a list of dict this can be as much as 200 dictionaries in the list. The final goal is a histogram for each dict 16 histograms on a page ( 4x4 ) - this already works. What I currently do is

Re: Please help with Threading

2013-05-18 Thread Jurgens de Bruin
I will post code - the entire scripts is 1000 lines of code - can I post the threading functions only? -- http://mail.python.org/mailman/listinfo/python-list

Re: Future standard GUI library

2013-05-19 Thread Vito De Tullio
Terry Jan Reedy wrote: >> Do you think tkinter is going to be the standard python built-in gui >> solution as long as python exists? > > AT the moment, there is nothing really comparable that is a realistic > candidate to replace tkinter. FLTK? (http://www.fltk.org/index.php) -- ZeD -- http:

Re: serialize a class to XML and back

2013-05-26 Thread Irmen de Jong
On 26-5-2013 22:48, Roy Smith wrote: > The advantage of pickle over json is that pickle can serialize many > types of objects that json can't. The other side of the coin is that > pickle is python-specific, so if you think you'll ever need to read your > data from other languages, pickle is ri

Re: Short-circuit Logic

2013-05-26 Thread Vito De Tullio
Cameron Simpson wrote: > if s is not None and len(s) > 0: > ... do something with the non-empty string `s` ... > > In this example, None is a sentinel value for "no valid string" and > calling "len(s)" would raise an exception because None doesn't have > a length. obviously in this case an

Re: Python error codes and messages location

2013-05-27 Thread Vito De Tullio
Fábio Santos wrote: >> This should make life easier for us > http://docs.python.org/3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy > > Speaking of PEPs and exceptions. When do we get localized exceptions? What do you mean by "localized exceptions"? Please, tell me it's

Re: serialize a class to XML and back

2013-05-27 Thread Irmen de Jong
On 27-5-2013 2:39, Roy Smith wrote: > In article <51a28f42$0$15870$e4fe5...@news.xs4all.nl>, > Irmen de Jong wrote: > >> On 26-5-2013 22:48, Roy Smith wrote: >> >>> The advantage of pickle over json is that pickle can serialize many >>> types of ob

Re: Python error codes and messages location

2013-05-27 Thread Vito De Tullio
Fábio Santos wrote: >> > > Speaking of PEPs and exceptions. When do we get localized exceptions? >> > >> > What do you mean by "localized exceptions"? >> > >> > Please, tell me it's *NOT* a proposal to send the exception message in >> > the >> > locale language! >> It is. I think I read it mention

Re: Please help with Threading

2013-06-02 Thread Jurgens de Bruin
On Saturday, 18 May 2013 10:58:13 UTC+2, Jurgens de Bruin wrote: > This is my first script where I want to use the python threading module. I > have a large dataset which is a list of dict this can be as much as 200 > dictionaries in the list. The final goal is a histogram for eac

Re: Pillow lib for x86_64 GNU/Linux

2013-06-03 Thread Irmen de Jong
On 3-6-2013 18:23, consult...@gmail.com wrote: > It is great that Pillow wants to be "setuptools compatible" but without a > suitable compiled library for x86_64 GNU/Linux, I am stuck between a rock and > a hard place. > > Any suggestions? > Try your distribution's package repository. $ sudo

Re: PyWart: The problem with "print"

2013-06-03 Thread Vito De Tullio
Rick Johnson wrote: > Take your > standard yes/no/cancel dialog, i would expect it to return > True|False|None respectively, you clearly mean True / False / FileNotFound. ( http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx ) -- ZeD -- http://mail.python.org/mailman/listinfo/python-lis

problem uploading docs to pypi

2013-06-14 Thread Irmen de Jong
Hi, I'm experiencing some trouble when trying to upload the documentation for one of my projects on Pypi. I'm getting a Bad Gateway http error message. Anyone else experiencing this? Is this an intermittent issue or is there a problem with Pypi? Downloading documentation (from pythonhosted.org)

Re: problem uploading docs to pypi

2013-06-15 Thread Irmen de Jong
On 15-6-2013 2:23, MRAB wrote: > About 10 ten days ago I got the error: > > Upload failed (503): backend write error > > while trying to upload to PyPI, and it failed the same way the second time, > but worked some > time later. You're right. I tried it again just now and it succeeded this

Re: Using Python to automatically boot my computer at a specific time and play a podcast

2013-06-17 Thread Irmen de Jong
On 17-6-2013 15:24, inq1ltd wrote: > On Sunday, June 16, 2013 12:06:08 PM C. N. Desrosiers wrote: > >> Hi, > >> > >> I'm planning to buy a Macbook Air and I want to use it as a sort of alarm. >> I'd like to write a program that boots my computer at a specific time, >> loads iTunes, and starts pl

Re: Looking for a name for a deployment framework...

2013-06-24 Thread Irmen de Jong
On 24-6-2013 20:13, Cousin Stanley wrote: > jonathan.slend...@gmail.com wrote: > >> Any suggestions for a good name, >> for a framework that does >> automatic server deployments ? > > asdf : automatic server deployment framework > > :-) wsad: wonderful serverside automatic deployments

Re: class factory question

2013-06-27 Thread Irmen de Jong
On 27-6-2013 15:48, Dave Angel wrote: >> The behavior for these is all the same so they're subclassed >> from one base class, but they need to have these particular names so the >> parser knows >> how to consume them when encountered in the source file. That is, for every >> custom >> command t

Re: math functions with non numeric args

2013-06-30 Thread Irmen de Jong
On 30-6-2013 20:46, Andrew Z wrote: > Hello, > > print max(-10, 10) > 10 > print max('-10', 10) > -10 > > My guess max converts string to number bye decoding each of the characters to > it's ASCII > equivalent? > > Where can i read more on exactly how the situations like these are dealt with? >

Re: socket data sending problem

2013-07-03 Thread Irmen de Jong
On 4-7-2013 0:38, ollietemple...@aol.com wrote: > it all works fine, except for when i try to use: > > s.send("hello") > > to send data between the client and server, i just get this error message: > > >>> > Traceback (most recent call last): > File "C:/Users/Ollie/Documents/code/cha

Re: How to check for threads being finished?

2013-07-05 Thread Irmen de Jong
On 5-7-2013 18:59, Steven D'Aprano wrote: > I then block until the threads are all done: > > while any(t.isAlive() for t in threads): > pass > > > Is that the right way to wait for the threads to be done? Should I stick > a call to time.sleep() inside the while loop? If so, how long should

Re: Python - remote object protocols and security

2013-07-15 Thread Irmen de Jong
ible), and put > limits on size > per transaction, and transactions per minute per legitimate user. Pyro doesn't provide anything by itself to protect against this. Cheers Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: Python - remote object protocols and security

2013-07-15 Thread Irmen de Jong
On 15-7-2013 18:57, Irmen de Jong wrote: >> Note that DOS attacks are possible whatever encoding scheme you have. Make >> sure that >> self-references within the data are well-defined (or impossible), and put >> limits on size >> per transaction, and transactions

a little more explicative error message?

2013-07-15 Thread Vito De Tullio
Hi I was writing a decorator and lost half an hour for a stupid bug in my code, but honestly the error the python interpreter returned to me doesn't helped... $ python3 Python 3.3.0 (default, Feb 24 2013, 09:34:27) [GCC 4.7.2] on linux Type "help", "copyright", "credits" or "license" for more i

Re: Is it that easy to install Python ?

2013-07-25 Thread Irmen de Jong
On 25-7-2013 17:11, santiago.d...@caoba.fr wrote: > Hi there, > > I never write any Python program but as a system administrator, I'm often > asked to install python on Debian servers. > > I just finished downloading, configuring, making and installing. > > The binary is now installed in : > /u

Re: Thread is somehow interfering with a while loop called after the thread is started

2013-07-28 Thread Irmen de Jong
On 28-7-2013 4:29, dan.h.mciner...@gmail.com wrote: > I have a simple scapy + nfqueue dns spoofing script that I want to turn into > a thread within a larger program: > > http://www.bpaste.net/show/HrlfvmUBDA3rjPQdLmdp/ > > Below is my attempt to thread the program above. Somehow, the only way t

Re: PEP8 79 char max

2013-07-30 Thread Vito De Tullio
Ed Leafe wrote: > I had read about a developer who switched to using proportional fonts for > coding, and somewhat skeptically, tried it out. After a day or so it > stopped looking strange, and after a week it seemed so much easier to > read. By my (limited) experience with proportional fonts, th

Re: PEP8 79 char max

2013-07-30 Thread Vito De Tullio
Joshua Landau wrote: >> By my (limited) experience with proportional fonts, they can be useful >> only with something like elastic tabstops[0]. But, as a general rule, I >> simply found more "squared" to just use a fixed-width font. > Not if you give up on the whole "aligning" thing. and this i

Re: splitting numpy array unevenly

2012-09-17 Thread Martin De Kauwe
On Tuesday, September 18, 2012 8:31:09 AM UTC+10, Wanderer wrote: > I need to divide a 512x512 image array with the first horizontal and vertical > division 49 pixels in. Then every 59 pixels in after that. hsplit and vsplit > want to start at the edges and create a bunch of same size arrays. Is

Re: setup.py Choosing Older Compiler On Windows

2012-12-02 Thread Irmen de Jong
On 2-12-2012 22:06, Dave Angel wrote: > On 12/02/2012 09:34 AM, Ami Tavory wrote: >> Hello, >> >> I'm porting a C++ extension module to a Windows machine that has both VC8 >> and VC10 installed. Unfortunately, `setup.py build` tries to build using >> VC8, which fails (the extension uses C++ sta

Re: Installing packages on Mac OS X 10.7.5

2012-12-05 Thread Irmen de Jong
On 6-12-2012 0:12, John Dildy wrote: > Hello Everyone! > > I have python v2.7.1 and I am trying to install packages on the Mac OS X > v10.7.5 > > I am trying to install: > > Distribute > > Nose > > virtualenv > > If anyone can help me that would be great > > John Dildy > > jdild...@gmail.c

Re: How to list a file which already created a 2 mins ago

2012-12-06 Thread Irmen de Jong
On 6-12-2012 17:49, moonhkt wrote: > Hi All > > AIX.5.3 > Python 2.6.2 > > File ftp to Machine A, need to rename then send to Machine B. > > How to list a file which already created a 2 mins ago ? If file aging > more than 2 mins. I want to rename file to other file name. > > moonhkt > ftpli

wrong ImportError message printed by python3.3 when it can't find a module?

2012-12-07 Thread Irmen de Jong
<--- ok. (this is on windows, but on osx I see the same behavior). Is there a problem with the rewritten import logic in Python 3.3? Thanks Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: wrong ImportError message printed by python3.3 when it can't find a module?

2012-12-07 Thread Irmen de Jong
On 7-12-2012 22:20, Peter Otten wrote: > A paragon of clarity -- ye lurkers, this is how a bug report should be. :-) > >> Is there a problem with the rewritten import logic in Python 3.3? >> >> Thanks >> Irmen de Jong > > I believe this is fixed, see htt

need some help with unexpected signal exception when using input from a thread (Pypy 1.9.0 on osx/linux)

2012-12-15 Thread Irmen de Jong
27;t figured out yet what the additional factors are that trigger this problem. A simple import readline and input() from a new thread doesn't seem to trigger it, unfortunately) Regards Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: Command Line Progress Bar

2012-12-26 Thread Irmen de Jong
On 26-12-2012 7:17, Kevin Anthony wrote: > Hello, > I'm writing a file processing script(Linux), and i would like to have a > progress bar. > But i would also like to be able to print messages. Is there a simple way > of doing > this without implementing something like ncurses? This little li

Re: Inserting Unicode chars in Entry widget

2012-12-29 Thread Irmen de Jong
On 29-12-2012 17:43, Alan Graham wrote: > Hello Python experts, > > I want to insert Unicode chars in an Entry widget by pushing on buttons; > one for each Unicode character I need. I have made the Unicode buttons. > I just need a simple function that will send the Unicode character to > the Entry

Re: Inserting Unicode chars in Entry widget

2012-12-29 Thread Irmen de Jong
On 29-12-2012 18:23, Chris Angelico wrote: > On Sun, Dec 30, 2012 at 4:11 AM, Irmen de Jong wrote: >> b1=Button(f, text='char1', command=lambda b=1: insert_char(b)) >> b2=Button(f, text='char2', command=lambda b=2: insert_char(b)) >> ...etc..

Re: Beginner: Trying to get REAL NUMBERS from %d command

2012-12-30 Thread Irmen de Jong
On 30-12-2012 23:37, Alvaro Lacerda wrote: > > I'm trying to get full number result using the %d command Try %f instead. %d is the formatting symbol for integer numbers. See http://docs.python.org/2/library/stdtypes.html#string-formatting-operations Or have a look at what string.format() can do:

Re: test failed: test_urlwithfrag

2013-01-07 Thread Irmen de Jong
On 7-1-2013 19:26, Elli Lola wrote: > I never used python before and installed it today the first time, so I have > no idea what > to do about this failure: > > > $ ./python -m test -v test_urlwithfrag [..snip..] > ImportError: No module named 'test.test_urlwithfrag' > > 1 test failed: >

Re: Safely add a key to a dict only if it does not already exist?

2013-01-18 Thread Vito De Tullio
Steven D'Aprano wrote: > I wish to add a key to a dict only if it doesn't already exist, but do it > in a thread-safe manner. > > The naive code is: > > if key not in dict: > dict[key] = value > > > but of course there is a race condition there: it is possible that > another thread may hav

Re: Safely add a key to a dict only if it does not already exist?

2013-01-18 Thread Vito De Tullio
Chris Rebert wrote: >> How can I add a key in a thread-safe manner? > I'm not entirely sure, but have you investigated dict.setdefault() ? but how setdefault makes sense in this context? It's used to set a default value when you try to retrieve an element from the dict, not when you try to set

Re: Safely add a key to a dict only if it does not already exist?

2013-01-19 Thread Vito De Tullio
Peter Otten wrote: How can I add a key in a thread-safe manner? >>> I'm not entirely sure, but have you investigated dict.setdefault() ? >> >> but how setdefault makes sense in this context? It's used to set a >> default value when you try to retrieve an element from the dict, not when >> yo

Re: Safely add a key to a dict only if it does not already exist?

2013-01-19 Thread Vito De Tullio
Peter Otten wrote: uhhmm.. I think I misread the example d = {} d.setdefault(1, 2) > 2 d > {1: 2} d.setdefault(1, 3) > 2 d > {1: 2} yeah, sure it can be useful for the OP... -- ZeD -- http://mail.python.org/mailman/listinfo/python-list

Re: Thorough Python 2.7.3 Windows Build Documentation?

2013-01-21 Thread Irmen de Jong
On 21-1-2013 18:16, Stephane Wirtel wrote: > Hi Leonard, > > Please, could you limit your text to 80 columns, because it's > unreadable. Your text is too long :( Stephane, shouldn't your news reader simply wrap the lines...? At least mine does. (Thunderbird) Irmen -- http://mail.python.org/ma

serpent, a serializer based around ast.literal_eval

2013-01-21 Thread Irmen de Jong
i: http://pypi.python.org/pypi/serpent A simple example session can be seen here: https://gist.github.com/4588429 I'm considering writing Java and .NET counterparts for this as well so I'll be able to exchange messages between the three. What do you think? Would you consider this us

Re: Increase value in hash table

2013-01-24 Thread Vito De Tullio
moonhkt wrote: > Data file > V1 > V2 > V3 > V4 > V4 > V3 > > How to using count number of data ? > > Output > V1 = 1 > V2 = 1 > V3 =2 > V4 = 2 import collections with open(data_file) as f: print(collections.Counter(f.readlines())) it's a start -- ZeD -- http://mail.python.org/mai

Re: Retrieving an object from a set

2013-01-25 Thread Vito De Tullio
MRAB wrote: > It turns out that both S & {x} and {x} & S return {x}, not {y}. curious. $ python Python 2.7.3 (default, Jul 3 2012, 19:58:39) [GCC 4.7.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> x = (1,2,3) >>> y = (1,2,3) >>> s = set([y]) >>> (s & se

Re: Comparing offset-aware and offset-naive datetimes?

2013-01-26 Thread Vito De Tullio
Roy Smith wrote: > I have two datetimes. One is offset-naive. The other is offset-aware, > but I happen to know its offset is 0 (i.e. GMT). How can I compare > these? http://pytz.sourceforge.net/#localized-times-and-date-arithmetic -- ZeD -- http://mail.python.org/mailman/listinfo/python-l

Re: Finding MIME type for a data stream

2012-03-08 Thread Irmen de Jong
On 8-3-2012 23:34, Tobiah wrote: > Also, I realize that I could write the data to a file > and then use one of the modules that want a file path. > I would prefer not to do that. > > Thanks > Use StringIO then, instead of a file on disk Irmen -- http://mail.python.org/mailman/listinfo/python-

Re: Raise X or Raise X()?

2012-03-11 Thread Irmen de Jong
On 11-3-2012 20:04, bvdp wrote: > Which is preferred in a raise: X or X()? I've seen both. In my specific case > I'm dumping out of a deep loop: > > try: > for ... > for ... > for ... > if match: >raise StopInteration() > else ... > > except StopInteratio

Re: Will MySQL ever be supported for Python 3.x?

2012-03-30 Thread Irmen de Jong
On 30-3-2012 23:20, John Nagle wrote: > The MySQLdb entry on SourceForge > (http://sourceforge.net/projects/mysql-python/) > web site still says the last supported version of Python is 2.6. > PyPi says the last supported version is Python 2.5. The > last download is from 2007. > > I reali

Re: Will MySQL ever be supported for Python 3.x?

2012-03-30 Thread Irmen de Jong
On 30-3-2012 23:46, John Nagle wrote: > On 3/30/2012 2:32 PM, Irmen de Jong wrote: >> Try Oursql instead http://packages.python.org/oursql/ >> "oursql is a new set of MySQL bindings for python 2.4+, including python 3.x" > >Not even close to being compatible

Re: Installing Python 2.5.2 on Win 7

2012-04-01 Thread Irmen de Jong
On 1-4-2012 22:11, W. eWatson wrote: > To solve this problem I thought I would install the software on my laptop > Win7 PC. When > I tried PIL.1.1.6 I got several unexpected messages that seem to indicate > things were > not going well. I have stopped to find out if it is really possible to > in

Re: ast.parse

2012-04-09 Thread Irmen de Jong
On 9-4-2012 13:53, Kiuhnm wrote: > Is it a known fact that ast.parse doesn't handle line continuations and some > multi-line > expressions? > For instance, he doesn't like > for (x, > y) in each([1, > 2]): > print(1) > at all. > Is there a workaround besid

Re: Suggest design to accomodate non-unix platforms ?

2012-04-18 Thread Irmen de Jong
On 18-4-2012 15:35, Richard Shea wrote: > ... which I think would work and be sufficiently flexible to deal with > alternatives to putty.exe but is there a more established (... > better !) way of doing this stuff ? Perhaps install Cygwin and use its ssh.exe? Or use the paramiko library? (which, I

Re: Create directories and modify files with Python

2012-04-30 Thread Irmen de Jong
On 1-5-2012 1:24, deltaquat...@gmail.com wrote: > Hi, 0 I would like to automate some simple tasks I'm doing by hand. Given a > text file > foobar.fo: [...] > At first, I tried to write a bash script to do this. However, when and if the > script > will work, I'll probably want to add more feat

Re: Create directories and modify files with Python

2012-05-01 Thread Irmen de Jong
On 1-5-2012 12:51, deltaquat...@gmail.com wrote: But if you really want to go this way (and hey, why not) then first you'll have to learn some basic Python. A good resource for this might be: http://learnpythonthehardway.org/ Ehm...name's not exactly inspiring for a newbie who's short on time :

Re: How to compute a delta: the difference between lists of strings

2012-05-05 Thread Vito De Tullio
J. Mwebaze wrote: > This is out of curiosity, i know this can be done with python diffllib > module, but been figuring out how to compute the delta, Consider two lists > below. > > s1 = ['e', 'f', 'g', 'A', 'B', 'C', 'D', 'C'] > s2 =['e', 'A', 'B', 'f', 'g', 'C', 'D', 'z'] > > This is the result

Re: .py to .pyc

2012-05-13 Thread Irmen de Jong
On 13-5-2012 23:27, Colin J. Williams wrote: > Is there some way to ensure that a .pyc file is produced when executing a .py > file? > > It seems that for small files the .pyc file is not produced. > > Colin W. All modules no matter how small produce a .pyc file *when they are imported*. If yo

Re: GUI toolkits and dynamic table browser widget

2012-05-18 Thread Vito De Tullio
Simon Cropper wrote: >>> I would like to create windows with grids (AKA rows and column of a >>> table like excel). Do any of the GUI interfaces have these types of >>> widgets? i have looked but can't find any and I have not stumbled on >>> program that presents data in this way so I can see how

Re: installing 2 and 3 alongside on MS Windows

2012-05-26 Thread Irmen de Jong
On 25-5-2012 10:24, Ulrich Eckhardt wrote: > Hi! > What I'm considering is installing Python 3 alongside, in order to > prepare the code for this newer version. What I'd like to know first is > whether there are any problems I'm likely to encounter and possible > workarounds. What I'm doing mysel

Re: Install lxml package on Windows 7

2012-05-29 Thread Irmen de Jong
On 29-5-2012 22:41, David Fanning wrote: > Folks, > > I need some help. I need the lxml package to run a particular > Python program. > >http://lxml.de/ > > I downloaded the appropriate binary egg package for lxml, and > I found easy_install.exe in my Python 2.7 distribution. I ran > that.

Re: ./configure

2012-06-04 Thread Irmen de Jong
On 4-6-2012 0:01, Janet Heath wrote: > > Thanks Alain. I should have a compiler on my Mac OS X Lion. I am thinking > that it > isn't set in my $PATH variable. I don't know where the $PATH is set at. I > will > check to see if their is a binary. You'll have to have the Apple Developer tool

PIL for the Python 3.2.3

2012-06-15 Thread Gonzalo de Soto
Dear Python Org, It wanted to know if already PIL's version is available for Python 3.2.3. Thanks. Gonzalo -- http://mail.python.org/mailman/listinfo/python-list

Re: Function call arguments in stack trace?

2011-06-07 Thread Irmen de Jong
.python.org/pypi/Pyro4/ or the file directly from subversion: $ svn export svn://svn.razorvine.net/Pyro/Pyro4/trunk/src/Pyro4/util.py Perhaps you can use this or adapt it to suit your needs. Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: To install lxml (and easy_install) for Python 3 under Windows...

2011-06-12 Thread Irmen de Jong
On 12-6-2011 18:38, ncdave4l...@mailinator.com wrote: > I had difficulty installing lxml for Python 3.1 under Windows, and > took some notes as I worked through it. Here's how I finally managed > it... > > [...] In cases like this, Christoph Gohlke's page with 'Unofficial Windows Binaries for

Infinite recursion in __reduce__ when calling original base class reduce, why?

2011-06-13 Thread Irmen de Jong
don't know why. It works fine in CPython and Pypy. I wonder if my understanding of __reduce__ is wrong, or that I've hit a bug in IronPython and Jython? Do I need to do something with __reduce_ex__ as well? Any help is very much appreciated. Irmen de Jong # ironpython / jython __redu

Re: working with raw image files

2011-06-14 Thread Martin De Kauwe
what is a .raw file, do you mean a flat binary? -- http://mail.python.org/mailman/listinfo/python-list

Re: Infinite recursion in __reduce__ when calling original base class reduce, why?

2011-06-14 Thread Irmen de Jong
On 14-6-2011 2:40, Chris Torek wrote: > > Nonetheless, there is something at least slightly suspicious here: [... snip explanations...] Many thanks Chris, for the extensive reply. There's some useful knowledge in it. My idea to call the base class reduce as the default fallback causes the prob

Re: debugging https connections with urllib2?

2011-06-18 Thread Irmen de Jong
On 18-6-2011 20:57, Roy Smith wrote: > We've got a REST call that we're making to a service provider over https > using urllib2.urlopen(). Is there any way to see exactly what's getting > sent and received over the network (i.e. all the HTTP headers) in plain > text? Things like tcpdump and st

Re: Best way to insert sorted in a list

2011-06-19 Thread Vito De Tullio
SherjilOzair wrote: > There are basically two ways to go about this. [...] > What has the community to say about this ? What is the best (fastest) > way to insert sorted in a list ? a third way maybe using a SkipList instead of a list on http://infohost.nmt.edu/tcc/help/lang/python/examples/py

Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-21 Thread Irmen de Jong
On 21-06-11 21:48, John Salerno wrote: I'm working on the Project Euler exercises and I'm stumped on problem 3: "What is the largest prime factor of the number 600851475143 ?" Now, I've actually written functions to get a list of the factors of any given number, and then another function to get

  1   2   3   4   5   6   7   8   9   10   >