Re: problem with selecting remote procedure calls

2015-07-23 Thread Irmen de Jong
pypi.python.org/pypi/Pyro4 > > Pyro's certainly actively maintained and I've seen its developer, Irmen > de Jong, pop up on this list fairly recently. Hi! > Exactly how good a fit it is would depend on your precise setup. But I > think it's worth exploring.

Re: register cleanup handler

2015-07-24 Thread Irmen de Jong
On 24-7-2015 16:57, Neal Becker wrote: > I have code like: > > if (condition): > do_something_needing_cleanup > > code_executed_unconditionally > > or exception> > > Now, how can I make sure cleanup happens? Actually, what I really would > like, is: > > if (condition): > do_something_ne

Re: Python 3.4 Idle?

2015-07-25 Thread Irmen de Jong
On 25-7-2015 18:00, Steve Burrus wrote: > On Thursday, July 23, 2015 at 8:50:47 PM UTC-5, Steve Burrus wrote: >> On Thursday, July 23, 2015 at 8:41:03 PM UTC-5, Chris Angelico wrote: >>> On Fri, Jul 24, 2015 at 11:34 AM, Steve Burrus >>> wrote: I got Idle the other day biut had to get the ol

Re: Fwd: Request for Information XML-RPC (Python)

2015-07-29 Thread Irmen de Jong
On 29-7-2015 14:52, Davide D'Arenzo wrote: > I want to send a DOM instance through xmlrpc protocol. I know that the > istance are > impossible to manage by xmlrpclib library in Python but this is what I need. > I'm trying > to understand why is not possible to marshal the class Nodelist and I >

Re: using sched

2015-07-30 Thread Irmen de Jong
On 30-7-2015 17:57, Nkansah Rexford wrote: > Using sched, how can I run a function, at for instance, exactly 00:00 GMT, > and only that time. > > If sched wouldn't be the best to do so a job, please can you recommend > something? > The sched module is by itself not really a task scheduler. It

Re: Most Pythonic way to store (small) configuration

2015-08-04 Thread Irmen de Jong
On 4-8-2015 16:53, marco.naw...@colosso.nl wrote: > Why not use Python files itself as configuration files? It could create a security risk if the config files are user-editable. (it will make it easy to inject code into your application) Irmen -- https://mail.python.org/mailman/listinfo/python

Re: Silly question about pip

2015-09-08 Thread Irmen de Jong
On 8-9-2015 17:54, wxjmfa...@gmail.com wrote: > win7 / py433 > > How to downgrade from the latest pip (7.1.2) to > the previous one? > I'm sorry, I do not remember the numerous msgs > I saw when updating. (Yesterday) > > (I'm serious) > > Now, what? > I think: $ pip install --upgrade pip==7.0

Re: win32com.client .Cells

2015-10-09 Thread Irmen de Jong
On 9-10-2015 20:45, gall.pavgal.g...@gmail.com wrote: > Hi Guys, > > i wrote small function : > > Excel = win32com.client.Dispatch("Excel.Application") [...] > com_error: (-2147221008, 'CoInitialize has not been called.', None, None) > > Please, help me! :) > First hit on google when search

Re: object() can't have attributes

2015-12-23 Thread Irmen de Jong
On 23-12-2015 13:58, Chris Angelico wrote: > On Wed, Dec 23, 2015 at 11:46 PM, Neal Becker wrote: >> Sometimes I want to collect attributes on an object. Usually I would make >> an empty class for this. But it seems unnecessarily verbose to do this. So >> I thought, why not just use an Object?

Re: problem

2016-01-14 Thread Irmen de Jong
On 14-1-2016 16:53, Shivam Gupta wrote: > Hello, > > I am using python 3.5.1 on my windows 8.1. The problem is that whenever i > save any file any after that when i run it the screen just close > immediately after i double click on python file. > > Thank you. > That's not a python thing, it's

confusing installation on windows? was: Re:

2016-02-13 Thread Irmen de Jong
On 13-2-2016 2:43, Joel Goldstick wrote: > On Fri, Feb 12, 2016 at 3:16 PM, Manas Soni wrote: > >> >> I have downloaded python and when I click on it, it asks me to repair >> which I do, it then says successful however when I click on it again it >> won’t let me on it >> Sent from Mail for Window

made a simple rhythm sample mixer for fun (think Roland TR-909)

2016-02-13 Thread Irmen de Jong
Hi, For fun and to learn a bit from messing around a little with audio samples, I've created a rhythm sample mixer inspired by the Roland TR-909 drum machine. Basically you write rhythm sample patterns and it then sequences and mixes them into a output wav file or streams it to your speakers. S

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Irmen de Jong
On 30-1-2017 21:33, Joseph L. Casale wrote: >> Python still has my heart, but .NET Core tempts me. One great thing of >> coding in C# would be no GIL. > > Seriously, check out the benchmarks at https://github.com/aspnet/benchmarks. Results vary quite a bit there. For instance take the json serial

Re: What library/package to use for parsing XML?

2017-01-30 Thread Irmen de Jong
On 30-1-2017 18:58, Chris Green wrote: > I want to parse some XML data, it's the address book data from the > linux program osmo. The file I want to parse is like this:- > [snip] > > I basically want to be able to extract the data and output in other > formats - e.g. write to a Sqlite3 databas

Re: WANT: bad code in python (for refactoring example)

2017-02-14 Thread Irmen de Jong
On 14-2-2017 23:44, Makoto Kuwata wrote: > Hi, > > Is there any *just right* python code to refactor? > In other words, I'm finding bad code example in python. > > (background) > I'm teaching Python to some novice programmer, and > want to show refactoring example to them. > > (required) > * not

Re: CSV

2017-02-22 Thread Irmen de Jong
On 22-2-2017 18:26, Braxton Alfred wrote: > Why does this not run? It is right out of the CSV file in the Standard Lib. What does "not run" mean. We can't help if you are not telling us the exact error message you're getting (if any) > filename = 'c:\users\user\my documents\Braxton\Excel\perso

Re: python decorator

2017-02-22 Thread Irmen de Jong
On 22-2-2017 8:39, Argentinian Black ops lll wrote: > Thanks for the quick response...! you saved me a lot of time, thank you! > I don't know if you want/have to use your own custom caching decorator, but are you aware of the lru_cache decorator that's part of the standard library? https://docs

Re: How to create a Python 3.6 traceroute without SOCK RAW?

2017-02-23 Thread Irmen de Jong
On 23-2-2017 22:33, Juan C. wrote: > I need to implement a traceroute inside my script but I can't escalate > privileges. Unix uses UDP for traceroute, but I didn't find any material > regarding UDP traceroute in Python. import os os.system("traceroute www.google.com") -- https://mail.python.

Re: How to create a Python 3.6 traceroute without SOCK RAW?

2017-02-23 Thread Irmen de Jong
On 24-2-2017 0:20, Juan C. wrote: > On Thu, Feb 23, 2017 at 7:42 PM, Irmen de Jong wrote: >> >> import os >> os.system("traceroute www.google.com") > > Indeed, that would work, but it isn't a great approach in my opinion > because I would rely o

Re: Python 3.6 installation doesn't add launcher to PATH

2017-02-24 Thread Irmen de Jong
On 24-2-2017 13:38, ChrisW wrote: > The installation guidelines for Python 3.6 say: > > "Per-user installations of Python do not add the launcher to PATH unless the > option was selected on installation." > (https://docs.python.org/3/using/windows.html#from-the-command-line). > > However, I've

Re: Error installing python on Windows

2017-02-24 Thread Irmen de Jong
On 24-2-2017 12:18, Michelle Tan wrote: > Hello all > > I am new to python. > > Trying to install Python and encountered this error message : "The program > can't start because api-ms-win-crt-runtime-I1-1-0.dll is missing from your > computer." > > Tried to repair and reinstall Python however i

Re: python and databases

2017-03-14 Thread Irmen de Jong
On 14-3-2017 20:59, Xristos Xristoou wrote: > I have a database in microsoft ACCESS with about 150 records.. if I want to > get some > data from this database using a query in python and i want to store in some > variables in python that will do this ? to avoid the 150 if ...: Using the > stand

Re: IOError: [Errno 12] Not enough space

2017-04-11 Thread Irmen de Jong
On 11-4-2017 14:30, LnT wrote: > Hi, > > version information > > python 27 Please be more precise, there is no Python 27. (Yeah it is clear you meant 2.7 but still) > java version "1.8.0_111" That should not be relevant > OS -Win 10 , 64Bit , 8GB RAM , 60GB HD 60 GB is not a lot of space for

Re: IOError: [Errno 12] Not enough space

2017-04-12 Thread Irmen de Jong
On 12-4-2017 7:54, LnT wrote: > > Hi Irmen, > > you may please find full log @ https://pastebin.mozilla.org/9018753 I have no idea what I'm looking at. But my initial response was wrong, see the reply by eryk sun; your error has nothing to do with disk space but rather, a lack of system memory

Re: write arrays to disk

2017-04-16 Thread Irmen de Jong
On 16-4-2017 14:28, jorge.conr...@cptec.inpe.br wrote: > Hi, > > I'm new on Python software. I would like to write on disk arrays in binary or > ascii > format. Can someone please help me? > > Thanks, > > Conrado What kind of data is in the arrays? Who or what will be reading the files? And mo

Re: Install python via MS batch file

2017-05-06 Thread Irmen de Jong
On 6-5-2017 7:14, Mahmood Naderan wrote: > Hello, > I have downloaded python-3.6.1-amd64.exe and it is fine to install it through > GUI. However, I want to write a batch file to install it via command line. > Since the installation process is interactive, it seems that the auto-install > batch f

Re: Out of memory while reading excel file

2017-05-10 Thread Irmen de Jong
On 10-5-2017 17:12, Mahmood Naderan wrote: > So, I think numpy is unable to manage the memory. That assumption is very likely to be incorrect. >> np.array([[i.value for i in j] for j in p.rows]) I think the problem is in the way you feed your excel data into the numpy array constructor. The co

Re: How to install Python package from source on Windows

2017-05-18 Thread Irmen de Jong
On 18-5-2017 3:30, Dennis Lee Bieber wrote: > Late-comer... I'm pretty sure 1.4, if not 1.3 was the version > documented in the first books I bought on the language... > > And I bought because AmigaOS was listed as a viable candidate (thanks > Irmen) -- within a week I had written an o

Re: SSL certificate of a server on Windows

2017-05-23 Thread Irmen de Jong
On 23-5-2017 10:19, COPIN Mathieu. wrote: > Hi, > > I want to get a server certificate from the host-name. > > I know I could do something like : >> call(openssl, s_client, -showcerts, -connect, hostname:port) > > > But the thing is to do it without openssl because I want to run the script on

adding type hints to one of my projects, things learned

2017-05-24 Thread Irmen de Jong
ably will because it now has them everywhere already, but my other projects have to wait. As this is the first and only time so far that I have used type hints, it is very likely that I made some mistakes or missed a better solution to some of the issues I encountered. Please correct

Re: Bug or intended behavior?

2017-06-02 Thread Irmen de Jong
On 2-6-2017 19:17, sean.diza...@gmail.com wrote: > Can someone please explain this to me? Thanks in advance! > > ~Sean > > > Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 12:39:47) > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin > Type "help", "copyright", "credits" or "license" fo

Re: Very Slow Disk Writes when Writing Large Data Blocks

2017-06-02 Thread Irmen de Jong
On 2-6-2017 20:14, remmm wrote: > These write speeds are in the range of 18 to 25 MBytes per second for > spinning disks and about 50 Mbytes/sec for SSDs. Keep in mind these numbers > should be more like 120 MBytes/sec for spinning disks and 300 MBytes/sec for > SSDs. You'll only reach thos

Re: Transitioning from Linux to Windows

2017-06-05 Thread Irmen de Jong
On 3-6-2017 15:44, chitt...@uah.edu wrote: > Ideally, I would like to set up the user on their Windows 7/10 system so that > they can "login" to the ubuntu system (say putty) - change working directory > (to where desired) - run the script (on the ubuntu system) - and scp the file > back to the

Re: Progress on the Gilectomy

2017-06-10 Thread Irmen de Jong
On 10-6-2017 14:54, Steve D'Aprano wrote: > Larry Hastings is working on removing the GIL from CPython: > > https://lwn.net/Articles/723949/ Here is Larry's "How's it going" presentation from Pycon 2017 on this subject https://www.youtube.com/watch?v=pLqv11ScGsQ -irmen -- https://mail.python.o

pythonhosted.org status?

