Re: Need your help

2011-04-28 Thread Jean-Michel Pichavant
1011_wxy wrote: Hi friends: Here I need some help. #encoding="utf-8" #moudle a.py def a(): print " function a!" #encoding="utf-8" #moudle b.py def b(): print " function b!" #encoding="utf-8" #moudle c.py import a import b def c(): a.a() b.b() Here in function c,How ca

Re: 回复: Re: Need your help

2011-04-28 Thread Jean-Michel Pichavant
1011_wxy wrote: Hi JM: *python c.py > afile.log* could you pls give me the whole example? I am so sorry that I am a beginner in Python. Your module a and b that you cannot modify given your original description, are printing data using the print statement. That means these module only

Re: Read-write lock for Python

2011-04-28 Thread Jean-Michel Pichavant
Geoff Bache wrote: Hi all, I currently find myself needing a Python read-write lock. I note that there is none in the standard library, but googling "python read-write lock" quickly produced 6 different competing examples, including two languishing patch proposals for the standard library. I ca

Re: Composition instead of inheritance

2011-04-28 Thread Jean-Michel Pichavant
Ethan Furman wrote: For anybody interested in composition instead of multiple inheritance, I have posted this recipe on ActiveState (for python 2.6/7, not 3.x): http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-multiple-inherit/ Comments welcome! ~Ethan~ Sounds

Re: Composition instead of inheritance

2011-04-29 Thread Jean-Michel Pichavant
Ben Finney wrote: Ethan Furman writes: Carl Banks wrote: That's not what we mean by composition. Composition is when one object calls upon another object that it owns to implement some of its behavior. Often used to model a part/whole relationship, hence the name. Hmmm. Okay -

Re: HI

2011-05-02 Thread Jean-Michel Pichavant
anvar wrote: Hello, Could you please help me with the modeling in Python the following problem: (e.g., g_t means g with index t) Min∑_(i=1)^n▒∑_(t=1)^l▒[s_i (t)-min[s ̂_i (t)×α_t×exp(g_t ),C_i (t) ] ]^2 subject to s_i (t)=f_i (t)[S_i+f_(i-1) (t)[S_(i-1)+f_(i-2) (t)[S_(i-2)+⋯f_2 (t) [S_2+f_1 (t)

Re: spf-records

2011-05-03 Thread Jean-Michel Pichavant
Wim Feijen wrote: Excuse me, this message was sent to the wrong mailing list. Sorry, Wim 2011/5/3 Wim Feijen mailto:w...@go2people.nl>> Dag mannen, You're lucky that the native language of our Benevolent Dictator For Life is tolerated in this list. JM -- http://mail.python.org/mailman

Re: Running and killing a process in python

2011-05-04 Thread Jean-Michel Pichavant
James Mills wrote: On Wed, May 4, 2011 at 10:45 AM, Astan Chee wrote: Hi, I'm trying to make a python script (in windows 7 x64 using python 2.5) to start a process, and kill it after x minutes/seconds and kill all the descendants of it. Whats the best way of doing this in python? which modul

Re: Overuse of try/except/else?

2011-05-10 Thread Jean-Michel Pichavant
James Mills wrote: On Tue, May 10, 2011 at 10:40 AM, Kyle T. Jones wrote: It has been hard for me to determine what would constitute overuse. A rule of thumb I always follow and practice is: "Let the error lie where it occurred." or "Don't hide errors.". It's good practice to foll

Re: obviscating python code for distribution

2011-05-16 Thread Jean-Michel Pichavant
Littlefield, Tyler wrote: Hello: Thanks all for your information and ideas. I like the idea of open source; I have a fairly large (or large, by my standards anyway) project that I am working on that is open source. Here's kind of what I want to prevent. I want to write a multi-player online

Re: connect SIGINT to custom interrupt handler

2011-05-18 Thread Jean-Paul Calderone
m the messages in this thread if you managed to get that approach working. The most commonly encountered problem with this approach is that it means that any blocking (eg I/O) operation in progress won't be interrupted and you'll have to wait for it to complete normally. In this case, it soun

Re: NEED HELP- read file contents, while loop to accept user input, and enter to exit

2011-05-24 Thread Jean-Michel Pichavant
Cathy James wrote: f = open ('c:/testing.txt'', 'r') replace the double quote by a single quote. JM -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining a full path name from file

2011-05-24 Thread Jean-Michel Pichavant
RVince wrote: Ha! You;re right -- but is there a way to get it without the filename appended at the end? On May 24, 11:52 am, Tim Golden wrote: On 24/05/2011 16:36, RVince wrote: s = "C:\AciiCsv\Gravity_Test_data\A.csv" f = open(s,"r") How do I obtain the full pathname given t

Re: Beginner needs advice

2011-05-25 Thread Jean-Michel Pichavant
Lew Schwartz wrote: So, if I read between the lines correctly, you recommend Python 3? Does the windows version install with a development environment? If you want to use python 3, make sure before that all the good stuff you need (==modules) have been ported to python 3. If you are a complet

Re: Sanitizing filename strings across platforms

2011-05-31 Thread Jean-Paul Calderone
results = "_" + results >     return results > > but if somebody already has war-hardened code they'd be willing > to share, I'd appreciate any thoughts. > There's http://pypi.python.org/pypi/filepath/0.1 (taken from twisted.python.filepath). Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

[ANN] txaws 0.5.0

2017-12-27 Thread Jean-Paul Calderone
anks to everyone who contributed and to Least Authority TFA GmbH <https://leastauthority.com/> for sponsoring my work on this release. Jean-Paul -- https://mail.python.org/mailman/listinfo/python-list

Announcing txAWS 0.2.3.1

2017-01-09 Thread Jean-Paul Calderone
nd fix this issue and to publish this new release. Jean-Paul -- https://mail.python.org/mailman/listinfo/python-list

[ANN] txkube 0.3.0

2018-08-08 Thread Jean-Paul Calderone
thon.org/pypi> You can contribute to its development on GitHub <https://github.com/LeastAuthority/txkube>. Thanks to Least Authority TFA GmbH <https://leastauthority.com/> for sponsoring this development and to Craig Rodrigues for his efforts on Python 3 porting work. Jean-Paul

ANN: libchirp (Message-passing for everyone)

2019-01-16 Thread Jean-Louis Fuchs
-chirp * C99-chirp: https://github.com/concretecloud/chirp * Other chirp related software: https://github.com/concretecloud Best, Jean-Louis Fuchs -- https://mail.python.org/mailman/listinfo/python-list

Tahoe-LAFS on Python 3 - Call for Porters

2019-09-24 Thread Jean-Paul Calderone
u have, as well as details of your availability and any related work you have done previously (GitHub, LinkedIn links, etc). If you would like to find out more about this opportunity, please contact us at jessielisbetfrance at gmail (dot) com or on IRC in #tahoe-lafs on Freenode. J

Re: How to decompile an exe file compiled by py2exe?

2005-09-24 Thread Jean-François Doyon
Last I looked, py2exe only kept the byte-compiiled versions of your files, and not the raw source. py2exe is just an archive, you can open it up in WinZip for example and see your .pyc/pyo files. That gets you part of the way there ... Then you would need to find a way to "disassemble" the byte

Re: Will Python Be Good For This Type Of Project?

2005-09-29 Thread Jean-François Doyon
> What I'm trying to determine is 1) if it's relatively easy to write a > program to work as an application AND an applet (depending on how it's > called) No. There is no such thing as "Python applets", unless the end user's browser has third-party plug-ins that enable browsers to do so (A Pytho

Re: Zope3 Examples?

2005-09-29 Thread Jean-François Doyon
Markus, Zope 3 is mature as a framework, but does not provide much "out of the box". It's a basis upon which to build applications like Plone ... If you are looking for something that provides Plone-like features on top of Zope 3, it doesn't exist (yet). Personally, I'm waiting for this: http

Re: Class Help

2005-10-01 Thread Jean-François Doyon
You have to crate an instanciation of the class before you can use one. So you want to do: instance = Xyz() instance.y() You won't get any output though, might want to do: class Xyz: def y(self): print 'y worked!' it's more satisfying :) Basically, look into the difference betwe

Re: "no variable or argument declarations are necessary."

2005-10-02 Thread Jean-François Doyon
Wow, never even occured ot me someone would have a problem with this! But, this might help: http://www.logilab.org/projects/pylint In more detail: > Surely that means that if I misspell a variable name, my program will > mysteriously fail to work with no error message. No, the error message

Re: Pickle to source code

2005-10-26 Thread Jean-Paul Calderone
On 26 Oct 2005 06:15:35 -0700, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> I want to convert from pickle format to python source code. That is, >> given an existing pickle, I want to produce a textual representation >> which, when evaluated, yields the original object (as if I had >> unpickled

Re: Help: Quick way to test if value lies within a list of lists of ranges?

2005-10-27 Thread Jean-Paul Calderone
at this is actually a premature optimization. I bet there are much more interesting problems to be solved in this project, ones that you could work on and test, even while doing something as unbelievable slow as looping over 100 or so objects. ;) You can always optimize later, after you've

Re: db.DB_CREATE|db.DB_INIT_MPOOL|db.DB_THREAD|db.DB_INIT_CDB

2005-10-27 Thread Jean-Paul Calderone
On Fri, 28 Oct 2005 00:17:54 +0800, "Neville C. Dempsey" <[EMAIL PROTECTED]> wrote: >Why does this python program fail to read record "600"? > >#!/usr/bin/env python >import bsddb # twiceopen.py > >key="600" >btf=bsddb.db.DB_INIT_THREAD > >list1=bsddb.btopen("twiceopen.tbl",btflags=btf) >l

Re: lambda functions within list comprehensions

2005-10-29 Thread Jean-Paul Calderone
390097 http://article.gmane.org/gmane.comp.python.general/389011 http://article.gmane.org/gmane.comp.python.general/334625 I could go on for a while longer, but hopefully some of the linked material will answer your question. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: socket receive file does not match sent file

2005-11-06 Thread Jean-Paul Calderone
whether the connection was dropped because the file was fully transferred or because of some transient network problem or other error. One solution to this is to prefix the file's contents with its length. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: RAW_INPUT

2005-11-07 Thread Jean-Paul Calderone
es there? Josh >> You may pass, Josh >> >> I'm assuming s=Josh...but that is not included in the statement at all >> I don't know how you put "Josh" in or how you got it to finish running >> w/o hitting enter after "Who goes there?" >> >> What am I doing wrong? Did you try typing "Josh" and then enter? Or any other name, for that matter... Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-07 Thread Jean-Paul Calderone
g system's capabilities to limit resource access and usage on a per-process. That is, run each piece of submitted code in a separate, unprivileged process, with the appropriate limits in place. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlite3 decode error

2005-11-08 Thread Jean-Paul Calderone
s.py>). By only encoding and decoding at the border between your application and the outside world, and the border between your application and the data, you will eliminate the possibility for a class of bugs where encodings are forgotten, or encoded strings are accidentally combined with unicode strings. Hope this helps, Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-08 Thread Jean-Paul Calderone
x27;t think it's maintained anymore. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Storing empties

2005-11-08 Thread Jean-Paul Calderone
ole as a sentinel, obviously. This is a reasonable trick, though: class sentinel: pass Now sentinel pickles and unpickles in a manner which agrees with the above pattern without any extra works. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Goto XY

2005-11-08 Thread Jean-Paul Calderone
rward. I'll probably do it myself when I have > the time or the motivation. > Like this? http://cvs.twistedmatrix.com/cvs/trunk/twisted/conch/insults/insults.py?view=markup&rev=14863 Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Lie Hetland book: Beginning Python..

2005-11-09 Thread Jean-Paul Calderone
gt; File "", line 1, in ? >AttributeError: 'module' object has no attribute 'paramstyle' > >>> The DB-API2ness is at pysqlite2.dbapi2: >>> from pysqlite2 import dbapi2 >>> dbapi2.paramstyle 'qmark' >>> dbapi2.threadsafety 1 >>> etc. :) Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: web interface

2005-11-09 Thread Jean-Paul Calderone
ags.meta(**{"http-equiv": "refresh", "content": "0;calc"})]]) def child_calc(self, ctx): return LongTaskPage(ICalculator, Adder()) application = service.Application("Push Mechanism, like back in '97") webserver = internet.TCPServer(8080, appserver.NevowSite(Root())) webserver.setServiceParent(application) # eof Right? But maybe you can explain why, for those of us who aren't enlightened. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-09 Thread Jean-Paul Calderone
o the end user. What's to stop someone from publishing the decrypted code online for anyone to download? Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: web interface

2005-11-10 Thread Jean-Paul Calderone
t'll probably work with IE in an upcoming release, though. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamically Update Class Definitions?

2005-11-11 Thread Jean-Paul Calderone
able failures as to make it cost more time than it saves. You really want to stop the rest of the program, then update things, then let everything get going again. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: XUL behavior in Python via XPCOM, Mozilla

2005-11-12 Thread Jean-Paul Calderone
it again. Anyway, I was hoping someone >on c.l.p / python.org would have a reliable reference on >this. I'm not sure which claim you read, but perhaps it was in reference to PyXPCOM? <http://aspn.activestate.com/ASPN/Downloads/Komodo/PyXPCOM/> I'm not quite sure if you are

Re: is parameter an iterable?

2005-11-15 Thread Jean-Paul Calderone
catch it during their testing >:) If you return an error code instead, they are just as likely to pass in bad data, and even *more* likely to not see that an error has occurred, causing their programs to be incorrect. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating (rather) generic plugin framework?

2005-11-16 Thread Jean-Paul Calderone
. > >Inspired by http://www.python.org/pycon/2005/papers/7/pyconHooking.html You may want to look at a few existing Python plugin systems. To get you started, here's a link to the Twisted plugin system documentation: <http://twistedmatrix.com/users/warner/doc-latest/core/howto/plugin.html>

Re: Ajax for the Developers

2005-11-18 Thread Jean-Roch SOTTY
But you could consider looking at seaside[1] or wee[2] which are based on continuations. [1] http://seaside.st/ [2] http://rubyforge.org/projects/wee Jean-Roch SOTTY -- http://mail.python.org/mailman/listinfo/python-list

Re: General question about Python design goals

2005-11-27 Thread Jean-Paul Calderone
suspect you don't. If you really did, you may want to pick up one of those platitude-filled XP books and give it a careful read. You may find there's more there than you were previously aware. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse best/good or bad IDE for Python?

2005-12-02 Thread Jean-François Doyon
I'm a big fan of Eclipse and reocmmend it to anyone who asks :) No one can say any one is the *best*, since it's a matter of taste, but it's pretty darn good. The main benefit IMO is it's felibility ... Eclipse is a *framework*, that can handle lots things quite well, like HTML (If you're coding

Re: libxml2 and XPath - Iterate through repeating elements?

2005-12-05 Thread Jean-Roch SOTTY
athEval('lineno')[0].content print line_node.xpathEval('productcode')[0].content doc.freeDoc() -- Cordially Jean-Roch SOTTY -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there anything that pickle + copy_reg cannot serialize?

2005-12-08 Thread Jean-Paul Calderone
kling will fail. You can raise this limit, to a point, with sys.setrecursionlimit(). Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there anything that pickle + copy_reg cannot serialize?

2005-12-08 Thread Jean-Paul Calderone
lp. The above example basically teaches the copy_reg module how to give the pickle module the help it needs for code objects. Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Validating an email address

2005-12-09 Thread Jean-Paul Calderone
to the email >package, if a satisfactory one can be written; i would definitely support >their doing that. The top part of <http://divmod.org/users/viewcvs.twistd/branches/exarkun/smtp-2418/quotient/proto/smtp.py?rev=7661&view=markup> contains a parser that, IIRC, is basica

Re: Dectecting dir changes

2005-12-09 Thread Jean-Paul Calderone
mpletion() return result def write(self, bytes): return self.wrappedReceiver.write(bytes) Hook it up to a Realm and a Portal and override uploadCompleted to taste and you've got an FTP server that should do you (granted, it's a little long - some of this code

Re: Overloading

2005-12-09 Thread Jean-Paul Calderone
, complex2): res = Complex(self.real + complex2.real, self.imag + complex2.imag) return res Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Dectecting dir changes

2005-12-09 Thread Jean-Paul Calderone
ause I thought you were tied to FTP. If you actually have security concerns, you might want to use SFTP instead (which Twisted also supports, but to which the code I sent is only partly applicable). Jean-Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Managing import statements

2005-12-10 Thread Jean-Paul Calderone
The *only* things it tells me about are modules that are imported but never used and names that are used but not defined. It's false positive rate is something like 1 in 10,000. > >Is there a tool that simply scans each module and updates the import >statements, subject to my app

Re: String from File -> List without parsing

2005-09-04 Thread Jean-François Doyon
Gregor, You want to use eval(): Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> eval('[3,54,5]') [3, 54, 5] >>> Cheers, J.F. Gregor Horvath wrote: > Hi, > > given the dynamic nature of

how to convert 4 bytes into a float ?

2005-02-08 Thread Jean-Baptiste PERIN
I read 4 bytes from a binary file. These bytes represent a floating point number (mantisse exponent form) How can I get a float from these bytes ? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert 4 bytes into a float ?

2005-02-08 Thread Jean-Baptiste PERIN
Alex Martelli a écrit : Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: I read 4 bytes from a binary file. These bytes represent a floating point number (mantisse exponent form) How can I get a float from these bytes ? See the docs for module struct, specifically the struct.unpack functi

Choosing the right parser for parsing C headers

2005-02-08 Thread Jean de Largentaye
Hi, I need to parse a subset of C (a header file), and generate some unit tests for the functions listed in it. I thus need to parse the code, then rewrite function calls with wrong parameters. What I call "shaking the broken tree" :) I chose to make my UT-generator in Python 2.4. However, I am no

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Jean de Largentaye
GCC-XML looks like a very interesting alternative, as Python includes tools to parse XML. The mini-C compiler looks like a step in the right direction for me. I'm going to look into that. I'm not comfortable with C++ yet, and am not sure how I'd use Pyste. Thanks for the information guys, you've b

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Jean de Largentaye
That looks cool Roman, however, I'm behind a Corporate Firewall, is there any chance you could send me a cvs snapshot? John -- http://mail.python.org/mailman/listinfo/python-list

extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
Hi, I'm trying to make a windows dll reachable from a python script .. and I'm encountering troubles during link step .. I use "lcc" to compile and link I use python 2.3 under win XP Here's the compile command which seems to work well : - lcclnk

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
Grant Edwards a écrit : On 2004-12-20, Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: I'm trying to make a windows dll reachable from a python script.. FWIW, you can call dll's using the ctypes modules without mucking around in C. There may be performance reasons to build a &quo

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
Grant Edwards a écrit : On 2004-12-20, Jean-Baptiste PERIN <[EMAIL PROTECTED]> wrote: I'm trying to make a windows dll reachable from a python script.. FWIW, you can call dll's using the ctypes modules without mucking around in C. There may be performance reasons to build a &quo

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
thanks for your valuable help .. ctypes is not lost for ever ..I'm going to explore a little bit .. it may suit my need in the end .. I had read : http://www.python.org/dev/doc/devel/ext/intro.html and eveything looked so simple in it .. I'm sad to realize that it only works for linux plateform

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
Diez B. Roggisch a écrit : The fact is that the python interpreter I use is not a standard one It is a python interpreter delivered within a software named Blender. I don't know whether it is possible or not to add ctypes to it ..(I don't even have a python shell to perform the setup) I'm sure it i

Re: extending python with a C-written dll

2004-12-20 Thread Jean-Baptiste PERIN
>> error: Python was built with version 6 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. How do you expect to be able to write your own extension if you don't have the environment to do so in the first place? that error has nothin

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
That's got nothing to do with Python. You have to compile extensions using a compiler that has an ABI that's compatible with the ABI of the compiler used to compile Python. You appear to be using a binary distribution of Python that was compiled with MSVS 6.0, therefore, you have to compile exten

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
Steve Holden a écrit : Jean-Baptiste PERIN wrote: >> error: Python was built with version 6 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. How do you expect to be able to write your own extension if you don&

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
Jean Brouwers a écrit : First, you might check the calldll module available here <http://www.nightmare.com/software.html> I have one or two things to try before ..but it looks interesting .. thank you very much .. Take a look at Pyrex, it may fit your requirements to access C from

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
Note that MinGW32 is a tested path for building (free) C extensions. I don't know if anyone has a tested way of using lcc. Yes, very interesting I can already conclude that either I don't know how to use lcc or it doesn't suit my needs .. in both case I have to quickly get rid of it .. before I t

Re: extending python with a C-written dll

2004-12-21 Thread Jean-Baptiste PERIN
John Machin a écrit : Jean-Baptiste PERIN wrote: Hi, I'm trying to make a windows dll reachable from a python script .. and I'm encountering troubles during link step .. I use "lcc" to compile and link I use python 2.3 under win XP [snip] Here are the errors : -

Re: change volume of single audio device

2013-11-13 Thread Jean-Michel Pichavant
- Original Message - > hi, > > i'd like to change the volume of my av-receiver (HDMI) and speakers > (analogue) simultaneously. in order to use both outputs i'm using > virtual audio cable but if i set it as default device and change > volume, hdmi and analogue remains unchanged. > i inten

Re: understanding someone else's program

2013-11-15 Thread Jean-Michel Pichavant
- Original Message - > Hi all, > > Please suggest how I can understand someone else's program where > - documentation is sparse > - in function A, there will be calls to function B, C, D and in > those functions will be calls to functions R,S,T and so on so > forth... making it dif

Re: Having trouble setting up an extremely simple server...

2013-11-22 Thread Jean-Michel Pichavant
- Original Message - > Please help! I'm very > new to networking, but I've been using Python for a while now, just > recent;y getting into networking, trying to get things down. Hi, Nothing wrong with diving into the muddy waters of network programming. If you like blue lagoons like me, t

Re: Use of logging module to track TODOs

2013-11-27 Thread Jean-Michel Pichavant
- Original Message - > Hey list, Greetings ! > How do you do with your TODOs? > > Regards, > Jordi TODOs always share the same fate : they get forgotten and wander the code until the project dies. Unless you have the required mental resilience to stop the urgent work to fix your TO

Re: python for everyday tasks

2013-11-27 Thread Jean-Michel Pichavant
- Original Message - > On Saturday 23 November 2013 02:01:26 Steven D'Aprano wrote: > > * Python is not Java, and Java is not Python either: > > > > http://dirtsimple.org/2004/12/python-is-not-java.html > > http://dirtsimple.org/2004/12/java-is-not-python-either.html > > Thanks for all th

Re: [newbie] problem trying out simple non object oriented use of Tkinter

2013-12-06 Thread Jean-Michel Pichavant
- Original Message - > I'm trying out Tkinter with the (non object oriented) code fragment > below: > It works partially as I expected, but I thought that pressing "1" > would > cause the program to quit, however I get this message: > TypeError: quit() takes no arguments (1 given), I tried

Re: [newbie] problem trying out simple non object oriented use of Tkinter

2013-12-06 Thread Jean-Michel Pichavant
x27;s the <1> meaning? > > > > #!/usr/bin/env python > import Tkinter as tk > import sys > #underscore is necessary in the following line > def quit(_): > sys.exit() > root = tk.Tk() > label = tk.Label(root, text="Click mouse here to quit") > lab

Re: Does Python optimize low-power functions?

2013-12-06 Thread Jean-Michel Pichavant
- Original Message - > The following two functions return the same result: > > x**2 > x*x > > But they may be computed in different ways. The first choice can > accommodate non-integer powers and so it would logically proceed by > taking a logarithm, multiplying by the power (in

Re: [newbie] trying socket as a replacement for nc

2013-12-13 Thread Jean-Michel Pichavant
; """ > import socket > host = '10.128.59.63' > port = 7000 > size = 10 > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.connect((host,port)) > s.send('*IDN?') > data = s.recv(size) > s.close() > print 'Received:', data >

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
rompt') > > # you can use read_very_eager also > > > > JM > > > > > Could you tell me how to install telnetlib on a linux-system (it's > not > available via apt-get install as I see it) > > kind regards, > jean > Please keep it on list, so

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
> Did you try > > import telnetlib > > ? > > Note that in the code above I forgot the EOF, which is very much > dependent of the equipment itself. > > You may have to write > t.write('*IDN?\n') > or > t.write('IDN?\n\r') > > JM Additionally, here's the code we're using for our signal generat

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
this is the result of executing the code(from which I deduce I > have to > install telnetlib, but how?) > Traceback (most recent call last): > File "./nctelnet.py", line 5, in > t = Telnet(host, port) > NameError: name 'Telnet' is not defined > > kin

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
- Original Message - > Op maandag 16 december 2013 13:05:41 UTC+1 schreef Jean-Michel > Pichavant: > > > Here is the code: > > > #!/usr/bin/env python > > > import telnetlib > > > host = '10.128.59.63' > > > port = 7000 >

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
> This is what I got using telnet: > [jean:~] $ telnet 10.128.59.63 7000 > Trying 10.128.59.63... > Connected to 10.128.59.63. > Escape character is '^]'. > *IDN? > KEITHLEY INSTRUMENTS INC.,MODEL 2425,1078209,C32

Re: [newbie] trying socket as a replacement for nc

2013-12-16 Thread Jean-Michel Pichavant
- Original Message - > On Tue, Dec 17, 2013 at 5:26 AM, Jean Dubois > wrote: > >> Try something simple first: > >> import telnetlib > >> host = '10.128.59.63' > >> port = 7000 > >> t = Telnet(host, port) > >> def f

Re: [newbie] trying socket as a replacement for nc

2013-12-17 Thread Jean-Michel Pichavant
> I'm a newbie in Python programming that is very much true, and > contrary to what you seem to suggest I did my homework At no point that was my intention, my apologies. If you fixed the syntax error, you should be pretty close to the solution though. JM -- IMPORTANT NOTICE: The contents of

Re: Logger module in python

2013-12-18 Thread Jean-Michel Pichavant
Original Message - > On Wednesday, December 18, 2013 8:52:11 AM UTC+5:30, > smileso...@gmail.com wrote: > > Hi, > > I am a newbie in python. I am looking for a existing module which > > I can import in my program to log the objects to a file? > > > I know there is a module Data::Dumpe

Re: Struggling for inspiration with lists

2013-12-18 Thread Jean-Michel Pichavant
- Original Message - > Hi > > I have a list of data that presents as: > > timestamp: value > > Timestamps are used solely to determine the sequence of items in the > list. > > I want to find the longest repeated sequence of values in the list. > Example, in the following list: > > data

Re: seeking a framework to automate router configurations

2013-12-18 Thread Jean-Michel Pichavant
- Original Message - > Hi Pythoners, > I'm looking for a tool or framework in which I can do a slight > modification to achieve the following task: > "Asynchronously reset a large number of cisco routers back to their > original configurations and push prepared initial configurations to

Re: How to import Wave files into python?

2013-12-18 Thread Jean-Michel Pichavant
- Original Message - > How exactly do I import a .wav file and run it? > also is it possible to run it inside a while loop if so or it just > start playing when its run? - Tom 14 > -- > https://mail.python.org/mailman/listinfo/python-list I think the pygame module should be able to do so.

Re: how to develop code using a mix of an existing python-program and console-commands

2013-12-23 Thread Jean-Michel Pichavant
- Original Message - > Am 18.12.13 21:17, schrieb Jean Dubois: > > I have a python-program which I want to perform its task first, > > then > > switch to > > the python console to experiment with further commands, using what > > was > > al

Re: Variables in a loop, Newby question

2013-12-24 Thread Jean-Michel Pichavant
- Original Message - > Hello, for the first time I'm trying te create a little Python > program. (on a raspberri Pi) > > I don't understand the handling of variables in a loop with Python. > > > Lets say i want something like this. > > x = 1 > while x <> 10 > var x = x > x =

Re: word replacing in a paragraph

2014-01-06 Thread Jean-Michel Pichavant
- Original Message - > Hey guys, > I'm trying to automate a process by initially creating a standard > template and then replace some text fields with variable values. > [for example, "DATE" in the paragraph will be replaced by the current > date value. it doesn't have to be a literal

Re: nested dictionaries and functions in data structures.

2014-01-07 Thread Jean-Michel Pichavant
- Original Message - > Hello all. > > I have some questions again. :-) > > I wish to be able to place a function within a data structure. I > would like to use a dictionary because I could pass it a key and > then the function could be called. I couldn't find anything on the > net to s

Re: nested dictionaries and functions in data structures.

2014-01-07 Thread Jean-Michel Pichavant
- Original Message - > Thanks for that. It resolved the issue and it was so simple compared > to everything else I saw on the net. > > Only outstanding thing I have to work out is how to execute functions > from a dictionary. I will continue searching on the net. > > > Sean This may hel

Re: Editor for Python

2014-01-08 Thread Jean-Michel Pichavant
- Original Message - > On Friday, 23 November 2001 04:13:40 UTC+5:30, MANUEL FERNANDEZ PEREZ > wrote: > > Hello, > > I'm looking for an editor for Python.I' m interested it works on > > Windows.Can > > anybody help me? > > > > Thank you > > > > Manuel http://lmgtfy.com/?q=python+editor+

Re: Editor for Python

2014-01-08 Thread Jean-Michel Pichavant
- Original Message - > I've been pleased with Komodo, and certainly prefer it over > Notepad++. > Komodo: > http://www.activestate.com/komodo-ide?gclid=COHE4eLj7rsCFQISMwodOUQAiw Komodo is an IDE and costs 385$. I certainly expect it to better than notepad++. JM -- IMPORTANT NOTICE:

Re: Editor for Python

2014-01-08 Thread Jean-Michel Pichavant
> > -- IMPORTANT NOTICE: > > > > The contents of this email and any attachments are confidential and > > may > > also be privileged. If you are not the intended recipient, please > > notify > > the sender immediately and do not disclose the contents to any > > other > > person, use it for any purp

<    1   2   3   4   5   6   7   8   9   10   >