How do I randomly add buttons to a Tkinter GUI? I need it to be able to create a button, then put it anywhere on the window, is this possible? I am using Python 2.6 on Windows.
Being new to Python, I decided to get some feedback on a class I'd written ASAP so I ran it against pylint. Is the message it gave "Warning: Method could be a function" telling me that it would be better to move this method out of the class because it doesn't use any instance variables? In c# I would make this a static method. What's the most pythonic thing to do here?
This may be a basic question but how can I include a module with my app.
I'm very new to python and what I want to do is to include this module simplejson with my app, but after downloading it I have no idea what to do next :(
This is how the module looks like after unzip it.
I don't know what files to move to my app.
i look at this article : http://code.google.com/intl/zh-CN/appengine/docs/python/mail/receivingmail.html
and i want to know : is article used to deal with mail from others send to me ?
and my gmail is [email protected] , so someone send email to [email protected],i can do something automatically use incoming mail ,yes ?
thanks
how can I write a .py file from python such that its type should not be like 'ASCII file with Windows CRLF'
because when i run file.write(data) inside windows it write the file but when I try to
eval(open(file.py).read()) it fails and gives syntax error because of windows CRLF on each line......
This is the standard question, "How do I set a process limit for a user account in Linux to prevent fork-bombing," with an additional twist. The running program originates as a root-owned Python process, which then setuids/setgids itself as a regular user. As far as I know, at this point, any limits set in /etc/security/limits.conf do not apply; the setuid-ed process may now fork bomb. Any ideas how to prevent this?
Hello everyone,
I am trying to write Python wrap for C code which uses struct.
modules.c:
struct foo
{
int a;
};
struct foo bar;
modulues.i
%module nepal
%{
struct foo
{
int a;
}
%}
extern struct foo bar;
But during compiling I am given error:
In function ‘Swig_var_bar_set’:
error: ‘bar’ undeclared (first use in this function)
Could you be so kind to help me how to correctly define export struct variable ?
How Google App instance can get the list of developers (like in Administration Developers).
I would like to get a solution in python (because I don't know java).
See here: http://api.giantbomb.com/documentation/
Would I need to use something similar to the WebClient.DownloadData() from C#, but only in Python3?
I'm incredibly new to Python so maybe something even simpler already exists. Thank you for your time.
http://code.google.com/intl/en/appengine/docs/python/tools/uploadingdata.html
the api is :
Downloading Data from App Engine
To start a data download, run appcfg.py download_data with the appropriate arguments:
appcfg.py download_data --config_file=album_loader.py --filename=album_data_archive.csv --kind=Album <app-directory>
i want to download data from my gae app zjm1126.appspot.com
so i write this in the commond:
appcfg.py download_data --config_file=GreetingLoad.py --filename=GreetingLoad.csv
but, i don't know how to write the 'app-directory'
so , how to write the 'app-directory'..
thanks
Is there anyway to know which functions exported from the dll througth python foreign function library -ctypes-
and if possible to know details about the exported functions throught ctypes.
if yes could someone provide snippet of code
I have the following Python 2.6 program and YAML definition (using PyYAML):
import yaml
x = yaml.load(
"""
product:
name : 'Product X'
sku : 123
features :
- size : '10x30cm'
weight : '10kg'
"""
)
print type(x)
print x
Which results in the following output:
<type 'dict'>
{'product': {'sku': 123, 'name': 'Product X', 'features': [{'weight': '10kg', 'size': '10x30cm'}]}}
It is possible to create a strongly typed object from x?
I would like to the following:
print x.features(0).size
I am aware that it is possible to create and instance from an existent class, but that is not what I want for this particular scenario.
I would like to implement a Python script which has the same functionality as http://www.greymagic.com/security/tools/decoder/
Is the encoding rule open for this type of javascript code encoding?
Thanks.
I would like to add subfolders while creating the python script using py2exe..
The syntax I have used is --
setup(windows = [{"script":"test.py"}],data_files=
[('Folder A',
[('Subfolder B'
,[os.path.join('Folder A','XYZ.py')]
)]
)]
)
What will be the correct syntax for creating a folder A, a subfolder B which includes file
XYZ??
I want to develop a gwt application using python .. but I fear that google will be the only host to host the code. is it possible to run gwt app on private server of other host.
I've just recently switched over to using 64-bit Python 2.6.1 on Mac OS X 10.6 (Snow Leopard). IPython won't work with Django anymore, but IPython works from the command-line.
The error says:
shell = IPython.Shell.IPShell(argv=[])
AttributeError: 'module' object has no attribute 'Shell'
I could use the ./manage.py --plain option, but it's not really a fix. Any help very gratefully received!
I have FigureCanvasWxAgg instance with a figure displayed on a frame. If user clicks on the canvas another frame with a new FigureCanvasWxAgg containing the same figure will be shown. By now closing the new frame can result in destroying the C++ part of the figure so that it won't be available for the first frame.
How can I save the figure? Python deepcopy from copy module does't work in this case.
Thanks in advance.
Okay. I have completed my first python program.It has around 1000 lines of code.
During development I placed plenty of print stmt before running a command using os.system()
say something like,
print "running command",cmd
os.system(cmd)
Now I have completed the program.I thought about commenting them but redirecting all these unnecessary print (i can't remove all print stmt- since some provide useful info for user) into a log file will be more useful? Any tricks or tips.
Trying to implement a web service which should have exactly the same function as http://www.google.com/finance the search quotes box
when user type the stock name or company name, the right stock name is suggested while typing.
my service will using historical information from google finance, so get proper quote name from google is a must!
anyone knows where i could find this quote list through google finance api? better with python.
or anyone can suggest some ideas please?
many thanks
I have a python list as
[
(A,{'a':1,'b':2,'c':3,'d':4}),
B,{'a':1,'b':2,'c':3,'d':4}),
...
]
I want to know if there is a standard library of serializing this kind of list to xml or should I hand code it to a file.
I want to use Google Data API on a Symbian device with pys60 but I could'nt find any doc.
Is there any way to install Google Data APIs Python Client Library on Symbian ?
Hello, I am wanting to write a script to play the .pls files Shoutcast uses to broadcast, but I am not sure how to do that. I want to write it in Python. Any help would be great!
Hey all,
I'm using PyLab to make some graphs in Python. I want to make a text box that is colored magenta with black text, but cannot get the text to be black.
text(x, y, 'Summary', backgroundcolor = 'm', color = 'k')
This gives me a magenta background and then text that is almost just as pink. Any ideas what I'm doing wrong?
Many thanks!
Hi All,
Pls someone guide me in finding paid Grad internships in Natural Language Processing over the summer. I am really interested in NLP/ML and have taken up the excellent course offered at my school in Fall. I would be glad to work for passionate startups that do actual NLP tasks such as semantic extraction (and not just information retrieval) etc. I have worked with Java and teaching myself Python in all NLP tasks.
Thanks,
Sanjay
I would like to know what are the certificates available for programming, like
Zend for PHP
SUN Certification for java
what are the others?
Javascript ?
C++ ?
Python ?
etc...
Please give me some suggestion for other available certifications.