15,190 Topics

Member Avatar for
Member Avatar for Caraka

Greetings I'm running in circes trying to accomplish something very simple. I have a csv file with multiple lines resembling: 0002345, 24, 5, 0.24 I need this format in my output file: '0002345', 24, 5 0.24 The first entry is a census meshblock code and the leading zeros are relevant …

Member Avatar for Caraka
0
865
Member Avatar for AnjaliThukral

I have windows xp operating system at my home with python 2.5 and same operating system with python 2.4 at my computer lab. While working in python IDLE suddenly this error message --socket error:connection refused-- pops up and then python IDLE does not work at all.To make it work again …

Member Avatar for vegaseat
-1
1K
Member Avatar for Sinnocence

I wasn't able to find the link describing how to solve this. When I try to compile my program with py2exe using python v2.6 at the end of the process I get a message saying The following modules appear to be missing ['ICCProfile','_grabscreen','_imaging_gif'] my setup script is just : from …

Member Avatar for snippsat
0
197
Member Avatar for vegaseat

One more application of the Python Image Library (PIL). This short code creates thumbnails from all JPEG files in the current folder. The thumbnail image file is prefixed with a T_ and saved to the same directory. The program checks for existing files with this prefix, so we don't create …

Member Avatar for thenate
1
2K
Member Avatar for jmark13

Hello again, So, I'm trying to work out a problem where there are 6 symbols in a string (A, B, 0, 1, [, ]). The brackets always have to face each other in the string but they can be nested. There are some rules, most of which I have down, …

Member Avatar for TrustyTony
0
138
Member Avatar for Petan Kl

Hello, I am wondering if there is an efficient way (other than for cycle) of solving following task: I need to multiply e.g. two matrices and at every point in the matrix there is an array. The two matrices shall be multiplied using matrix multiplication and when the elements of …

Member Avatar for Gribouillis
0
212
Member Avatar for FALL3N

ok, I'm sure the answer to this is very simple.. there may even be some component in the os package to do this... I want to do what the code underneath seems like it would do.. I understand it does not, and when I try to run the code, I …

Member Avatar for FALL3N
0
276
Member Avatar for FALL3N

hello all, I have a program, and in it, it eventually specifies 'aFolder' to be os.walk(path/to/folder) how do I obtain inifo such as the name or the path of the folder, is it then the temporary current working directory?

Member Avatar for snippsat
0
111
Member Avatar for jml101

Hello All, New to Python, I keep getting an indentation error after the if (yescheck == todcheck): line. Any suggestions? As far as my python knowledge goes, I've got it correctly aligned, but clearly not. Could some of you try running this, see if it goes? [code=python] import os yesfile …

Member Avatar for vegaseat
0
716
Member Avatar for TrustyTony

I thought to post some not quite so trivial as it looks quiz for Python, to test if your brain has Python installed OK ;) Try to figure out what interpreter answers (#? lines), then check with your Python interpreter of choice: [CODE]>>> a = list(range(10)) >>> a[1:1] #? >>> …

Member Avatar for TrustyTony
3
669
Member Avatar for Kirielson

Hello, I'm trying to run an object on Python with ROS. When I run the code with a variable inside the object: [CODE]class lk(old_image): ....then some code def main(args): rospy.init_node('lk', anonymous=True) old_image = lk(old_image) try: rospy.spin() except KeyboardInterrupt: print "Shutting down" #cv.DestroyAllWindows() [/CODE] [ICODE]Traceback (most recent call last): File "/home/aadejare/ros/omnisensor/nodes/lk.py", …

Member Avatar for griswolf
0
339
Member Avatar for hszforu

I started learning python3 some 3-4 days ago.My ultimate aim to learn this language is to design web apps(eg apps to automate account creations for seo etc.) For this i guess i will have to use django or turbogears for this, but now i came to know that django or …

Member Avatar for hszforu
0
191
Member Avatar for TrustyTony

There was little buggy version of Python base conversion around, so here quick hack for my own program, including test with random numbers to verify it.

Member Avatar for TrustyTony
0
922
Member Avatar for johanngomes

Hi people, i am in trouble with python quotes, see this: [CODE]string = "qwerty"[/CODE] when i do a print string it returns: [CODE]'qwerty'[/CODE] how do i replace this singles quotes to double quotes when the value of the variable is returned? there is a way? thanks in advance! ;)

Member Avatar for Schol-R-LEA
0
684
Member Avatar for TrustyTony

What modules come builtin with your Python? Let's exclude the internal _ starting ones for this question. You know those? Are you sure? Good, because I did not! (Hint WindowsXP and Python2.72 has 27 builtin modules) Here the answer in code [CODE]import sys print('\n'.join(n for n in sys.builtin_module_names if not …

