15,181 Topics
| |
Hey. You all know the game dwarf fortress? I'm pretty sure it uses curses to display it's ascii characters. Although, how can I overwrite the ascii characters with my own font, like dwarf fortress? EDIT: > Post your code and ask specific questions, I can not catch the connection with … | |
I 've a following query that going to use in python api. SELECT n.FIRST_NAME as "NAME", a.STREET_1 as "ST1", a.STREET_2 as "ST2" FROM SCHE.EMPLOEE_NAME n, SCHE.EMPLOYEE_ADDR a WHERE n.eid=a.eid AND n.estatus='ACTIVE' The above query yields the result cursor().execute(sqlQuery) sqlTupleRows=cursor().fetchall(); sqlQueryReturnedDict={}; for sqlTupleRow in sqlTupleRows: columns=cursor().description ...... Here the column names … | |
Hi Pythonist, I write the code in Python for search and replace the text in all XML files at current directory. But I'm unable to find and replace the text `<tex>` as empty in all XML files. Here I want to remove the text: <tex>z_{1 - \alpha }^2 \,\sigma _{{\rm … | |
Greetings all, I'm trying to crate some symbolic links, provided the link doesn't already exist. To do that, this is what I've done: [icode]if not os.path.islink(dst_dir): os.symlink("src_dir", "dst_dir")[/icode] but still I'm getting [icode]OSError: [Errno 17] File exists[/icode] for an existing link. Any idea what am I missing? another question, how … | |
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 … | |
Hi, I've been having trouble posting a code snipet tonight, I keep getting this error: The code snippet in your post is formatted incorrectly. Please use the Code button in the editor toolbar when posting whitespace-sensitive text or curly braces. My code is running fine in wingware IDE with 4 … | |
| This is a program intended to write text to any file specified var_file = (raw_input('nof$ ') #nof, number of files. try: text = str(raw_input('ttwtf$ ') #ttwtf, text to write to files. print text >>> var_file except ValueError: print "Error: Not a string" main() When the program starts the "`try`" part … |
0 down vote favorite I have written a code to convert decimal numbers into hexadecimal equivalent. The program prints correct value till '2559'. How to get correct values of hexadecimal for larger numbers. Here is my code: ######################################### # Decimal to Hexadecimal Conversion # ######################################### def DectoHex(n): if n <= … | |
I'd like to make a dictionary subclass that takes in positional keywords in addition to the standard *args, **kwargs. I found this example on stackoverflow: class attrdict(dict): def __init__(self, *args, **kwargs): dict.__init__(self, *args, **kwargs) self.__dict__ = self a = attrdict(x=1, y=2) print a.x, a.y print a['x'] b.x, b.y = 1, … | |
Hi, I think I have a pretty simple question but my google searches are giving me more information than I need. I think my terminology is not clear. Let's say I'm making a dictionary to hold a datatype very specific to some filetype or data of interest. Let's say I … | |
I am a fledgling at best when it comes to programing. I am trying to acclimate myself with Python's date and time functions. Below is a program I wrote to calculate the Sun rise and set times for a given lat, long. What I am hoping to find out is … | |
I am trying to learn how to install packages into python. Asn example is http://www.clearskyinstitute.com/xephem/. I have no idea how to do this. I have viewed a variety of sites to help, but none really explain how someone with no clue can do this. Any leads welcome. Thanks | |
Hi, I have been subclassing namedtuple to handle my custom data type: fields=['Query', 'u1', 'Accession] Old = namedtuple('Old', fields, verbose=False) class New(Old): def __repr__(self): return 'Overwriting works nicely' p=New('Hi',2,3) print p >>> 'Overwriting works nicely' What I want to do is to add the behavior that some of my fields … | |
Hi guys, This is more a general discussion of methodology than a specific question. I have been working on a, the primary purpose of which is to store an oddly formatted data file (aka not you classic CSV). At the end of the day, the data is stored in a … | |
As the title says, I have a flash drive, and a script on that flash drive. Whenever I plug my drive into my Mac OSX, I want a specific Python script that is on my drive to run, and be able to access directories on my computer. Why am I … | |
My script is sapposed to have you choose a number and then spit out that number of 1's and 2's randomly chosen and then count and post how much.could someone help me by telling me what is wrong, i would really apreciate it, here is the script(it is a cmd … | |
I am learning about networking and programming. I am trying to be a simple IM application. What i am trying to achieve having a server application route messages between computers over the internet creating a simple instant messenger. However i can't find any sort of tutorial for that. I want … | |
I am trying to call functions from a DLL `function oziRepositionWP(Number:integer;lat,lon:double):integer;stdcall; ` I have written the code in python no = c_int(1) lat = c_double(34.00962) lon = c_double(74.80067) var =windll.OziAPI.oziRepositionWP(byref(no),byref(lat),byref(lon)) But i get the message var =windll.OziAPI.oziRepositionWP(byref(no),byref(lat),byref(lon)) ValueError: Procedure probably called with not enough arguments (8 bytes missing) where am … | |
Hi again, I'm here to ask another stupid question so I apologize. I'm going to make a calculator in Python but I've ran into a wall, with the tutorials I've been following I've only ever been taught how to add two numbers together. Never have I learned how to add … | |
Hello python world. I am new to python. I need some help in creating a table. It is an input file as <name>,<age>,<gender>,<marks>. these items can be seperated using a ','. The test part would contain mixed spaces.. e.g Jhones can be written as __JHoneS__. but if has to return … | |
Hi, I have made a square that will move but there are some bugs in the movement. I can't find anything wrong with the logic which is why I need help ;) You have to press left and right to move the square. The problems with the movement are: 1: … | |
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, … | |
Hi, I just installed PyQt Designer to start creating UI's with python, I've used WxPython and TKinter before, but never really done anything with PyQt. So for some of you this might be a very simple question that I can't seem to find with google. I really like how it … | |
I need to write a code that imports a list of files then goes through each file and rewrites only half the file. Cutting off the file at a key word. If I can make my code print the half I need I can make it write new files with … | |
Hey all I would like to ask a few questions about an idea I had for my forensics class. 1. How hard would it be to create a script that monitored when icons on the desktop are moved? AND (bonus) if they are in a specific placement THEN call a … | |
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? | |
I would like to develop a SQL injection vulnerbility scanner. However, i dont know how to develop it, It is any module in python could help me develop this app? My app requirement User able to input the target URL and apply SQL injection scanning on target URL After that, … | |
Could someone please give me a pointer as to why my use of appendText fails? This is my first bit of programming for 30 years - I'm sorry if its an idiot mistake :) The program has 2 text fields. You paste a list of url's into the first box … |
The End.