python

how can i get the geo_pt on another Model using google app engine(python)

this is my code: class Marker_latlng(db.Model): geo_pt = db.GeoPtProperty() class Marker_info(db.Model): info = db.StringProperty() marker_latlng =db.ReferenceProperty(Marker_latlng) class BaseRequestHandler(webapp.RequestHandler): def render_template(self, filename, template_values={}): values={ } ...

i need to convert the input from telnet to a list in twisted

input from telnet GET /learn/tutorials/351079-weekend-project-secure-your-system-with-port-knocking?name=MyName&married=not+single&male=yes HTTP/1.1 Host: merch1.localhost User-Agent: Mozilla/5.0 (Windows;en-GB; rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11 Accept: text/xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Lang...

how to get the info which contains 'sss', not "= ",

this is my code: class Marker_latlng(db.Model): geo_pt = db.GeoPtProperty() class Marker_info(db.Model): info = db.StringProperty() marker_latlng =db.ReferenceProperty(Marker_latlng) q = Marker_info.all() q.filter("info =", "sss") but how to get the info which contains 'sss', not "=", has a method like "contains "? ...

Where is the raise object in Python?

When you want to print a bunch of variables in Python, you have quite a few options, such as: for i in range(len(iterable)): print iterable[i].name OR map(lambda i: sys.stdout.write(i.name), iterable) The reason I use sys.stdout.write instead of print in the second example is that lambdas won't accept print, but sys.stdout.writ...

Errors using PySnmp on Windows XP

I am running a Python program on a Windows XP machine. When I run the program, I get the following error: File "C:\Python27\lib\pysnmp\smi\builder.pyt, line 230, in loadModules... pysnmp.smi.error.SmiError: MIB file "SNMPv2-MIB.py[co]" not found in search path Does anyone know how I can solve this? The file SNMPv2-MIB.py is curren...

Using Python quick insert many columns into Sqlite\Mysql.

If Newdata is list of x columns, How would get the number unique columns--number of members of first tuple. (Len is not important.) Change the number of "?" to match columns and insert using the statement below. csr = con.cursor() csr.execute('Truncate table test.data') csr.executemany('INSERT INTO test.data VALUES (?,?,?,?)',...

Search Crawling "Bot"?

I am working on a project that requires me to collect a large list of URLs to websites about certain topics. I would like to write a script that will use google to search specific terms, then save the URLs from the results to a file. How would I go about doing this? I have used a module called xgoogle, but it always returned no results. ...

Advanced Tkinter text box?

I am working on a simple messaging system, and need to add the following to a Tkinter text box widget: 1) Spell Check 2) Option To Change Font ( on selected text ) 3) Option to change font color ( on selected text ) 4) Option to Change Font Size ( on selected text ) I have used Google to try and find examples or modules I could use, ...

Prototype for python?

I just learned Prototype for Javascript, it's super convenient, use the $ expanding, access the xml elements is not painful any more! Just wondering if there is any extension like Prototype existed in Python space? ...

.NET vs Python?

Hallo everyone. Today i had a disagreement about which is the best language, C# with ASP.Net and Sql Server or python with postgresql? Can you please give me some good points cause i have to prove that it is a better choice to choose .NET for our eshop instead of Python? ...

How can I remove the axes in an Axes3D class?

Hi, I am using mplot3d like this: fig = plt.figure(figsize=(14,10)) ax = Axes3D(fig,azim=azimuth,elev=elevation) ax.grid(on=False) # Additional axes xspan = np.linspace(0,80+20) yspan = np.linspace(0,60+20) zspan = np.linspace(0,60+20) ax.plot3D(xspan,np.zeros(xspan.shape[0]),np.zeros(xspan.shape[0]),'k--') ax.plot3D(np.zeros(yspan...

convert into string using twisted python

How can i convert this input into a string? GET /learn/tutorials/351079-weekend-project-secure-your-system-with-port-knocking?name=MyName&married=not+single&male=yes HTTP/1.1 Host: merch1.localhost User-Agent: Mozilla/5.0 (Windows;en-GB; rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11 Accept: text/xml,text/html;q=0.9,text/plain;q=0.8,ima...

What are the errors in this code?

Assume you have written a new function that checks to see if your game character has any life left. If the character does not have any life left, the function should print 'dead', if it has less than or equal to 5 life points left the function should print 'almost dead', otherwise it should print 'alive'. am_i_alive(): hit_points...

Using DC to draw wx.BitMapButtons on the fly?

I'm currently able to get this to do most of what I want to. It draws buttons based on lines from a text file as well as handles the way different button states look. What's really tripping me up right now is when self.input writes to the text file I have no idea how to get it to redraw everything to add or update buttons based on the ne...

How to remove lines from stdout in python?

I have a program that grabs some data through ssh using paramiko: ssh = paramiko.SSHClient() ssh.connect(main.Server_IP, username=main.Username, password=main.Password) ssh_stdin_host, ssh_stdout_host, ssh_stderr_host =ssh_session.exec_command(setting.GetHostData) I would like to remove the first 4 lines from ssh_stdout_host. I've t...

Are there any free/open-source WCF client frameworks/libraries out there?

I am working on a tool that will test the server of a Silverlight application. AFAIK, Silverlight uses WCF to communicate with the server. I am curious if here are any free tools out there that can enable to write test scripts that test the server via WCF, preferably in Java, Python, Ruby or anything that does not require .NET. ...

Boost.Python method returned strings truncated, unexpected integer values

I'm using Boost.Python to expose JRA's BWRepLib so I can try to do some data mining on sc:bw replays in python and I've run into a small problem with the values being returned from the C++ methods. When running any old simple program such as the tutorial I get the expected value returned to python (a "hello, world" string that prints out...

Python subprocess timeout?

Hello is there any argument or options to setup kinda subprocess.Popen(['..'], ..., timeout=20)? Sultan ...

TCP server: how to avoid message overlapping

I am going to write a TCP server, the client sends me XML message, I am wondering if below condition will happen and how to avoid that: 1) client sends <cmd ...></cmd> 2) sever is busy doing something 3) clients sends <cmd ...></cmd> 4) server does a recv() and put the string to buffer Will the buffer be filled with <cmd ...></cmd><cmd...

extending scripting integration to an existing lib

I found swig can generate script wrapper for various scripting languages. I've a 3rd party static library, a header file and a lib. How can I use swig so that I can call functions from that library from a scripting language, say python? Thanks ...