Re: [Tutor] python RMI
Il 07/10/06, Alan Gauld [EMAIL PROTECTED] ha scritto: PS. Any Italian speakers on the list who can cover this?I think I can as far it's possible,Alan! :-) Picio [EMAIL PROTECTED] wrote in messagenews:[EMAIL PROTECTED]Salve,dovrei usare python per due progettini universitari, su RMI e l'altro sui Web Services.Ho notato che esiste PyRO, preferirei perĂ² sentire voi sull'argomento:cosa uso per l'RMI (esiste qualche libreria,modulo)cosa uso per i Web ServicesCiao, Per quanto riguarda l'RMI vale la pena di dare un'occhiata a quest'esempio,anche se in inglese in quanto il codice e'di per se abbastanza comprensibile: http://www.daimi.au.dk/~mailund/scripting2005/lecture-notes/rmi.htmlPer quanto riguarda i web services,e'impossibile darti una risposta precisa senza poter conoscere i servizi che devi (o dovresti) utilizzare; prova a girare nella standard library,magari a guardare XML-RPC come altri ti hanno gia'detto;comunque,se cerchi qualcosa di piu'dedicato usa Twisted che e'sicuramente l'eccellenza nel campo della programmazione di rete in Python per completezza e maturita'del codice. Mentre per eventuali ritocchi e implementazione di particolari funzionalita'di basso livello esiste dpkt..Fai la tua scelta,spero di essere stato esaustivo. __ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] layout ( i guess)
Desk Jet wrote: uh ive been wondering if with python you would be able to make layouts?Hello,I premise that i don't get the exact meaning you are using for 'layouts',GUI-enabled applications ( i.e. those with windows,buttons,progress bars,notebooks..) could it be?Well,sure Python can :) In the majority of case,programming graphical user interfaces will require you to install additional packages,but there is one that comes along with Python : Tkinter.Cheers,Ivan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Fwd: Difference between popens
2006/6/9, Bernard Lebel [EMAIL PROTECTED]: Hi,I'd like to know what are the differences at the various os.popenXflavors. I read the documentation and I can see they return fileobjects. so what can you do with these file objects? I mean, why would you need a set of file objects rather than another?Sorry the difference is very not clear to me.ThanksBernard___Tutor maillist- Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutorHello,The common idea behind the various popen implementation is to provide the creation of pipes.A pipe is a flavor of a file object.A pipe serves the job to address data from a process to another,but what if sometimes you want to execute a commandout of the parent process on a child process?You should be able to issue the command,catch the result and even to know which way the thing has ended,at times. If you are familiar with the concept of 'streams',the input,output and error stream are the resource of communication provided by Unix to handle these tasks,respectively.Nevertheless ,at times you don't need to gather data from all the streams,but just to control two of them out of three,for example.The reason could be that of sparing system resources,time or just that you don't need or want to.popen2 ,popen3 and popen4 are designed to catch exactly the streams you want to control.So:popen2:returns the file objects corresponding to the child stdin and stdout;popen3:returns the file objects corresponding to the child stdin,stdout and stderr;popen4:returns the file objects corresponding to the child stdout and stderr ( together as a single object) and stdin.The file objects,you see,are what you normally make use to manipulate data within processes. They are memory structures which assume peculiar names based on their type : Queues,Semaphores,Pipes and so on...And they can persist a) in the scope of a process b) of a machine session c) on the filesystem (the strongest kind of persistence). Choosing the right one for each task a matter depending on what you want to do with them.I recognize I'm not being exhaustive but hope that helps.Cheers,Ivan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] passwords in scripts
Hi Ivan I'm not sure I understand what you are saying here. Surely if the file is compiled it can just run (and will only need to be RE-compiled when I have to change the code (such as when one of the servers has their password changed). I would never need to de-compile, because I'll just keep a copy of the file on a memory stick, edit it there, compile it and replace the current compiled file with the newly compiled file. Not that I know anything about compiling Python programs, I just want to know if this is a possibility Thanks Ben Hi Ben, Perhaps I've been too much long-winded talking about the compiling issue,and too rash elsewhere.What I would say,essentially,it's possible to split the script in two modules,the first containing the passwords and a crypting/decrypting routine,and the second which could perform the checking operations on the logs.The second should need the passwords stored in the first to check them,so in module2,for example,you would import module1.This would allow the module with the passwords to be attached just at the needed moment then to be removed. Otherwise it applies the same if it's preferred.to backup and replace just a part of the script instead of everything,so it's possibile to modify the passwords or the script itself separately.It all depends by how you like to work with it. However I must establish that the access via telnet is the main security concern,and I agree to what Danny previously said about.The problem here is much matter of dealing with admins. Cheers, Ivan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Totorial announcement
Sorry to both A.Gauld and Rinzwind for my previous mistake in addressing. Great,Alan,I got pretty much help from your OS tutorial in my past hard times in learning Python. I'm glad you've completed it :) Cheers Ivan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] How can I clean the screen
2006/1/23, Suri Chitti [EMAIL PROTECTED]: Dear group, If I am executing a python prog from the command line and need to clear the screen (like using the cls command at the windows cmd prompt) midway into the program, how do I do it?? Any inputs will be greatly appreciated. Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor Hi there A nice neat trick which is: print '\n' * 100 Will print a hundred lines on the screen,thus shifting the cursor down so the screen will seem to have been cleaned. Or it's possible to implement these lines in a program: import os, platform def clear_screen(): if platform.system() == 'Linux': os.system('clear') if platform.system() == 'Windows': os.system('cls') clear_screen() (Both them are excerpt from the Python Tips and Tricks published from the Italian Python User Group). Cheers Ivan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] passwords in scripts
2006/1/21, Ben Vinger [EMAIL PROTECTED]: Hello I've written a couple of scripts that check log files on our WIndows and Unix servers. These scripts have plain text passwords in them, so anyone who can access the filesystem of the Windows server that runs the scripts can discover the passwords of the servers. Is there a way to hide/encrypt these passwords? Or can the scripts be converted to compiled code in order for the passwords to be hidden? Thanks Ben Hello, Compiling a file in python is a big time loss,because there's not a built-in function for decompiling,but you can just use the 'dis'module for disassembling it and the result is always different from the original,because it uses Abstract Source Tree syntax in spite of Python language for translating the bytecode;on the other hand it wouldn't secure the file itself from being accessed but makes it useless IMHO.Thus,with a slight impact on complexity,a module with the crypted passwords would be imported, which would proceed for checking the passwords and exporting them in a StringIO object at runtime.For enhancing security,once used it could be removed and used again when needed,without removing the scripts themselves.You can check the 'crypt' module for this task. Cheers, Ivan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Python upgrade from 2.3 to 2.4
Hello Srinivas, You can install both versions on the same platform,in separate directories,and start them individually as any other else application.Obviously each one will rely on the modules with which was coming when installed.(And,if you installed further extensions,they will work properly with the installation corresponding to the version of Python that they were designed to work correctly for.).If you need even one module alone that requires a new installation,i suggest to clean install in spite of updrading.(unless you have disk space problems most of the time.) Basically,this is the reason for which I suggest to clean install the new version,then install the new stuff packing it within its directories;and to keep the old ones alone,where you installed them,with the old version.Another point:if you need,adjust your PATH in order to point to your favourite version the more conveniently. My configuration : Python 2.3.5 Enthought Edition in C:\PYTHON23; Python 2.4 (with wxPython,BOAConstructor) in C:\py24 (sic!) Sorry,I only use IDLE on Linux,so I'm unaware of this strange behaviour of its on Windows,but I would review that the same,if I only knew what Windows version you are using and the build number of the Python version (the third number after 2.4) Cheers Ivan ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor