No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Re:
More or less a templet database that allows you to load, save, add, list, search, edit and delete data items. I used movies as an example, but you can easily change that to make a database of many other things. |
|
Is there any way I can execute a block of code in a loop, like so: [ some code goes here ] Where the delimiters are "[" and "]", and also allowing for nested blocks, i.e.: [the user can create another loop[]] I am creating a parser for a language … |
|
I've been looking for a way to parse a simple XML-like language for use as a type of data storage. I've been through stuff like JSON, XML, etc but I don't want to use them because they are quite slow. I just need a simple way to parse this: [stuff] … |
|
So I have this piece of code in a socket server: def process(self, request, client_address): input_file = request.makefile("rb", 0) output = request.makefile('wb', 0) remote_input = input_file.readline().strip() + b"\n" self.log(remote_input) self.proc.stdin.write(remote_input) self.proc.stdin.flush() self.proc.stdout.flush() while True: line = self.proc.stdout.readline() line = line.decode() if line: line = bytes(line.rstrip() + "\n", 'utf-8') output.write(line) else: … |
|
Re:
Hi All, I need to call a function for evry 10 secs how can i achieve this in python |
|
So I have a code that prints out the `sys.argv` when the program is ran. How can I parse $ python ./arch.py install * to show `["./arch.py","install","*"]` Instead of `["./arch.py","install",#other files in directory]`? |
|
How do you start a SSH server on localhost through executing a shell script? If so, is there any way to restrict the commands performed or use another shell script as it's default console (i.e. Instead of Terminal.app it uses X11)? |
|
Re:
Hey guys! I've started writing a 2d platformer game some days ago, and I'm really enthusiastic about it, but I already failed to live up to my own expectations: I just cannot possibly think of a way I could make my character jump. I used the MVC desing is why, … |
|
For some reason , my code keeps returning a false reply even if the string is in the file. Here's my code: def check(self): self = str(self) if self in config_file: print ('Account exists') if self not in config_file: print ('Account doesn't exist') |
|
How could I make the return command in Python return a list AS a list, and not as a 'programmer' list? For example, for line in list: return (line) But for some reason it only returns the first element in the list, for example: myList = ['1','2','a','b'] for line in … |
|
Re:
I need help with my facebook page it wont load and my media player wont let me play it |
|
How do you make Python accept multiple strings and break them down in an input? For example, main = input ('> ') if main == ('ECHO',some_words): print (some_words) But everytime I do that, the some_words string wouldn't be defined. Error Message: Traceback (most recent call last): File "<pyshell#7>", line 1, … |
|
Can someone give a code snippet on how to 'chat' using the XMLRPC library in Python? Here's my server code: from xmlrpc.server import SimpleXMLRPCServer from xmlrpc.server import SimpleXMLRPCRequestHandler import os from os import access, path PATH = 'chatlog.$' class RequestHandler(SimpleXMLRPCRequestHandler): rpc_paths = ('/RPC2',) server = SimpleXMLRPCServer(("localhost", 8000), requestHandler=RequestHandler) server.register_introspection_functions() server.register_function(pow) … |
|
Is it possible (without using any external modules) to make two computers, or Python programs communicate through an Ethernet cable? E.g. Sending messages, numbers, etc. And if so, how? |
|
How do you make Python set an str from a file? For example, my file would contain these pieces of text: username=Eugene password=eugene How do I get Python to return this? >>> print(username) Eugene >>> print(password) eugene Any help is deeply appreciated. Thanks! |
|
How do you make Python delete a specific line of text from a file? For example, delete_input = input ('> ') file = open('blahblah.$','w') #delete the variable delete_input file.delete(delete_input from file) Any form of help would be appreciated. Thanks! |
|
I have a very tough problem- how do you make an icon/character move across a console screen? For example, if I press W, +++++ ++E++ +++++ Then I press D +++++ +++E+ +++++ And I want it to be like the CHOICE command in CMD- Without requiring the user to … |
|
How do you make Python delete a string or a number (in this case, .0) from a file? Example: #Error Fixing if '.0' in open('ship.$','r'): #Delete the '.0' |
|
Guys check out http://cx6-dev.blogspot.com/ for an awesome game coded in Python. It's new but still fun. HIGHLY RECOMMENDED! PS: You'll need to have Python 3.2 or above to install/play it. |
|
I have a code for a game. money_file = open ('money.$','r').read() money_file = str(money_file) money = int(money_file) But everytime I run it, it returns an error: Traceback (most recent call last): File "C:\Users\eeo.j\Desktop\CX6 SDK\CX6 Normal\CX6.py", line 86, in <module> money = int(money_file) ValueError: invalid literal for int() with base 10: … |
|
Re:
I've an web page which reads the data from (server side) database and write into csv file, but as per requirement I need to write the file in client side and asked user to save the file in their local machine with popup window to save the location (client side), … |
|
Re:
OK, so when I use open(<filename>, 'w') the program either writes to the specified file or creates a new one if it doesn't exist, right? Is there a way to create a folder path or something? Like to create D:\My Documents\Folder and create a file in that folder? How would … |
|
I've been working on Tkinter, and setting a message box. It worked fine, but I didn't really like the fact that the text displayed was in a small position in the window. Take a look at this code and you'll know what I mean. def About(self): text = Message(self, text=''' … |
|
|
Re:
Hi, all. I am trying to clear the console window without using the "os" library. This seems like the only way to do it: from os import system import time print "I will clear the screen in 2 seconds" time.sleep(2) system("cls") print "*Cleared Screen*" SystemExit() But the problem is, this … |
Is there any way to host several txt files on a computer without having to dive deep into socket programming? I have a few requirements, though: * People could connect when the app is running * No inteference of Windows * Instructions on how to create a client side software … |