last day (35 days later) » 

9:43 AM
This is an example room that is not question -oriented, but may serve as a home for more general discussion points for people interested in all things python.
And they probably want to know about interesting SO questions, so...
 
newest questions tagged python - Stack Overflow
1
votes
4
answers
No more BeautifulSoup

Peter NielsenHi there.. I have been using BeautifulSoup but as I understand it that library is no longer being maintained. So what should I use ? I have heard about Xpath but what else is there ?

python parser
newest questions tagged python - Stack Overflow
0
votes
0
answers
python opencv: no image

user391339Hi all, I am trying to capture from a Sony Handicam DCR-HC38, running the code below, and passing [-1 .. 3] to the CaptureFromCAM function. The code runs, but I get no image. Do I need to "wrap" the camera somehow? Skype recognizes the camera, but python/opencv won't. I'm running W...

python opencv camera capture
newest questions tagged python - Stack Overflow
1
votes
0
answers
How to create logic bricks programmatically in Blender?

muhukI would like to let my initializing script to create additional sensors/controller/actuators necessary for an interactive Blender application (not necessarily a game). This is preferable for two reasons: I can use this script in multiple applications. Creating common logic over a...

python 3d interactive game-engine blender
newest questions tagged python - Stack Overflow
0
votes
3
answers
Django - How to share configuration constants within an app?

JonathanIt is sometimes beneficial to share certain constants between various code files in a django application. Examples: - Name or location of dump file used in various modules\commands etc - Debug mode on\off for the entire app - Site specific configuration What...

python django style constants
newest questions tagged python - Stack Overflow
0
votes
1
answers
Can we generate DTMF tones using python?

Rupesh ChavanHello, i am keen to know whether we can generate a DTMF tones using python? If yes then is there any library to do so? I have checked on the net there i could find sample program to decode the DTMF tones but not vice-versa. It would be great if anyone can give me some hint. Thanks,...

python telecommunication
 
...we can consume the python RSS feed inside the room.
 
and, you can mute these feeds by clicking on the "feeds" user!
 
9:59 AM
Well, isn't this nifty
 
newest questions tagged python - Stack Overflow
0
votes
0
answers
Error! could not create a empty list

ShilpaOpen = [] Closed = [] currNode = problem.getStartState() Open.push(currNode) while (len(Open) != 0): node = Open.pop() if problem.isGoalState(node): print "true" if node not in Closed: Closed.push(no...

python
 
10:22 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
URL udpation while using django

JijoyHi , I have started using django very recently . I am building a service with user login. Login , I am sending as POST service. There is a template to render , once the user is logged in. But the browser address is not getting updated. eg : abc.com the root my form would be somet...

python django
newest questions tagged python - Stack Overflow
0
votes
0
answers
python Qt4 How to bind action on button click

Oleksandrhi! I'm trying make my first python app. I want make simple email sender form. In qt designer create a dialog.ui, then generate dialog.py from dialog.ui and write there function def SendEmail(self,efrom,eto,esubj,ebody): msg = MIMEText( ebody.encode('UTF-8'),'html', 'UTF-8'...

python
newest questions tagged python - Stack Overflow
0
votes
0
answers
Reading an audiostream in python.

thepandaatemyfaceHi, Amazingly, in bash, you can do $ curl mp3.streampower.be/radio1-high.mp3 > test.mp3 with an audiostream and then ^C out, and you will have a working mp3 file, leading me to believe I could have this automated in python, but I can't find ...

python audio stream inputstream
 
Aha! Alrighty, two things:
 
jkp
10:37 AM
So is this meant to be like a wave / irc replacement provided by the StackExchange team?
 
1. The mute option in the box that opens up when you click on (or I think also mouseover?) the Feeds user isn’t super obvious. Three unspaced text links in the same colour, and that colour is a tastefully subtle shade of red.
 
@jkp / @Paul - those things may be more appropriate to the chat feedback room:
Chat feedback - We want your thoughts...
 
@Marc: aha, yes, good point.
This one might be for here: 2. how do I get the feeds back once I’ve muted them?
 
That depends whether you muted them temporarily, or forever.
If temporary, then reload
If permenant, you can undo this on your user page
We should make this easier though.
 
Gotcha. Looks like permanently, I’ll have a look at my user page. Overall: great job guys, this is fantastic. Two of you built this? Makes me feel sorry for the bigger tech companies, brontosauruses with raptors like you chomping away merrily at their legs.
 
10:47 AM
We did have some other input, for example styling by the excellent Jin
Jin, DC
315 1 5
html css web-design design color photoshop rgb
 
newest questions tagged python - Stack Overflow
0
votes
0
answers
SQLAlchemy and max_allowed_packet

David ParunakianDue to the nature of my application, I need to support fast inserts of large volumes of data into the database. Using executemany() increases performance, but there's a caveat. For example, MySQL has a configuration parameter called max_allowed_packet, and if the tota...

python mysql sqlalchemy
newest questions tagged python - Stack Overflow
0
votes
0
answers
help in finding the syntax error

Shilpastack = [] closed = [] currNode = problem.getStartState() stack.append(currNode) while (len(stack) != 0): node = stack.pop() if problem.isGoalState(node): print "true" closed.append(node) else: child = problem.getSuccessors(node) ...

python
 
11:05 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Rendering dynamic images with google app engine.

anandHi All, I am working on a Google app engine project where I have saved some images in the datastore. Now I have to resize these images and render them to the template. I have successfully fetched the images but I am not getting,how to render them with other data dictionaries to the te...

python google-app-engine
 
11:27 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
how to process a audio file using python

hidayathow to process a audio file using python

python file audio
 
12:04 PM
newest questions tagged python - Stack Overflow
0
votes
1
answers
Downloading files using Python

AlfredHi. I need to download files from the internet. For that I am using subprocess and calling wget. Is this the right way? The files are hosted on static links and there is no need to log in or anything. I glanced over urllib but I could no...

python
newest questions tagged python - Stack Overflow
0
votes
0
answers
[python] mysqldb rowcount bug?

www.yegorov-p.ruHello I've got some problems with a script I'm writing. #!/usr/local/bin/python import MySQLdb ConvDB = MySQLdb.Connect(host="1.1.1.1", user="123", passwd="123", db="somedb") ConvDBcursor = ConvDB.cursor() query="SELECT id from sometable WHERE somethng=63" print quer...

python beginner mysqldb
newest questions tagged python - Stack Overflow
0
votes
0
answers
Back-casting a ctypes.py_object in a callback

Freddie WitherdenI am trying to wrap a C library using ctypes. One feature of the library is an ondestroy callback which is called when a handle returned by the library is about to be destroyed. The callback has the signature: void cb(f *beingdestroyed); The API allow...

python ctypes
newest questions tagged python - Stack Overflow
0
votes
0
answers
how to make a script be active for only on every hour on the half hour?

RichardHello all. I have a script and I want to code it so that it becomes active every hour on the half hour. This is the code I have so far. from ConfigParser import * import emailModule from datetime import datetime import time configuration = ConfigParser() configuration.read('E...

python efficiency
 
12:30 PM
newest questions tagged python - Stack Overflow
0
votes
1
answers
Python equivalent of Curl HTTP post

Arnab Sen GuptaI am posting to Hudson server using curl from the command line using the following-- curl -X POST -d '4142430A02000' \ jobName/postBuildResult">http://user:pass@myhost/hudson/job/jobName/postBuildResult

python http curl
newest questions tagged python - Stack Overflow
0
votes
0
answers
How can I set UVs to a Mesh in Blender Python ?

George ProfenzaUsing Blender 2.49's Python API I'm creating a mesh. I have a list of vertices and a list of face indices. e.g. mesh = bpy.data.meshes.new('mesh') mesh.verts.extend(mVerts) mesh.faces.extend(mFaces) I've noticed MVert's

python blender bpython bpy uvw
newest questions tagged python - Stack Overflow
0
votes
0
answers
Django: Save to a many-to-many field in a ModelForm's save() method?

GroadyI'm writing a webblog app in Django. I currently have 2 models Post and PostMeta. Post is a standard post style model with fields such as author, title, content etc. It also contains a single many-to-many field called post_meta which is associated with my second model PostMeta. PostMeta is a s...

python django
 
12:57 PM
newest questions tagged python - Stack Overflow
1
votes
5
answers
python: How do I assign values to letters?

EddyI want to assign a value to each letter in the alphabet, so that a -> 1, b -> 2, c -> 3, ... z -> 26. Something like a function which returns the value of the letter, for example: value('a') = 1 value('b') = 2 etc... How would I go abou...

python string mapping letters
 
1:13 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Error in `import objc` : Symbol not found: _PyType_Modified

Anurag UniyalMy system is Mac OS X 10.5.8 and I have installed python from python.org/ftp/python/2.5.4/python-2.5.4-macosx.dmg because I do not want to use System python (python which already comes instal...

python pyobjc
 
1:23 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Parsing .c/.cpp/.py source files in Python to get a list of the functions contained

pimesonI'm trying to learn about parsers, for Python, C and C++ source (on my own, not for a school project). Here is a summary of what i want to do: 1) read .c/.cpp/.py source files in Python 2) get a list of all the functions in the source files, and the span of their definitions in terms of line...

c++ python c parsing
newest questions tagged python - Stack Overflow
0
votes
0
answers
java-applet gui testing with python

user266011is there any frame-work or tool to test java-applets in python

python
newest questions tagged python - Stack Overflow
0
votes
0
answers
Why can't I create a COM object in a new thread in Python?

DangerMouseI'm trying to create a COM Object from a dll in a new thread in Python - so I can run a message pump in that thread: from comtypes.client import CreateObject import threading class MessageThread(threading.Thread): def __init__(self): threading.Thread.__init__(self...

python com comtypes python-multithreading
 
1:44 PM
newest questions tagged python - Stack Overflow
-1
votes
0
answers
python and web field !

str1k3rhello everybody today am looking for method of modules functions .. to help to do that example ok first telling my python file go to www.example.com and looking for The user name field and enter the username :Hello World and search of submit and check on it did you understand ? ok I'll re ex...

python
 
2:00 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Using lxml to find order of text and sub-elements

muckaboutLet's say I have the following HTML: <div> text1 <div> t1 </div> text2 <div> t2 </div> text3 </div> I know of how to get the text and subelements of the enclosing div using lxml.html. But is there a way to access both t...

python html xml lxml
newest questions tagged python - Stack Overflow
0
votes
0
answers
stdiodemo and command history

user391648Hello again to all, While playing and extending stdiodemo.py, a came up with a thought of adding command line history. Is this possible? Any hints? Thanks Antonis K.

python twisted
 
2:36 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
variable table name in sqlite with out using a string constructors

NarcolapserQuestion: Is it possible to use a variable as your table name w/o having to use string constructors to do so? Info: I'm working on a project right now that catalogs data from a star simulation of mine. To do so I'm loading all the data into a sqlite database. It's workin...

python database sqlite table
newest questions tagged python - Stack Overflow
1
votes
0
answers
Choosing a random file from a directory in Python

NoneTypeI have a directory with a large number of files (~1mil). I need to choose a random file from this directory. Since there are so many files, os.listdir naturally takes an eternity to finish. Is there a way I can circumvent this problem? Maybe somehow get to know the number of files in t...

python files
 
2:47 PM
newest questions tagged python - Stack Overflow
1
votes
0
answers
Is it possible to add a single row to a Django form?

SimonI have a form along the lines of: class aForm(forms.Form): input1 = forms.CharField() input2 = forms.CharField() input3 = forms.CharField() What I'm hoping to do is add an additional input3 to the form when the user clicks an "add another input3".

python django forms django-forms
 
3:08 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Approach to upgrade application configuration

stanleyxu2005Hi All, My application has a xml based configuration. It has also a xsd file. Before my application starts, xmllint will check the configuration against the xsd file. With the growth of my application, the configuration structure has changed a bit. Now I have to face this prob...

python xml configuration xsd upgrade
 
remarkable.
This much power and clear syntax too!
 
newest questions tagged python - Stack Overflow
0
votes
0
answers
Using Python version 2.6.4 how to program excels filter function

Jon RipleyThanks in advance. Using Excel in the data tab there is a filter option. I wish to implement that into a program I have been working on. It may be as simple as 1 line. If you know anything or if it is not possible in this version/programming language please let me know Thanks!

python excel formatting filter help
newest questions tagged python - Stack Overflow
1
votes
0
answers
Running a Python program on a web server

ssdesignHi, I have a Python script which accepts a XML file as input and then processes it and creates another file. Now the way I have to run this program in terminal (mac) is: ttx myfile.xml

python mod-python
newest questions tagged python - Stack Overflow
0
votes
0
answers
Where`s the primary key of the object I want to update in django using modelform?

WeholtI`m using modelform in django to insert and update objects in my database, but when I try to update I cannot see the primary key/id of the object being updated: My model: class Category(models.Model): name = models.CharField(max_length=20, db_index = True)

python django update id
newest questions tagged python - Stack Overflow
0
votes
0
answers
Self Extract ZIP?

Zachary BrownI need help creating a self extracting zip file that does not display anything. I just need it to extract the files to a given place in the background. Everything I have found displays a dialog, but I need it to just run in the background.

python vbscript background zip self-extracting
 
3:39 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
python: How to check arguments of the function

Oleg TarasenkoHi, I have function defined this way: def f1 (a, b, c = None, d = None): ..... How do I check that a,b are not equal to some value. E.g. I want to check they are not empty strings like, "" or " " Thinking about something like.

python
 
3:51 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Using Python Functions From the Clips Expert System

Chris SUsing PyClips, I'm trying to build rules in Clips that dynamically retrieve data from the Python interpreter. To do this, I register an external function as outlined in the manual

python machine-learning expert-system clips
newest questions tagged python - Stack Overflow
0
votes
0
answers
How to preload model for ReferenceProperty?

AntonHello! I have a models in different files (blog/models.py, forum/models.py, article/models.py). In each of this files I have defined model classes with application prefix (BlobPost, BlogTag, ForumPost, ForumThread, Article, ArticleCategory). Also I have appliation - comment, fo...

python google-app-engine
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python: Range() maximum size; dynamic or static?

Andrew BolsterI'm quite new to python, so I'm doing my usual of going through Project Euler to work out the logical kinks in my head. Basically, I need the largest list size possible, ie range(1,n), without overflowing. Any ideas?

python overflow range
 
4:12 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python file upload "KeyError"

ssdesignHi, Whats wrong in this code? Here is my HTML: <html><body> <form action="iindex.py" method="POST" enctype="multipart/form-data"> <p>File: <input type="file" name="ssfilename"></p> <p><input type="submit" value="Upload" name=...

python fileupload cgi
 
4:23 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Eclipse using multiple Python interpreters with execnet

Eduardo CoelhoHi there, I'm using the execnet package to allow communication between Python scripts interpreted by different Python interpreters. The following code (test_execnet.py): import execnet for python...

python eclipse python-interpreter
newest questions tagged python - Stack Overflow
0
votes
0
answers
XML-RPC Javascript Unsupported method ('OPTIONS')

MattyWWe've got an XML-RPC server (implemented in python), and I'm trying to write a simple javascript app to send calls to it. Whatever library I make I seem to always get the error: Unsupported method ('OPTIONS') It's fair to say I don't understand the underlying ...

javascript python http xml-rpc
 
4:39 PM
newest questions tagged python - Stack Overflow
0
votes
1
answers
Extract specific text lines?

novakI have a large several hudred thousand lines text file. I have to extract 30,000 specific lines that are all in the text file in random spots. This is the program I have to extract one line at a time: big_file = open('C:\\gbigfile.txt', 'r') small_file3 = open('C:\\small_file3...

python
newest questions tagged python - Stack Overflow
0
votes
0
answers
django admin panel changelist submit

Uszy WielorybaI have used list_editable setting to make several fields editable on my model in the admin panel. The problem is, that when I edit the values and hit Enter, the browser behaves as if I clicked Go button next to actions drop-down list. I get the j...

python django django-admin
 
5:01 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
How find values in an array that meet two conditions using Python

DavidI have an array a=[1,2,3,4,5,6,7,8,9] and I want to find the indices of the element s that meet two conditions i.e. a>3 and a<8 ans=[3,4,5,6] a[ans]=[4,5,6,7] I can use numpy.nonzero(a>3) or numpy.nonzero(a<8) but not numpy.nonzero(a>3 and a<8) which gives the error: ValueErro...

python find numpy
newest questions tagged python - Stack Overflow
0
votes
1
answers
slicing python array elements with a vector similar to matlab/R

mindmattersI'm new to python and wanted to do something I normally do in matlab/R all the time, but couldn't figure it out from the docs. I'd like to slice an array not as 0:3 which includes elements 0,1,2 but as an explicit vector of indices such as 0,3 For example, say I had this data structur...

python
 
5:39 PM
newest questions tagged python - Stack Overflow
3
votes
0
answers
Python's enum equivalent

Amir RachumWhat is the Python idiom for a list of differently indexed names (like Enum in C/C++ or Java)? Clarification: I want a property of a value to be set to a restricted range, such as card suites Heart, Club, Spade, Diamond. I could represent it with an int in range 0..3, but ...

python enums
 
6:00 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
"BadValueError: Filtering on Text properties is not supported" on a StringProperty using AppEngine

MartinHi, I am running AppEngine locally.I use some filters on the following attribute of my object : class Blah(db.Model): access_code = db.StringProperty() Then I run my filter in the view: cac = CustomAccessCode.all().filter( 'acc...

python google-app-engine app
newest questions tagged python - Stack Overflow
0
votes
0
answers
Setting an excel sheet in landscape mode from XLWT

timothyawisemanI have a Python program that creates an excel sheet, but I have been asked by one of the users to modify it so that if he hits print it will print out to landscape mode, without him having to specify this. Is there some way to set the sheet to landscape in XLWT or some similar Python library ...

python excel xlwt
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python - How to PYTHONPATH with a complex directory structure?

JonathanConsider the following file\directory structure: project\ | django_project\ | | __init__.py | | django_app1\ | | | __init__.py | | | utils\ | | | | __init__.py | | | | bar1.py | | | | ... | | | ... | | django_app2\ | | | __init__.py | | | bar2....

python pythonpath python-import
newest questions tagged python - Stack Overflow
0
votes
0
answers
Unable to use sorted() on a list of Model classes

GregAfter running a query on the datastore, I copy the results to a new list as I interrogate, merge and prune the results. When I'm finished, I'd like to sort the new list, but I'm seeing the following error... TypeError: 'LiveRouteStatus' object is unsubscriptable LiveRouteStatus...

python google-app-engine
 
6:21 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Why does django complain that I have not set my ENGINE yet?

Brian DDATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'djangobb', # Or path to database file if using sqlite3. 'USER': 'root', ...

python django web-development
newest questions tagged python - Stack Overflow
0
votes
0
answers
Error!!! cant concatenate the tuple to non float

Shilpastack = [] closed = [] currNode = problem.getStartState() stack.append(currNode) while (len(stack) != 0): node = stack.pop() if problem.isGoalState(node): print "true" closed.append(node) else: child = problem.getSuccessors(node) ...

python
 
6:37 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Override "remaining elements truncated" in Python

duane9I'm using the Python shell in Django to make some queries. The results keep getting truncated. I get the message, "remaining elements truncated." How can I see all the results? Or, how can I write the results to a file?

python django
 
6:47 PM
newest questions tagged python - Stack Overflow
1
votes
1
answers
Python convert string object into dictionary

learnerHi I have been working to build a complex data structure which would return a dictionary. Currently that class return string object of the form { cset : x, b1 : y, b2 : z, dep : { cset : x1, b1 : y1, b...

python string dictionary
newest questions tagged python - Stack Overflow
0
votes
0
answers
python data types

lollygaggerI wrote a script to take files of data that is in columns and plot it depending on which column the user wants to view. Well, I noticed that the plots look crazy, and have all the wrong numbers because python is ignoring the exponential. My numbers are in the format: 1.000000E+1 OR 1...

python datatypes
 
7:03 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Using Jython, I need to randomize a string keeping the words in tact.

carsonThis is the problem: Function Name: randomSentenceRedux Parameters: 1.string – a string object to manipulate Return Value: A transformed string where the words from the original sentence are in a random order. Test Case(s):

java python
newest questions tagged python - Stack Overflow
0
votes
4
answers
Print in one line dynamically. Python

PolHow to print in python in one line. Suppose I have iteration for iten in range(1,100): print item It give me 1 2 3 4 ...... but I want to be result like this 1 2 3 4 5 ...................

python print
newest questions tagged python - Stack Overflow
0
votes
0
answers
Uploading Django Development to Dreamhost/Passenger first time "Could no import"

iJamesHi, I've been developing on my laptop. Now, I've uploaded my development project from Django 1.2/Python 2.7 up to Dreamhost created using the Passenger setup. I am using South for migration. I modified settings.py to access MySQL. Got Admin working. Question...

python django dreamhost
 
7:30 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Does python have a non-lazy version of itertools.groupby?

dvogelI don't need the laziness of itertools.groupby. I just want to group my list into a dict of lists as such: dict([(a, list(b)) for a,b in itertools.groupby(mylist, mykeyfunc)]) Is there a standard function that already does this?

python itertools
 
7:41 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Understanding behavior of django model save

blurbackWhen using the shell, this confused me (the permissions did not reflect changes): >>> user = User.objects.get(username='test') >>> user.get_all_permissions() set([]) >>> p = Permission.objects.get(codename="add_slide") >>> user.user_permissio...

python django
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python feedparser not using atom/WordPress namespace?

Kyle FoxI'm trying to use feedparser (an excellent library) to parse WordPress export files, and a (minor) inconsistency between WordPress version is causing me a huge headache. WordPress 2.x doesn't include atom:link tags in the...

python xml wordpress atom feedparser
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python 2.6.4 marshal.load doesn't accept open file objects made with subprocess.Popen

Pat CorwinThis is a really unfortunate situation. Maya 2011 comes with 2.6.4 and this code does not work in it: pipe = subprocess.Popen( 'p4 -G edit C:/somefile.txt', stdout=subprocess.PIPE).stdout try: while 1: record = marshal.load( pipe ) list.append( record ) ex...

python
newest questions tagged python - Stack Overflow
0
votes
0
answers
python QThread.run parameters - changed between versions?

NathanHi, In my code (python2.6, PyQt4) I do something like this: def myRun(): doStuff thread = QtCore.QThread() thread.run = myRun thread.start() On my gentoo machine, this works perfectly. On a ubunut (9.10, Karmic Koala) it does not work, it says: Typ...

python pyqt4 qthread
newest questions tagged python - Stack Overflow
0
votes
0
answers
How to reload a file in python?

teratomataIf I have a script that writes 1000 lines to file and then continues regular expressions against that file, however only the last 100 lines of text written will be available. One way around this is to close and reopen the file. Is there a way to reload a file after being written to or should I...

python file-io
newest questions tagged python - Stack Overflow
0
votes
0
answers
homework in python plzzzzzz help

babikaris there anyone that can do my python homework.. some emergency happened and I have to go somewhere and I wont be able to access a computer and I dont think i will have the time to do it also! :( I have done some things that are are showed at the end of the page so if there is some one...

python homework
newest questions tagged python - Stack Overflow
0
votes
0
answers
How to print a string of variables without spaces in Python (minimal coding!).

ThinkCodeI have something like : print "\n","|",id,"|",var1,"|",var2,"|",var3,"|",var4,"|" It prints with spaces for each variable. | 1 | john | h | johnny | mba | I want something like this : |1|john|h|johnny|mba|

python print stdout
newest questions tagged python - Stack Overflow
0
votes
0
answers
ORM in Django vs. PHP Doctrine

EthanI am a PHP guy. In PHP I mainly use Doctrine ORM to deal with database issues. I am considering move to Python + Django recently. I know Python but don't have experience with Django. Can anyone who has good knowledge of both Doctrine and ORM in Django give me a comparison of these two ORM impl...

php python django orm doctrine
 
8:14 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Django view function calling xmlrpc client

asdfasdI have a view function which needs to perform an xmlrpc call to my engine which runs on twisted. I have googled around for something like that, but there doesn't seem to be any material on django + xmlrpc CLIENT (there's tons of literature on xmlrpc server + django). The reason behind ...

python django xmlrpc
 
8:25 PM
newest questions tagged python - Stack Overflow
0
votes
1
answers
Using Deque.popleft as args for function

Andy BarlowHi, I am attempting to store a list of commands to send down a serial cable using deque in Python. My function "send_command" accepts 3 values; The command, an int. pause and a boolean wait. its definition is as follows. def send_command(self, command, pause=0, ...

python lists tuples deque
newest questions tagged python - Stack Overflow
0
votes
0
answers
Loading a config file from operation system independent place in python

NathanHi, under Linux I put my configs in "~/.programname". Where should I place it in windows? What would be the recommendated way of opening the config file OS independent in python? Thanks! Nathan

python windows linux
newest questions tagged python - Stack Overflow
0
votes
0
answers
how to change page selection in wxNotebook or wxChoicebook?

David MortonIs there any way to change the page of a wxNotebook or wxChoicebook programmatically? Looking at the documentation I would have thought that wxChoicebook::ChangeSelection was the way to go, or wxChoicebook::SetSelection if I want the page changing/changed events to be sent. However, I don't ...

python gui wxwidgets
newest questions tagged python - Stack Overflow
0
votes
0
answers
Minimizing, maximizing exe's..

MarijusHow do I maximize, minimize, check whether the program is minimized ?

python beginner
newest questions tagged python - Stack Overflow
0
votes
0
answers
How to efficiently output dictionary as csv file using Python's csv module? Out of memory error.

user248237I am trying to serialize a list of dictionaries to a csv text file using Python's CSV module. My list has about 13,000 elements, each is a dictionary with ~100 keys consisting of simple text and numbers. My function "dictlist2file" simply calls DictWriter to serialize this, but I am getting ...

python csv dictionaries
 
8:46 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python twisted asynchronous write using deferred

Ken PuWith regard to the Python Twisted framework, can someone explain to me how to write asynchronously a very large data string to a consumer, say the protocol.transport object? I think what I am missing is a write(data_chunk) function that returns a Deferred. Th...

python asynchronous twisted
newest questions tagged python - Stack Overflow
0
votes
0
answers
Visualize and clustering

JackyEarlier on i post a question about visualization and clustering. I guess my question was not quite clear enough so I post it again. I hope i make a better explanation this time . I also apologize for not "accept answer" for my old questions. I didn't know i can do that until a guy point it out...

python clustering visualization
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python writing programs

novakIn the actual window where I right code is there a way to insert part of the code into everyline that I already have. Like insert a comma into all lines at the first spot>?

python
newest questions tagged python - Stack Overflow
0
votes
0
answers
Django boilerplate template code

user386129Hi, I am a django newbie and in creating my first project I have come to realize that a lot of my boilerplate code (the lists on the side of my page). I have to recreate them in every view and I am trying to stick with DRY but I find myself rewriting the code every time. Is there a wa...

python django
 
9:13 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python: KeyError with form.getfirst

HarpalI have a dtml page, which calls a function, with this code: <dtml-var public_blast(form.getfirst('job_ID'))> But i get a key error? stating "KeyError: "public_blast(form.getfirst('job_ID'))" ". I can see the job_ID variable at the top of the page. So i k...

python
newest questions tagged python - Stack Overflow
-1
votes
0
answers
inserting text with python

novakI need to insert some text at the beginnnig and the end of each line of a text file. how can I use python to do this?

python
 
9:29 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Access MP3 music data using Python.

Jack M.I'm trying to write a Python script for searching out duplicate mp3/4 files using the song's data as the base for comparison. My situation involves many mp3/4 files with similar file names, but different ID3 tags. At first I tried looping through and using md5 to find duplicate files (ignori...

python mp3
 
9:40 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Using Windows Python from Cygwin

SkilldrickI've been using Cygwin on Windows recently. I want to use the Windows installation of Python, so during testing I'm using /cygdrive/c/Python26/python.exe myfile.py rather than python myfile.exe. This is working almost perfectly, except for printing. When I run...

python windows cygwin
newest questions tagged python - Stack Overflow
0
votes
0
answers
Django form does not display when only one field is being used

Justin LucasI have a django model and model form that look like this: -models.py class Menu_Category(models.Model): merchant = models.ForeignKey(Merchant, related_name='menu_categories') name = models.CharField(max_length=64) test_field = models.CharField(max_length=20)...

python django django-forms
 
9:56 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
How can I use PIL with Netbeans 6.8 (Python version 2.6.5)

SimpleCoderHi all, I have installed Python Imaging Library (PIL) version 1.1.7 on a Windows 7 computer. I have configured Netbeans to use Python (instead of Jython). I added a reference to C:\Python26\Lib\site-packages\PIL to the project but when I attempt this code: import Image,...

python netbeans image-processing
 
10:12 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
extract from a list of lists

DGTHow can I extract elements in a list of lists and create another one in python. So, I want to get from this: all_list = [['1 2 3 4','2 3 4 5'],['2 4 4 5', '3 4 5 5' ]] a new list like this: list_of_lists = [[('3','4'),('4','5')], [('4','5'),('5...

python
 
10:23 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Python: Obtain a URL

HarpalBecause I cant get this working: stackoverflow.com/questions/3250572/… I have an alternative option, I have a function in DTML which needs to obtain a URL...

python
newest questions tagged python - Stack Overflow
0
votes
1
answers
How do I tell what type of data is inside python variable?

djmcI have a list of variables.. inside the list are strings, numbers, and class objects. I need to perform logic based on each different type of data. I am having trouble detecting class objects and branching my logic at that point. if(type(lists[listname][0]).__name__ == 'str'): ...

python types detection
newest questions tagged python - Stack Overflow
0
votes
0
answers
Automatically recognize patterns in images

qbiRecently I downloaded some flags from the CIA world factbook. Now I want to "classify them. Get the colors Get some shapes (stars, moons etc.)

python algorithm image-processing pil
 
10:45 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Value Error: Too many values to unpack

ShilpaWhen I execute it, it is giving me an eror i.e too many values to unpack? How do i make it to work properly. stack = util.Stack() closed = [] child = [] index = 0 currNode = problem.getStartState() node = currNode stack.push(node) while not st...

python
newest questions tagged python - Stack Overflow
0
votes
0
answers
How to simulate re.findall for pexpect in python?

superuserIs it possible to simulate re.findall in the pexpect module? I currently have a script that ssh's into a server using pexpect. I then have it send a command to the server which returns a bunch of lines in p.before (p being a pexpect spawn): JUNK JUNK JUNK IP ADDRESS 10....

python regex pexpect
 
11:06 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
python hotmail login

str1k3rhello everyone .. ineed help .. how i can made that project : hotmail log in ! when my python file run .. it's ask for Username and Password then try to login even if the password wrong just try to login once ! explain again : my python file ask hotmail user name like : examp...

python
 
11:17 PM
newest questions tagged python - Stack Overflow
0
votes
1
answers
Problem with python packages and tests

CrociDBI have a directory struture like that: project | __init__.py | project.py | src/ | __init__.py | class_one.py | class_two.py | test/ | __init__.py | test_class_one.py Which project.py just instantiate ClassOne and run it. My proble...

python unittest
 
11:33 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
How do you add Python Imaging Library (PIL) documentation (code completion, etc.) to Netbeans?

SimpleCoderI am using Netbeans 6.8 as my Python IDE. I can use PIL (1.1.7) in my Python programs, but the code completion features are not working. I just downloaded the Source Kit edition of PIL, but I am unsure if it contains documentation/code completion entries that Netbeans can use. Does an...

python netbeans
newest questions tagged python - Stack Overflow
0
votes
0
answers
How to click a javascripted' radio button and fetch next page using Python (urllib2)? [WebScrape, selenium]

ThinkCodeI am struggling with this. I have a fully tested python script. I have to make a small change wherein I have to first click on a radio button which in turn automatically executes a javascript function forwarding the page to a search form. Radio button code : <input...

javascript python selenium screen-scraping
 
11:55 PM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Optimize a list comprehension

James Fassettresult = [(item, foo(item)) for item in item_list if cond1(item) and cond2(foo(item))] In the above snippet I call foo(item) twice. I can't think of a way to iterate over the list only once maintain both item and foo(item)

python list-comprehension
 

  last day (35 days later) »