2017-07-02 Thread Irmen de Jong
Hi, I'm using pythonhosted.org to host the docs for various projects but it has either been very slow or unavailable over the past week. Anyone else having the same problems? Should I perhaps consider putting my docs on readthedocs.org instead? Irmen -- https://mail.python.org/mailman/listinfo/

Re: pythonhosted.org status?

2017-07-03 Thread Irmen de Jong
On 02/07/2017 11:27, breamore...@gmail.com wrote: > On Sunday, July 2, 2017 at 10:03:34 AM UTC+1, Irmen de Jong wrote: >> Hi, >> I'm using pythonhosted.org to host the docs for various projects but it has >> either been >> very slow or unavailable over the past w

Re: JSON encoding PDF or Excel files in Python 2.7

2017-07-21 Thread Irmen de Jong
On 21/07/2017 20:52, Skip Montanaro wrote: > I would like to JSON encode some PDF and Excel files. I can read the content: > > pdf = open("somefile.pdf", "rb").read() > > but now what? json.dumps() insists on treating it as a string to be > interpreted as utf-8, and bytes == str in Python 2.x. I

zipapp should not include temporary files?

2017-07-26 Thread Irmen de Jong
Hi, when creating an executable zip file using the zipapp module, it's a little sad to see that no effort is done to filter out obvious temporary files: the resulting zipfile contains any *.pyc/pyo files and other things such as .git, .tox, .tmp folders. The documentation says "zip is created f

Re: Installation Python 3.6.x on Windows using command line installer (without GUI)

2017-07-28 Thread Irmen de Jong
On 27/07/2017 20:55, Andreas Jung wrote: > > I need to installed Python 3.6.x on Windows as part of an automated process > without user-interaction. Recently Python releases provided MSI files for > installation using the "msiexec" utility however there are no more MSI > release files available

Re: zipapp should not include temporary files?

2017-07-28 Thread Irmen de Jong
On 27/07/2017 00:03, Paul Moore wrote: > On Wednesday, 26 July 2017 18:37:15 UTC+1, Irmen de Jong wrote: >> What do you think? Should the zipapp module perhaps be improved to >> automatically skip >> obvious temporary files or perhaps allow to provide a filter function? &g

Re: zipapp should not include temporary files?

2017-07-28 Thread Irmen de Jong
On 28/07/2017 18:36, Irmen de Jong wrote: > On 27/07/2017 00:03, Paul Moore wrote: >> If you want to create a feature request for a filter function on >> bugs.python.org and assign it to me, I'll take a look at it. \ > > > I will do this, thanks in advance. Should

Re: Issues with Python

2017-07-30 Thread Irmen de Jong
On 30/07/2017 23:31, Ode Idoko wrote: > Hi, I am new to Python and though I have been able to download the 3.6 > version on my laptop , I still have issues with the syntax. While writing a > program to execute, it will display syntax error with different shades of > color usually green or yellow

SSL/TLS support in Pyro4

2017-08-03 Thread Irmen de Jong
' SSL certificate for testing purposes. I don't think letsencrypt can help here because it is only for web sites? (and their certs are only valid for a very short period) Cheers Irmen de Jong -- https://mail.python.org/mailman/listinfo/python-list

Re: SSL/TLS support in Pyro4

2017-08-04 Thread Irmen de Jong
On 04/08/2017 10:26, Robin Becker wrote: > On 03/08/2017 19:30, Irmen de Jong wrote: > . >> >> I wonder if any current (or new) users of Pyro4 want to check this out? The >> biggest >> concern I have is that I only have dummy (self-signed) certificates so I

Re: SSL/TLS support in Pyro4

2017-08-04 Thread Irmen de Jong
On 03/08/2017 20:30, Irmen de Jong wrote: > Alternatively, is there a cheap way to get an 'official' SSL certificate for > testing > purposes. I don't think letsencrypt can help here because it is only for web > sites? > (and their certs are only valid for a very

Re: SSL/TLS support in Pyro4

2017-08-04 Thread Irmen de Jong
On 04/08/2017 15:44, Robin Becker wrote: > .. >> >> Hi Robin >> >> I am not sure how this is any benefit over the self-signed root certs that I >> now use? >> >> Except for the fact that these are a root cert as well and don't use any CA >> trust chain. >> To be able to validate this cert

wrote a commodore-64 emulator using just Python

