Search Results

Search found 15187 results on 608 pages for 'boost python'.

Page 117/608 | < Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >

  • Need to constantly monitor serial data in Python

    - by jakke34
    Right now I am using an arduino to send data from an analog sensor to COM4. I am trying to make a python script that continuously monitors that data and looks for a certain parameter. I tried something like this but it isn't outputing the data like I want. import serial port = "COM4" ser = serial.Serial(port,9600, timeout =1) value = 0 while 1: value = ser.read() print value

    Read the article

  • Running a python script for a user-specified amount of time?

    - by Rob
    Sorry, this is probably a terrible question. I've JUST started learning python today. I've been reading a Byte of Python. Right now I have a project for Python that involves time. I can't find anything relating to time in Byte of Python, so I'll ask you: How can I run a block for a user specified amount of time and then break? For example (in some pseudo-code): time = int(raw_input('Enter the amount of seconds you want to run this: ')) while there is still time left: #run this block or even better: import sys time = sys.argv[1] while there is still time left: #run this block Thanks for any help. Also, additional online guides and tutorials would be much appreciated. I really like Byte of Python. Dive into Python can't quite hold my attention, though. I suppose I should suck it up and try harder to read that one.

    Read the article

  • Scientific Plotting in Python

    - by user100046
    I have a large data set of tuples containing (time of event, latitude, longitude) that I need to visualize. I was hoping to generate a 'movie'-like xy-plot, but was wondering if anyone has a better idea or if there is an easy way to do this in Python? Thanks in advance for the help, --Leo

    Read the article

  • Python templates for huge HTML/XML

    - by newtover
    Hello, Recently I needed to generate a huge HTML page containing a report with several thousand row table. And, obviously, I did not want to build the whole HTML (or the underlying tree) in memory. As result, I built the page with the old good string interpolation, but I do not like the solution. Thus, I wonder whether there are Python templating engines that can yield resulting page content by parts.

    Read the article

  • How to make an executable file in python?

    - by aF
    Hello, I want to make an executable file (.exe) of my python's application. I want to know how to do it but have this in mind: I use a c++ dll! Do I have to put the dll along side with the .exe or is there some other way? Thanks in advance!

    Read the article

  • Worst aspect of Python for a newbie

    - by schickb
    I'm wondering specifically what experienced programmers thought when they started developing in Python. I'm sure the answer depends on your background, but my own personal answer is the conversion of basically anything in the language to a True/False value in boolean contexts. Resulting in "oddities" like: if x: not meaning the same thing as: if x == True: I understand why, but it bugs me, and I certainly had to think about it a bit when I first ran into it.

    Read the article

  • Find all occurrences of a substring in Python

    - by cru3l
    Python has string.find() and string.rfind() to get the index of a substring in string. I wonder, maybe there is something like string.find_all() which can return all founded indexes (not only first from beginning or first from end)? For example: string = "test test test test" print string.find('test') # 0 print string.rfind('test') # 15 #that's the goal print string.find_all('test') # [0,5,10,15]

    Read the article

  • python: list manipulation

    - by Jason S
    I have a list L of objects (for what it's worth this is in scons). I would like to create two lists L1 and L2 where L1 is L with an item I1 appended, and L2 is L with an item I2 appended. I would use append but that modifies the original list. How can I do this in Python? (sorry for the beginner question, I don't use the language much, just for scons)

    Read the article

  • Python bitoperators

    - by Neelima
    What do the bit operators like AND(&),OR(|),XOR(^) in python do behind the screen? What do they calculate? I cannot understand the results they give when used in a program? 30&45 yields 12. How can we relate these three? 30|45 yields 63. How are these three related? Please answer this...

    Read the article

  • Fast matrix transposition in Python

    - by psihodelia
    Is there any fast method to make a transposition of a rectangular 2D matrix in Python (non-involving any library import).? Say, if I have an array X=[[1,2,3], [4,5,6]] I need an array Y which should be a transposed version of X, so Y=[[1,4],[2,5],[3,6]].

    Read the article

  • What should I learn & use to become a pro in PHP & Python Web development?

    - by pecker
    Hello, I'll just show some code to show how I do web development in PHP. <html> <head> <title>Example #3 TDavid's Very First PHP Script ever!</title> </head> <? print(Date("m/j/y")); require_once("somefile.php"); $mysql_db = "DATABASE NAME"; $mysql_user = "YOUR MYSQL USERNAME"; $mysql_pass = "YOUR MYSQL PASSWORD"; $mysql_link = mysql_connect("localhost", $mysql_user, $mysql_pass); mysql_select_db($mysql_db, $mysql_link); $result = mysql_query("SELECT impressions from tds_counter where COUNT_ID='$cid'", $mysql_link); if(mysql_num_rows($result)) { mysql_query("UPDATE tds_counter set impressions=impressions+1 where COUNT_ID='$cid'", $mysql_link); $row = mysql_fetch_row($result); if(!$inv) { print("$row[0]"); } } ?> <body> </body> </html> Thats it. I write every file like this. Recently, I learnt OOP and started using classes & objects in PHP. I hear that there are many frameworks there for PHP. They say that one must use these libraries. But I feel they are just making things complicated. Anyway, this is how I've been doing my web development. Now, I want to improve this. and make it professional. Also I want to move to Python. I searched SO archives and found everyone suggesting Django. But, can any one give me some idea about how web development in Python works? user (client) request for page --- webserver(-embedded PHP interpreter) ---- Server side(PHP) Script --- MySQL Server. Now, is it that instead of PHP interpreter there is python interpreter & instead of php script there is python script, which contains both HTML & python (embedded in some kind of python tags). Python script connects to database server and fetches some data which will be printed as HTML. or is it different in python world? Is this Django thing like frameworks for PHP? Can't one code in python without using Django. Because, I never encountered any post without django Please give me some kick start.

    Read the article

  • Python to extract data from a file

    - by user297003
    Hi, I am new to python. I am trying to extract the text between that has specific text file: ---- data1 data1 data1 extractme ---- data2 data2 data2 ---- data3 data3 extractme ---- and then dump it to text file so that ---- data1 data1 data1 extractme --- data3 data3 extractme --- Thanks for the help.

    Read the article

  • NetBeans and Python

    - by spacemonkey
    When I run some python code in NetBeans, which raises an error, the output in NetBeans just gives an error message and no further information, such as line number. Is there any way to fix that?

    Read the article

  • Is there YAPE::Regex::Explain alternative to python?

    - by S.Mark
    Is there perl's YAPE::Regex::Explain alternative to python? Which could do \w+=\d+|\w+='[^']+' to explanations like this NODE EXPLANATION -------------------------------------------------------------------------------- \w+ word characters (a-z, A-Z, 0-9, _) (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- = '=' -------------------------------------------------------------------------------- \d+ digits (0-9) (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- | OR -------------------------------------------------------------------------------- \w+ word characters (a-z, A-Z, 0-9, _) (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- =' '=\'' -------------------------------------------------------------------------------- [^']+ any character except: ''' (1 or more times (matching the most amount possible)) -------------------------------------------------------------------------------- ' '\''

    Read the article

  • logarithms in python

    - by Srikanth
    write a program to find the sum of the logarithms of all the primes from 2 to some number n, and print out the sum of the logs of the primes, the number n, and the ratio of these two quantities in python

    Read the article

  • Practicing BDD with python

    - by JtR
    Which are the most advanced frameworks and tools there are available for python for practicing Behavior Driven Development? Especially finding similar tools as rspec and mocha for ruby would be great.

    Read the article

  • Python for loop question

    - by Joe Dunk
    I was wondering how to achieve the following in python: for( int i = 0; cond...; i++) if cond... i++; //to skip an run-through I tried this with no luck. for i in range(whatever): if cond... : i += 1

    Read the article

  • Python: Run a progess bar and work simultaneously?

    - by DanielTA
    I want to know how to run a progress bar and some other work simultaneously, then when the work is done, stop the progress bar in Python (2.7.x) import sys, time def progress_bar(): while True: for c in ['-','\\','|','/']: sys.stdout.write('\r' + "Working " + c) sys.stdout.flush() time.sleep(0.2) def work(): *doing hard work* How would I be able to do something like: progress_bar() #run in background? work() *stop progress bar* print "\nThe work is done!"

    Read the article

  • Using wget via Python

    - by CoreIs
    How would I download files (video) with Python using wget and save them locally? There will be a bunch of files, so how do I know that one file is downloaded so as to automatically start downloding another one? Thanks.

    Read the article

< Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >