15,185 Topics
| |
I know Python has adopted Java's decorator, but I can not make much sense from the reference manual example. It would be nice if soemone could give a good example of the implimentation of a Python function decorator. | |
alright, I'm new to this community and I have been reading the beginners posts, and I am still having trouble. I need to design a function for a class. It needs to convert decimal numbers to base 16. So for example if the input is 705083, then the function should … | |
Hello beautiful people..! i need a way to run a python program from another one... does anyone know what is the best way to call a process which runs another program in python, and when running that child process, causing the parent process to continue without waiting for the child … | |
I want to make a small backup script to copy files to cdr. Are there any python modules that can accomplish this? | |
Hello, I've been experimenting with different Python IDEs since I started to learn Python. I must say that WingIDE is the best I tried, but unfortunately it's not free and that 10 minutes use is killing me. So I decide to write my Python programs in DrPython which was recommended … | |
I found this nice online book with exmples [url]http://www.byteofpython.info/[/url] | |
Hello, I'm trying to execute this simple code: [code] class Person: population = 0 def __init__(self, name): print 'Creating % s peron' % name self.name = name Person.population += 1 def __del__(self): print 'Destroying %s person' % self.name Person.population -= 1 prvi = Person('Asimi') drugi = Person('Mici') [/code] I'm using … | |
Hi, I've been trying to make a really simple word unscrambler, that takes a scrambled word, and then compares it to a txt file filled with words. The problem I'm getting, is that I'm trying to only read the first word of each line, and if it finds the word, … | |
Here's a cute little encipher/decipher program with a Tkinter GUI I wrote a while back. It's an implementation of a derivative of the Vigenere algorithm; the algorithm is taken from Laurence Smith's [U]Cryptography: The Science of Secret Writing[/U], Amazon link [URL=http://www.amazon.com/exec/obidos/tg/detail/-/048620247X/qid=1125004078/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/102-6170856-3267319?v=glance&s=books&n=507846]here[/URL]. It's a dated book (and the technique itself is … | |
Hello, I am new to Python and I am just starting to figure things out but this one has me stumped. I need to capture the exit code of my processes in order to track them in a database. I have all the other components working except this. In DOS … | |
Hello, I've downloaded PythonWin as a better IDE for writing Python code. I came across an interesting issue (as vegaseat pointed out) When I try to write this sentence in my native language "Ja sam | |
I want to read everything from a file using python. the one problem i am having (note: EVERYTHING from a file) is that python is returning an EOFError when i know that it's not the end of the file, is there any way to just read the damn thing till … | |
I'm completely new to python and really need help with this. I have written this basic cash fund program that allows a person to withdraw, deposit, and receive a balance from it. But now I need to now add email capabilities, by setting up a database (or list) of account … | |
Hey there, i have a simple question about getting a script to do two things at once. like this. for i in range(100): print i time.sleep(.2) if i == 15: os.system('python /home/me/ipupdate.py') print 'done' when i run this, it stops at 15 and runs the script called out in the … | |
Hai Friends This is my first post to this forum. I am new to Python but I find its quite interesting. I have a problem with the folowing code... ########################## import telnetlib import sys HOST = "192.168.10.5" USER = "somename" PASSWORD = "somepassword" telnet = telnetlib.Telnet(HOST) telnet.read_until("login: ") telnet.write(USER + … | |
i have an interesting project at work going on. here is the challenge. i am using the serial module to read data from a serial input. it comes in as a hex. i need to make it a binary and compare it bit by bit to another byte. They have … | |
Hello! I need some help... I parsed an xml file using the minidom.parse method, but when i printed the document object to the screen (using toxml() function), i noticed that the parser automatically replaced my " (inverted commas) chars into ' chars. for example : <Father_Tag> <Son_Tag title=' "Son" '> … | |
Hi, I wonder if you can give me any advice how to learn Python. My plan is to read python tutorial in documentation from begining to the end, and then to get some book (learning Python, or Python in a nutshell). How long it will take (in average) to get … | |
Hello, I've just started to learn Python. I have two questions: 1. Is there any way to set up default folder for Python files (that Atest from introductionary example)? 2. can you suggest any good Python IDE (existing is OK, but I have a fealing that I'm working in ordinary … | |
I have a script that is called by a batch file. Whether or not the script completes successfully the batch file continues. I need to know the results of the script. Is there a way to open an IE session, and call a CF page that I can pass an … | |
I would like to write good code, it is so east to start writing crap. Is the following bad. lets say I have the following code [code] testvar = 5 def test(testvar): print testvar test(testvar)[/code] is it a bad practice to use the name of a variable or function in … | |
hi I have this source [code] env = {} env['SERVER_SOFTWARE'] = ''+self.version_string() env['SERVER_NAME'] = self.server.server_name env['GATEWAY_INTERFACE'] = 'CGI/1.1' env['SERVER_PROTOCOL'] = self.protocol_version env['SERVER_PORT'] = str(self.server.server_port) env['REQUEST_METHOD'] = self.command uqrest = urllib.unquote(rest) env['PATH_INFO'] = uqrest env['PATH_TRANSLATED'] = self.translate_path(uqrest) env['SCRIPT_NAME'] = scriptname [/code] how I can print arrays in this format [code] [HTTP_GET_VARS] … | |
hi I have a problem with this source code [code] #fi, fo = os.popen2('c:/python24/python.exe C:/AppServ/webserver/www/index.pyw') #fi, fo = os.popen2('c:/Perl/bin/perl.exe C:/AppServ/webserver/www/wwwp.pl') fi, fo = os.popen2('c:/appserv/php/php.exe C:/AppServ/webserver/www/wphp.php') data = self.rfile.read(nbytes) fi.write(data) fi.close() shutil.copyfileobj(fo, self.wfile) sts = fo.close() [/code] when I try with python or perl it works but with php not. first … | |
hi :) i have problem with opening ".py" files in my web server this is the source code: [code] import string,cgi,time from os import curdir, sep from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer class MyHandler(BaseHTTPRequestHandler): def do_GET(self): try: if self.path.endswith(".html"): f = open(curdir + sep + self.path) #self.path /index.html self.send_response(200) self.send_header('Content-type', 'text/html') … | |
Hello, I've just read thread why I should lear python and I must admit that I'm very interestwed to learn oppython myself. i have experience with C and C++ programming language. If I understood corectly Python is an interpreted language. What is advantage of interepreted languages (if there are any)? … | |
[FONT=Fixedsys]Hi it's me again, I want to know how to make a new directory containing my python script. Also, how do I make the new directory containing my python script into the current directory? Just for you to know, I installed the newest version of Python which is Python 2.4.1 … | |
Hey I'm a new member here. I just need some help. I need help with setting the path for python. I must set a path in Windows to the directory where the Python.exe is located so that I can execute Python script. I need to get the directory containing the … | |
As I said before im new to python and stink at math(great combination huh?) Well I've looked at Thinking in Tkinter but I still don't fully understand the concept of classes. Could you provide any help\tutorials on this subject? Help Appreciated :cheesy: | |
Python Version: 2.1 Platform: HP Windows XP I am using Python scripts generated by ArcGIS/ModelBuilder in order to automate geoprocesses. Currently I am calling a series of scripts from a batch file that is called by the task scheduler. My problem is if there is an error the process stops, … | |
I wrote simple python program that rips, encodes, and gets song data from the cddb. I would like to give the user the option of customizing it to there taste. So I want to make a config file that I can store in /etc(linux fiel location). for example it would … |
The End.