2017-08-13 Thread Irmen de Jong
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 You only need the pillow library to be able to run this. I guess most people have that one already anyway. It works pretty well :) (

Re: wrote a commodore-64 emulator using just Python

2017-08-14 Thread Irmen de Jong
On 08/13/2017 03:50 PM, Irmen de Jong wrote: > Now, it's not a "true" emulator: obviously it doesn't simulate the C64 on a > hardware > level. It does however implement enough to load and run simple basic programs > that can > show interesting PETSCII pict

tkinter keypress events are a mess for numpad keys

2017-08-28 Thread Irmen de Jong
Hi, Using tkinter in python3, I was trying to intercept individual keypresses (and releases) of keys on the numeric keypad. I want to use this as a simple joystick simulation. While you can bind the event, actually doing something sensible with it in a cross platform way seems utterly impossib

Re: tkinter keypress events are a mess for numpad keys

2017-08-29 Thread Irmen de Jong
On 29/08/2017 06:32, Terry Reedy wrote: > *The* documentation (for 8.6) is the tcl.tk/man doc set: > https://www.tcl.tk/man/tcl8.6/TkCmd/contents.htm > For the level of detail you are looking at, they are essential. > > The nmt docs for 8.5 are neither complete (intentionally not) nor always > c

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

ANN: Pyrolite 1.12 - native pickle and Pyro client library for java and .net

2013-08-14 Thread Irmen de Jong
tp://irmen.home.xs4all.nl/pyrolite/ Enjoy, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: log incoming ip/porrt connections

2013-08-17 Thread Irmen de Jong
On 17-8-2013 22:23, D. Xenakis wrote: > Hi there. I have a script-service running on a remote server, listening on a > specific port. What i need here is to make this also maintain a log file of > ALL incoming connections. > > Could someone suggest to me a simple codefunction example to implemen

Re: Python getters and setters

2013-08-17 Thread Irmen de Jong
On 17-8-2013 19:18, Steven D'Aprano wrote: > On Sat, 17 Aug 2013 09:53:07 -0700, Fernando Saldanha wrote: > >> Suppose my class contains an attribute called "data" that can >> potentially provide a lot of information that will be needed by class >> users. I have two options: >> >> 1) For each piec

Re: How to send broadcast IP address to network?

2013-08-24 Thread Irmen de Jong
On 23-8-2013 14:32, lightai...@gmail.com wrote: > I want to send a broadcast packet to all the computers connected to my home > router. > > The following 2 lines of code do not work; > host="192.168.0.102" > s.connect((host, port)) > > Can someone advise? > > Thank you. > Use UDP (datagram)

Re: How to check client shutdown?

2013-08-27 Thread Irmen de Jong
iable, you need to have a means of deciding when the 'full' amount of data has been collected. As Chris already suggested, this is usually done by putting the recv() in a loop and collecting data until it reaches a length that you precisely know beforehand, or by detecting a special end-of-message marker in the data stream, such as a newline. Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: How to check client shutdown?

2013-08-27 Thread Irmen de Jong
On 27-8-2013 22:40, Chris Angelico wrote: > Right. When you use TCP sockets, there's no boundaries, so you could > get two pickles in one recv, or you could get one and a half, or > anything. It depends partly on your buffer sizes and things; if you're > sending very short messages (less than a k

Re: Downloading the feed using feedparser

2013-09-04 Thread Irmen de Jong
On 4-9-2013 13:12, mukesh tiwari wrote: > Hello all, I am trying to download the feed of > http://blogs.forrester.com/feed but I > am stuck with a problem. > import feedparser d = feedparser.parse('http://blogs.forrester.com/feed') d.etag > u'"1378291653-1"' d.modified > 'Wed, 04

Re: Find out where a class is used throughout a program.

2013-09-04 Thread Irmen de Jong
On 4-9-2013 22:08, dieter wrote: > Azureaus writes: >> ... >> is there a way of finding out / visualising where a particular class is >> called/used throughout a program? > > I do not know a simple and reliable way. Not 100% reliable, but arguably easier than reverting to simple text search to

Re: How pickle helps in reading huge files?

2013-10-16 Thread Irmen de Jong
On 16-10-2013 23:04, Peter Cacioppi wrote: > On Tuesday, October 15, 2013 11:55:26 PM UTC-7, Harsh Jha wrote: >> I've a huge csv file and I want to read stuff from it again and again. Is it >> useful >> to pickle it and keep and then unpickle it whenever I need to use that data? >> Is it >> faste

Re: Implementing #define macros similar to C on python

2013-11-15 Thread Irmen de Jong
On 15-11-2013 3:29, JL wrote: > One of my favorite tools in C/C++ language is the preprocessor macros. > > One example is switching certain print messages for debugging use only > > #ifdef DEBUG_ENABLE > DEBUG_PRINT print > #else > DEBUG_PRINT > > Is it possible to implement something similar

Re: Implementing #define macros similar to C on python

2013-11-15 Thread Irmen de Jong
On 16-11-2013 0:36, JL wrote: > Thanks! This is the answer which I am seeking. However, I am not able to get > the following line to work. I am using python 2.7.5 > > debug_print = print > > Can we assign a function into a variable in this manner? Yes, functions are just another object. But 'pr

Re: Getting the Appdata Directory with Python and PEP?

2013-11-26 Thread Irmen de Jong
On 26-11-2013 19:09, Eamonn Rea wrote: > Thanks for the help on PEP, but I can't find a way to get the application > support (appdata on Windows, no idea on Linux). If I do: > > print os.environ['HOME'] > > I get: '/Users/eamonn', as that is my home directory. But when I do: > > print os.enviro

Re: Is it more CPU-efficient to read/write config file or read/write sqlite database?

2013-12-14 Thread Irmen de Jong
On 14-12-2013 16:29, JL wrote: > I have a number of python processes which communicate with each other through > writing/reading config text files. The python ConfigParser is used. I am > wondering if > it is more CPU-efficient to switch to using sqlite database instead of using > configuration fi

Re: Using pythons smtp server

2013-12-14 Thread Irmen de Jong
On 14-12-2013 1:46, Dennis Lee Bieber wrote: > About then, I discovered the first two significant books on Python at > Computer Literacy, and that an Amiga binary was available (Python 1.4, I > think -- thanks, Irmin). You're welcome, but my name is spelled Irmen, with an 'e' ;-) Cheers Ir

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: What replaces log4py under Python 3.2?

2011-11-22 Thread Irmen de Jong
On 22-11-11 19:32, Rob Richardson wrote: Greetings! My company has been using the log4py library for a long time. A co-worker recently installed Python 3.2, and log4py will no longer compile. (OK, I know that's the wrong word, but you know what I mean.) What logging package should be used

Re: getting svn tag in version

2011-11-25 Thread Irmen de Jong
On 25-11-2011 12:15, Andrea Crotti wrote: > Given a project with many eggs, I would like to make it easy to have all the > version > numbers synchronized > to the upper level SVN version. > > So for example I might have svn tags > 0.1, > 0.2 > and a development version. > The development version

why is bytearray treated so inefficiently by pickle?

2011-11-27 Thread Irmen de Jong
Hi, A bytearray is pickled (using max protocol) as follows: >>> pickletools.dis(pickle.dumps(bytearray([255]*10),2)) 0: \x80 PROTO 2 2: cGLOBAL '__builtin__ bytearray' 25: qBINPUT 0 27: XBINUNICODE u'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' 52: qBINP

Re: why is bytearray treated so inefficiently by pickle?

2011-11-29 Thread Irmen de Jong
On 28-11-2011 3:09, Terry Reedy wrote: > Possibly. The two developers listed as particularly interested in pickle are > 'alexandre.vassalotti,pitrou' (antoine), so if you do open a tracker issue, > add them as > nosy. > > Take a look at http://www.python.org/dev/peps/pep-3154/ > by Antoine Pitrou

Re: Need some IPC pointers

2011-11-30 Thread Irmen de Jong
with minimal programming effort. You can just use normal Python method calls to call objects on other machines (or locally, ofcourse). It's written in 100% pure Python and works on Python 2.6 and upwards (including 3.x). Regards, Irmen de Jong -- http://mail.python.org/mailman/listinfo/python-list

Re: Need some IPC pointers

2011-11-30 Thread Irmen de Jong
On 30-11-11 23:28, Irmen de Jong wrote: On 30-11-11 22:03, Andrew Berg wrote: processes (that aren't necessarily written in Python) and communicates Oops, missed this on my first read. This rules out my suggestion of Pyro because that requires Python on both ends (or Java/.net o

<    1   2   3   4   5   6   >