Member Avatar for Gribouillis
0
301
Member Avatar for Tremillian

I took an intro python class and learned some about jython. Unfortunately, what I have in mind is far too complicated for my level of training. Is it possible to use jython to import pictures from a scanner? If so, what module would I start with/use? The scanner is an …

Member Avatar for FALL3N
0
133
Member Avatar for pblnrao

I created python executable with py2exe. In my program, I use the pywin32 module. [U][B]Details of the SW's[/B][/U] OS Window 7 64 Bit Python 2.6 pywin32-214.win32-py2.6 when i created the exe its working fine on other system running Windows 7 but giving below error when running on Windows XP systems... …

0
133
Member Avatar for andrewtrench

Hi. I have a problem that I am tearing my hair out to solve. I am trying to transfer tens of thousands of records into a sqlite db using the script below. The script seems to run okay and I can see the db growing as it runs to some …

Member Avatar for andrewtrench
0
2K
Member Avatar for vasuv

Hi, I am not aware where to post my query.That's why here I am posting my query.I am sorry for my mistake. Here the requirement is s to write small JYTHON script to modify some parameters on a WebSphere cluster at install time. I am new to this concept. SO …

Member Avatar for griswolf
0
98
Member Avatar for rickyfre

OK geniuses! I have to use python 2.4 and 2.5 here and my programs ideally work with both versions. This area of code was working in 2.4 and 2.5 versions until replacing my computer. Python did not get ported over so I reloaded with new downloads from the web. (both …

Member Avatar for rickyfre
0
396
Member Avatar for darkwing

Hi all. I'm writing a Python program to subscribe to a multicast group and prints out data it receives. The program works fine if the source is in the same subnet as my receiver. However if the source is on a different subnet, my application just doesn't pick it up …

0
74
Member Avatar for 7sisters

Hi, I am really new to Python and I am having real trouble with this new language. This is what I want to do: I have two sets of .txt files that contain numbers. They look like this: FILE1 1028.085 283.795 2056.13 295.254 121912.4 11.346 0.004 147.932 780.677 966.771 289.326 …

Member Avatar for 7sisters
0
160
Member Avatar for debasishgang7

So guys here is my situation. There is text file.Which contains some strings.They are all comma separated. What i wanna do is just read the text file and print individually those strings which are comma separated. Suppose the text file contains: dog,cat,bird,good,bad,blah,blah,blah etc.... The python script should print dog cat …

Member Avatar for vegaseat
0
154
Member Avatar for hszforu

i am using python idle in windows7 to run my program. whenever i try to run the program i get an syntax error as unexpected indent. the code i am trying to run is as follows: [CODE]def print_lol(movies): for each in movies: if isinstance(each,list): print_lol(each) else: print(each)[/CODE]

Member Avatar for Gribouillis
0
925
Member Avatar for vlady

Hello, I do the following exercise: [COLOR="Green"]Write a function called most_frequent that takes a string and prints the letters in decreasing order of frequency. Find text samples from several different languages and see how letter frequency varies between languages. Compare your results with the tables at wikipedia.org/wiki/Letter_frequencies.[/COLOR] I try my …

Member Avatar for vlady
0
1,000
Member Avatar for Eswarimallur

Hi, I am gettitn error in the python scripts as shown below: AttributeError: 'module' object has no attribute 'lib' I have installed the package WxPython of 2.8 version and Python of version 2.6 Please help me out to resolve this error

Member Avatar for Gribouillis
0
2K
Member Avatar for TrustyTony

Lookup table is usually the fastest method to find function value, if number of values is small. Here we demonstrate the principle by using task of showing the value of byte as binary string or transforming binary string to byte binary value.

0
458
Member Avatar for weezy101

i have a problem with my python class. it contains a method that goes through all the keys of a multi_dimensional dictionary. The dictionary keys may be in the following order (1->(2,3),2->(5,6)). the problem is when the method attempts to get the keys, sometimes it gets them in the right …

Member Avatar for woooee
0
181
Member Avatar for yuvalm2

Is there any good way to share a given directory over the network? Or at least, if the directory is already being shared, is there any way for me to get its network path? (Something like [code]\\190.10.10.1\my_shared_dir\[/code])

Member Avatar for richieking
0
118
Member Avatar for Beat_Slayer

Well, it bothers me to build menus for every shell application that needs one. So, I've written a module to handle that, like in the good old turbo pascal times. :) Here it is, the module comments are pretty explainatory, I think, and the sample usage if run as script …

Member Avatar for Beat_Slayer
0
3K

The End.