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: 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: 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

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

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: 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: 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: 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: .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: 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

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: 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: 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

sorry, possibly too much info. was: 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 22:10, Irmen de Jong wrote: [stuff] I didn't read the last paragraph of John's message until just now, and now realize that what I wrote is likely way too much information for what he asked. I'm sorry. Next time I'll read everything until and including the last

Re: sorry, possibly too much info. was: 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-6-2011 23:09, John Salerno wrote: > On Jun 21, 3:22 pm, Irmen de Jong wrote: >> On 21-06-11 22:10, Irmen de Jong wrote: >> [stuff] >> >> I didn't read the last paragraph of John's message until just now, and >> now realize that what I wrote is lik

Re: Security test of embedded Python

2011-06-22 Thread Irmen de Jong
On 22-6-2011 4:44, Chris Angelico wrote: > Followup: The test box has been administratively taken offline after > about an hour of testing. Thank you to everyone who participated; it > seems we have a lot of changes to make! > > Monty failed the test. But it was an incredibly successful test. And

Re: sorry, possibly too much info. was: Re: How can I speed up a script that iterates over a large range (600 billion)?

2011-06-22 Thread Irmen de Jong
On 22-6-2011 5:02, John Salerno wrote: > Thanks. So far they are helping me with Python too, but definitely not > as much as more general exercises would, I'm sure. The part about > writing the code is fun, but once that's done, I seem to end up stuck > with an inefficient implementation because I

Re: windows 7 create directory with read write execute permission for everybody

2011-06-26 Thread Irmen de Jong
On 26-6-2011 22:57, Gelonida wrote: > Hi, > > What do I have to do under python windows to create a directory with all > permissions, > such, that new files / directories created below will inherit the permissions. > > > The reason I am asking is, that I'd like to create a directory structure

Re: windows 7 create directory with read write execute permission for everybody

2011-06-26 Thread Irmen de Jong
On 26-6-2011 23:53, Gelonida wrote: > > Yep I'm afraid that's the way to go and where I hoped somebody would have a > few tiny > example lines or pointers to the functions in question to be used. Maybe this is a bit of a help: http://timgolden.me.uk/python/win32_how_do_i/add-security-to-a-file.h

Re: Problem!!

2011-07-03 Thread Irmen de Jong
On 4-7-2011 1:41, amir chaouki wrote: > i have written code on linux for parsing text files and it works great > but when i try to run it on windows it goes crazy, do you have any > idea??? No, I misplaced my crystal ball. Irmen P.S. http://www.catb.org/~esr/faqs/smart-questions.html -- http:

Pyrolite - a lightweight interface library to connect java to python

2011-07-16 Thread Irmen de Jong
/svn.razorvine.net/Various/Pyrolite More info on Pyro: http://irmen.home.xs4all.nl/pyro/ Pyrolite is an experiment. You can use Jython+Pyro as well but I was interested in the possibilities of a lightweight client-only library. Please let me know your thoughts about it, and if you decide to use it :

Re: Any suggestion to start more threads at the same time?

2011-07-28 Thread Irmen de Jong
On 28-7-2011 23:07, smith jack wrote: > I start many threads in order to make the work done, when the > concurrent number is set to 300, all thing just works fine, but when > the number is set to 350 or higher, error just comes out? what's wrong > ? the error info is just as follows: failed to st

Re: PIL question. having exactly same font on multiple platforms

2011-08-04 Thread Irmen de Jong
On 4-8-2011 20:54, Gelonida N wrote: > The reason why I want the images to look identical is very simple. > Though the final web server will run on a linux server, I use sometimes > windows for development or as test server. > > For automated tests I would have liked pixel identical images. > th

Re: PIL question. having exactly same font on multiple platforms

2011-08-04 Thread Irmen de Jong
On 4-8-2011 21:30, Irmen de Jong wrote: > As far as I know, I did not see any difference in output on windows, linux > and mac os x > as long as the code used the same ttf file and PIL versions. (but I'll double > check now > and see if I remember this correctly). To follo

Re: Table Driven GUI Definition?

2011-08-05 Thread Irmen de Jong
On 05-08-11 19:53, Tim Daneliuk wrote: I have a task where I want to create pretty simple one page visual interfaces (Graphical or Text, but it needs to run across Windows, Cygwin, Linux,*BSD, OSX ...). These interfaces are nothing more than option checklists and text fields. Conceptually somet

Re: Object Diffs

2011-08-09 Thread Irmen de Jong
On 08-08-11 21:50, Croepha wrote: Hello Python list: I am doing research into doing network based propagation of python objects. In order to maintain network efficiency. I wan't to just send the differences of python objects, I was wondering if there was/is any other research or development in

Re: SocketServer expceion after upgrading to 2.7

2011-08-10 Thread Irmen de Jong
On 10-08-11 15:42, Laszlo Nagy wrote: Exception happened during processing of request from ('80.99.165.122', 56069) Traceback (most recent call last): File "/usr/local/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock self.process_request(request, client_address) File "/usr/loc

Re: Dialog boxes in curses

2011-08-13 Thread Irmen de Jong
On 13-8-2011 17:21, f...@slick.airforce-one.org wrote: > Hello. > > I've googled for hints but I didn't find anything, I hope it's not an > RTFM question :^) > > I want to have dialog boxes (a message with Yes/No/Cancel options, > possibly with keyboard accels) in python + curses. > > Does anyon

Re: Ten rules to becoming a Python community member.

2011-08-14 Thread Irmen de Jong
On 14-8-2011 7:57, rantingrick wrote: > 8. Use "e.g." as many times as you can! (e.g. e.g.) If you use "e.g." > more than ten times in a single post, you will get an invite to > Guido's next birthday party; where you'll be forced to do shots whist > walking the balcony railing wearing wooden shoes!

Re: pythonw.exe

2011-08-14 Thread Irmen de Jong
On 14-8-2011 15:23, Ronald Reynolds wrote: > Dear Python Friends: > in my python directory there is a python.exe file which I understand > completely but there is also a pythonw.exe DOS seems to honor the pythonw > command (No error message) but nothing happens. What is pythonw.exe? > Also is ther

Re: Idea for pure-python templates using AST.

2011-08-16 Thread Irmen de Jong
On 16-08-11 13:33, Paul Wray wrote: The idea: Python syntax allows a statement to be a bare literal or identifier. These have no effect on the program. So the function below is legal python: def myFunc(): 'a' x = 45 'b'; 'c'; x So is this (within the appropriate class context of course): def

Re: Python Windows Extensions for Mac

2011-08-21 Thread Irmen de Jong
On 21-8-2011 1:51, Johnny Venter wrote: > Thank you all for the replies. I would like to query various Windows' objects > and > resources from Mac and/or Linux such as Active Directory users, network > shares, group > members, etc... What module or methods can I use with python to accomplish > t

Re: relative speed of incremention syntaxes (or "i=i+1" VS "i+=1")

2011-08-21 Thread Irmen de Jong
On 21-08-11 19:03, Laurent wrote: Well I agree with you about string concatenation, but here I'm talking about integers incrementation... Seems the two forms are not 100% identical: >>> import dis >>> def f1(x): ... x=x+1 ... >>> def f2(x): ... x+=1 ... >>> >>> dis.dis(f1) 2 0 L

Re: Pickle a list

2011-03-08 Thread Irmen de Jong
ans that when you read the pickle back in, the new object won't have the 1,2,3,4,5 numbers in the lista list, instead it just has the initial list. You probably want to initialize self.alist in the class's __init__ method instead. That way it is a normal object attribute and will get pickled normally. Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: Do you monitor your Python packages in inux distributions?

2011-03-12 Thread Irmen de Jong
stro that includes a Pyro package. I found out about Debian/Ubuntu by googling. All in all probably not a very helpful example but I thought I'd share my experience. Cheers Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: How to schedule execution of code?

2011-03-15 Thread Irmen de Jong
On 15-03-11 08:16, Virgil Stokes wrote: Suppose that I have some Python code (vers. 2.6) that has been converted into an *.exe file and can be executed on a Windows (Vista or 7) platform. What can one do to have this *.exe executed at a set of specific times each day? In addition, if a day is mis

Re: What breaks if I remove lib/python2.7/test/* ?

2011-04-19 Thread Irmen de Jong
On 19-4-2011 19:06, cjblaine wrote: > What breaks if I remove lib/python2.7/test/* ? What purpose does it serve? > > It is 26MB for me. > > I am trying to trim my Python install for good reason. > > Thanks for any info! Terry answered what it is for. Personally, I also once used some functions

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Irmen de Jong
On 20-4-2011 0:21, Grant Edwards wrote: > I'm have problems figuring out how to receive UDP broadcast packets on > Linux. > [...] > Here's the sending code: > > send.py--- > #!/usr/bin/python > import sys,socket,time > > host = sys.arg

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Irmen de Jong
On 20-4-2011 1:21, Grant Edwards wrote: > > If I don't call bind(), then the broadcast packets go out the wrong > interface on the sending machine. > Fair enough. Next issue then: as far as I know, broadcast packets are by default not routed across subnets by gateways. Which is a good thing.

Re: Remote Connection

2011-04-21 Thread Irmen de Jong
On 20-04-11 05:26, ray wrote: The speech commands will scripted in Python. Dragonfly is the Python project to coordinate this but does not address connectivity. So I am wondering if there have been any Python projects to address the connectivity. ray I'm not quite sure what you want exactly

Re: suggestions, comments on an "is_subdict" test

2011-04-22 Thread Irmen de Jong
On 22-4-2011 15:55, Vlastimil Brom wrote: > Hi all, > I'd like to ask for comments or advice on a simple code for testing a > "subdict", i.e. check whether all items of a given dictionary are > present in a reference dictionary. > Sofar I have: > > def is_subdict(test_dct, base_dct): > """Test

Re: windows 7 x64 shutdown

2011-04-25 Thread Irmen de Jong
On 25-4-2011 23:15, rjmccorkle wrote: > does anyone know a solution to shutting down windows 7 x64 via python > script? the win32 obviously doesn't work... something similar? http://goo.gl/5tVPj (a recipe on activestate, First hit on Google for 'python ctypes shutdown') Works fine on my win7 x64

Re: Have you read the Python docs lately?

2011-04-27 Thread Irmen de Jong
On 27-4-2011 19:56, Raymond Hettinger wrote: > A number of developers have been working on adding examples and useful > advice to the docs. To sharpen your skills, here are some pieces of > recommended reading: > > http://docs.python.org/dev/library/heapq.html#priority-queue-implementation-notes

Re: Today's fun and educational Python recipe

2011-05-04 Thread Irmen de Jong
On 04-05-11 20:17, Raymond Hettinger wrote: Here's a 22-line beauty for a classic and amazing algorithm: http://bit.ly/bloom_filter The wiki article on the algorithm is brief and well-written: http://en.wikipedia.org/wiki/Bloom_filter It turns out that people in the 1970's were pretty smart :-)

Re: Today's fun and educational Python recipe

2011-05-04 Thread Irmen de Jong
On 04-05-11 21:13, Raymond Hettinger wrote: It turns out that people in the 1970's were pretty smart :-) I think that often, the cleverness of people is inversely proportional to the amount of CPU power and RAM that they have in their computer. The Google guys have plenty of CPU power *and* p

Re: PIL: The _imaging C module is not installed

2011-05-06 Thread Irmen de Jong
On 06-05-11 15:56, Nico Grubert wrote: However, running the selftest still fails: $ python selftest.py *** The _imaging C module is not installed I had this happening to me as well someday. I recall that first installing it (python setup.py install), and then rerunning selftest, solved that

Re: PIL: The _imaging C module is not installed

2011-05-09 Thread Irmen de Jong
On 9-5-2011 8:22, Nico Grubert wrote: >> I had this happening to me as well someday. >> I recall that first installing it (python setup.py install), and then >> rerunning selftest, solved that error. > > I tried that as well. > Here is the summary of the install process: > > build/temp.linux-x86_

Re: Finding the bitness of an arbitrary executable with Python

2011-05-09 Thread Irmen de Jong
On 9-5-2011 22:52, Andrew Berg wrote: > I need to find whether a given file is 32-bit or 64-bit (and raise an > exception if the file doesn't exist or isn't an executable file). I > thought platform.architecture() would do this, but it returns ('64bit', > '') no matter what value I assign to the ex

experiments with dictionary attacks against password hashes, in Python

2011-05-21 Thread Irmen de Jong
he code I wrote might interest other people as well, so I share it here: (It should run on Python 2.6 and up, including Python 3.x.) Download: http://www.razorvine.net/download/dictionary_attack/ Or by Subversion: svn://svn.razorvine.net/Various/PythonStuff/trunk/dictionaryattack Have fun, Ir

referring to package scope from module, using relative import?

2011-05-21 Thread Irmen de Jong
Hi, I have a package with several modules in it. The package also has some objects created in the package scope (done in the package __init__.py). Is it possible to access those package scope objects from the modules, with relative imports or something? So that I don't have to import the packag

Re: referring to package scope from module, using relative import?

2011-05-21 Thread Irmen de Jong
On 21-5-2011 22:00, Ian Kelly wrote: > Note that PEP 8 discourages relative imports and encourages absolute > imports, though. This would be the preferred way to do it: > > from A import something Right. I got rid of the silly relative import stuff. As an added bonus, this makes my original qu

Re: hash values and equality

2011-05-21 Thread Irmen de Jong
On 22-5-2011 0:55, John Nagle wrote: > On 5/19/2011 11:33 PM, Ulrich Eckhardt wrote: > >> For that reason, it is generally useful to use immutable types like >> integers, floats, strings and tuples thereof as keys. Since you can't change >> them, you basically have the guarantee that they hash the

Re: The worth of comments

2011-05-27 Thread Irmen de Jong
On 27-05-11 15:54, Grant Edwards wrote: On 2011-05-27, Ben Finney wrote: Richard Parker writes: On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote: My experience is that comments in Python are of relatively low usefulness. (For avoidance of doubt: not *zero* usefulness, mere

Re: The worth of comments

2011-05-28 Thread Irmen de Jong
On 27-5-2011 19:53, Grant Edwards wrote: > On 2011-05-27, Irmen de Jong wrote: >> On 27-05-11 15:54, Grant Edwards wrote: >>> On 2011-05-27, Ben Finney wrote: >>>> Richard Parker writes: >>>> >>>>> On May 26, 2011, at 4:28 AM, python-lis

Re: The worth of comments

2011-05-28 Thread Irmen de Jong
of the code (like you wrote above, about documenting interfaces). I always try to avoid writing comments that duplicate the working of the code itself in pseudo code or text phrases. But humans make mistakes and forget things so after enough modifications my code probably contains lies as well... :( Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: The worth of comments

2011-05-28 Thread Irmen de Jong
On 29-5-2011 2:47, Gregory Ewing wrote: > Irmen de Jong wrote: > >> I don't see how that is opposed to what Grant was saying. It's that these >> 'contracts' >> tend to change and that people forget or are too lazy to update the comments >> to r

Re: How to Use Setuptools, Alternatives?

2011-05-29 Thread Irmen de Jong
On 29-5-2011 23:41, ray wrote: > I have Python 2.7 on Win7 Pro on a tightly locked down desktop. I > would like to install Networkx from an egg. From what I have read, > Setuptools can be used for this. What does 'tightly locked down' mean? > I don't know how to install Setuptools. The exe wi

Re: Alternatives to PythonPath

2011-05-29 Thread Irmen de Jong
On 29-5-2011 23:49, ray wrote: > I am using Win7 on a tightly locked down desktop. > > Is there an alternative to using PythonPath? > What do you mean by "using PythonPath"? What doesn't work that you want to have an alternative for? Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: python in school notebooks/laptops

2011-05-30 Thread Irmen de Jong
On 30-5-2011 16:30, jmfauth wrote: > On 30 mai, 13:09, hackingKK wrote: > > [...] > >> >> Even better, try convincing them to use Ubuntu instead of a virus >> called Where I Never Do Operations With Safety, or WINDOWS for short. >> That way Python will come by default and VB will be out of que

Re: wrote a commodore-64 emulator using just Python

2017-09-04 Thread Irmen de Jong
On 08/13/2017 03:50 PM, Irmen de Jong wrote: > Hi, > > As another experiment with using just tkinter for graphics, this time I > created a > Commodore-64 emulator. You can find it here https://github.com/irmen/pyc64 [...] > There's also https://github.com/mnaberez/p

a Boulder Dash clone with retro graphics and sound

2017-09-04 Thread Irmen de Jong
Hi, Yet another continuation of my graphics experiments with tkinter. In the previous project I've been using tkinter bitmaps to simulate a commodore-64 screen where I exploited the possibility to change the foreground and background color of the bitmap on the fly. This conveniently matches the wa

Re: a Boulder Dash clone with retro graphics and sound

2017-09-06 Thread Irmen de Jong
On 05/09/2017 00:02, Irmen de Jong wrote: https://github.com/irmen/bouldercaves > There's just two things missing I think: > - high score table > - being able to play multiple sounds simultaneously, as the amoeba and > magic wall sounds are lacking at the moment. In version 1.

v2.0 released of: a Boulder Dash clone with retro graphics and sound

2017-09-10 Thread Irmen de Jong
On 06/09/2017 23:17, Irmen de Jong wrote: > > https://github.com/irmen/bouldercaves > My Boulder Dash clone is now at version 2.0 because a few important things that were lacking are now implemented: * authentic mode: The game is now displayed in a small screen that scrolls smoothly

Re: Fw: Problems Installing Python36

2017-09-20 Thread Irmen de Jong
On 14/09/2017 05:46, Michael Torrie wrote: > On 09/12/2017 03:05 AM, Thomas Jollans wrote: >> Other people on this list: >> This isn't the first time I've someone with this issue here. It's >> probably putting off plenty of potential new users who don't make as >> much effort to find a solution. I

Re: Fw: Problems Installing Python36

2017-09-22 Thread Irmen de Jong
On 09/22/2017 08:34 PM, Stephan Houben wrote: > I was vaguely tempted to offer the Mingw-w64 (GCC) Python as an > alternative, since it doesn't rely on any optionally-installed Microsoft > DLLs and so avoids this issue. But I suppose that is not really the > newbie-friendly solution the OP was loo

auto installing dependencies with pip to run a python zip application ?

2017-09-26 Thread Irmen de Jong
Hi, I've been using Python's executable zip application feature to neatly package my little game into a single "executable" file. Here "executable" means the user can simply start it by doubleclicking it, or launching it from a shell prompt. Of course the user already has to have a proper Python in

  1   2   3   4   5   6   >